Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_hec_separated_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
    x = starting_point_x
8
    y = starting_point_y
9
    instance_create(starting_point_x, starting_point_y, obj_hec_dead)
10
    instance_destroy()
11
    return;
12
}
13
else if (enemy_spared_2 == true)
14
{
15
    sprite_index = spr_hec_spared
16
    x = starting_point_x
17
    y = starting_point_y
18
    image_speed = 0
19
    image_index = 0
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
    damage_disjoint_count -= 1
30
else if (enemy_dead_2 == false && enemy_spared_2 == false)
31
{
32
    if (global.enemy_low_hp_2 == true)
33
    {
34
        if (sprite_index != spr_hec_critical)
35
        {
36
            sprite_index = spr_hec_critical
37
            image_speed = (1/3)
38
            image_index = 0
39
        }
40
    }
41
    else if (sprite_index != spr_hec_normal)
42
    {
43
        sprite_index = spr_hec_normal
44
        image_speed = (1/3)
45
        image_index = 0
46
    }
47
}
48
if (instance_exists(obj_text_damage_count) && global.fight_number == 2 && no_loop_damage_disjoint_count == false)
49
{
50
    time_elapsed = 0
51
    sign_modifier = -1
52
    damage_disjoint_count = 12
53
    no_loop_damage_disjoint_count = true
54
    audio_play_sound(enemy_hurt_noise, 1, 0, 1, 0, enemy_hurt_pitch)
55
}
56
else if (!instance_exists(obj_text_damage_count))
57
    no_loop_damage_disjoint_count = false
58
if (damage_disjoint_count == 12)
59
    damage_disjoint_x = -50
60
else if (damage_disjoint_count == 10)
61
    damage_disjoint_x = 50
62
else if (damage_disjoint_count == 8)
63
    damage_disjoint_x = -20
64
else if (damage_disjoint_count == 6)
65
    damage_disjoint_x = 20
66
else if (damage_disjoint_count == 4)
67
    damage_disjoint_x = -10
68
else if (damage_disjoint_count == 2)
69
    damage_disjoint_x = 10
70
else if (damage_disjoint_count == 0)
71
    damage_disjoint_x = 0
72
if (damage_disjoint_count > 0 || global.current_hp_enemy_2 <= 0)
73
{
74
    sprite_index = spr_hec_dead
75
    image_speed = 0
76
    image_index = 0
77
}
78
x = draw_position_x + damage_disjoint_x
79
y = draw_position_y + damage_disjoint_y