Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_battle_enemy_attack_sousborg_egg_boil_generator_Step_0

(view raw script w/o annotations or w/e)
1
if live_call()
2
    return global.live_result;
3
var box = obj_dialogue_box_battle_transformation_any
4
switch scene
5
{
6
    case 0:
7
        if (egg.image_alpha < 0.99)
8
            egg.image_alpha = lerp(egg.image_alpha, 1, 0.3)
9
        else
10
            cutscene_advance()
11
        break
12
    case 1:
13
        cutscene_wait(1)
14
        break
15
    case 2:
16
        for (var i = 0; i < array_length(attack_interval_current); i++)
17
        {
18
            attack_interval_current[i] -= 1
19
            if (attack_interval_current[i] <= 0)
20
            {
21
                xx[i] = irandom_range((box.bbox_left + 20), (box.bbox_right - 20))
22
                if (i > 0)
23
                {
24
                    xx[i] = (xx[(i - 1)]) + 50
25
                    if (xx[i] > (box.bbox_right - 20))
26
                        xx[i] = (xx[(i - 1)]) - 50
27
                }
28
                var yy = box.bbox_bottom + 40
29
                instance_create_depth(xx[i], yy, (box.depth - 1), obj_battle_enemy_attack_sousborg_egg_boil_smoke)
30
                attack_interval_current[i] = attack_interval
31
            }
32
        }
33
        cutscene_wait(4.5)
34
        break
35
    case 3:
36
        egg = instance_create_depth(320, (box.bbox_bottom - 4), (egg.depth - 10), obj_battle_enemy_attack_sousborg_egg_fire)
37
        instance_destroy(obj_battle_enemy_attack_sousborg_egg_boil)
38
        with (egg)
39
        {
40
            image_xscale = 2
41
            image_yscale = 2
42
            image_speed = 1
43
            image_alpha = 1
44
        }
45
        audio_play_sound(snd_sousborg_egg_fire, 1, 0)
46
        audio_stop_sound(snd_sousborg_egg_sizzle)
47
        audio_play_sound(snd_sousborg_egg_fire_loop, 1, 1)
48
        cutscene_advance()
49
        break
50
    case 4:
51
        cutscene_wait(0.2)
52
        break
53
    case 5:
54
        for (i = 0; i < array_length(attack_interval_fire); i++)
55
        {
56
            attack_interval_fire[i] -= 1
57
            if (attack_interval_fire[i] <= 0)
58
            {
59
                xx[i] = irandom_range((box.bbox_left + 20), (box.bbox_right - 20))
60
                if (i > 0)
61
                {
62
                    xx[i] = (xx[(i - 1)]) + 50
63
                    if (xx[i] > (box.bbox_right - 20))
64
                        xx[i] = (xx[(i - 1)]) - 50
65
                }
66
                yy = box.bbox_bottom + 40
67
                instance_create_depth(xx[i], yy, (box.depth - 1), obj_battle_enemy_attack_sousborg_egg_boil_fireball)
68
                attack_interval_fire[i] = attack_interval
69
            }
70
        }
71
        cutscene_wait(4.5)
72
        break
73
    case 6:
74
        instance_destroy()
75
        audio_stop_sound(snd_sousborg_egg_fire_loop)
76
        break
77
}