Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_battle_enemy_attack_ceroba_flower_circle_flower_Step_0

(view raw script w/o annotations or w/e)
1
if live_call()
2
    return global.live_result;
3
if (!instance_exists(obj_heart_battle_fighting_parent))
4
{
5
    instance_destroy()
6
    return;
7
}
8
if (state < 1)
9
{
10
    attack_target_x = target.x
11
    attack_target_y = target.y
12
}
13
x = attack_target_x + (lengthdir_x(attack_distance, attack_dir))
14
y = attack_target_y + (lengthdir_y(attack_distance, attack_dir))
15
if (image_alpha < 1 && can_move == false)
16
{
17
    image_alpha += 0.2
18
    if (image_alpha > 1)
19
        image_alpha = 1
20
}
21
if (attack_dir < 360)
22
    attack_dir += bullet_speed
23
else
24
    attack_dir = bullet_speed
25
if (state == 0)
26
{
27
}
28
if (state == 1 || state == 2)
29
{
30
    if (attack_distance > 0)
31
        attack_distance -= homing_speed
32
    else
33
    {
34
        var count = 0
35
        with (object_index)
36
        {
37
            if (bullet_spawner == other.bullet_spawner)
38
                count += 1
39
        }
40
        if (count == 1)
41
            instance_create_depth(attack_target_x, attack_target_y, -200, obj_battle_enemy_attack_ceroba_flower_circle_explosion)
42
        instance_destroy()
43
        instance_destroy(bullet_spawner)
44
    }
45
    if (state != 2)
46
    {
47
        homing_speed += 0.1
48
        if (global.hotland_flag[2] == 3)
49
            homing_speed += 0.1
50
    }
51
}