Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_susiezilla_singlescreen_shadowguy_laser_machine_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
shake *= 0.8;
24
if (shake < 0.5)
25
    shake = 0;
26
polarity *= -1;
27
image_xscale = 
scr_approach
scr_approach

function
scr_approach(arg0, arg1, arg2)
{ if (arg0 < arg1) { arg0 += arg2; if (arg0 > arg1) return arg1; } else { arg0 -= arg2; if (arg0 < arg1) return arg1; } return arg0; }
(image_xscale, 2, 0.05);
28
image_yscale = 
scr_approach
scr_approach

function
scr_approach(arg0, arg1, arg2)
{ if (arg0 < arg1) { arg0 += arg2; if (arg0 > arg1) return arg1; } else { arg0 -= arg2; if (arg0 < arg1) return arg1; } return arg0; }
(image_yscale, 2, 0.05);
29
if (state == states.dead)
30
{
31
    state_timer++;
32
    shake = 12 - (0.3 * state_timer);
33
    image_xscale = 2 + (state_timer * 0.05);
34
    image_yscale = 2 - (state_timer * 0.05);
35
    var spawny = offset_index[hurt_index] * 7;
36
    if ((state_timer % 5) == 0 && state_timer < 30)
37
    {
38
        repeat (2 + irandom(4))
39
        {
40
            with (instance_create_depth(x + 32 + ((10 + random(50)) * choose(-1, 1)), y - 24 - random(104 - spawny), depth + choose(-1, 1), obj_dozer_parts))
41
            {
42
                var facing = x - (other.x + 32);
43
                sprite_index = spr_susiezilla_spamcannon_chip;
44
                image_angle = irandom(360);
45
                
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", image_angle, image_angle + ((90 + irandom(270)) * choose(-1, 1)), 30 + irandom(60));
46
                image_speed = 0;
47
                image_index = irandom(image_number - 1);
48
                image_xscale = 1 + (random(2) * choose(1, -1));
49
                image_yscale = image_xscale;
50
                h_speed = (sign(facing) * 2) + (random(10) * sign(facing));
51
                v_speed = -4 - random(8);
52
                ground = other.y;
53
            }
54
        }
55
    }
56
    if (state_timer == 40)
57
    {
58
        instance_destroy();
59
        exit;
60
    }
61
}
62
if (state == states.dead)
63
    exit;
64
laser_width = 
scr_approach
scr_approach

function
scr_approach(arg0, arg1, arg2)
{ if (arg0 < arg1) { arg0 += arg2; if (arg0 > arg1) return arg1; } else { arg0 -= arg2; if (arg0 < arg1) return arg1; } return arg0; }
(laser_width, laser_width_goal, abs(laser_width - laser_width_goal) * 0.35);
65
laser_wobble = laser_width - ((global.time % 3) * 0.1);
66
rxo = choose(-1, 0, 1);
67
ryo = choose(-1, 0, 1);
68
ra = clamp(ra + random_range(-2, 2), -10, 10);
69
if (hitstop <= 0)
70
{
71
    if (state == states.rope)
72
    {
73
        state_timer++;
74
        if (state_timer == 24)
75
        {
76
            state = states.charge;
77
            snd_play(snd_sneo_overpower);
78
            state_timer = 0;
79
            image_index = 2;
80
        }
81
    }
82
    if (state == states.charge)
83
    {
84
        var charge_val = 1;
85
        with (obj_susiezilla_gamecontroller)
86
        {
87
            if (loss_counter >= 9)
88
                charge_val *= (1 - (other.state_timer / other.max_charge));
89
        }
90
        if (hp == maxhp && state_timer >= (max_charge * 0.5))
91
            charge_val *= 0.5;
92
        state_timer += charge_val;
93
        with (obj_susiezilla_gamecontroller)
94
        {
95
            if (loss_counter >= 9)
96
            {
97
                if (other.state_timer > (other.max_charge - 0.2))
98
                    other.state_timer = other.max_charge - 0.2;
99
            }
100
        }
101
        sprite_index = charge_index[hurt_index];
102
        image_speed = 0.25 + (state_timer * 0.005);
103
        if ((global.time % 4) == 0)
104
        {
105
            with (instance_create_depth(x + 116 + 20 + random(20), (y - 44) + (laser_offset * 2) + random_range(-64, 64), depth - 1, obj_susiezilla_charge_ball))
106
            {
107
                goal_x = (other.x + 116) - 40;
108
                goal_y = (other.y - 44) + (other.laser_offset * 2);
109
            }
110
        }
111
        if (state_timer >= 210 && hp == maxhp && !tenna_panic)
112
        {
113
            tenna_panic = true;
114
            safe_delete(obj_ch3_tennashouter_alt);
115
            with (obj_script_delayed)
116
            {
117
                if (script == scr_tennashouter)
118
                    instance_destroy();
119
            }
120
            var tepanic = stringsetloc(
* What the $*!? are you doing!? Kill him!!!!!
"* What the $*!? are you doing!? Kill him!!!!!", "obj_susiezilla_singlescreen_shadowguy_laser_machine_slash_Step_0_gml_150_0"
);
121
            
scr_tennashouter
scr_tennashouter

function
scr_tennashouter()
{ safe_delete(obj_ch3_tennashouter); safe_delete(obj_ch3_tennashouter_alt); var tennadialoguer = instance_create(0, 0, obj_ch3_tennashouter_alt); tennadialoguer.mystring = argument0; if (argument_count > 1) tennadialoguer.customlife = argument1; if (argument_count > 2) tennadialoguer.preset = argument2; if (argument_count > 3) tennadialoguer.tcustanimrate = argument3; if (argument_count > 4) tennadialoguer.skippable = argument4; return tennadialoguer; }
(tepanic, 125);
122
        }
123
        if (state_timer == max_charge)
124
        {
125
            mask_index = spr_nomask;
126
            state = states.fire;
127
            state_timer = 0;
128
            image_index = 5;
129
            laser_width = 5;
130
            laser_width_goal = 2;
131
            with (obj_susiezilla_gamecontroller)
132
            {
133
                if (!spamton_hit)
134
                    resolve_this = true;
135
            }
136
            safe_delete(obj_ch3_tennashouter_alt);
137
            with (obj_script_delayed)
138
            {
139
                if (script == scr_tennashouter)
140
                    instance_destroy();
141
            }
142
            var tenooo = stringsetloc(
* Nooooooo!!!!!!
"* Nooooooo!!!!!!", "obj_susiezilla_singlescreen_shadowguy_laser_machine_slash_Step_0_gml_178_0"
);
143
            
scr_tennashouter
scr_tennashouter

function
scr_tennashouter()
{ safe_delete(obj_ch3_tennashouter); safe_delete(obj_ch3_tennashouter_alt); var tennadialoguer = instance_create(0, 0, obj_ch3_tennashouter_alt); tennadialoguer.mystring = argument0; if (argument_count > 1) tennadialoguer.customlife = argument1; if (argument_count > 2) tennadialoguer.preset = argument2; if (argument_count > 3) tennadialoguer.tcustanimrate = argument3; if (argument_count > 4) tennadialoguer.skippable = argument4; return tennadialoguer; }
(tenooo, 125);
144
        }
145
    }
146
    if (state == states.fire)
147
    {
148
        state_timer++;
149
        image_index = 0;
150
        image_speed = 0;
151
        with (instance_create_depth(x + 116 + 20, (y - 44) + (laser_offset * 2), depth, obj_susiezilla_laser_segment))
152
        {
153
            direction = 0;
154
            var facing = other.facing;
155
            speed = 60;
156
            depth = other.depth;
157
            force_depth = other.depth;
158
        }
159
    }
160
    if (state == states.recharge)
161
    {
162
        state_timer++;
163
        if (state_timer == 32)
164
        {
165
            state = states.charge;
166
            state_timer = 0;
167
            image_index = 2;
168
        }
169
    }
170
    if (state == states.hurt)
171
    {
172
        hurt_timer++;
173
        if (hurt_timer == 20)
174
        {
175
            state = states.charge;
176
            snd_play(snd_sneo_overpower);
177
            state_timer = 0;
178
        }
179
    }
180
    hitdir = direction;
181
    hitspeed = speed;
182
    with (obj_susiezilla_laser_segment)
183
        image_yscale = other.laser_wobble;
184
}