Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_chem_05_computer_Step_0

(view raw script w/o annotations or w/e)
1
if live_call()
2
    return global.live_result;
3
switch screen_state
4
{
5
    case 0:
6
        with (obj_compound_parent)
7
        {
8
            if (robot_item_is_carried == true)
9
            {
10
                if (point_distance(x, y, (other.x + 55), (other.y + 64)) < 30)
11
                {
12
                    if (other.item_throw_noloop == false || keyboard_multicheck_pressed(1))
13
                    {
14
                        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 }
()
15
                        robot_item_x_target = 165
16
                        robot_item_y_target = 132
17
                        other.screen_state += 1
18
                        other.compound_active = id
19
                        other.item_throw_noloop = true
20
                    }
21
                }
22
                else
23
                    other.item_throw_noloop = false
24
            }
25
        }
26
        if (keyboard_multicheck_pressed(0) && scr_interact
scr_interact

function scr_interact() //gml_Script_scr_interact { if (distance_to_object(obj_pl) < 20 && obj_pl.state == gml_Script_scr_normal_state) { var pl_dir = obj_pl.direction var pl_x = 0 var pl_y = 0 var check_distance_x = 0 var check_distance_y = 0 switch pl_dir { case 0: pl_x = obj_pl.bbox_right pl_y = obj_pl.bbox_top + 1 check_distance_x = 20 break case 180: pl_x = obj_pl.bbox_left pl_y = obj_pl.bbox_top + 1 check_distance_x = -20 break case 90: pl_x = obj_pl.x pl_y = obj_pl.bbox_top check_distance_y = -20 break case 270: pl_x = obj_pl.x pl_y = obj_pl.bbox_bottom check_distance_y = 20 break } if collision_line_first(pl_x, pl_y, (pl_x + check_distance_x), (pl_y + check_distance_y), id, false, false) return true; } }
() && screen_interact_noloop == false)
27
        {
28
            screen_counter = 0
29
            screen_message = "...\nWaiting for correct\ncompounds to complete\nmixture . . ."
30
            if (global.route == 3)
31
                screen_message = "ERROR: Power low"
32
            screen_interact_noloop = true
33
        }
34
        break
35
    case 1:
36
        with (compound_active)
37
        {
38
            if (robot_item_is_jumping == false)
39
            {
40
                robot_item_is_jumping = true
41
                audio_play_sound(snd_playerjump, 1, 0)
42
            }
43
            other.screen_state += 1
44
        }
45
        break
46
    case 2:
47
        with (compound_active)
48
        {
49
            if robot_item_is_jumping
50
                return;
51
            if (image_alpha >= 0)
52
                image_alpha -= 0.05
53
            else
54
            {
55
                other.screen_counter = 0
56
                other.screen_message = "Reading. . ."
57
                other.screen_state += 1
58
            }
59
        }
60
        break
61
    case 3:
62
        if (!alarm[1])
63
            alarm[1] = room_speed * 1
alarm[1]

if live_call() return global.live_result; screen_state += 1
64
        break
65
    case 4:
66
        screen_counter = 0
67
        screen_message = compound_active.compound_id
68
        screen_state += 1
69
        break
70
    case 5:
71
        if (!alarm[1])
72
            alarm[1] = room_speed * 1
alarm[1]

if live_call() return global.live_result; screen_state += 1
73
        break
74
    case 6:
75
        screen_message += "\nVerdict: "
76
        screen_state += 1
77
        break
78
    case 7:
79
        if (!alarm[1])
80
            alarm[1] = room_speed * 0.5
alarm[1]

if live_call() return global.live_result; screen_state += 1
81
        break
82
    case 8:
83
        if (compound_active.compound_id == "Chlorine [Cl]" || compound_active.compound_id == "Hydrogen [H]")
84
        {
85
            compound_count += 1
86
            compound_destroy = true
87
            if (global.route == 3)
88
                screen_message += "Acception Message"
89
            else
90
                screen_message += "Accepted."
91
        }
92
        else
93
        {
94
            if (global.route == 3)
95
                screen_message += "Rejection Message"
96
            else
97
                screen_message += "Declined."
98
            compound_destroy = true
99
            with (compound_active)
100
            {
101
            }
102
        }
103
        screen_state += 1
104
        break
105
    case 9:
106
        if (!alarm[1])
107
            alarm[1] = room_speed * 1
alarm[1]

if live_call() return global.live_result; screen_state += 1
108
        break
109
    case 10:
110
        if (global.route != 3)
111
        {
112
            scr_text
scr_text

function scr_text() //gml_Script_scr_text { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue) }
()
113
            var compound_id = compound_active
114
            with (msg)
115
            {
116
                for (var i = 0; i < array_length(compound_id.message); i++)
117
                {
118
                    col_modif[0] = 65280
119
                    message[i] = compound_id.message[i]
120
                    message_col[i][0] = message[i]
121
                    color = true
122
                }
123
            }
124
        }
125
        if (!global.dialogue_open)
126
            screen_state += 1
127
        break
128
    case 11:
129
        if (compound_destroy == true)
130
            instance_destroy(compound_active)
131
        if (compound_count == 0)
132
        {
133
            screen_counter = 0
134
            screen_message = "...\nWaiting for correct\ncompounds to complete\nmixture . . ."
135
            if (global.route == 3)
136
                screen_message = "ERROR: Power low"
137
            screen_interact_noloop = true
138
        }
139
        else
140
        {
141
            screen_counter = 0
142
            var status_1 = "MISSING"
143
            var status_2 = "MISSING"
144
            if (compound_count > 0)
145
                status_1 = "PRESENT"
146
            if (compound_count > 1)
147
                status_2 = "PRESENT"
148
            screen_message = "Status:\nCompound 1: " + status_1 + "\nCompound 2: " + status_2
149
            screen_interact_noloop = true
150
        }
151
        if (compound_count > 1)
152
        {
153
            screen_message = ". . .Booting process."
154
            if (global.route == 3)
155
                screen_message = ". . ."
156
            screen_state += 1
157
        }
158
        else
159
        {
160
            screen_state = 0
161
            scr_cutscene_end
scr_cutscene_end

function scr_cutscene_end() //gml_Script_scr_cutscene_end { global.cutscene = false obj_pl.alarm[0] = 1 }
()
162
        }
163
        break
164
    case 12:
165
        if (!alarm[1])
166
            alarm[1] = room_speed * 2
alarm[1]

if live_call() return global.live_result; screen_state += 1
167
        break
168
    case 13:
169
        if (global.route == 3)
170
            screen_message += "\nITEMs ready\nApproach terminal"
171
        else
172
            screen_message += "\nBoot complete.\nMixing initialized."
173
        screen_state += 1
174
    case 14:
175
        if (!alarm[1])
176
            alarm[1] = room_speed * 1.5
alarm[1]

if live_call() return global.live_result; screen_state += 1
177
        break
178
    case 15:
179
        instance_create_depth(0, 0, (-room_height), obj_chem_05_maze_puzzle)
180
        screen_state += 1
181
        break
182
    case 16:
183
        if (!instance_exists(obj_chem_05_maze_puzzle))
184
            screen_state += 1
185
        break
186
    case 17:
187
        screen_counter = 0
188
        screen_message = "Mixing process\ncomplete. Enjoy your\ndeadly acid :)"
189
        if (global.route == 3)
190
            screen_message = "Your ITEM is ready"
191
        screen_interact_noloop = true
192
        screen_state += 1
193
        break
194
    case 18:
195
        if (!alarm[1])
196
            alarm[1] = room_speed * 1.5
alarm[1]

if live_call() return global.live_result; screen_state += 1
197
        break
198
    case 19:
199
        audio_play_sound(snd_success, 1, 0)
200
        instance_create(264, 158, obj_steamworks_05_acid)
201
        scr_cutscene_end
scr_cutscene_end

function scr_cutscene_end() //gml_Script_scr_cutscene_end { global.cutscene = false obj_pl.alarm[0] = 1 }
()
202
        global.sworks_flag[25] = 2
203
        screen_state += 1
204
        break
205
}
206
207
if (screen_counter < string_length(screen_message))
208
{
209
    if (keyboard_multicheck_pressed(1) && screen_state > 0)
210
        screen_counter = string_length(screen_message)
211
    screen_counter += 1
212
    if (screen_counter == floor(screen_counter))
213
        audio_play_sound(snd_talk_default, 1, 0)
214
    screen_cursor = "_"
215
    alarm[0] = room_speed
alarm[0]

if live_call() return global.live_result; if (screen_cursor == "_") screen_cursor = "" else screen_cursor = "_" alarm[0] = room_speed
216
}
217
screen_message_current = string_copy(screen_message, 0, screen_counter)