Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_tri_separated_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_tri_dead)
10
    instance_destroy()
11
    return;
12
}
13
else if (enemy_spared == true)
14
{
15
    sprite_index = spr_tri_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 == false && enemy_spared == false)
31
{
32
    if (global.enemy_low_hp == true)
33
    {
34
        if (sprite_index != spr_tri_critical)
35
        {
36
            sprite_index = spr_tri_critical
37
            image_speed = (1/3)
38
            image_index = 0
39
        }
40
    }
41
    else if (sprite_index != spr_tri_normal)
42
    {
43
        sprite_index = spr_tri_normal
44
        image_speed = (1/3)
45
        image_index = 0
46
    }
47
}
48
if (instance_exists(obj_text_damage_count) && global.fight_number == 1 && 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 <= 0)
73
{
74
    sprite_index = spr_tri_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