Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_penilla_head_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
    instance_destroy();
8
    exit;
9
    image_alpha = 0.5;
10
}
11
else if (enemy_spared == true)
12
{
13
    x = starting_point_x;
14
    y = starting_point_y;
15
    image_alpha = 0.5;
16
    if (no_loop_create_clouds == false)
17
    {
18
        for (i = 0; i <= 11; i += 1)
19
            instance_create(x - 20, y, obj_spare_cloud);
20
    }
21
    no_loop_create_clouds = true;
22
    instance_destroy();
23
    exit;
24
}
25
if (damage_disjoint_count > 0)
26
{
27
    damage_disjoint_count -= 1;
28
}
29
else if (enemy_dead == false && enemy_spared == false)
30
{
31
    if (global.enemy_low_hp == true && global.current_hp_enemy < global.max_hp_enemy)
32
        sprite_index = spr_penilla_head_critical;
33
    else
34
        sprite_index = spr_penilla_head;
35
}
36
if (instance_exists(obj_text_damage_count) && global.fight_number == 1 && no_loop_damage_disjoint_count == false)
37
{
38
    time_elapsed_x = 0;
39
    time_elapsed_y = 0;
40
    sign_modifier = -1;
41
    damage_disjoint_count = 12;
42
    no_loop_damage_disjoint_count = true;
43
}
44
else if (!instance_exists(obj_text_damage_count))
45
{
46
    no_loop_damage_disjoint_count = false;
47
}
48
if (damage_disjoint_count == 12)
49
    damage_disjoint_x = -50;
50
else if (damage_disjoint_count == 10)
51
    damage_disjoint_x = 50;
52
else if (damage_disjoint_count == 8)
53
    damage_disjoint_x = -20;
54
else if (damage_disjoint_count == 6)
55
    damage_disjoint_x = 20;
56
else if (damage_disjoint_count == 4)
57
    damage_disjoint_x = -10;
58
else if (damage_disjoint_count == 2)
59
    damage_disjoint_x = 10;
60
else if (damage_disjoint_count == 0)
61
    damage_disjoint_x = 0;
62
if (damage_disjoint_count > 0 || global.current_hp_enemy <= 0)
63
    image_alpha = 0;
64
x = draw_position_x + damage_disjoint_x;
65
y = draw_position_y + damage_disjoint_y;
66
if (!(instance_exists(obj_text_damage_count) && global.fight_number == 1) && enemy_dead == false && enemy_spared == false)
67
{
68
    if (sprite_index == spr_penilla_head)
69
    {
70
        game_maker_cannot_do_math = power((time_elapsed_x / ((time_max_x / 2) * (1 / sqrt(max_rise_x)))) - sqrt(max_rise_x), 2);
71
        animation_disjoint_x = sign_modifier_x * (max_rise_x - round(game_maker_cannot_do_math));
72
        time_elapsed_x += time_increase_x;
73
        if (time_elapsed_x >= time_max_x)
74
        {
75
            time_elapsed_x = 0;
76
            sign_modifier_x = -sign_modifier_x;
77
        }
78
        x = draw_position_x + animation_disjoint_x;
79
    }
80
    game_maker_cannot_do_math = power((time_elapsed_y / ((time_max_y / 2) * (1 / sqrt(max_rise_y)))) - sqrt(max_rise_y), 2);
81
    animation_disjoint_y = sign_modifier_y * (max_rise_y - round(game_maker_cannot_do_math));
82
    time_elapsed_y += time_increase_y;
83
    if (time_elapsed_y >= time_max_y)
84
    {
85
        time_elapsed_y = 0;
86
        sign_modifier_y = -sign_modifier_y;
87
    }
88
    y = draw_position_y + animation_disjoint_y;
89
    image_angle = max_angle * ((draw_position_x - x) / max_rise_x);
90
}
91
else
92
{
93
    image_angle = 0;
94
}