Undertale script viewer

← back to main script listing

gml_Object_obj_knighthammer_Step_0

(view raw script w/o annotations or w/e)
1
if (go == 1)
2
{
3
    if (side == 0 && (y + sprite_height) > 400)
4
    {
5
        if (instance_exists(obj_shaker) == 0)
6
        {
7
            snd_play(snd_impact);
8
            scr_shake
scr_shake

instance_create(0, 0, obj_shaker); obj_shaker.hshake = argument0; obj_shaker.vshake = argument1; obj_shaker.shakespeed = argument2;
(2, 2, 2);
9
        }
10
        nowx = x;
11
        nowy = y;
12
        go = 2;
13
        vspeed = 0;
14
        alarm[4] = 5;
gml_Object_obj_knighthammer_Alarm_4.gml

if (side == 0) { go = 3; vspeed = -10; } if (side == 1) { go = 3; vspeed = 10; }
15
    }
16
    if (side == 1 && y < 250)
17
    {
18
        if (instance_exists(obj_shaker) == 0)
19
        {
20
            snd_play(snd_impact);
21
            scr_shake
scr_shake

instance_create(0, 0, obj_shaker); obj_shaker.hshake = argument0; obj_shaker.vshake = argument1; obj_shaker.shakespeed = argument2;
(2, 2, 2);
22
        }
23
        nowx = x;
24
        nowy = y;
25
        go = 2;
26
        vspeed = 0;
27
        alarm[4] = 5;
gml_Object_obj_knighthammer_Alarm_4.gml

if (side == 0) { go = 3; vspeed = -10; } if (side == 1) { go = 3; vspeed = 10; }
28
    }
29
}
30
if (go == 2)
31
{
32
    x = (nowx - 2) + random(4);
33
    y = (nowy - 2) + random(4);
34
}
35
if (go == 3)
36
{
37
    if (side == 0 && (y + sprite_height) < 250)
38
        instance_destroy();
39
    if (side == 1 && y > 400)
40
        instance_destroy();
41
}
42
hit = 0;
43
if (collision_rectangle(bbox_left, bbox_top, bbox_right, bbox_bottom, obj_heart, 0, 1))
44
    hit = 1;
45
if (image_index == 0)
46
{
47
    if (collision_rectangle(6, 144, 33, 188, obj_heart, 0, 1))
48
        hit = 1;
49
}
50
if (image_index == 1)
51
{
52
    if (collision_rectangle(6, 6, 33, 52, obj_heart, 0, 1))
53
        hit = 1;
54
}
55
if (hit == 1)
56
    event_user(0);