Deltarune (Chapter 5) script viewer

← back to main script listing

gml_Object_obj_plat_enm_aqua_miniboss_Destroy_0

related scripts: Collision_obj_plat_enm_smallgloveCollision_obj_plat_susieaxe_hbxCreate_0Destroy_0 Draw_0PreCreate_0Step_0

(view raw script w/o annotations or w/e)
1
if (!initialized)
2
    exit;
3
if (!hit)
4
    exit;
5
audio_stop_sound(snd_enemy_defeat_quick);
6
snd_play(snd_enemy_defeat_quick);
7
with (instance_create_depth(x, y, depth, obj_plat_vfx))
8
{
9
    sprite_index = spr_hit_vfx;
10
    image_speed = 1;
11
}
12
with (instance_create_depth(x, y, depth, obj_plat_vfx))
13
{
14
    sprite_index = spr_smokepuff;
15
    image_speed = 2;
16
}
17
var _col = merge_color(c_gray, other.petal_color, clamp01(other.hp / other.__max_hp));
18
if (hp > 0)
19
{
20
    var _dir = irandom(360);
21
    var _len = 80 + irandom(120);
22
    snd_play_pitch(snd_creepylaugh, 0.8);
23
    var _gx = 0;
24
    var _gy = 0;
25
    if (regular_enemy)
26
    {
27
        var len = random_range(150, 180);
28
        var dir = random_range(0, 360);
29
        _gx = clamp(x + lengthdir_x(len, dir), xstart - 260, xstart + 260);
30
        _gy = clamp(y + lengthdir_y(len, dir), ystart - 60, ystart + 60);
31
    }
32
    else if (nextlerp < 2)
33
    {
34
        _gx = xstart + (targetlerp[2][0] * -320);
35
        _gy = ystart + (targetlerp[2][1] * 120);
36
    }
37
    else
38
    {
39
        _gx = xstart + (targetlerp[0][0] * -320);
40
        _gy = ystart + (targetlerp[0][1] * 120);
41
    }
42
    var _gtime = 20 + (max(0, hp - 3) * 10);
43
    with (instance_create(_gx, _gy, obj_flower_respwn))
44
    {
45
        obj = other.object_index;
46
        extflag = other.extflag;
47
        x_home = other.x_home;
48
        colored = true;
49
        image_blend = _col;
50
        depth = other.depth;
51
        _memory.regular_enemy = other.regular_enemy;
52
        _memory.anchor_x = other.xstart;
53
        _memory.anchor_y = other.ystart;
54
        _memory._hp_init = true;
55
        _memory.__max_hp = other.__max_hp;
56
        y_home = other.y_home;
57
        __spawner = other.__spawner;
58
        hp = other.hp;
59
        alarm[0] = _gtime;
60
        alarm[1] = _gtime / 2;
61
    }
62
    with (instance_create_depth(x, y, depth, obj_flowerdie))
63
    {
64
        fadewait = 60;
65
        colored = true;
66
        image_blend = _col;
67
        speed = 10;
68
        gx = _gx;
69
        gy = _gy;
70
        regroup_target = id;
71
        gtime = _gtime * 0.5;
72
    }
73
}
74
else
75
{
76
    with (obj_plat_bulletred)
77
    {
78
        if (sprite_index == spr_faqua_knife_cracked)
79
        {
80
            if (variable_instance_exists(id, "owner") && instance_exists(owner) && owner.id == other.id)
81
            {
82
                event_user(10);
83
                
scr_doom
scr_doom

function
scr_doom(arg0, arg1)
{ var _doom = instance_create_depth(0, 0, 0, obj_doom); with (_doom) { alarm[0] = arg1; target = arg0; } return _doom; }
(self, 30);
84
                
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; }
("image_alpha", image_alpha, 0, 30);
85
            }
86
        }
87
    }
88
    with (__spawner)
89
        instance_destroy();
90
    spawn_death_coins();
91
    
scr_plat_hitstop_global
scr_plat_hitstop_global

function
scr_plat_hitstop_global(arg0)
{ with (obj_plat_game) hitstop = max(arg0, hitstop); }
(8);
92
    var snd = snd_play_pitch(snd_creepylaugh, 0.8);
93
    snd_pitch_time(snd, 0.4, 15);
94
    snd_volume(snd, 0, 30);
95
    with (instance_create_depth(x, y, depth, obj_flowerdie))
96
    {
97
        speed = 12;
98
        amount = 12;
99
    }
100
}