Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_ch3_b4_chef_kris_Create_0

(view raw script w/o annotations or w/e)
1
pos = 0;
2
pos_range = 0;
3
jumping = 0;
4
jumpwait = 0;
5
image_xscale = 2;
6
image_yscale = 2;
7
depth = 7000;
8
invincible = 0;
9
firewait = 0;
10
xstart = 320;
11
ystart = 280;
12
x = xstart;
13
y = ystart;
14
stun = 0;
15
stack_height = 0;
16
throwing = 0;
17
throwwait = 0;
18
19
burn_stack = function()
20
{
21
    var _fall = true;
22
    if (invincible || stun > 0)
23
        exit;
24
    var damage_amount = choose(10, 15);
25
    if (global.hp[1] < (global.maxhp[1] / 2))
26
        damage_amount = choose(2, 3);
27
    global.hp[1] = clamp(global.hp[1] - damage_amount, 1, global.maxhp[1]);
28
    var _dmgwriter = instance_create(x, y, obj_dmgwriter);
29
    _dmgwriter.damage = damage_amount;
30
    snd_play_pitch(snd_error, 1.2);
31
    snd_play_pitch(snd_explosion_mmx, 0.8);
32
    if (_fall)
33
    {
34
        firewait = 40;
35
        stun = 40;
36
        hspeed = 0;
37
        vspeed = -8;
38
        gravity = 1;
39
        y -= 2;
40
        image_speed = 0;
41
        sprite_index = spr_chefs_kris_stun;
42
        image_index = 0;
43
        jumping = 0;
44
        throwing = 0;
45
    }
46
    else
47
    {
48
        firewait = 10;
49
        invincible = 45;
50
    }
51
};