Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_penilla_tail_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
    instance_destroy();
8
    exit;
9
    image_alpha = 0.5;
10
}
11
else if (enemy_spared_2 == true)
12
{
13
    instance_destroy();
14
    exit;
15
}
16
if (damage_disjoint_count > 0)
17
{
18
    damage_disjoint_count -= 1;
19
}
20
else if (enemy_dead_2 == false && enemy_spared_2 == false)
21
{
22
    if (global.enemy_low_hp_2 == true && global.current_hp_enemy_2 < global.max_hp_enemy_2)
23
        sprite_index = spr_penilla_tail_critical;
24
    else
25
        sprite_index = spr_penilla_tail;
26
}
27
if (instance_exists(obj_text_damage_count) && global.fight_number == 2 && no_loop_damage_disjoint_count == false)
28
{
29
    time_elapsed = 0;
30
    sign_modifier = -1;
31
    damage_disjoint_count = 12;
32
    no_loop_damage_disjoint_count = true;
33
}
34
else if (!instance_exists(obj_text_damage_count))
35
{
36
    no_loop_damage_disjoint_count = false;
37
}
38
if (damage_disjoint_count == 12)
39
    damage_disjoint_x = -50;
40
else if (damage_disjoint_count == 10)
41
    damage_disjoint_x = 50;
42
else if (damage_disjoint_count == 8)
43
    damage_disjoint_x = -20;
44
else if (damage_disjoint_count == 6)
45
    damage_disjoint_x = 20;
46
else if (damage_disjoint_count == 4)
47
    damage_disjoint_x = -10;
48
else if (damage_disjoint_count == 2)
49
    damage_disjoint_x = 10;
50
else if (damage_disjoint_count == 0)
51
    damage_disjoint_x = 0;
52
if (damage_disjoint_count > 0 || global.current_hp_enemy_2 <= 0)
53
    image_alpha = 0;
54
x = draw_position_x + damage_disjoint_x;
55
y = draw_position_y + damage_disjoint_y;
56
if (!(instance_exists(obj_text_damage_count) && global.fight_number == 2) && sprite_index == spr_penilla_tail && enemy_dead_2 == false && enemy_spared_2 == false)
57
{
58
    game_maker_cannot_do_math = power((time_elapsed / ((time_max / 2) * (1 / sqrt(max_rise)))) - sqrt(max_rise), 2);
59
    animation_disjoint = sign_modifier * (max_rise - round(game_maker_cannot_do_math));
60
    time_elapsed += time_increase;
61
    if (time_elapsed >= time_max)
62
    {
63
        time_elapsed = 0;
64
        sign_modifier = -sign_modifier;
65
    }
66
    image_angle = animation_disjoint - max_rise;
67
}
68
else
69
{
70
    image_angle = 0;
71
}