Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_battle_enemy_attack_insomnitot_sheep_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 (attack_direction == -1)
7
{
8
    run_sprite = spr_battle_enemy_attack_insomnitot_sheep_left
9
    jump_sprite = 2259
10
    if (no_loop_sprite_assign == false)
11
    {
12
        sprite_index = run_sprite
13
        image_speed = image_speed_default
14
        image_index = 0
15
        no_loop_sprite_assign = true
16
    }
17
}
18
if (state == "run")
19
{
20
    y = draw_position_y
21
    event_user(0)
22
}
23
else if (state == "jump")
24
{
25
    game_maker_cannot_do_math = power((time_elapsed / (time_max / 2 * (1 / sqrt(max_rise))) - sqrt(max_rise)), 2)
26
    animation_disjoint_y = sign_modifier * (max_rise - round(game_maker_cannot_do_math))
27
    time_elapsed += time_increase
28
    if (time_elapsed >= time_max)
29
    {
30
        time_elapsed = 0
31
        sprite_index = run_sprite
32
        image_speed = image_speed_default
33
        image_index = 0
34
        state = "run"
35
    }
36
    y = draw_position_y + animation_disjoint_y
37
}
38
x += (move_speed * attack_direction)
39
if ((attack_direction == 1 && bbox_left > obj_dialogue_box_battle_transformation_any.bbox_right) || (attack_direction == -1 && bbox_right < obj_dialogue_box_battle_transformation_any.bbox_left))
40
{
41
    instance_destroy()
42
    return;
43
}