Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_battle_enemy_attack_rorrim_mirror_Step_0

(view raw script w/o annotations or w/e)
1
if (instance_exists(obj_heart_battle_fighting_parent))
2
{
3
    if (image_alpha < 1 && can_move == false)
4
    {
5
        image_alpha += 0.1;
6
        if (image_alpha > 1)
7
            image_alpha = 1;
8
        if (image_alpha == 1)
9
            can_move = true;
10
    }
11
    if (can_move == true)
12
    {
13
        x += hsp;
14
        vsp += grav;
15
        if (vsp > terminal_velocity)
16
            vsp = terminal_velocity;
17
        y += vsp;
18
        if (bbox_bottom >= (obj_dialogue_box_battle_transformation_any.bbox_bottom - 4))
19
        {
20
            while (bbox_bottom > (obj_dialogue_box_battle_transformation_any.bbox_bottom - 4))
21
                y -= 1;
22
            instance_create(x, y, obj_battle_enemy_attack_rorrim_mirror_shard);
23
            instance_create(x, y, obj_battle_enemy_attack_rorrim_mirror_shard);
24
            instance_create(x, y, obj_battle_enemy_attack_rorrim_mirror_shard);
25
            var random_sound = irandom_range(0, 2);
26
            switch (random_sound)
27
            {
28
                case 0:
29
                    audio_play_sound(snd_mirrorbreak1, 20, 0);
30
                    break;
31
                case 1:
32
                    audio_play_sound(snd_mirrorbreak2, 20, 0);
33
                    break;
34
                case 2:
35
                    audio_play_sound(snd_mirrorbreak3, 20, 0);
36
                    break;
37
            }
38
            instance_destroy();
39
            exit;
40
        }
41
    }
42
}