Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_battle_enemy_attack_decibat_wave_mini_blue_Step_0

(view raw script w/o annotations or w/e)
1
if (!instance_exists(obj_heart_battle_fighting_parent))
2
{
3
    instance_destroy()
4
    return;
5
}
6
if (image_alpha < 1)
7
{
8
    image_alpha += 0.1
9
    if (image_alpha >= 1)
10
    {
11
        image_alpha = 1
12
        can_move = true
13
        angle = irandom_range(image_angle_min, image_angle_max)
14
        image_angle = angle
15
        audio_play_sound(snd_decibatbouncewave2, 20, 0)
16
    }
17
}
18
if (can_move == true)
19
{
20
    x += lengthdir_x(move_speed, angle)
21
    y += lengthdir_y(move_speed, angle)
22
    var x_move = lengthdir_x(move_speed, angle)
23
    var y_move = lengthdir_y(move_speed, angle)
24
    if (bbox_left <= (obj_dialogue_box_battle_transformation_any.bbox_left + 4) && x_move < 0)
25
    {
26
        while (bbox_left <= (obj_dialogue_box_battle_transformation_any.bbox_left + 4))
27
            x += 1
28
        angle = irandom_range((image_angle_min + 90), (image_angle_max + 90))
29
        image_angle = angle
30
        change_type = true
31
    }
32
    if (bbox_right >= (obj_dialogue_box_battle_transformation_any.bbox_right - 4) && x_move > 0)
33
    {
34
        while (bbox_right >= (obj_dialogue_box_battle_transformation_any.bbox_right - 4))
35
            x -= 1
36
        angle = irandom_range((image_angle_min - 90), (image_angle_max - 90))
37
        image_angle = angle
38
        change_type = true
39
    }
40
    if (bbox_top <= (obj_dialogue_box_battle_transformation_any.bbox_top + 4) && y_move < 0)
41
    {
42
        while (bbox_top <= (obj_dialogue_box_battle_transformation_any.bbox_top + 4))
43
            y += 1
44
        angle = irandom_range(image_angle_min, image_angle_max)
45
        image_angle = angle
46
        change_type = true
47
    }
48
    if (bbox_bottom >= (obj_dialogue_box_battle_transformation_any.bbox_bottom - 4) && y_move > 0)
49
    {
50
        while (bbox_bottom >= (obj_dialogue_box_battle_transformation_any.bbox_bottom - 4))
51
            y -= 1
52
        angle = irandom_range((image_angle_min - 180), (image_angle_max - 180))
53
        image_angle = angle
54
        change_type = true
55
    }
56
    if (change_type == true)
57
    {
58
        change_type = false
59
        instance_change(obj_battle_enemy_attack_decibat_wave_mini_orange, false)
60
    }
61
}