Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_board_cactus_Step_0

(view raw script w/o annotations or w/e)
1
if (kris == 0)
2
{
3
    with (obj_mainchara_board)
4
    {
5
        if (name == "kris")
6
            other.kris = id;
7
    }
8
}
9
if (init == 0)
10
{
11
    mysolid = instance_create(bbox_left + 2, bbox_top + 2, obj_board_solid);
12
    mysolid.sprite_index = spr_whitepx;
13
    mysolid.image_xscale = bbox_right - bbox_left - 3;
14
    mysolid.image_yscale = bbox_bottom - bbox_top - 3;
15
    if (cold)
16
        sprite_index = spr_board_cactus_cold;
17
    init = 1;
18
}
19
if (wither == 1)
20
{
21
    if (witherproof == 0)
22
        sprite_index = spr_board_cactus_dead;
23
    wither = 2;
24
}
25
if (active)
26
{
27
    
scr_depth_board
scr_depth_board

function
scr_depth_board()
{ depth = 1000000 - ((y * 10) + ((sprite_height - sprite_yoffset) * 10)); } function scr_board_depth() {
scr_depth_board();
}
();
28
    if (room != room_board_1 && room != room_board_2)
29
    {
30
        if (i_ex(kris))
31
        {
32
            if (kris.sword == true)
33
            {
34
                sndbuff--;
35
                if (place_meeting(x, y, obj_board_swordhitbox))
36
                {
37
                    var sword = instance_place(x, y, obj_board_swordhitbox);
38
                    if (sword.swordlv > defense)
39
                    {
40
                        myhealth--;
41
                        if (myhealth <= 0)
42
                        {
43
                            instance_create(centerx(), centery(), obj_board_enemydefeatsplash);
44
                            instance_destroy();
45
                        }
46
                    }
47
                    else if (sndbuff <= 0)
48
                    {
49
                        snd_stop(snd_board_sword_metal);
50
                        snd_play(snd_board_sword_metal);
51
                        sndbuff = 10;
52
                    }
53
                }
54
            }
55
        }
56
    }
57
}