Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_flier_a_Step_0

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