Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_battle_ceroba_phase_1_transformation_Step_0

(view raw script w/o annotations or w/e)
1
if live_call()
2
    return global.live_result;
3
switch scene
4
{
5
    case -1:
6
        with (obj_heart_battle_fighting_parent)
7
        {
8
            moveable = false
9
            x = lerp(x, 320, 0.15)
10
            y = lerp(y, 350, 0.15)
11
        }
12
        if scr_battle_box_resize_midfight
scr_battle_box_resize_midfight

function scr_battle_box_resize_midfight() //gml_Script_scr_battle_box_resize_midfight { if instance_exists(obj_dialogue_box_battle_transformation_any) { with (obj_dialogue_box_battle_transformation_any) { battle_box_resize_midfight = true battle_box_target_xscale = argument[0] / sprite_get_width(sprite_index) battle_box_target_yscale = argument[1] / sprite_get_height(sprite_index) if (argument_count > 2) { battle_box_target_x = argument[2] battle_box_target_y = argument[3] } if (abs(image_xscale - battle_box_target_xscale) < 0.01 && abs(image_yscale - battle_box_target_yscale) < 0.01 && abs(x - battle_box_target_x) < 0.1 && abs(y - battle_box_target_y) < 0.1) { var box = obj_dialogue_box_battle_transformation_any global.attack_surface_width = box.sprite_width - 8 global.attack_surface_height = box.sprite_height - 8 global.attack_surface_x = box.x - global.attack_surface_width * 0.5 global.attack_surface_y = box.y - global.attack_surface_height * 0.5 if surface_exists(global.attack_surface) global.attack_surface = surface_create(global.attack_surface_width, global.attack_surface_height) return true; } } } else return false; }
(60, 40, 320, 350)
13
        {
14
            obj_heart_battle_fighting_parent.moveable = true
15
            scene++
16
        }
17
        break
18
    case 0:
19
        with (obj_ceroba_body_pacifist_phase_1)
20
        {
21
            if (sprite_index != spr_ceroba_transformation_p1_1 && sprite_index != spr_ceroba_transformation_p1_2)
22
            {
23
                sprite_index = spr_ceroba_transformation_p1_1
24
                image_speed = 1
25
                image_index = 0
26
            }
27
            else if (image_index >= (image_number - 1))
28
            {
29
                sprite_index = spr_ceroba_transformation_p1_2
30
                image_speed = 0
31
                image_index = image_number - 1
32
                with (other)
33
                {
34
                    if cutscene_wait(0.5)
35
                        image_speed = 1
36
                }
37
            }
38
        }
39
        break
40
    case 1:
41
        var attack_duration = 3
42
        if (global.current_hp_self < 1)
43
            cutscene_wait(attack_duration)
44
        if (!instance_exists(obj_ceroba_transform_particles))
45
            instance_create_depth(0, 0, -100, obj_ceroba_transform_particles)
46
        if (global.hit_self == true)
47
        {
48
            if ((soul_hurt_count % 2) == 0)
49
            {
50
                instance_create_depth(obj_heart_battle_fighting_parent.x, obj_heart_battle_fighting_parent.y, (obj_heart_battle_fighting_parent.depth + 1), obj_ceroba_transform_soul_particles)
51
                soul_flash_overlay = 1
52
                audio_play_sound(snd_attackhitcrit, 1, 0, 1, 0, random_range(0.8, 1.2))
53
            }
54
            global.hit_self = false
55
            soul_hurt_count += 1
56
        }
57
        obj_ceroba_body_pacifist_phase_1.image_speed = 1
58
        break
59
    case 2:
60
        if (global.current_hp_self >= 1)
61
            return;
62
        with (obj_ceroba_body_pacifist_phase_1)
63
        {
64
            if (sprite_index != spr_ceroba_transformation_p1_3)
65
            {
66
                sprite_index = spr_ceroba_transformation_p1_3
67
                image_speed = 1
68
                image_index = 0
69
            }
70
            else if (image_index >= (image_number - 1))
71
            {
72
                image_speed = 0
73
                image_index = image_number - 1
74
                sprite_index = -4
75
                instance_create_depth(x, y, (depth - 1), obj_ceroba_transformation_p1_4_legs)
76
                instance_create_depth(x, y, (depth - 3), obj_ceroba_transformation_p1_4_arm)
77
                instance_create_depth(x, y, (depth - 2), obj_ceroba_transformation_p1_4_blouse)
78
                instance_create_depth(x, y, (depth - 1), obj_ceroba_transformation_p1_4_face)
79
                instance_create_depth(x, y, (depth + 1), obj_ceroba_transformation_p1_4_staff)
80
                other.scene++
81
            }
82
        }
83
        break
84
    case 3:
85
        ring_timer--
86
        if (ring_timer <= 0 && cutscene_timer > 60)
87
        {
88
            instance_create_depth((obj_ceroba_body_pacifist_phase_1.x - 117), (obj_ceroba_body_pacifist_phase_1.y - 165), -999, obj_attack_ceroba_transform_ring)
89
            ring_timer = ring_timer_max
90
            ring_timer_max -= 0.08
91
        }
92
        ceroba_shake_intensity += 0.015
93
        var xx = random_range((-ceroba_shake_intensity), ceroba_shake_intensity)
94
        var yy = random_range((-ceroba_shake_intensity), ceroba_shake_intensity)
95
        with (obj_ceroba_transformation_p1_4_arm)
96
        {
97
            x = xstart
98
            y = ystart
99
            x += xx
100
            y += yy
101
        }
102
        with (obj_ceroba_transformation_p1_4_staff)
103
        {
104
            x = xstart
105
            y = ystart
106
            x += xx
107
            y += yy
108
        }
109
        with (obj_ceroba_transformation_p1_4_face)
110
        {
111
            x = xstart
112
            y = ystart
113
            x += xx
114
            y += yy
115
        }
116
        with (obj_ceroba_transformation_p1_4_blouse)
117
        {
118
            x = xstart
119
            y = ystart
120
            x += (xx * 0.5)
121
            y += (yy * 0.5)
122
        }
123
        with (obj_ceroba_transformation_p1_4_legs)
124
        {
125
            x = xstart
126
            y = ystart
127
            x += (xx * 0.3)
128
            y += (yy * 0.3)
129
        }
130
        cutscene_wait(6)
131
        break
132
    case 4:
133
        with (obj_heart_battle_fighting_parent)
134
        {
135
            moveable = false
136
            x = lerp(x, 320, 0.25)
137
            y = lerp(y, obj_dialogue_box_battle_transformation_any.y, 0.25)
138
        }
139
        with (obj_ceroba_body_pacifist_phase_1)
140
        {
141
            if (sprite_index != spr_ceroba_transformation_p1_4)
142
            {
143
                instance_destroy(obj_ceroba_transformation_p1_4_legs)
144
                instance_destroy(obj_ceroba_transformation_p1_4_arm)
145
                instance_destroy(obj_ceroba_transformation_p1_4_blouse)
146
                instance_destroy(obj_ceroba_transformation_p1_4_face)
147
                instance_destroy(obj_ceroba_transformation_p1_4_staff)
148
                sprite_index = spr_ceroba_transformation_p1_4
149
                image_index = 0
150
                image_speed = 1
151
            }
152
            else if (image_index >= (image_number - 1))
153
            {
154
                sprite_index = spr_ceroba_transformation_p1_4_loop
155
                image_index = 0
156
                instance_create_depth(320, y, -999, obj_ceroba_transformation_p1_blast)
157
                audio_play_sound(snd_ceroba_big_shot, 1, 0)
158
                other.scene++
159
            }
160
        }
161
        break
162
    case 5:
163
        if (!instance_exists(obj_ceroba_transform_slowdown))
164
            instance_create_depth(0, 0, -10000, obj_ceroba_transform_slowdown)
165
        with (obj_ceroba_transformation_p1_blast)
166
        {
167
            y += other.bullet_speed
168
            if (y > (obj_dialogue_box_battle_transformation_any.bbox_top - 40))
169
                other.bullet_speed = lerp(other.bullet_speed, 0, 0.1)
170
        }
171
        var speed_perc = bullet_speed / bullet_speed_max
172
        with (obj_ceroba_body_pacifist_phase_1)
173
            image_speed = speed_perc
174
        if instance_exists(obj_petal_generator_phase_1)
175
            instance_destroy(obj_petal_generator_phase_1)
176
        with (obj_petal)
177
        {
178
            if (!(variable_instance_exists(id, "weight_original")))
179
            {
180
                weight_original = weight
181
                trajectory_original = trajectory
182
                modifier_original = modifier
183
            }
184
            else
185
            {
186
                weight = weight_original * speed_perc
187
                trajectory = trajectory_original * speed_perc
188
                modifier = modifier_original * (1000 * (1 - speed_perc))
189
                image_speed = 1 * speed_perc
190
            }
191
        }
192
        with (obj_ceroba_transform_slowdown)
193
            starlo_take_aim_overlay_alpha = 1 - speed_perc
194
        if (speed_perc <= 0)
195
            cutscene_wait(0.5)
196
        break
197
    case 6:
198
        if (!instance_exists(obj_ceroba_transformation_soul))
199
        {
200
            instance_create(0, 0, obj_battle_justice_effect)
201
            obj_heart_battle_fighting_parent.image_alpha = 0
202
            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)
203
            instance_create_depth(obj_heart_battle_fighting_parent.x, obj_heart_battle_fighting_parent.y, (obj_heart_battle_fighting_parent.depth - 1), obj_ceroba_transformation_soul_effect)
204
        }
205
        cutscene_wait(1)
206
        break
207
    case 7:
208
        with (obj_ceroba_transformation_soul)
209
        {
210
            if (image_angle > -24)
211
                image_angle -= 6
212
            else
213
                other.scene = 7.5
214
        }
215
        break
216
    case 7.5:
217
        with (obj_ceroba_transformation_soul)
218
        {
219
            if (image_angle < 180)
220
                image_angle += 10
221
            else
222
            {
223
                charge_time = 90
224
                charge_time_max = 90
225
                image_angle = 0
226
                sprite_index = spr_heart_yellow_up
227
                image_speed = 0
228
                image_index = 0
229
                other.scene = 8
230
            }
231
        }
232
        break
233
    case 8:
234
        if cutscene_wait(1)
235
            scene = 9
236
        break
237
    case 9:
238
        with (obj_ceroba_transformation_soul)
239
        {
240
            is_charging = true
241
            if is_charged
242
                other.scene++
243
        }
244
        break
245
    case 10:
246
        bullet_speed_max = 1
247
        if (bullet_speed < bullet_speed_max)
248
            bullet_speed += 0.1
249
        speed_perc = bullet_speed / bullet_speed_max
250
        with (obj_ceroba_body_pacifist_phase_1)
251
        {
252
            if (sprite_index <= spr_ceroba_transformation_p1_5)
253
                sprite_index = spr_ceroba_transformation_p1_5
254
            image_speed = speed_perc
255
        }
256
        with (obj_ceroba_transform_slowdown)
257
            starlo_take_aim_overlay_alpha = 1 - speed_perc
258
        with (obj_petal)
259
        {
260
            weight = weight_original * speed_perc
261
            trajectory = trajectory_original * speed_perc
262
            modifier = modifier_original * (1000 * (1 - speed_perc))
263
            image_speed = 1 * speed_perc
264
        }
265
        if (speed_perc >= 1)
266
            cutscene_wait(0.5)
267
        break
268
    case 11:
269
        instance_destroy(obj_ceroba_transform_slowdown)
270
        with (obj_ceroba_transformation_soul)
271
        {
272
            can_shoot = true
273
            draw_hint = true
274
        }
275
        scene++
276
        break
277
    case 12:
278
        if (!instance_exists(obj_heart_yellow_shot_big))
279
            return;
280
        with (obj_heart_yellow_shot_big)
281
        {
282
            if (instance_exists(obj_ceroba_transformation_p1_blast) && y <= obj_ceroba_transformation_p1_blast.y)
283
            {
284
                instance_destroy(obj_ceroba_transformation_p1_blast)
285
                with (obj_petal)
286
                {
287
                    weight = 0
288
                    trajectory = 0
289
                    direction = point_direction(obj_heart_yellow_shot_big.x, obj_heart_yellow_shot_big.y, x, y)
290
                    speed = 20
291
                }
292
            }
293
            if (y <= obj_ceroba_body_pacifist_phase_1.y)
294
            {
295
                with (obj_ceroba_body_pacifist_phase_1)
296
                {
297
                    image_index = 0
298
                    image_speed = 1
299
                    sprite_index = spr_ceroba_transformation_p1_6
300
                }
301
                other.scene++
302
            }
303
        }
304
        break
305
    case 13:
306
        with (obj_ceroba_body_pacifist_phase_1)
307
        {
308
            if (image_index >= 87)
309
            {
310
                image_speed = 0
311
                instance_create(402, 68, obj_quote_bubble_battle_yellow_2)
312
                instance_create_depth(0, 0, (obj_quote_bubble_battle_yellow_2.depth - 1), obj_quote_battle_ceroba_transform)
313
                other.scene++
314
            }
315
        }
316
        break
317
    case 14:
318
        if (!instance_exists(obj_quote_battle_ceroba_transform))
319
            obj_ceroba_body_pacifist_phase_1.image_speed = 1
320
        with (obj_ceroba_body_pacifist_phase_1)
321
        {
322
            if (image_index >= 103)
323
            {
324
                image_speed = 0
325
                instance_create(402, 68, obj_quote_bubble_battle_yellow_2)
326
                instance_create_depth(0, 0, (obj_quote_bubble_battle_yellow_2.depth - 1), obj_quote_battle_ceroba_transform_2)
327
                other.scene++
328
            }
329
        }
330
        break
331
    case 15:
332
        if (!instance_exists(obj_quote_battle_ceroba_transform_2))
333
            obj_ceroba_body_pacifist_phase_1.image_speed = 1
334
        with (obj_ceroba_body_pacifist_phase_1)
335
        {
336
            if (image_index >= 109)
337
            {
338
                image_speed = 0
339
                instance_create(402, 68, obj_quote_bubble_battle_yellow_2)
340
                instance_create_depth(0, 0, (obj_quote_bubble_battle_yellow_2.depth - 1), obj_quote_battle_ceroba_transform_3)
341
                other.scene++
342
            }
343
        }
344
        break
345
    case 16:
346
        if (!instance_exists(obj_quote_battle_ceroba_transform_3))
347
            obj_ceroba_body_pacifist_phase_1.image_speed = 1
348
        with (obj_ceroba_body_pacifist_phase_1)
349
        {
350
            if (image_index >= 143)
351
            {
352
                image_speed = 0
353
                instance_create(402, 68, obj_quote_bubble_battle_yellow_2)
354
                instance_create_depth(0, 0, (obj_quote_bubble_battle_yellow_2.depth - 1), obj_quote_battle_ceroba_transform_4)
355
                other.scene++
356
            }
357
        }
358
        break
359
    case 17:
360
        if (!instance_exists(obj_quote_battle_ceroba_transform_4))
361
        {
362
            global.battle_music = audio_play_sound(mus_mothers_love_intro, 20, false)
363
            xx = -1000
364
            yy = -1000
365
            instance_create_depth(xx, yy, -1000, obj_ceroba_transformation_mask)
366
            obj_ceroba_transformation_mask.sprite_index = spr_ceroba_mask_resting
367
            scene++
368
        }
369
        break
370
    case 18:
371
        with (obj_ceroba_body_pacifist_phase_1)
372
        {
373
            if (sprite_index != spr_ceroba_transformation_p1_7)
374
            {
375
                instance_create_depth(-500, -500, (depth + 1), obj_ceroba_transformation_p1_hair)
376
                sprite_index = spr_ceroba_transformation_p1_7
377
                image_speed = 1
378
                image_index = 0
379
            }
380
            else if (image_index > 4 && image_index < 16 && (!instance_exists(obj_ceroba_transformation_beam_spawner)))
381
            {
382
                instance_create_depth(obj_ceroba_transformation_mask.x, (obj_ceroba_transformation_mask.y - 10), (obj_ceroba_transformation_mask.depth + 1), obj_ceroba_transformation_beam_spawner)
383
                audio_play_sound(snd_ceroba_powerup, 1, 0)
384
            }
385
            else if (image_index > 16 && instance_exists(obj_ceroba_transformation_beam_spawner))
386
                instance_destroy(obj_ceroba_transformation_beam_spawner)
387
            else if (image_index >= 24)
388
            {
389
                instance_create_depth(obj_ceroba_transformation_mask.x, (obj_ceroba_transformation_mask.y - 5), (obj_ceroba_transformation_mask.depth + 1), obj_ceroba_transform_white_transition)
390
                other.scene = 19
391
            }
392
        }
393
        break
394
    case 19:
395
        with (obj_ceroba_body_pacifist_phase_1)
396
        {
397
            if (image_index >= (image_number - 1))
398
            {
399
                image_index = image_number - 1
400
                image_speed = 0
401
            }
402
        }
403
        if (obj_ceroba_transform_white_transition.multiplier >= 1)
404
            scene = 20
405
        break
406
    case 20:
407
        cutscene_wait(1)
408
        break
409
    case 21:
410
        obj_ceroba_transformation_mask.image_alpha -= 0.022
411
        if (obj_ceroba_transformation_mask.image_alpha <= 0)
412
        {
413
            obj_ceroba_transformation_mask.image_alpha = 0
414
            cutscene_wait(1)
415
        }
416
        break
417
    case 22:
418
        var bell = instance_create_depth(320, 10, -1100, obj_ceroba_transformation_p1_bell)
419
        bell.alarm[0] = 1
420
        bell = instance_create_depth(400, 90, -1100, obj_ceroba_transformation_p1_bell)
421
        bell.alarm[0] = 30
422
        bell = instance_create_depth(320, 180, -1100, obj_ceroba_transformation_p1_bell)
423
        bell.alarm[0] = 60
424
        bell = instance_create_depth(240, 90, -1100, obj_ceroba_transformation_p1_bell)
425
        bell.alarm[0] = 90
426
        scene++
427
        break
428
    case 23:
429
        with (obj_ceroba_transformation_p1_bell)
430
        {
431
            if (image_alpha < 1)
432
                return;
433
        }
434
        instance_create_depth(320, 110, -1050, obj_ceroba_transformation_p1_shield)
435
        scene++
436
        break
437
    case 24:
438
        if (obj_ceroba_transformation_p1_shield.image_index >= (obj_ceroba_transformation_p1_shield.image_number - 1))
439
            cutscene_wait(1.5)
440
        break
441
    case 25:
442
        obj_ceroba_transformation_p1_shield.image_alpha -= 0.0222
443
        with (obj_ceroba_transformation_p1_bell)
444
        {
445
            fade = false
446
            image_alpha = obj_ceroba_transformation_p1_shield.image_alpha
447
        }
448
        if (obj_ceroba_transformation_p1_shield.image_alpha <= 0)
449
            scene++
450
        break
451
    case 26:
452
        if (global.current_hp_self < global.max_hp_self)
453
            global.current_hp_self = global.max_hp_self
454
        obj_ceroba_phase_2_red_shader.decimal_count = 0
455
        cutscene_wait(1)
456
        break
457
    case 27:
458
        draw_alpha += 0.05
459
        if (draw_alpha >= 1)
460
        {
461
            scene++
462
            draw_alpha = 1
463
        }
464
        break
465
    case 28:
466
        instance_destroy(obj_ceroba_body_pacifist_phase_1)
467
        obj_ceroba_transformation_mask.y = 78
468
        obj_ceroba_transformation_mask.x = 318
469
        obj_ceroba_transformation_mask.ystart = 80
470
        obj_ceroba_transformation_mask.image_alpha = 0
471
        cutscene_wait(1)
472
        break
473
    case 29:
474
        obj_ceroba_transformation_mask.image_alpha += 0.035
475
        if (obj_ceroba_transformation_mask.image_alpha >= 1)
476
        {
477
            obj_ceroba_transformation_mask.image_alpha = 1
478
            scene++
479
        }
480
        break
481
    case 30:
482
        with (obj_ceroba_transformation_mask)
483
        {
484
            if (sprite_index != spr_ceroba_transformation_p1_mask_start)
485
            {
486
                audio_play_sound(snd_ceroba_phase_1_transform, 1, 0)
487
                sprite_index = spr_ceroba_transformation_p1_mask_start
488
                image_index = 0
489
                image_speed = 1
490
            }
491
            else if (image_index >= (image_number - 1))
492
            {
493
                image_index = image_number - 1
494
                image_speed = 0
495
                other.scene += 1
496
            }
497
        }
498
        break
499
    case 31:
500
        cutscene_wait(0.5)
501
        break
502
    case 32:
503
        instance_destroy(obj_ceroba_transform_white_transition)
504
        instance_destroy(obj_ceroba_transformation_p1_bell)
505
        instance_destroy(obj_petal_generator_phase_1)
506
        instance_create_depth(0, 0, 0, obj_petal_generator_phase_2)
507
        instance_create_depth(318, 250, 100, obj_ceroba_body_pacifist_phase_2)
508
        with (obj_ceroba_body_pacifist_phase_2)
509
        {
510
            sprite_index = spr_ceroba_p2_1
511
            image_index = 0
512
            image_speed = 1
513
        }
514
        scene++
515
        break
516
    case 33:
517
        if (draw_alpha > 0)
518
            draw_alpha -= 0.03
519
        else
520
            scene++
521
        break
522
    case 34:
523
        if scr_battle_box_resize_midfight
scr_battle_box_resize_midfight

function scr_battle_box_resize_midfight() //gml_Script_scr_battle_box_resize_midfight { if instance_exists(obj_dialogue_box_battle_transformation_any) { with (obj_dialogue_box_battle_transformation_any) { battle_box_resize_midfight = true battle_box_target_xscale = argument[0] / sprite_get_width(sprite_index) battle_box_target_yscale = argument[1] / sprite_get_height(sprite_index) if (argument_count > 2) { battle_box_target_x = argument[2] battle_box_target_y = argument[3] } if (abs(image_xscale - battle_box_target_xscale) < 0.01 && abs(image_yscale - battle_box_target_yscale) < 0.01 && abs(x - battle_box_target_x) < 0.1 && abs(y - battle_box_target_y) < 0.1) { var box = obj_dialogue_box_battle_transformation_any global.attack_surface_width = box.sprite_width - 8 global.attack_surface_height = box.sprite_height - 8 global.attack_surface_x = box.x - global.attack_surface_width * 0.5 global.attack_surface_y = box.y - global.attack_surface_height * 0.5 if surface_exists(global.attack_surface) global.attack_surface = surface_create(global.attack_surface_width, global.attack_surface_height) return true; } } } else return false; }
(140, 140, 319, 320)
524
            cutscene_wait(1)
525
        break
526
    case 35:
527
        global.battle_music = audio_play_sound(mus_mothers_love_phase_1, 20, true)
528
        global.hotland_flag[2] = 1
529
        global.attack_cycle_max = 17
530
        global.enemy_attack = "Ceroba Phase 2 Opener"
531
        global.attack_end_text = false
532
        global.enemy_attack_stat = 14
533
        if global.option_autoshoot
534
            instance_create_depth(536, 399, 5, obj_autofire_toggle)
535
        obj_ceroba_transformation_mask.image_alpha = 0
536
        if (!instance_exists(obj_heart_battle_fighting_yellow_final))
537
        {
538
            instance_destroy(obj_heart_battle_fighting_parent)
539
            instance_create_depth(obj_ceroba_transformation_soul.x, obj_ceroba_transformation_soul.y, obj_ceroba_transformation_soul.depth, obj_heart_battle_fighting_yellow_final)
540
        }
541
        obj_heart_battle_fighting_yellow_final.moveable = true
542
        obj_heart_battle_fighting_yellow_final.image_alpha = 1
543
        instance_destroy(obj_ceroba_transformation_soul)
544
        instance_destroy(self, false)
545
        break
546
}
547
548
if instance_exists(obj_ceroba_transformation_soul)
549
{
550
    with (obj_ceroba_transformation_soul)
551
    {
552
        if (sprite_index == spr_heart_yellow_shoot && image_index >= (image_number - 1))
553
        {
554
            sprite_index = spr_heart_yellow_up
555
            image_index = 0
556
            image_speed = 0
557
        }
558
    }
559
}
560
if (scene < 7)
561
{
562
    var shake_amount = soul_hurt_count * soul_shake_modif
563
    soul_x_offset = random_range((-shake_amount), shake_amount)
564
    soul_y_offset = random_range((-shake_amount), shake_amount)
565
    if (soul_flash_overlay > 0.05)
566
        soul_flash_overlay = lerp(soul_flash_overlay, 0, 0.15)
567
    else
568
        soul_flash_overlay = 0
569
}