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