Deltarune (Chapter 5) script viewer

← back to main script listing

gml_Object_obj_plat_enm_yellow_punishmentgun_Collision_obj_plat_susieaxe_hbx

related scripts: CleanUp_0Collision_obj_plat_playerCollision_obj_plat_susieaxe_hbx Create_0Destroy_0Draw_0Draw_72Other_20Other_4Step_0Step_2

(view raw script w/o annotations or w/e)
1
if (killed)
2
    exit;
3
if (movetype == 0)
4
    
scr_lerpvar
scr_lerpvar

function
scr_lerpvar()
{ var _id = self; if (!is_struct(self)) _id = id; 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_lerpcol() { if (argument_count < 6) ___lerpvar = scr_lerpcol_instance(id, argument[0], argument[1], argument[2], argument[3]); else ___lerpvar = scr_lerpcol_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]); return ___lerpvar; }
("gunspin", 0, 360, 30, -1, "out");
5
with (obj_plat_hbx)
6
{
7
    if (!hit_check(other.id))
8
        exit;
9
}
10
if (hp == maxhp)
11
{
12
    with (obj_plat_enm_yellow_punishmentgun)
13
    {
14
        talkcon = 3;
15
        event_user(10);
16
    }
17
}
18
hp -= 2;
19
hit = 1;
20
if (hp > 0)
21
    stun();
22
spawn_hit_petals(8, point_direction(other.x, other.y, x, y), 1);
23
shake = 8;
24
with (obj_plat_hbx)
25
    do_hbx_hit(-4, 0);
26
with (instance_create_depth(x, y, depth + 1, obj_plat_vfx))
27
{
28
    sprite_index = spr_hit_vfx;
29
    image_speed = 1;
30
}
31
with (instance_create_depth(x, y, depth + 1, obj_plat_vfx))
32
{
33
    sprite_index = spr_smokepuff;
34
    image_speed = 2;
35
}
36
flash_hurt(16711935);
37
if (hp <= 0)
38
{
39
    killed = true;
40
    spawn_death_coins();
41
    if (chargesound != -4)
42
        snd_stop(chargesound);
43
    exit;
44
}
45
var pitch = 0.6 + ((hp / maxhp) * 0.3);
46
snd_play(snd_metal_hit_strong, 1, 1.1);
47
snd_play(snd_playablebell, 0.3, pitch + 1);
48
snd_play(snd_playablebell, 0.6, pitch);
49
var fx_anchor_x = x - lengthdir_x(60, image_angle);
50
var fx_anchor_y = y - lengthdir_y(60, image_angle);
51
if (hp <= 0 || (image_index < 5 && hp <= next_phase_hp[image_index]))
52
{
53
    if (hp <= 0)
54
        scr_plat_cool_zoom();
55
    snd_play(snd_playablebell, 1, pitch + 2);
56
    snd_play(snd_playablebell, 0.6, pitch * 0.5);
57
    if (image_index < 5)
58
        image_index++;
59
    
scr_make_ripple
scr_make_ripple

function
scr_make_ripple(arg0, arg1, arg2 = 60, arg3 = 16159050, arg4 = 160, arg5 = 1, arg6 = 15, arg7 = 1999000, arg8 = 0, arg9 = 0, arg10 = 0.1, arg11 = 0, arg12 = 1, arg13 = 0, arg14 = 0, arg15 = true)
{ var _ripple = -4; var _found = false; if (instance_exists(obj_ripples)) { with (obj_ripples) { if (depth == arg7) { _found = true; _ripple = MakeRipple(arg0, arg1, arg4, arg5, arg6, arg3, arg8, arg9, arg10, arg2, arg11, arg12, arg13, arg14, arg15); blend = arg13; } } } if (!_found) { with (instance_create_depth(0, 0, arg7, obj_ripples)) { _ripple = MakeRipple(arg0, arg1, arg4, arg5, arg6, arg3, arg8, arg9, arg10, arg2, arg11, arg12, arg13, arg14, arg15); blend = arg13; } } return _ripple; }
(fx_anchor_x, fx_anchor_y, 30, 65535, 200, 8, 24, depth + 1, undefined, undefined, undefined, undefined, undefined, 1, 2, true);
60
    
scr_make_ripple
scr_make_ripple

function
scr_make_ripple(arg0, arg1, arg2 = 60, arg3 = 16159050, arg4 = 160, arg5 = 1, arg6 = 15, arg7 = 1999000, arg8 = 0, arg9 = 0, arg10 = 0.1, arg11 = 0, arg12 = 1, arg13 = 0, arg14 = 0, arg15 = true)
{ var _ripple = -4; var _found = false; if (instance_exists(obj_ripples)) { with (obj_ripples) { if (depth == arg7) { _found = true; _ripple = MakeRipple(arg0, arg1, arg4, arg5, arg6, arg3, arg8, arg9, arg10, arg2, arg11, arg12, arg13, arg14, arg15); blend = arg13; } } } if (!_found) { with (instance_create_depth(0, 0, arg7, obj_ripples)) { _ripple = MakeRipple(arg0, arg1, arg4, arg5, arg6, arg3, arg8, arg9, arg10, arg2, arg11, arg12, arg13, arg14, arg15); blend = arg13; } } return _ripple; }
(fx_anchor_x, fx_anchor_y, 60, 65535, 400, 8, 16, depth + 1, undefined, undefined, undefined, undefined, undefined, 1, 2, true);
61
    chunks_particle_system.depth = depth + 2;
62
    chunks_particle_system.shader2_greyscale_fade = hp / maxhp;
63
    repeat (6)
64
    {
65
        chunks_particle_system.x = x + random_range(-40, 40);
66
        chunks_particle_system.y = y + random_range(-40, 40);
67
        chunks_particle_struct.image_index = choose(1, 2);
68
        var spd = random_range(16, 18);
69
        var dir = random_range(135, 405);
70
        chunks_particle_struct.hspeed = lengthdir_x(spd, dir);
71
        chunks_particle_struct.vspeed = lengthdir_y(spd, dir);
72
        chunks_particle_system.emit(chunks_particle_struct);
73
    }
74
    if (phase < 5)
75
    {
76
        phase++;
77
        
scr_plat_hitstop_global
scr_plat_hitstop_global

function
scr_plat_hitstop_global(arg0)
{ with (obj_plat_game) hitstop = max(arg0, hitstop); }
(6);
78
        snd_play(snd_ultraswing);
79
        on_phase_change(phase);
80
    }
81
}