Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_penilla_body_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
    x = starting_point_x;
8
    y = starting_point_y;
9
    instance_create(starting_point_x, starting_point_y, obj_penilla_dead);
10
    instance_destroy();
11
    exit;
12
    image_alpha = 0.5;
13
}
14
else if (enemy_spared == true)
15
{
16
    sprite_index = spr_penilla_spared;
17
    x = starting_point_x;
18
    y = starting_point_y;
19
    image_alpha = 0.5;
20
}
21
if (damage_disjoint_count > 0)
22
{
23
    damage_disjoint_count -= 1;
24
}
25
else if (enemy_dead == false && enemy_spared == false)
26
{
27
    if (global.enemy_low_hp == true && global.current_hp_enemy < global.max_hp_enemy)
28
        sprite_index = spr_penilla_body;
29
    else
30
        sprite_index = spr_penilla_body;
31
}
32
if (instance_exists(obj_text_damage_count) && global.fight_number == 1 && no_loop_damage_disjoint_count == false)
33
{
34
    time_elapsed = 0;
35
    sign_modifier = -1;
36
    damage_disjoint_count = 12;
37
    no_loop_damage_disjoint_count = true;
38
    audio_play_sound(enemy_hurt_noise, 1, 0, 1, 0, enemy_hurt_pitch);
39
}
40
else if (!instance_exists(obj_text_damage_count))
41
{
42
    no_loop_damage_disjoint_count = false;
43
}
44
if (damage_disjoint_count == 12)
45
    damage_disjoint_x = -50;
46
else if (damage_disjoint_count == 10)
47
    damage_disjoint_x = 50;
48
else if (damage_disjoint_count == 8)
49
    damage_disjoint_x = -20;
50
else if (damage_disjoint_count == 6)
51
    damage_disjoint_x = 20;
52
else if (damage_disjoint_count == 4)
53
    damage_disjoint_x = -10;
54
else if (damage_disjoint_count == 2)
55
    damage_disjoint_x = 10;
56
else if (damage_disjoint_count == 0)
57
    damage_disjoint_x = 0;
58
if (damage_disjoint_count > 0 || global.current_hp_enemy <= 0)
59
    sprite_index = spr_penilla_dead;
60
x = draw_position_x + damage_disjoint_x;
61
y = draw_position_y + damage_disjoint_y;