Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_battle_enemy_attack_ceroba_flower_circle_opener_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 0:
6
        for (var i = 0; i < bullet_number_max; i++)
7
        {
8
            if (timer == floor(i * (360 / bullet_number_max / bullet_speed)))
9
            {
10
                var bullet = instance_create_depth(obj_heart_battle_fighting_parent.x, (obj_heart_battle_fighting_parent.y - 80), -100, obj_battle_enemy_attack_ceroba_flower_circle_flower)
11
                bullet.bullet_speed = bullet_speed
12
                bullet.attack_dir = attack_dir
13
                bullet.bullet_spawner = id
14
                bullet_number_current += 1
15
            }
16
        }
17
        if (bullet_number_current >= bullet_number_max)
18
        {
19
            if (!alarm[0])
20
            {
21
                alarm[0] = 20
alarm[0]

if live_call() return global.live_result; with (obj_battle_enemy_attack_ceroba_flower_circle_flower) { if (state == 0 && bullet_spawner == other.id) state = 1 }
22
                scene++
23
            }
24
        }
25
        timer += 1
26
        break
27
    case 1:
28
        with (obj_heart_battle_fighting_parent)
29
        {
30
            if (point_distance(x, y, obj_battle_enemy_attack_ceroba_flower_circle_flower.x, obj_battle_enemy_attack_ceroba_flower_circle_flower.y) < 50)
31
                other.scene++
32
        }
33
        break
34
    case 2:
35
        var speed_perc = _speed_perc
36
        if instance_exists(obj_petal_generator_phase_2)
37
            obj_petal_generator_phase_2.petals_enabled = false
38
        with (obj_battle_enemy_attack_ceroba_flower_circle_flower)
39
        {
40
            state = 2
41
            if (!(variable_instance_exists(id, "homing_speed_original")))
42
                homing_speed_original = homing_speed
43
            image_speed = speed_perc
44
            bullet_speed = other.bullet_speed * speed_perc
45
            homing_speed = homing_speed_original * speed_perc
46
        }
47
        with (obj_petal)
48
        {
49
            if (!(variable_instance_exists(id, "weight_original")))
50
            {
51
                weight_original = weight
52
                trajectory_original = trajectory
53
                modifier_original = modifier
54
            }
55
            else
56
            {
57
                weight = weight_original * speed_perc
58
                trajectory = trajectory_original * speed_perc
59
                modifier = modifier_original * (1000 * (1 - speed_perc))
60
                image_speed = 1 * speed_perc
61
            }
62
        }
63
        obj_ceroba_cape_1.image_speed = 1 * speed_perc
64
        obj_ceroba_cape_2.image_speed = obj_ceroba_cape_1.image_speed
65
        obj_ceroba_phase_2_head.image_speed = obj_ceroba_cape_1.image_speed
66
        obj_ceroba_phase_2_staff.image_speed = obj_ceroba_cape_1.image_speed
67
        obj_ceroba_sideburn_left.image_speed = obj_ceroba_cape_1.image_speed
68
        obj_ceroba_sideburn_right.image_speed = obj_ceroba_cape_1.image_speed
69
        obj_ceroba_body_pacifist_phase_2.anim_stage = 0
70
        with (obj_ceroba_transform_slowdown)
71
            starlo_take_aim_overlay_alpha = 1 - speed_perc
72
        if (_speed_perc <= 0)
73
        {
74
            obj_heart_battle_fighting_parent.moveable = false
75
            cutscene_advance()
76
        }
77
        else
78
            _speed_perc -= 0.1
79
        break
80
    case 3:
81
        cutscene_wait(0.5)
82
        break
83
    case 4:
84
        with (obj_heart_battle_fighting_yellow_final)
85
        {
86
            can_dash = true
87
            dash_delay = 0
88
        }
89
        hint_draw = true
90
        if keyboard_multicheck_pressed(1)
91
        {
92
            var walk_speed = global.speed_self + 1 * sign(global.current_sp_self)
93
            var key_right = global.right_key
94
            var key_left = (-global.left_key)
95
            var key_down = global.down_key
96
            var key_up = (-global.up_key)
97
            var move_x = key_left + key_right
98
            var move_y = key_down + key_up
99
            var hsp = move_x * walk_speed
100
            var vsp = move_y * walk_speed
101
            if (vsp == 0 && hsp == 0)
102
                vsp = -1 * walk_speed
103
            var battle_box = 3154
104
            with (obj_heart_battle_fighting_yellow_final)
105
            {
106
                can_cancel_dash = false
107
                moveable = true
108
                is_dashing = true
109
                if (move_x == 0 && move_y == 0)
110
                    move_y = -1
111
                move_y_dash = move_y
112
                move_x_dash = move_x
113
                dash_timer = 8
114
            }
115
            hint_draw = false
116
            scene++
117
        }
118
        break
119
    case 5:
120
        speed_perc = _speed_perc
121
        obj_petal_generator_phase_2.petals_enabled = true
122
        with (obj_battle_enemy_attack_ceroba_flower_circle_flower)
123
        {
124
            if (!(variable_instance_exists(id, "homing_speed_original")))
125
                homing_speed_original = homing_speed
126
            image_speed = speed_perc
127
            bullet_speed = other.bullet_speed * speed_perc
128
            homing_speed = homing_speed_original * speed_perc
129
        }
130
        with (obj_petal)
131
        {
132
            if (!(variable_instance_exists(id, "weight_original")))
133
            {
134
                weight_original = weight
135
                trajectory_original = trajectory
136
                modifier_original = modifier
137
            }
138
            else
139
            {
140
                weight = weight_original * speed_perc
141
                trajectory = trajectory_original * speed_perc
142
                modifier = modifier_original * (1000 * (1 - speed_perc))
143
                image_speed = 1 * speed_perc
144
            }
145
        }
146
        obj_ceroba_cape_1.image_speed = 1 * speed_perc
147
        with (obj_ceroba_transform_slowdown)
148
            starlo_take_aim_overlay_alpha = 1 - speed_perc
149
        if (_speed_perc >= 1)
150
        {
151
            obj_ceroba_cape_1.image_speed = 1
152
            instance_destroy(obj_ceroba_transform_slowdown)
153
            cutscene_advance()
154
        }
155
        else
156
            _speed_perc += 0.1
157
        obj_ceroba_cape_2.image_speed = obj_ceroba_cape_1.image_speed
158
        obj_ceroba_phase_2_head.image_speed = obj_ceroba_cape_1.image_speed
159
        obj_ceroba_phase_2_staff.image_speed = obj_ceroba_cape_1.image_speed
160
        obj_ceroba_sideburn_left.image_speed = obj_ceroba_cape_1.image_speed
161
        obj_ceroba_sideburn_right.image_speed = obj_ceroba_cape_1.image_speed
162
        with (obj_ceroba_body_pacifist_phase_2)
163
            event_perform(ev_create, 0)
164
        break
165
    case 6:
166
        if (!instance_exists(obj_battle_enemy_attack_ceroba_flower_circle_flower))
167
            instance_destroy()
168
        break
169
}
170
171
if (scene < 4)
172
{
173
    with (obj_battle_enemy_attack_ceroba_flower_circle_flower)
174
    {
175
        attack_target_x = obj_heart_battle_fighting_parent.x
176
        attack_target_y = obj_heart_battle_fighting_parent.y
177
    }
178
}
179
if (hint_draw == true)
180
{
181
    if (hint_alpha < 1)
182
        hint_alpha += 0.1
183
}