Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_battle_enemy_attack_dunebud_chase_attack_Step_0

(view raw script w/o annotations or w/e)
1
if (state == "move")
2
{
3
    if (can_sink == true)
4
    {
5
        state = "animate";
6
        sprite_index = sprite_sink[side];
7
        image_speed = image_speed_sink;
8
        image_index = 0;
9
    }
10
    else
11
    {
12
        if (x < obj_heart_battle_fighting_parent.x)
13
            move_sign = 1;
14
        else if (x > obj_heart_battle_fighting_parent.x)
15
            move_sign = -1;
16
        else
17
            move_sign = 0;
18
        move_speed += (move_accel * move_sign);
19
        if (abs(move_speed) > move_max)
20
            move_speed = sign(move_speed) * move_max;
21
        if (critical == false || !(critical == true && abs(x - obj_heart_battle_fighting_parent.x) < move_max && obj_heart_battle_fighting_parent.move_hsp_count == 0))
22
            x += move_speed;
23
        else
24
            move_speed = 0;
25
    }
26
}
27
else if (state == "fly")
28
{
29
    if (side == 0)
30
    {
31
        y += fly_speed;
32
        if (bbox_bottom >= (obj_dialogue_box_battle_transformation_any.bbox_bottom - 5))
33
        {
34
            y = obj_dialogue_box_battle_transformation_any.bbox_bottom - 5;
35
            state = "animate";
36
            sprite_index = sprite_fly_end[side];
37
            image_speed = image_speed_fly_end;
38
            image_index = 0;
39
        }
40
    }
41
    else
42
    {
43
        y -= fly_speed;
44
        if (bbox_top <= (obj_dialogue_box_battle_transformation_any.bbox_top + 5))
45
        {
46
            y = obj_dialogue_box_battle_transformation_any.bbox_top + 5;
47
            state = "animate";
48
            sprite_index = sprite_fly_end[side];
49
            image_speed = image_speed_fly_end;
50
            image_index = 0;
51
        }
52
    }
53
}