Undertale Yellow script viewer

← back to main script listing

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