Undertale script viewer

← back to main script listing

gml_Object_obj_asgore_spearswipe_Step_2

(view raw script w/o annotations or w/e)
1
if (image_index >= 5 && image_index < 6)
2
{
3
    if (cutsdone == 0)
4
    {
5
        cutsfxN += 1;
6
        cutsfxA[cutsfxN] = cutsfx;
7
        cutsfxA[cutsfxN - 1] = cutsfx;
8
        if (cutsfxN > 1)
9
            caster_stop(cutsfxA[cutsfxN - 1]);
10
        caster_play(cutsfxA[cutsfxN], 0.8, 1);
11
        cutsdone = 1;
12
    }
13
    if (type[curamt] == 1 && hitted == 0)
14
    {
15
        hit = 1;
16
        if (abs(obj_heart.x - obj_heart.xprevious) < 0.1)
17
            hit = 0;
18
        if (!obj_time.left && !obj_time.right && !obj_time.up && !obj_time.down)
19
            hit = 0;
20
        if (hit == 1)
21
        {
22
            event_user(0);
23
            hitted = 1;
24
        }
25
    }
26
    if (type[curamt] == 2 && hitted == 0)
27
    {
28
        hit = 1;
29
        if (abs(obj_heart.x - obj_heart.xprevious) > 0.1)
30
            hit = 0;
31
        if (keyboard_check_pressed(vk_left) || keyboard_check_pressed(vk_right) || keyboard_check_pressed(vk_up) || keyboard_check_pressed(vk_down))
32
            hit = 0;
33
        if (hit == 1)
34
        {
35
            event_user(0);
36
            hitted = 1;
37
        }
38
    }
39
    hitted = 2;
40
}
41
else
42
{
43
    cutsdone = 0;
44
}