Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_battle_enemy_ceroba_phase_2_outro_Step_0

(view raw script w/o annotations or w/e)
1
if live_call()
2
    return global.live_result;
3
var battle_box = obj_dialogue_box_battle_transformation_any
4
switch scene
5
{
6
    case 0:
7
        instance_destroy(obj_ceroba_transformation_mask)
8
        with (obj_heart_yellow_shot)
9
            instance_destroy()
10
        audio_play_sound(snd_ceroba_p2_block, 1, 0)
11
        obj_ceroba_body_pacifist_phase_2.sprite_index = spr_ceroba_p2_block
12
        obj_ceroba_body_pacifist_phase_2.image_index = 0
13
        obj_ceroba_body_pacifist_phase_2.image_speed = 1
14
        scene++
15
        break
16
    case 1:
17
        cutscene_wait(2)
18
        break
19
    case 2:
20
        obj_heart_battle_fighting_yellow_final.is_charging = false
21
        obj_heart_battle_fighting_parent.moveable = false
22
        obj_heart_battle_fighting_yellow_final.can_shoot = true
23
        scene++
24
        break
25
    case 3:
26
        cutscene_wait(1)
27
        break
28
    case 4:
29
        obj_heart_battle_fighting_parent.image_alpha = 0
30
        instance_create_depth(obj_heart_battle_fighting_parent.x, obj_heart_battle_fighting_parent.y, obj_heart_battle_fighting_parent.depth, obj_ceroba_transformation_soul)
31
        obj_ceroba_transformation_soul.sprite_index = obj_heart_battle_fighting_parent.sprite_index
32
        with (obj_heart_yellow_shot)
33
            instance_destroy()
34
        scene++
35
        break
36
    case 5:
37
        with (obj_ceroba_transformation_soul)
38
        {
39
            is_charging = true
40
            if is_charged
41
            {
42
                can_shoot = true
43
                other.scene++
44
            }
45
        }
46
        break
47
    case 6:
48
        if instance_exists(obj_heart_yellow_shot)
49
        {
50
            with (obj_heart_yellow_shot)
51
            {
52
                if (y < (obj_ceroba_body_pacifist_phase_2.y + 150))
53
                {
54
                    vspeed = lerp(vspeed, 0, 0.1)
55
                    if (vspeed > -5)
56
                        other.draw_alpha = 1 - vspeed / -5
57
                    if (vspeed > -0.01)
58
                    {
59
                        other.draw_alpha = 1
60
                        vspeed = 0
61
                        other.scene = 8
62
                        instance_destroy()
63
                    }
64
                }
65
            }
66
        }
67
        break
68
    case 7:
69
        cutscene_wait(0.75)
70
        break
71
    case 8:
72
        cutscene_wait(1)
73
        break
74
    case 9:
75
        instance_create_depth(obj_ceroba_body_pacifist_phase_2.x, obj_ceroba_body_pacifist_phase_2.y, (depth - 1), obj_ceroba_last_hit_impact)
76
        audio_play_sound(snd_ceroba_staff_break, 1, 0)
77
        scene++
78
        break
79
    case 10:
80
        cutscene_wait(1)
81
        break
82
    case 11:
83
        box_overlay_alpha = 1
84
        obj_dialogue_box_battle_transformation_any.image_xscale = 1
85
        obj_dialogue_box_battle_transformation_any.image_yscale = 1
86
        obj_heart_battle_fighting_parent.image_alpha = 1
87
        instance_destroy(obj_ceroba_phase_2_red_shader)
88
        instance_destroy(obj_ceroba_transformation_soul)
89
        instance_destroy(obj_battle_hp_current_self)
90
        instance_destroy(obj_battle_hp_max_self)
91
        instance_destroy(obj_text_hp_stat)
92
        instance_destroy(obj_text_hp)
93
        instance_destroy(obj_text_battle_stat_lv)
94
        instance_destroy(obj_text_battle_stat_name)
95
        instance_destroy(obj_petal_generator_phase_2)
96
        instance_destroy(obj_autofire_toggle)
97
        obj_ceroba_body_pacifist_phase_2.sprite_index = spr_ceroba_p2_block_2
98
        obj_ceroba_body_pacifist_phase_2.image_index = 0
99
        obj_ceroba_body_pacifist_phase_2.image_speed = 0
100
        scene++
101
        break
102
    case 12:
103
        if (draw_alpha > 0)
104
            draw_alpha -= 0.1
105
        else
106
        {
107
            draw_alpha = 0
108
            scene++
109
        }
110
        break
111
    case 13:
112
        cutscene_wait(0.5)
113
        break
114
    case 14:
115
        obj_ceroba_body_pacifist_phase_2.image_speed = 1
116
        obj_ceroba_body_pacifist_phase_2.x = obj_ceroba_body_pacifist_phase_2.xstart
117
        scene++
118
        break
119
    case 15:
120
        with (obj_ceroba_body_pacifist_phase_2)
121
        {
122
            if (sprite_index == spr_ceroba_p2_block_3 && image_index >= (image_number - 1))
123
                other.scene++
124
        }
125
        break
126
    case 16:
127
        cutscene_wait(3)
128
        break
129
    case 17:
130
        instance_create(380, 74, obj_quote_bubble_battle_yellow_3)
131
        instance_create_depth(0, 0, -1000, obj_quote_battle_ceroba_outro_1)
132
        obj_ceroba_body_pacifist_phase_2.sprite_index = spr_ceroba_p2_defeated_talk
133
        obj_ceroba_body_pacifist_phase_2.image_index = 0
134
        obj_ceroba_body_pacifist_phase_2.image_speed = 0
135
        cutscene_advance()
136
        break
137
    case 18:
138
        if (!instance_exists(obj_quote_battle_ceroba_outro_1))
139
            scene++
140
        break
141
    case 19:
142
        cutscene_wait(1)
143
        break
144
    case 20:
145
        instance_create(380, 74, obj_quote_bubble_battle_yellow_3)
146
        instance_create_depth(0, 0, -1000, obj_quote_battle_ceroba_outro_2)
147
        cutscene_advance()
148
        break
149
    case 21:
150
        if (!instance_exists(obj_quote_battle_ceroba_outro_2))
151
            scene++
152
        break
153
    case 22:
154
        if (obj_ceroba_body_pacifist_phase_2.sprite_index != spr_ceroba_p2_defeated_turn_left)
155
        {
156
            obj_ceroba_body_pacifist_phase_2.sprite_index = spr_ceroba_p2_defeated_turn_left
157
            obj_ceroba_body_pacifist_phase_2.image_index = 0
158
            obj_ceroba_body_pacifist_phase_2.image_speed = 1
159
        }
160
        else if (obj_ceroba_body_pacifist_phase_2.image_index >= obj_ceroba_body_pacifist_phase_2.image_number)
161
        {
162
            obj_ceroba_body_pacifist_phase_2.image_index = obj_ceroba_body_pacifist_phase_2.image_number - 1
163
            obj_ceroba_body_pacifist_phase_2.image_speed = 0
164
            cutscene_advance(22.5)
165
        }
166
        break
167
    case 22.5:
168
        if cutscene_wait(0.5)
169
            scene = 23
170
        break
171
    case 23:
172
        instance_create(380, 74, obj_quote_bubble_battle_yellow_3)
173
        instance_create_depth(0, 0, -1000, obj_quote_battle_ceroba_outro_3)
174
        cutscene_advance()
175
        break
176
    case 24:
177
        if (!instance_exists(obj_quote_battle_ceroba_outro_3))
178
            scene++
179
        break
180
    case 25:
181
        obj_ceroba_body_pacifist_phase_2.sprite_index = spr_ceroba_p2_defeated_side_idle
182
        obj_ceroba_body_pacifist_phase_2.image_index = 0
183
        obj_ceroba_body_pacifist_phase_2.image_speed = 0
184
        cutscene_wait(2)
185
        break
186
    case 26:
187
        obj_ceroba_body_pacifist_phase_2.sprite_index = spr_ceroba_p2_defeated_side_talk
188
        instance_create(380, 74, obj_quote_bubble_battle_yellow_3)
189
        instance_create_depth(0, 0, -1000, obj_quote_battle_ceroba_outro_4)
190
        cutscene_advance()
191
        break
192
    case 27:
193
        if (!instance_exists(obj_quote_battle_ceroba_outro_4))
194
        {
195
            obj_ceroba_body_pacifist_phase_2.sprite_index = spr_ceroba_p2_defeated_side_idle
196
            cutscene_wait(2)
197
        }
198
        break
199
    case 28:
200
        obj_ceroba_body_pacifist_phase_2.sprite_index = spr_ceroba_p2_defeated_side_talk
201
        instance_create(380, 74, obj_quote_bubble_battle_yellow_3)
202
        instance_create_depth(0, 0, -1000, obj_quote_battle_ceroba_outro_5)
203
        cutscene_advance()
204
        break
205
    case 29:
206
        if (!instance_exists(obj_quote_battle_ceroba_outro_5))
207
        {
208
            obj_ceroba_body_pacifist_phase_2.sprite_index = spr_ceroba_p2_defeated_talk
209
            obj_ceroba_body_pacifist_phase_2.image_index = 0
210
            obj_ceroba_body_pacifist_phase_2.image_speed = 0
211
            cutscene_wait(1)
212
        }
213
        break
214
    case 30:
215
        battle_box = obj_dialogue_box_battle_transformation_any
216
        box_overlay_alpha -= 0.1
217
        if (box_overlay_alpha <= 0)
218
        {
219
            instance_create_depth((battle_box.bbox_left + 30), (battle_box.y - 22), (battle_box.depth - 1), obj_ceroba_phase_2_fight)
220
            instance_create_depth((battle_box.bbox_right - sprite_get_width(spr_mercy) - 30), (battle_box.y - 22), (battle_box.depth - 1), obj_ceroba_phase_2_mercy)
221
            obj_heart_battle_fighting_parent.moveable = true
222
            obj_heart_battle_fighting_parent.can_shoot = false
223
            obj_heart_battle_fighting_yellow_final.can_charge = false
224
            scene++
225
        }
226
        break
227
    case 31:
228
        if (obj_ceroba_phase_2_mercy.button_pressed == true)
229
        {
230
            obj_ceroba_phase_2_mercy.fade_in = false
231
            obj_ceroba_phase_2_fight.fade_in = false
232
            obj_heart_battle_fighting_parent.moveable = false
233
            scene += 1
234
        }
235
        if (obj_ceroba_phase_2_fight.button_pressed == true)
236
        {
237
            obj_ceroba_phase_2_mercy.fade_in = false
238
            obj_ceroba_phase_2_fight.fade_in = false
239
            obj_heart_battle_fighting_parent.moveable = false
240
            scene = 44
241
        }
242
        break
243
    case 32:
244
        cutscene_wait(1)
245
        break
246
    case 33:
247
        instance_create(380, 74, obj_quote_bubble_battle_yellow_3)
248
        instance_create_depth(0, 0, -1000, obj_quote_battle_ceroba_outro_spare_1)
249
        cutscene_advance()
250
        break
251
    case 34:
252
        if (!instance_exists(obj_quote_battle_ceroba_outro_spare_1))
253
        {
254
            obj_ceroba_phase_2_mercy.fade_in = true
255
            obj_ceroba_phase_2_fight.fade_in = true
256
            obj_heart_battle_fighting_parent.moveable = true
257
            scene++
258
        }
259
        break
260
    case 35:
261
        if (obj_ceroba_phase_2_mercy.button_pressed == true)
262
        {
263
            obj_ceroba_phase_2_mercy.fade_in = false
264
            obj_ceroba_phase_2_fight.fade_in = false
265
            obj_heart_battle_fighting_parent.moveable = false
266
            scene += 1
267
        }
268
        if (obj_ceroba_phase_2_fight.button_pressed == true)
269
        {
270
            obj_ceroba_phase_2_mercy.fade_in = false
271
            obj_ceroba_phase_2_fight.fade_in = false
272
            obj_heart_battle_fighting_parent.moveable = false
273
            scene = 44
274
        }
275
        break
276
    case 36:
277
        cutscene_wait(1)
278
        break
279
    case 37:
280
        instance_create(380, 74, obj_quote_bubble_battle_yellow_3)
281
        instance_create_depth(0, 0, -1000, obj_quote_battle_ceroba_outro_spare_2)
282
        cutscene_advance()
283
        break
284
    case 38:
285
        if (!instance_exists(obj_quote_battle_ceroba_outro_spare_2))
286
        {
287
            obj_ceroba_phase_2_mercy.fade_in = true
288
            obj_ceroba_phase_2_fight.fade_in = true
289
            obj_heart_battle_fighting_parent.moveable = true
290
            scene++
291
        }
292
        break
293
    case 39:
294
        if (obj_ceroba_phase_2_mercy.button_pressed == true)
295
        {
296
            obj_ceroba_phase_2_mercy.fade_in = false
297
            obj_ceroba_phase_2_fight.fade_in = false
298
            obj_heart_battle_fighting_parent.moveable = false
299
            scene += 1
300
        }
301
        if (obj_ceroba_phase_2_fight.button_pressed == true)
302
        {
303
            obj_ceroba_phase_2_mercy.fade_in = false
304
            obj_ceroba_phase_2_fight.fade_in = false
305
            obj_heart_battle_fighting_parent.moveable = false
306
            scene = 44
307
        }
308
        break
309
    case 40:
310
        cutscene_wait(1)
311
        break
312
    case 41:
313
        instance_create(380, 74, obj_quote_bubble_battle_yellow_3)
314
        instance_create_depth(0, 0, -1000, obj_quote_battle_ceroba_outro_spare_3)
315
        cutscene_advance()
316
        break
317
    case 42:
318
        if (!instance_exists(obj_quote_battle_ceroba_outro_spare_3))
319
        {
320
            obj_ceroba_body_pacifist_phase_2.sprite_index = spr_ceroba_p2_defeated_spared
321
            obj_ceroba_body_pacifist_phase_2.image_index = 0
322
            obj_ceroba_body_pacifist_phase_2.image_speed = 0
323
            var bubble = instance_create(440, 74, obj_quote_bubble_battle_yellow_2_reverse)
324
            instance_create_depth(0, 0, -1000, obj_quote_battle_ceroba_outro_spare_4)
325
            scene++
326
        }
327
        break
328
    case 43:
329
        if (!instance_exists(obj_quote_battle_ceroba_outro_spare_4))
330
        {
331
            if (!instance_exists(obj_battle_fade_out_screen))
332
            {
333
                global.hotland_flag[3] = 1
334
                global.current_room_overworld = "rm_newhome_03"
335
                audio_play_sound(snd_monster_damage_death, 1, 0)
336
                instance_create(0, 0, obj_battle_fade_out_screen)
337
            }
338
        }
339
        break
340
    case 44:
341
        cutscene_wait(1.5)
342
        break
343
    case 45:
344
        instance_create(380, 74, obj_quote_bubble_battle_yellow_3)
345
        instance_create_depth(0, 0, -1000, obj_quote_battle_ceroba_outro_kill)
346
        cutscene_advance()
347
        break
348
    case 46:
349
        if instance_exists(obj_quote_battle_ceroba_outro_kill)
350
            return;
351
        obj_heart_battle_fighting_parent.image_alpha = lerp(obj_heart_battle_fighting_parent.image_alpha, 0, 0.05)
352
        box_overlay_alpha = 1 - obj_heart_battle_fighting_parent.image_alpha
353
        if (obj_heart_battle_fighting_parent.image_alpha <= 0.1)
354
        {
355
            obj_heart_battle_fighting_parent.image_alpha = 0
356
            box_overlay_alpha = 1
357
            scene++
358
        }
359
        break
360
    case 47:
361
        cutscene_wait(1)
362
        break
363
    case 48:
364
        global.enemy_sparing = true
365
        global.enemy_vulnerable = true
366
        global.last_action_selected = "Fight"
367
        global.last_action_selected_2 = "Nothing"
368
        global.last_action_selected_3 = "Nothing"
369
        instance_create(320, 320, obj_toy_gun_battle_circle)
370
        obj_toy_gun_battle_circle.image_alpha = 0
371
        instance_create_depth(319, 319, -643, obj_final_boss_circle)
372
        global.enemy_target_y = obj_ceroba_body_pacifist_phase_2.y - 130
373
        scene++
374
        break
375
    case 49:
376
        break
377
    case 50:
378
        cutscene_wait(2.5)
379
        break
380
    case 51:
381
        instance_create((obj_ceroba_body_pacifist_phase_2.x - 59), (obj_ceroba_body_pacifist_phase_2.y - 29), obj_ceroba_dead_pacifist)
382
        global.hotland_flag[3] = 2
383
        scene++
384
        break
385
    case 52:
386
        obj_ceroba_body_pacifist_phase_2.image_alpha = 0
387
        cutscene_wait(3)
388
        break
389
    case 53:
390
        global.enemy_dead = false
391
        global.current_room_overworld = "rm_newhome_03"
392
        instance_create(0, 0, obj_battle_fade_out_screen)
393
        scene++
394
        break
395
}
396
397
with (obj_heart_battle_fighting_parent)
398
{
399
    if (!moveable)
400
    {
401
        x = lerp(x, battle_box.x, 0.1)
402
        y = lerp(y, battle_box.y, 0.1)
403
        if (abs(x - battle_box.x) < 0.01 && abs(y - battle_box.y) < 0.01)
404
        {
405
            x = battle_box.x
406
            y = battle_box.y
407
        }
408
    }
409
}
410
if (instance_exists(obj_heart_yellow_shot) && scene < 6)
411
{
412
    with (obj_heart_yellow_shot)
413
    {
414
        if (y < (obj_ceroba_body_pacifist_phase_2.y - 70))
415
        {
416
            audio_play_sound(snd_ring, 1, 0)
417
            instance_create_depth(x, (y - sprite_height), -999, obj_heart_yellow_shot_destroy)
418
            instance_destroy()
419
        }
420
    }
421
}
422
if (scene < 11)
423
    obj_ceroba_body_pacifist_phase_2.y = lerp(obj_ceroba_body_pacifist_phase_2.y, 220, 0.25)