Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_pl_Alarm_1

(view raw script w/o annotations or w/e)
1
if (instance_exists(obj_postgame_walk_blocker) || instance_exists(obj_steam_walk_blocker) || instance_exists(obj_dunes_29_geno_blocker))
2
{
3
    autowalk_direction = "nothing";
4
    state = scr_normal_state;
5
    exit;
6
}
7
switch (global.flag[28 Spoken to Dalv in his house])
8
{
9
    case 1:
10
        if (instance_exists(obj_dalv2))
11
        {
12
            if (obj_dalv2.dalv_talk_waiter > 0)
13
            {
14
                clover_walk_backwards = false;
15
                autowalk_direction = "nothing";
16
                state = scr_frozen_state;
17
                direction = 90;
18
                exit;
19
            }
20
        }
21
        if (instance_exists(obj_doorway_blocker_dalvshouse))
22
        {
23
            if (obj_doorway_blocker_dalvshouse.waiter > 0)
24
            {
25
                clover_walk_backwards = false;
26
                autowalk_direction = "nothing";
27
                state = scr_frozen_state;
28
                direction = 90;
29
                exit;
30
            }
31
        }
32
        if (instance_exists(obj_doorway_blocker_dalvsroom))
33
        {
34
            if (obj_doorway_blocker_dalvsroom.waiter > 0)
35
            {
36
                clover_walk_backwards = false;
37
                autowalk_direction = "nothing";
38
                state = scr_frozen_state;
39
                direction = 90;
40
                exit;
41
            }
42
        }
43
        switch (room)
44
        {
45
            case rm_dalvshouse:
46
                switch (global.lastroom)
47
                {
48
                    case "rm_dalvroomhall":
49
                        instance_create(335, 110, obj_dalv2);
50
                        with (obj_dalv2)
51
                        {
52
                            image_alpha = 1;
53
                            direction = 180;
54
                            path_speed = 3;
55
                        }
56
                        autowalk_direction = "nothing";
57
                        state = scr_frozen_state;
58
                        obj_dalv2.alarm[0] = 30;
59
                        break;
60
                    case "rm_dalvhallway":
61
                        autowalk_direction = "nothing";
62
                        state = scr_normal_state;
63
                        break;
64
                    default:
65
                        autowalk_direction = "nothing";
66
                }
67
                break;
68
            case rm_dalvroomhall:
69
                switch (global.lastroom)
70
                {
71
                    case "rm_dalvshouse":
72
                        instance_create(-20, 140, obj_dalv2);
73
                        with (obj_dalv2)
74
                        {
75
                            image_alpha = 1;
76
                            direction = 0;
77
                            path_speed = 3;
78
                        }
79
                        autowalk_direction = "nothing";
80
                        state = scr_frozen_state;
81
                        obj_dalv2.alarm[0] = 30;
82
                        break;
83
                    case "rm_dalvsroom":
84
                        autowalk_direction = "nothing";
85
                        state = scr_normal_state;
86
                        break;
87
                }
88
                break;
89
            case rm_dalvExit_pacifist:
90
                if (autowalk_direction == "left")
91
                {
92
                    clover_walk_backwards = false;
93
                    direction = 0;
94
                }
95
                else if (autowalk_direction == "right")
96
                {
97
                    direction = 90;
98
                }
99
                autowalk_direction = "nothing";
100
                state = scr_normal_state;
101
                break;
102
            default:
103
                autowalk_direction = "nothing";
104
        }
105
        break;
106
    default:
107
        autowalk_direction = "nothing";
108
}