Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_battle_enemy_attack_ceroba_phase_1_rotating_bullets_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 1:
7
        cutscene_wait(1);
8
        break;
9
    case 2:
10
        with (obj_battle_enemy_attack_bullet_spawner)
11
        {
12
            instance_destroy();
13
            with (instance_create_depth(x, y, -100, obj_battle_enemy_attack_bullet_rotating))
14
            {
15
                bullet_dir = point_direction(battle_box.x, battle_box.y, x, y);
16
                bullet_dist = point_distance(battle_box.x, battle_box.y, x, y);
17
                direction = bullet_dir + 90;
18
            }
19
        }
20
        audio_play_sound(snd_ceroba_charge, 1, 0);
21
        scene++;
22
        break;
23
    case 3:
24
        if (spin_speed < 10)
25
            spin_speed += 0.25;
26
        with (obj_battle_enemy_attack_bullet_rotating)
27
        {
28
            bullet_dir -= other.spin_speed;
29
            direction = bullet_dir + 90;
30
        }
31
        cutscene_wait(2.5);
32
        break;
33
    case 4:
34
        with (obj_battle_enemy_attack_bullet_rotating)
35
        {
36
            bullet_dir -= other.spin_speed;
37
            direction = bullet_dir + 90;
38
            other.spin_speed = lerp(other.spin_speed, 0, 0.05);
39
            if (other.spin_speed < 1)
40
            {
41
                var spawner = instance_create_depth(x, y, -100, obj_battle_enemy_attack_bullet_spawner);
42
                spawner.sprite_index = spr_ceroba_attack_bullet_loop;
43
                instance_destroy();
44
                other.scene = 5;
45
            }
46
        }
47
        break;
48
    case 5:
49
        cutscene_wait(0.2);
50
        break;
51
    case 6:
52
        with (obj_battle_enemy_attack_bullet_spawner)
53
        {
54
            direction = point_direction(x, y, battle_box.x, battle_box.y);
55
            speed = -10;
56
        }
57
        scene++;
58
        break;
59
    case 7:
60
        with (obj_battle_enemy_attack_bullet_spawner)
61
        {
62
            direction = point_direction(x, y, battle_box.x, battle_box.y);
63
            speed = lerp(speed, 0, 0.15);
64
            if (abs(speed) <= 0.1)
65
                other.scene = 8;
66
        }
67
        break;
68
    case 8:
69
        with (obj_battle_enemy_attack_bullet_spawner)
70
        {
71
            instance_destroy();
72
            with (instance_create_depth(x, y, -100, obj_battle_enemy_attack_bullet_rotating))
73
            {
74
                direction = point_direction(x, y, battle_box.x, battle_box.y);
75
                speed = 3;
76
            }
77
        }
78
        audio_play_sound(snd_ceroba_super_bullet_drop, 1, 0);
79
        scene++;
80
        break;
81
    case 9:
82
        with (obj_battle_enemy_attack_bullet_rotating)
83
        {
84
            if (speed < 15)
85
                speed += 3;
86
            if (point_distance(x, y, battle_box.x, battle_box.y) < 10)
87
                instance_destroy();
88
        }
89
        if (!instance_exists(obj_battle_enemy_attack_bullet_rotating))
90
        {
91
            instance_create_depth(battle_box.x, battle_box.y, -200, obj_battle_enemy_attack_rotating_bullet_explode);
92
            scene++;
93
        }
94
        break;
95
    case 10:
96
        if (instance_exists(obj_battle_enemy_attack_rotating_bullet_explode))
97
            scene++;
98
        break;
99
    case 11:
100
        if (!instance_exists(obj_battle_enemy_attack_ceroba_diamond))
101
            cutscene_wait(2.5);
102
        break;
103
    case 12:
104
        instance_create_depth(soul.x, soul.y, -100, obj_attack_diamond_warning);
105
        scene = 13;
106
        break;
107
    case 13:
108
        if (!instance_exists(obj_battle_enemy_attack_bullet_residue))
109
            scene = 14;
110
        break;
111
    case 14:
112
        instance_destroy();
113
        break;
114
}