Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_attack_moray_balls_ball_Step_0

(view raw script w/o annotations or w/e)
1
var battle_box = obj_dialogue_box_battle_transformation_any
2
if (box_enter_noloop == false)
3
{
4
    if (bbox_left > (battle_box.bbox_left + 4) && bbox_right < (battle_box.bbox_right - 4) && bbox_bottom < (battle_box.bbox_bottom - 4) && bbox_top > (battle_box.bbox_top + 4))
5
        box_enter_noloop = true
6
    return;
7
}
8
if (bbox_left <= (battle_box.bbox_left + 4))
9
{
10
    while (bbox_left <= (battle_box.bbox_left + 4))
11
        x++
12
    if (direction < 180)
13
    {
14
        direction = 45 + (irandom_range(-25, 25))
15
        audio_play_sound(snd_decibatbouncewave1, 20, 0)
16
    }
17
    else
18
    {
19
        direction = 315 + (irandom_range(-25, 25))
20
        audio_play_sound(snd_decibatbouncewave1, 20, 0)
21
    }
22
}
23
if (bbox_right >= (battle_box.bbox_right - 4))
24
{
25
    while (bbox_right >= (battle_box.bbox_right - 4))
26
        x--
27
    if (direction < 90)
28
    {
29
        direction = 135 + (irandom_range(-25, 25))
30
        audio_play_sound(snd_decibatbouncewave1, 20, 0)
31
    }
32
    else
33
    {
34
        direction = 225 + (irandom_range(-25, 25))
35
        audio_play_sound(snd_decibatbouncewave1, 20, 0)
36
    }
37
}
38
if (bbox_bottom >= (battle_box.bbox_bottom - 4))
39
{
40
    while (bbox_bottom >= (battle_box.bbox_bottom - 4))
41
        y--
42
    if (direction < 270)
43
    {
44
        direction = 135 + (irandom_range(-25, 25))
45
        audio_play_sound(snd_decibatbouncewave1, 20, 0)
46
    }
47
    else
48
    {
49
        direction = 45 + (irandom_range(-25, 25))
50
        audio_play_sound(snd_decibatbouncewave1, 20, 0)
51
    }
52
}
53
if (bbox_top <= (battle_box.bbox_top + 4))
54
{
55
    while (bbox_top <= (battle_box.bbox_top + 4))
56
        y++
57
    if (direction < 90)
58
    {
59
        direction = 315 + (irandom_range(-25, 25))
60
        audio_play_sound(snd_decibatbouncewave1, 20, 0)
61
    }
62
    else
63
    {
64
        direction = 225 + (irandom_range(-25, 25))
65
        audio_play_sound(snd_decibatbouncewave1, 20, 0)
66
    }
67
}