Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_susiezilla_singlescreen_shadowguy_with_rpg_Step_0

(view raw script w/o annotations or w/e)
1
depth = 10000 - y;
2
with (obj_susiezilla_gamecontroller)
3
{
4
    var sourcedude = other.id;
5
    if (gameover)
6
    {
7
        other.speed = 0;
8
        other.image_speed = 0;
9
        with (obj_script_delayed)
10
        {
11
            if (target == sourcedude)
12
                instance_destroy();
13
        }
14
        with (obj_lerpvar)
15
        {
16
            if (target == sourcedude)
17
                instance_destroy();
18
        }
19
        other.gameover = true;
20
        exit;
21
    }
22
}
23
bobble++;
24
if (canhit && !i_ex(myhitbox))
25
{
26
    myhitbox = instance_create(x, y, obj_susiezilla_activehitbox);
27
    myhitbox.sprite_index = spr_whitepx;
28
    myhitbox_xoffset = -24;
29
    myhitbox_yoffset = -28;
30
    myhitbox.image_yscale = 30;
31
    myhitbox.image_xscale = 40;
32
    myhitbox.depth = depth - 20;
33
    myhitbox.image_blend = c_yellow;
34
    myhitbox.daddy = id;
35
    myhitbox.visible = false;
36
}
37
if (i_ex(myhitbox))
38
{
39
    if (!canhit || ropeheight != 0)
40
        safe_delete(myhitbox);
41
}
42
if (hitstop <= 0)
43
{
44
    if (fakeheight < maxheight || state == states.dead)
45
        friction = 0;
46
    else
47
        friction = fric_var;
48
    fakevspeed += fakegravity;
49
    fakeheight += fakevspeed;
50
    if (fakeheight >= maxheight)
51
    {
52
        fakeheight = maxheight;
53
        fakevspeed = 0;
54
    }
55
    if (i_ex(obj_susiezilla_statue) && state != states.dead)
56
    {
57
        if (obj_susiezilla_statue.x < x)
58
            facing = 0;
59
        else
60
            facing = 1;
61
    }
62
    if (state == states.rope)
63
    {
64
        state_timer++;
65
        if (state_timer == 16)
66
        {
67
            state_timer = 30;
68
            state = states.idle;
69
        }
70
    }
71
    if (state == states.idle)
72
    {
73
        state_timer++;
74
        if (state_timer == 60)
75
        {
76
            state_timer = 0;
77
            state = states.fire;
78
        }
79
    }
80
    if (state == states.fire)
81
    {
82
        state_timer++;
83
        if (state_timer == 1)
84
        {
85
            flash = 10;
86
            sprite_index = s_fire;
87
            image_index = 0;
88
            image_speed = 0;
89
        }
90
        if (state_timer == 19)
91
        {
92
            image_speed = 0.25;
93
            shoot_angle = 90 - (sign(obj_susiezilla_statue.x - x) * 90);
94
            snd_stop(snd_gunshot_b);
95
            snd_play_pitch(snd_gunshot_b, 0.75);
96
            var tempx = x + lengthdir_x(36, shoot_angle);
97
            var tempy = (y - 42) + lengthdir_y(36, shoot_angle);
98
            with (instance_create_depth(tempx, tempy, depth - 1, obj_susiezilla_singlescreen_hazard))
99
            {
100
                direction = other.shoot_angle;
101
                image_xscale = 4;
102
                image_yscale = 4;
103
                damage = 20;
104
                knockback = 20;
105
                facing = other.facing;
106
                speed = 3;
107
                sprite_index = spr_basketball_ball_bullet;
108
                image_angle = 0;
109
                
scr_lerpvar
scr_lerpvar

function
scr_lerpvar()
{ if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
return ___lerpvar; } function scr_lerpvar_respect() { if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
___lerpvar.respectglobalinteract = true; return ___lerpvar; }
("image_angle", 0, 4320, 480);
110
            }
111
        }
112
        if (state_timer == 28)
113
        {
114
            sprite_index = s_idle;
115
            image_index = 0;
116
            image_speed = 0.25;
117
            state = states.idle;
118
            state_timer = 0;
119
        }
120
    }
121
    if (state == states.dead && state_timer == 0)
122
    {
123
        state_timer++;
124
        if (abs(hspeed) > 8)
125
        {
126
            snd_stop(snd_punchmed);
127
            snd_play_pitch(snd_punchmed, 0.65);
128
            for (var i = 0; i < 4; i++)
129
            {
130
                dust = 
scr_dark_marker
scr_dark_marker

function
scr_dark_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; image_xscale = 2; image_yscale = 2; } return thismarker; }
((x - 20) + (i * 10), y, spr_dust1);
131
                dust.depth = depth - 10;
132
                dust.vspeed = -4 - irandom(2) - (abs(hspeed) / 4);
133
                dust.gravity = 0.5;
134
                dust.image_speed = 0.5;
135
                dust.image_xscale = 2 + random_range(-0.2, 0);
136
                dust.image_xscale = dust.image_yscale;
137
                
scr_doom
scr_doom

function
scr_doom(arg0, arg1)
{ with (instance_create_depth(0, 0, 0, obj_doom)) { alarm[0] target = arg0; } }
(dust, 10);
138
                dust.hspeed = -4 + (i * 2) + (hspeed / 8);
139
                dust.friction = 0.85;
140
            }
141
            fakevspeed = -abs(hspeed / 8);
142
        }
143
        else
144
        {
145
            snd_stop(snd_punchmed);
146
            snd_play_pitch(snd_punchmed, 0.8);
147
        }
148
    }
149
    if (x <= 10)
150
    {
151
        x = 10;
152
        hspeed = -hspeed / 2;
153
    }
154
    if (x >= 1270)
155
    {
156
        x = 1270;
157
        hspeed = -hspeed / 2;
158
    }
159
    if (y <= 200)
160
    {
161
        y = 200;
162
        vspeed = -vspeed / 2;
163
    }
164
    hitdir = direction;
165
    hitspeed = speed;
166
}
167
hitstop--;
168
if (hitstop == 0)
169
{
170
    canhit = 1;
171
    speed = memspeed;
172
    direction = memdir;
173
    fakegravity = 1;
174
    hitstop = -1;
175
}
176
if (hitstop > 0)
177
    flash = 0;
178
if (abs(hspeed) > fastestspeed)
179
    fastestspeed = abs(hspeed);
180
myxcenter = x - 6;
181
myycenter = (y - 34) + fakeheight;