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
21
if (place_meeting(x, y, obj_pl) && caught_noloop == false && instance_exists(obj_factory_03_minigame))
22
{
23
    if (delay_current > 0)
24
        delay_current--
25
    else
26
    {
27
        audio_play_sound(snd_encounter, 1, 0)
28
        instance_create_depth(obj_axis_npc.x, (obj_axis_npc.y - 28), (obj_axis_npc.depth - 1), obj_cutscene_ex)
29
        scr_cutscene_start
scr_cutscene_start

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

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)
39
    }
40
}
41
else
42
    delay_current = delay_max
43
if (fade_out == true && (!global.dialogue_open))
44
{
45
    draw_alpha += 0.1
46
    if (draw_alpha >= 1)
47
    {
48
        if (!alarm[1])
49
            alarm[1] = 15
alarm[1]

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