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
    exit;
12
    image_alpha = 0.5;
13
}
14
else if (enemy_spared == true)
15
{
16
    sprite_index = spr_tri_spared;
17
    x = starting_point_x;
18
    y = starting_point_y;
19
    image_speed = 0;
20
    image_index = 0;
21
    image_alpha = 0.5;
22
    if (no_loop_create_clouds == false)
23
    {
24
        for (i = 0; i <= 11; i += 1)
25
            instance_create(x, y, obj_spare_cloud);
26
    }
27
    no_loop_create_clouds = true;
28
}
29
if (damage_disjoint_count > 0)
30
{
31
    damage_disjoint_count -= 1;
32
}
33
else if (enemy_dead == false && enemy_spared == false)
34
{
35
    if (global.enemy_low_hp == true)
36
    {
37
        if (sprite_index != spr_tri_critical)
38
        {
39
            sprite_index = spr_tri_critical;
40
            image_speed = 1/3;
41
            image_index = 0;
42
        }
43
    }
44
    else if (sprite_index != spr_tri_normal)
45
    {
46
        sprite_index = spr_tri_normal;
47
        image_speed = 1/3;
48
        image_index = 0;
49
    }
50
}
51
if (instance_exists(obj_text_damage_count) && global.fight_number == 1 && no_loop_damage_disjoint_count == false)
52
{
53
    time_elapsed = 0;
54
    sign_modifier = -1;
55
    damage_disjoint_count = 12;
56
    no_loop_damage_disjoint_count = true;
57
    audio_play_sound(enemy_hurt_noise, 1, 0, 1, 0, enemy_hurt_pitch);
58
}
59
else if (!instance_exists(obj_text_damage_count))
60
{
61
    no_loop_damage_disjoint_count = false;
62
}
63
if (damage_disjoint_count == 12)
64
    damage_disjoint_x = -50;
65
else if (damage_disjoint_count == 10)
66
    damage_disjoint_x = 50;
67
else if (damage_disjoint_count == 8)
68
    damage_disjoint_x = -20;
69
else if (damage_disjoint_count == 6)
70
    damage_disjoint_x = 20;
71
else if (damage_disjoint_count == 4)
72
    damage_disjoint_x = -10;
73
else if (damage_disjoint_count == 2)
74
    damage_disjoint_x = 10;
75
else if (damage_disjoint_count == 0)
76
    damage_disjoint_x = 0;
77
if (damage_disjoint_count > 0 || global.current_hp_enemy <= 0)
78
{
79
    sprite_index = spr_tri_dead;
80
    image_speed = 0;
81
    image_index = 0;
82
}
83
x = draw_position_x + damage_disjoint_x;
84
y = draw_position_y + damage_disjoint_y;