Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_susiezilla_gunzombie_Step_0

(view raw script w/o annotations or w/e)
1
if (hurtCon == 0)
2
{
3
    if (shootcon == 0)
4
    {
5
        if (x < camerax())
6
        {
7
            hspeed = 6;
8
            image_index = 1;
9
        }
10
        else
11
        {
12
            hspeed = -6;
13
        }
14
        shootcon = 1;
15
    }
16
    if (shootcon == 1)
17
    {
18
        shoottimer++;
19
        if (shoottimer == 20)
20
            hspeed = 0;
21
        if (shoottimer == 100)
22
        {
23
            shoottimer = 0;
24
            shootcon = 2;
25
            redflashtimer = 11;
26
        }
27
    }
28
    if (shootcon == 2)
29
    {
30
        shoottimer++;
31
        if (shoottimer == 20)
32
        {
33
            if (image_index == 0)
34
                instance_create(x - 15, y - 19, obj_zombiebullet);
35
            else
36
                instance_create(x + 15, y - 19, obj_zombiebullet);
37
        }
38
        if (shoottimer == 23)
39
        {
40
            if (image_index == 0)
41
                instance_create(x - 15, y - 19, obj_zombiebullet);
42
            else
43
                instance_create(x + 15, y - 19, obj_zombiebullet);
44
        }
45
        if (shoottimer == 26)
46
        {
47
            if (image_index == 0)
48
                instance_create(x - 15, y - 19, obj_zombiebullet);
49
            else
50
                instance_create(x + 15, y - 19, obj_zombiebullet);
51
            shootimer = 0;
52
            shootcon = 1;
53
        }
54
    }
55
}
56
if (hurtCon == 1)
57
{
58
    recoil += (recoilSpeed * recoilDir);
59
    recoilSpeed -= 1;
60
    if (sign(recoil) != recoilDir)
61
    {
62
        recoil = 0;
63
        hurtCon = 0;
64
        recoilSpeed = 0;
65
        image_index = 0;
66
    }
67
}
68
if (fall_speed != 0 || height > 0)
69
{
70
    height -= fall_speed;
71
    fall_speed += 1;
72
    if (height <= 0)
73
    {
74
        height = 0;
75
        if (bounce_count < 1)
76
            fall_speed *= -0.5;
77
        else
78
            fall_speed = 0;
79
        bounce_count++;
80
        snd_stop(snd_bump);
81
        snd_play(snd_bump);
82
        vspeed = 0;
83
    }
84
}
85
if (hurtCon == 2)
86
{
87
    if (fall_speed > 0)
88
    {
89
        image_index = 5 + reverse_image;
90
        hurtCon = 3;
91
        shadow.image_xscale *= 1;
92
    }
93
}
94
if (hurtCon == 3 && height == 0 && fall_speed == 0)
95
{
96
    alarm[0]
 = 10;
gml_Object_obj_susiezilla_gunzombie_Alarm_0.gml

hurtCon++;
97
    hurtCon = 4;
98
    hspeed = 0;
99
}
100
if (hurtCon == 5)
101
{
102
    fader++;
103
    if ((fader % 2) == 1)
104
        visible = false;
105
    else
106
        visible = true;
107
    if (fader == 15)
108
    {
109
        var fx = instance_create(x - 24, y - 50, obj_animation);
110
        fx.sprite_index = spr_explosion_round;
111
        fx.image_speed = 0.5;
112
        fx.depth = obj_susiezilla.depth - 20;
113
        audio_stop_sound(snd_explosion_firework);
114
        snd_play_pitch(snd_explosion_firework, 1.1 + random(0.4));
115
    }
116
    if (fader >= 20)
117
        instance_destroy();
118
}