Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_susiezilla_singlescreen_kickboxin_tenna_Step_0

(view raw script w/o annotations or w/e)
1
falltimer++;
2
if (falltimer > 150 && hp < 3 && i_ex(obj_tenna_zoom) && obj_tenna_zoom.con < 2 && createspotlights == true)
3
{
4
    falltimer = 0;
5
    if (fallcon == 0)
6
    {
7
        controller = instance_create(x, y, obj_spotlightlaser_controller);
8
        controller.side = "above";
9
        fallcon = 1;
10
    }
11
    else
12
    {
13
        controller = instance_create(x, y, obj_spotlightlaser_controller);
14
        controller.side = "below";
15
        fallcon = 0;
16
    }
17
}
18
if (i_ex(obj_tenna_enemy) && tennainit == false)
19
{
20
    visible = true;
21
    tennainit = true;
22
}
23
depth = 10000 - y;
24
if (i_ex(obj_tenna_enemy))
25
    depth = 1000 - y;
26
flash = 
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; }
(flash, 0, 1);
27
if (afterimages && (global.time % 2) == 0)
28
{
29
    with (instance_create(x, y, obj_afterimage_glow))
30
    {
31
        sprite_index = other.sprite_index;
32
        image_index = other.image_index;
33
        image_blend = other.image_blend;
34
        image_speed = 0;
35
        depth = other.depth;
36
        image_xscale = other.xscale;
37
        image_yscale = other.image_yscale;
38
        image_angle = other.image_angle;
39
        fadeSpeed = 0.08;
40
        solidcolor = 7020069;
41
    }
42
}
43
polarity *= -1;
44
xoff *= 0.8;
45
if (xoff < 0.5)
46
    xoff = 0;
47
if (z < 0 && (z + zspeed) >= 0)
48
{
49
    bounciness = 0.25;
50
    xscale = -2 * side;
51
    yscale = 1;
52
}
53
z += zspeed;
54
zspeed += zgrav;
55
if (z >= 0)
56
{
57
    z = 0;
58
    zspeed = 0;
59
}
60
if (z < 0 || state == states.dead)
61
    friction = 0;
62
else
63
    friction = fric;
64
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; }
(xscale, -2 * side, bounciness);
65
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; }
(yscale, 2, bounciness);
66
if (idle_loop)
67
{
68
    if (sprite_index == spr_tenna_kick)
69
    {
70
        if (image_index >= 3.75)
71
            idle_dir = -0.25;
72
        if (image_index <= 0)
73
            idle_dir = 0.25;
74
        image_index += idle_dir;
75
    }
76
    else
77
    {
78
        idle_loop = false;
79
    }
80
}
81
if (kick_loop)
82
{
83
    if (image_index >= 17 || sprite_index != spr_tenna_kick)
84
        kick_loop = false;
85
    else
86
        image_index = 
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_index, 17, 1);
87
}
88
if (state == states.breakout)
89
{
90
    state_timer++;
91
    if (state_timer > 0 && state_timer < 25)
92
        xoff += 1;
93
    if (state_timer == 25)
94
    {
95
        doshadow = true;
96
        xoff = 0;
97
        bounciness = 0.25;
98
        xscale = -3 * side;
99
        yscale = 1;
100
        do_shadow = true;
101
        sprite_index = spr_tenna_kick;
102
        image_index = 14;
103
        speed = 7;
104
        zspeed = -14;
105
        snd_play(snd_jump);
106
    }
107
    if (state_timer > 25 && z == 0)
108
    {
109
        state_timer = -999;
110
        image_index = 0;
111
        idle_loop = true;
112
        anchor_x = mid + 180;
113
        snd_play(snd_screenshake);
114
        with (obj_susiezilla_gamecontroller)
115
            shake = 8;
116
        
scr_var_delay
scr_var_delay

function
scr_var_delay(arg0, arg1, arg2)
{
scr_script_delayed(scr_var, arg2, arg0, arg1);
} function scr_var_delayed(arg0, arg1, arg2) {
scr_script_delayed(scr_var, arg2, arg0, arg1);
} function scr_delay_var(arg0, arg1, arg2) {
scr_script_delayed(scr_var, arg2, arg0, arg1);
}
("state", states.idle, 15);
117
        
scr_var_delay
scr_var_delay

function
scr_var_delay(arg0, arg1, arg2)
{
scr_script_delayed(scr_var, arg2, arg0, arg1);
} function scr_var_delayed(arg0, arg1, arg2) {
scr_script_delayed(scr_var, arg2, arg0, arg1);
} function scr_delay_var(arg0, arg1, arg2) {
scr_script_delayed(scr_var, arg2, arg0, arg1);
}
("state_timer", 0, 15);
118
    }
119
}
120
if (state == states.idle)
121
{
122
    state_timer++;
123
    if (state_timer == 8)
124
    {
125
        xscale = -2.25 * side;
126
        yscale = 1.75;
127
        juke_offset = clamp(juke_offset, -40, 60);
128
        if (abs(y - (obj_susiezilla_player.y + 84)) < 30)
129
            juke_counter += 999;
130
        if (irandom(3))
131
        {
132
            juke_offset = clamp((obj_susiezilla_player.y + 84) - y, -40, 60);
133
        }
134
        else
135
        {
136
            repeat (5)
137
            {
138
                for (a = 0; a < 10; a++)
139
                {
140
                    var juke_backup = juke_offset;
141
                    juke_offset += (juke_direction * (3 + irandom(9)));
142
                    if (juke_offset > 60 || juke_offset < -40)
143
                    {
144
                        juke_offset = juke_backup;
145
                        juke_direction *= -1;
146
                    }
147
                }
148
                if (abs(y - (anchor_y + juke_offset)) > 40)
149
                    break;
150
            }
151
        }
152
        dest_x = anchor_x + irandom_range(-12, 12);
153
        dest_y = anchor_y + juke_offset;
154
    }
155
    if (state_timer >= 8)
156
    {
157
        move_towards_point(dest_x, dest_y, max(point_distance(x, y, dest_x, dest_y) * 0.2, 6));
158
        if (point_distance(x, y, dest_x, dest_y) <= 8)
159
        {
160
            juke_counter++;
161
            if ((juke_counter > 0 && irandom(1) && (!alarm[1] && !alarm[0])) || juke_counter > 1)
162
            {
163
                if (!idle_loop)
164
                    image_index = 0;
165
                idle_loop = true;
166
                kick_loop = false;
167
                juke_counter = 0;
168
                state = states.kick;
169
                state_timer = 0;
170
            }
171
            else
172
            {
173
                image_index = 0;
174
                idle_loop = true;
175
                kick_loop = false;
176
                state = states.idle;
177
                state_timer = 3 + (turbo * 3);
178
            }
179
        }
180
    }
181
}
182
if (state == states.kick)
183
{
184
    state_timer++;
185
    if (state_timer == -100)
186
    {
187
        fric = 0.85;
188
        image_index = 0;
189
        idle_loop = true;
190
        kick_loop = false;
191
        state = states.idle;
192
        state_timer = 7;
193
        side *= -1;
194
        xscale *= -1;
195
        anchor_x = mid - (180 * side);
196
    }
197
    if (state_timer == 8)
198
    {
199
        bounciness = 0.25;
200
        xscale = -2.5 * side;
201
        yscale = 1.5;
202
        direction = 90 + (side * 90);
203
        speed = 8;
204
        fric = 0.35;
205
        snd_play(snd_heartshot_dr_b);
206
        image_index = 34;
207
        idle_loop = false;
208
    }
209
    if (state_timer == (20 + (turbo * 4)))
210
    {
211
        image_index = 13;
212
        kick_loop = true;
213
        idle_loop = false;
214
        direction = 90 - (side * 90);
215
        speed = 50;
216
        fric = 3;
217
        if (i_ex(obj_susiezilla_singlescreen_shadowguy_red))
218
        {
219
            speed = 40;
220
            fric = 2;
221
        }
222
        snd_play(snd_chargeshot_fire);
223
        afterimages = true;
224
    }
225
    if (state_timer > (20 + (turbo * 4)) && speed < 1)
226
    {
227
        afterimages = false;
228
        ds_list_clear(hit_list);
229
        state_timer = -110 + (5 * turbo);
230
    }
231
}
232
if (state == states.zip)
233
{
234
    state_timer++;
235
    if (state_timer == -100)
236
    {
237
        fric = 0.85;
238
        image_index = 0;
239
        idle_loop = true;
240
        kick_loop = false;
241
        state = states.idle;
242
        state_timer = 7;
243
    }
244
    if (state_timer == 8)
245
    {
246
        direction = 0;
247
        speed = 10;
248
    }
249
    if (state_timer == 24)
250
    {
251
        afterimages = true;
252
        image_index = 13;
253
        kick_loop = true;
254
        zip_dir = choose(-1, 1);
255
    }
256
    if (state_timer >= 24 && state_timer < 96)
257
    {
258
        direction = 180;
259
        speed = 7;
260
        y = 
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; }
(y, anchor_y + (sin((state_timer - 24) * 0.15) * 64 * zip_dir), abs(y - (anchor_y + (sin((state_timer - 24) * 0.15) * 64 * zip_dir))) * 0.15);
261
    }
262
    if (state_timer == 96)
263
    {
264
        afterimages = false;
265
        ds_list_clear(hit_list);
266
        state_timer = -110;
267
    }
268
}
269
if (state == states.pain)
270
{
271
}
272
if (state == states.dead)
273
{
274
    with (obj_susiezilla_gamecontroller)
275
        shake = max(shake, 5);
276
    if ((state_timer % 3) == 0)
277
    {
278
        with (
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 + random_range(-58, 58), y - irandom(120), spr_realisticexplosion))
279
        {
280
            image_speed = 1;
281
            
scr_doom
scr_doom

function
scr_doom(arg0, arg1)
{ with (instance_create_depth(0, 0, 0, obj_doom)) { alarm[0] target = arg0; } }
(id, 16);
282
            
scr_scale
scr_scale

function
scr_scale()
{ if (argument_count == 1) { image_xscale = argument0; image_yscale = argument0; } if (argument_count == 2) { with (argument1) { image_xscale = argument0; image_yscale = argument0; } } } function scr_set_scale() { if (argument_count == 2) { image_xscale = argument0; image_yscale = argument1; } if (argument_count == 3) { with (argument2) { image_xscale = argument0; image_yscale = argument1; } } }
(2, id);
283
            depth = other.depth - 1000;
284
            if (i_ex(obj_tenna_zoom))
285
                depth = obj_tenna_zoom.depth + 100;
286
        }
287
    }
288
    state_timer++;
289
}
290
if (afterimages)
291
{
292
    if (abs(speed) > 8 && (global.time % 2) == 0)
293
    {
294
        with (
scr_afterimage_grow
scr_afterimage_grow

function
scr_afterimage_grow()
{ afterimage = instance_create(x, y, obj_afterimage_grow); afterimage.sprite_index = sprite_index; afterimage.image_index = image_index; afterimage.image_blend = image_blend; afterimage.image_speed = 0; afterimage.depth = depth; afterimage.image_xscale = image_xscale; afterimage.image_yscale = image_yscale; afterimage.image_angle = image_angle; return afterimage; }
())
295
        {
296
            sprite_index = spr_ground_shockwave;
297
            image_xscale = other.side * 2;
298
            image_yscale = 3;
299
            fade = 0.025;
300
            xrate = 0;
301
            yrate = 0;
302
            y += 20;
303
            x += (100 * other.side);
304
            visible = false;
305
        }
306
    }
307
    var tempmask = obj_susiezilla_player.mask_index;
308
    obj_susiezilla_player.mask_index = spr_susiezilla_susie_hit_mask;
309
    var _hit = ds_list_create();
310
    collision_rectangle_list(x - 84, y + 29, x + 84, y - 16, obj_susiezilla_player, false, true, _hit, false);
311
    obj_susiezilla_player.mask_index = tempmask;
312
    for (a = 0; a < ds_list_size(_hit); a++)
313
    {
314
        if (ds_list_find_index(hit_list, ds_list_find_value(_hit, a).id) != -1)
315
            continue;
316
        ds_list_add(hit_list, ds_list_find_value(_hit, a).id);
317
        if (speed < 32 && ds_list_find_value(_hit, a).dashcon == 2)
318
            continue;
319
        ds_list_find_value(_hit, a).take_hit_unblockable(facing, damage, knockback);
320
    }
321
    ds_list_destroy(_hit);
322
}
323
var susiehit = -4;
324
susiehit = collision_rectangle(x - 84, y + 29, x + 84, y - 16, obj_susiezilla_player, false, false);
325
var canhitsusie = true;
326
if (afterimages && state == states.kick && speed > 32)
327
    canhitsusie = false;
328
if (!alarm[0] && !alarm[1] && canhitsusie == true && state != states.breakout && state != states.dead)
329
{
330
    if (susiehit != -4)
331
    {
332
        if (state != states.dead && state != states.given_up)
333
        {
334
            if (susiehit.hitactive)
335
            {
336
                hp = 
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; }
(hp, 0, 1);
337
                with (obj_susiezilla_gamecontroller)
338
                    shake = 8;
339
                afterimages = false;
340
                
scr_tenna_add_score
scr_tenna_add_score

function
scr_tenna_add_score(arg0)
{ if (i_ex(obj_tenna_enemy_bg)) { var _multiplier = 1; var _multi_minigame_adjustment = 1; if (obj_tenna_enemy.minigameactivated) { if (obj_tenna_enemy.minigamecount >= 6) _multi_minigame_adjustment = 0.65; _multiplier = (obj_tenna_enemy.pointsmultiplierthisturn + obj_tenna_enemy.pointsmultiplier) * _multi_minigame_adjustment; obj_tenna_enemy.pointsmultiplierthisturn -= 1; if (obj_tenna_enemy.pointsmultiplierthisturn < 1) obj_tenna_enemy.pointsmultiplierthisturn = 1; } if (!i_ex(obj_tenna_zoom)) obj_tenna_enemy_bg.addscore += round(arg0 * _multiplier); else if (i_ex(obj_tenna_minigame_ui)) obj_tenna_minigame_ui.myscore += round(arg0 * _multiplier); } }
(8);
341
                if (hp)
342
                {
343
                    flash = 10;
344
                    snd_stop(snd_screenshake);
345
                    snd_stop(snd_metal_hit_reverb);
346
                    snd_play(snd_screenshake);
347
                    snd_play_x(snd_metal_hit_reverb, 1, 0.9);
348
                    with (susiehit)
349
                        event_user(0);
350
                    if (side == -1)
351
                        susiehit.memhspeed = -12;
352
                    else
353
                        susiehit.memhspeed = 12;
354
                    sprite_index = spr_tenna_hurt;
355
                    image_index = 0;
356
                    image_speed = 0;
357
                    state = states.pain;
358
                    state_timer = 0;
359
                    speed = 22;
360
                    if (side == -1)
361
                        direction = irandom(30);
362
                    else
363
                        direction = 180 - irandom(30);
364
                    fric = 0.75;
365
                    alarm[0]
 = 12;
gml_Object_obj_susiezilla_singlescreen_kickboxin_tenna_Alarm_0.gml

sprite_index = spr_tenna_kick; state = states.idle; state_timer = 6; alarm[1]
 = 45;
366
                }
367
                else
368
                {
369
                    snd_stop(snd_screenshake);
370
                    snd_stop(snd_metal_hit_reverb);
371
                    snd_play(snd_screenshake);
372
                    snd_play_x(snd_metal_hit_reverb, 1, 0.9);
373
                    snd_play_pitch(snd_explosion, 0.5);
374
                    with (susiehit)
375
                        event_user(0);
376
                    if (side == -1)
377
                        susiehit.memhspeed = -12;
378
                    else
379
                        susiehit.memhspeed = 12;
380
                    sprite_index = spr_tenna_hurt;
381
                    image_index = 0;
382
                    image_speed = 0;
383
                    state = states.dead;
384
                    state_timer = 0;
385
                    doshadow = false;
386
                    speed = 24;
387
                    gravity = 1;
388
                    gravity_direction = 270;
389
                    if (side == -1)
390
                        direction = 55;
391
                    else
392
                        direction = 125;
393
                    fric = 0;
394
                    with (obj_susiezilla_gamecontroller)
395
                    {
396
                        if (time_timer && i_ex(obj_tenna_zoom) && obj_tenna_zoom.con != 2 && obj_tenna_zoom.minigameinsanity == false)
397
                        {
398
                            finished = true;
399
                            with (obj_tenna_zoom)
400
                            {
401
                                con = 2;
402
                                timer = -30;
403
                            }
404
                        }
405
                    }
406
                }
407
                with (
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; }
(mean(x, susiehit.x + 32), mean(y, susiehit.y + 40), spr_dogcar_hit))
408
                {
409
                    
scr_doom
scr_doom

function
scr_doom(arg0, arg1)
{ with (instance_create_depth(0, 0, 0, obj_doom)) { alarm[0] target = arg0; } }
(id, 4);
410
                    
scr_scale
scr_scale

function
scr_scale()
{ if (argument_count == 1) { image_xscale = argument0; image_yscale = argument0; } if (argument_count == 2) { with (argument1) { image_xscale = argument0; image_yscale = argument0; } } } function scr_set_scale() { if (argument_count == 2) { image_xscale = argument0; image_yscale = argument1; } if (argument_count == 3) { with (argument2) { image_xscale = argument0; image_yscale = argument1; } } }
(4, id);
411
                    
scr_lerpvar_instance
scr_lerpvar_instance

function
scr_lerpvar_instance()
{ __lerpvar = instance_create(0, 0, obj_lerpvar); __lerpvar.target = argument[0]; __lerpvar.varname = argument[1]; __lerpvar.pointa = argument[2]; __lerpvar.pointb = argument[3]; __lerpvar.maxtime = argument[4]; if (argument_count >= 6) __lerpvar.easetype = argument[5]; if (argument_count >= 7) __lerpvar.easeinout = argument[6]; return __lerpvar; } function scr_lerp_var_instance() { if (argument_count >= 6)
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5);
else if (argument_count >= 7)
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5, argument6);
else
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4);
} function scr_lerp_instance_var() { if (argument_count >= 6)
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5);
else if (argument_count >= 7)
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5, argument6);
else
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4);
}
(id, "image_xscale", 4, 1, 4);
412
                    
scr_lerpvar_instance
scr_lerpvar_instance

function
scr_lerpvar_instance()
{ __lerpvar = instance_create(0, 0, obj_lerpvar); __lerpvar.target = argument[0]; __lerpvar.varname = argument[1]; __lerpvar.pointa = argument[2]; __lerpvar.pointb = argument[3]; __lerpvar.maxtime = argument[4]; if (argument_count >= 6) __lerpvar.easetype = argument[5]; if (argument_count >= 7) __lerpvar.easeinout = argument[6]; return __lerpvar; } function scr_lerp_var_instance() { if (argument_count >= 6)
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5);
else if (argument_count >= 7)
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5, argument6);
else
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4);
} function scr_lerp_instance_var() { if (argument_count >= 6)
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5);
else if (argument_count >= 7)
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5, argument6);
else
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4);
}
(id, "image_yscale", 4, 1, 4);
413
                    depth = other.depth - 100;
414
                }
415
            }
416
        }
417
    }
418
}
419
var lx = 0;
420
var rx = 1280;
421
var ly = 0;
422
with (obj_susiezilla_gamecontroller)
423
{
424
    lx = xorig;
425
    rx = xorig + width;
426
    ly = yorig;
427
}
428
if (x <= (lx + 5) && hspeed < 0)
429
{
430
    x = lx + 5;
431
    hspeed = abs(hspeed / 2);
432
}
433
if (x >= (rx - 5) && hspeed > 0)
434
{
435
    x = rx - 5;
436
    hspeed = -abs(hspeed / 2);
437
}
438
if (state != states.dead)
439
{
440
    if (y <= (ly + 200) && vspeed < 0)
441
    {
442
        y = ly + 200;
443
        vspeed = abs(vspeed / 2);
444
    }
445
}