Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_battle_enemy_attack_axis_bomb_geno_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
if (dir_start == -1)
5
{
6
    dir_start = gravity_direction;
7
    image_angle = dir_start - 270;
8
}
9
if (image_alpha < 1)
10
{
11
    image_alpha += 0.2;
12
}
13
else if (noloop == false)
14
{
15
    var base_speed = 12;
16
    switch (gravity_direction)
17
    {
18
        case 0:
19
            break;
20
        case 180:
21
            break;
22
        case 90:
23
            break;
24
        case 270:
25
            break;
26
    }
27
    gravity = 0.5;
28
    noloop = true;
29
}
30
if (noloop == true && dir_switch == false)
31
{
32
    if (bomb_collision_check())
33
    {
34
        dir_switch = true;
35
        var angle_dif = angle_difference(gravity_direction, point_direction(x, y, obj_heart_battle_fighting_parent.x, obj_heart_battle_fighting_parent.y));
36
        gravity_direction -= (angle_dif * 0.01);
37
    }
38
}
39
if (dir_switch)
40
{
41
    var angle_dif = angle_difference(gravity_direction, dir_start - 180);
42
    gravity_direction -= (angle_dif * 0.5);
43
    gravity = 0.8;
44
    if (abs(angle_dif) <= 1 && speed > 1)
45
    {
46
        if (bomb_collision_check() && !destroy_check)
47
        {
48
            audio_play_sound(snd_bullet_warning, 1, 0);
49
            destroy_check = true;
50
            image_blend = c_red;
51
            alarm[0] = 3;
52
        }
53
    }
54
}
55
if (destroy_check == true)
56
{
57
    destroy_timer--;
58
    if (destroy_timer <= 0)
59
        instance_destroy();
60
}
61
62
function bomb_collision_check()
63
{
64
    if (dir_start == 90 || dir_start == 270)
65
    {
66
        if (collision_line(x - 900, y, x + 900, y, obj_heart_battle_fighting_parent, false, true))
67
            return true;
68
    }
69
    else if (dir_start == 0 || dir_start == 180)
70
    {
71
        if (collision_line(x, y - 900, x, y + 900, obj_heart_battle_fighting_parent, false, true))
72
            return true;
73
    }
74
}
75
76
speed = clamp(speed, 0, speed_max);