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