Undertale Yellow script viewer

← back to main script listing

gml_GlobalScript_cutscene_npc_action_sprite_reverse

(view raw script w/o annotations or w/e)
1
function cutscene_npc_action_sprite_reverse() //gml_Script_cutscene_npc_action_sprite_reverse
2
{
3
    with (argument[0])
4
    {
5
        if (sprite_index != argument[1] || image_speed == 0)
6
        {
7
            action_sprite = true
8
            sprite_index = argument[1]
9
            image_speed = (-argument[2])
10
            image_index = image_number - 1
11
        }
12
        else
13
        {
14
            if ((image_index + image_speed) <= 0)
15
            {
16
                if (argument[3] == false)
17
                {
18
                    action_sprite = false
19
                    image_speed = 0
20
                    with (other)
21
                        cutscene_advance()
22
                    return true;
23
                }
24
                else
25
                {
26
                    if (argument_count > 4)
27
                        image_speed = argument[4]
28
                    with (other)
29
                        cutscene_advance()
30
                    return true;
31
                }
32
            }
33
            if (argument_count > 5)
34
            {
35
                if (argument[6] >= (image_index + image_speed) && argument[6] <= (image_index - image_speed))
36
                {
37
                    if (!audio_is_playing(argument[5]))
38
                        audio_play_sound(argument[5], 1, 0)
39
                }
40
            }
41
        }
42
    }
43
    return false;
44
}