Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_flier_b_Step_0

(view raw script w/o annotations or w/e)
1
var enemy_dead_2 = global.enemy_dead_2;
2
var enemy_spared_2 = global.enemy_spared_2;
3
if (enemy_dead_2 == false && enemy_spared_2 == false)
4
    image_alpha = global.image_alpha_enemy_attacking;
5
if (enemy_dead_2 == true)
6
{
7
    x = starting_point_x;
8
    y = starting_point_y;
9
    instance_create(starting_point_x, starting_point_y, obj_flier_dead);
10
    instance_destroy();
11
    exit;
12
    image_alpha = 0.5;
13
}
14
else if (enemy_spared_2 == true)
15
{
16
    sprite_index = spr_flier_spared;
17
    x = starting_point_x;
18
    y = starting_point_y;
19
    image_alpha = 0.5;
20
    if (no_loop_create_clouds == false)
21
    {
22
        for (i = 0; i <= 11; i += 1)
23
            instance_create(x, y, obj_spare_cloud);
24
    }
25
    no_loop_create_clouds = true;
26
}
27
if (damage_disjoint_count > 0)
28
{
29
    damage_disjoint_count -= 1;
30
}
31
else if (enemy_dead_2 == false && enemy_spared_2 == false)
32
{
33
    if (global.enemy_low_hp_2 == true && global.current_hp_enemy_2 < global.max_hp_enemy_2)
34
        sprite_index = spr_flier_critical;
35
    else
36
        sprite_index = spr_flier;
37
    image_speed = 0.5;
38
}
39
if (instance_exists(obj_text_damage_count) && global.fight_number == 2 && no_loop_damage_disjoint_count == false)
40
{
41
    time_elapsed = 0;
42
    sign_modifier = -1;
43
    damage_disjoint_count = 12;
44
    no_loop_damage_disjoint_count = true;
45
    audio_play_sound(enemy_hurt_noise, 1, 0, 1, -0.5, enemy_hurt_pitch);
46
}
47
else if (!instance_exists(obj_text_damage_count))
48
{
49
    no_loop_damage_disjoint_count = false;
50
}
51
if (damage_disjoint_count == 12)
52
    damage_disjoint_x = -50;
53
else if (damage_disjoint_count == 10)
54
    damage_disjoint_x = 50;
55
else if (damage_disjoint_count == 8)
56
    damage_disjoint_x = -20;
57
else if (damage_disjoint_count == 6)
58
    damage_disjoint_x = 20;
59
else if (damage_disjoint_count == 4)
60
    damage_disjoint_x = -10;
61
else if (damage_disjoint_count == 2)
62
    damage_disjoint_x = 10;
63
else if (damage_disjoint_count == 0)
64
    damage_disjoint_x = 0;
65
if (damage_disjoint_count > 0 || global.current_hp_enemy_2 <= 0)
66
    sprite_index = spr_flier_dead;
67
x = draw_position_x + damage_disjoint_x;
68
y = draw_position_y + damage_disjoint_y;
69
if (!(instance_exists(obj_text_damage_count) && global.fight_number == 2) && enemy_dead_2 == false && enemy_spared_2 == false)
70
{
71
    game_maker_cannot_do_math = power((time_elapsed / ((time_max / 2) * (1 / sqrt(max_rise)))) - sqrt(max_rise), 2);
72
    animation_disjoint_y = sign_modifier * (max_rise - round(game_maker_cannot_do_math));
73
    time_elapsed += time_increase;
74
    if (time_elapsed >= time_max)
75
    {
76
        time_elapsed = 0;
77
        sign_modifier = -sign_modifier;
78
    }
79
    y = draw_position_y + animation_disjoint_y;
80
}