Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_board_hazard_Step_0

(view raw script w/o annotations or w/e)
1
if (active)
2
    
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();
}
();
3
if (init == 0)
4
{
5
    mysolid = instance_create(bbox_left + 2, bbox_top + 2, obj_board_solid);
6
    mysolid.sprite_index = spr_whitepx;
7
    mysolid.image_xscale = bbox_right - bbox_left - 3;
8
    mysolid.image_yscale = bbox_bottom - bbox_top - 3;
9
    init = 1;
10
}
11
if (room != room_board_1 && room != room_board_2)
12
{
13
    hitbuff--;
14
    if (place_meeting(x, y, obj_board_swordhitbox) && hitbuff <= 0)
15
    {
16
        hitbuff = 10;
17
        
scr_shakeobj
scr_shakeobj

function
scr_shakeobj()
{ var _shakeobj = instance_create(x, y, obj_shakeobj); _shakeobj.target = id; if (argument_count >= 1) { if (i_ex(argument0)) _shakeobj.target = argument0; } if (argument_count >= 2) { if (argument1 != -1) _shakeobj.shakeamt = argument1; } if (argument_count >= 3) { if (argument2 != -1) _shakeobj.shakereduct = argument2; } with (_shakeobj) event_user(0); }
();
18
        snd_play(snd_board_damage);
19
        myhealth--;
20
        if (myhealth == 0)
21
        {
22
            instance_create(centerx(), centery(), obj_board_enemydefeatsplash);
23
            instance_destroy();
24
        }
25
    }
26
}