Undertale Yellow script viewer

← back to main script listing

gml_GlobalScript_cutscene_npc_action_sprite

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