Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_factory_03_axis_flashlight_Step_0

(view raw script w/o annotations or w/e)
1
if (live_call())
2
    return global.live_result;
3
x = obj_axis_npc.x;
4
y = obj_axis_npc.y;
5
switch (obj_axis_npc.npc_direction)
6
{
7
    case "right":
8
        image_angle = 0;
9
        break;
10
    case "up":
11
        image_angle = 90;
12
        break;
13
    case "left":
14
        image_angle = 180;
15
        break;
16
    case "down":
17
        image_angle = 270;
18
        break;
19
}
20
if (place_meeting(x, y, obj_pl) && caught_noloop == false && instance_exists(obj_factory_03_minigame))
21
{
22
    if (delay_current > 0)
23
    {
24
        delay_current--;
25
    }
26
    else
27
    {
28
        audio_play_sound(snd_encounter, 1, 0);
29
        instance_create_depth(obj_axis_npc.x, obj_axis_npc.y - 28, obj_axis_npc.depth - 1, obj_cutscene_ex);
30
        scr_cutscene_start
scr_cutscene_start

function scr_cutscene_start() { global.cutscene = true; obj_pl.state = scr_frozen_state; obj_pl.image_index = 0; obj_pl.image_speed = 0; }
();
31
        instance_destroy(obj_factory_03_minigame);
32
        with (obj_axis_npc)
33
        {
34
            actor_speed = 0;
35
            can_walk = false;
36
            npc_arrived = true;
37
        }
38
        caught_noloop = true;
39
        alarm[0] = 30;
gml_Object_obj_factory_03_axis_flashlight_Alarm_0.gml

if (!instance_exists(obj_dialogue_axis_hindered)) msg = instance_create(x, y, obj_dialogue_axis_hindered); with (msg) { sndfnt = 111; message[0] = "* HA. FOUND YOU."; message[1] = "* AWAY YOU GO."; prt[0] = 473; prt[1] = 473; } fade_out = true; instance_destroy(obj_cutscene_ex);
40
    }
41
}
42
else
43
{
44
    delay_current = delay_max;
45
}
46
if (fade_out == true && !global.dialogue_open)
47
{
48
    draw_alpha += 0.1;
49
    if (draw_alpha >= 1)
50
    {
51
        if (!alarm[1])
52
            alarm[1] = 15;
gml_Object_obj_factory_03_axis_flashlight_Alarm_1.gml

room = rm_steamworks_factory_shaft; obj_pl.x = 160; obj_pl.y = 128;
53
    }
54
}
55
if (active == true)
56
{
57
    audio_emitter_position(flashlight_emitter, x, y, 0);
58
    audio_listener_position(obj_pl.x, obj_pl.y, 0);
59
    if (!audio_is_playing(snd_axis_flashlight))
60
        audio_play_sound_on(flashlight_emitter, snd_axis_flashlight, true, 1);
61
}
62
else if (audio_is_playing(snd_axis_flashlight))
63
{
64
    audio_stop_sound(snd_axis_flashlight);
65
}