Deltarune (Chapter 5) script viewer

← back to main script listing

gml_Object_obj_plat_enm_yellow_miniboss_Other_19

related scripts: Collision_obj_plat_enm_smallgloveCollision_obj_plat_playerCollision_obj_plat_susieaxe_hbxCreate_0Destroy_0Draw_0Draw_72Other_19 Other_4PreCreate_0Step_0Step_2

(view raw script w/o annotations or w/e)
1
var _hspeed = lengthdir_x(stored_speed, direction) * 2;
2
var _vspeed = lengthdir_y(stored_speed, direction) * 2;
3
var newdir = direction;
4
var cx = camerax();
5
var cy = cameray();
6
var cw = camerawidth();
7
var ch = cameraheight();
8
var padh = -60;
9
var padv = -80;
10
var hcheck = (x + _hspeed) < (cx - padh) || (x + _hspeed) > (cx + cw + padh);
11
var vcheck = (y + _vspeed) < (cy - padv) || (y + _vspeed) > ((cy + ch) - 160);
12
if (vspeed > 0)
13
{
14
    with (obj_plat_follower)
15
    {
16
        if (name == "ralsei" && is_platform_mode && y > ((cy + ch) - 160))
17
        {
18
            vcheck = true;
19
            break;
20
        }
21
    }
22
}
23
var got_hit = false;
24
if (hcheck && !vcheck)
25
{
26
    newdir = 180 - newdir;
27
    x += lengthdir_x(stored_speed, newdir);
28
    y += lengthdir_y(stored_speed, newdir);
29
    
scr_debug_print
scr_debug_print

function
scr_debug_print()
{ if (!
scr_debug())
exit; } function scr_debug_clear_all() { }
("hbounce");
30
    got_hit = true;
31
    with (obj_plat_camera)
32
        shakex = 6;
33
}
34
else if (vcheck && !hcheck)
35
{
36
    newdir = -1 * newdir;
37
    x += lengthdir_x(stored_speed, newdir);
38
    y += lengthdir_y(stored_speed, newdir);
39
    
scr_debug_print
scr_debug_print

function
scr_debug_print()
{ if (!
scr_debug())
exit; } function scr_debug_clear_all() { }
("vvbounce");
40
    got_hit = true;
41
    with (obj_plat_camera)
42
        shakey = 6;
43
}
44
else if (hcheck && vcheck)
45
{
46
    newdir = 180 - newdir;
47
    newdir = -1 * newdir;
48
    x += lengthdir_x(stored_speed, newdir);
49
    y += lengthdir_y(stored_speed, newdir);
50
    
scr_debug_print
scr_debug_print

function
scr_debug_print()
{ if (!
scr_debug())
exit; } function scr_debug_clear_all() { }
("xxxbounce");
51
    got_hit = true;
52
    with (obj_plat_camera)
53
    {
54
        shakex = 6;
55
        shakey = 6;
56
    }
57
}
58
if (got_hit)
59
{
60
    turnstun = 2;
61
    hp--;
62
    hit = 1;
63
    shake = 4;
64
    flash_hurt(255);
65
    snd_play(snd_punchweak, 1, 0.5);
66
    if (hp <= 0)
67
    {
68
        instance_destroy();
69
        exit;
70
    }
71
}
72
direction = newdir;
73
target_angle = 180 + direction;
74
if (image_xscale < 0)
75
    target_angle += 180;