Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_slither_body_b_Step_0

(view raw script w/o annotations or w/e)
1
var enemy_dead = global.enemy_dead_2
2
var enemy_spared = global.enemy_spared_2
3
var enemy_sparing = global.enemy_sparing_2
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_depth(starting_point_x, starting_point_y, (depth - 1), obj_slither_dead)
11
    instance_destroy()
12
    return;
13
}
14
else if (enemy_spared == true)
15
{
16
    sprite_index = spr_sir_slither_hurt
17
    x = xstart
18
    y = ystart
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 - 22), obj_spare_cloud)
26
    }
27
    no_loop_create_clouds = true
28
}
29
if (damage_disjoint_count > 0)
30
    damage_disjoint_count -= 1
31
else if (enemy_dead == false && enemy_spared == false && damage_disjoint_count <= 0)
32
{
33
    if (global.enemy_low_hp_2 == true && global.current_hp_enemy_2 < global.max_hp_enemy_2)
34
    {
35
        if (low_hp_noloop == false)
36
        {
37
            layer_sequence_destroy(idle_seq)
38
            layer_sequence_create("sequence_layer", x, y, 15)
39
            low_hp_noloop = true
40
        }
41
        sprite_index = -4
42
    }
43
    else
44
        sprite_index = -4
45
}
46
else if (enemy_spared == true)
47
    sprite_index = spr_sir_slither_spared
48
if (instance_exists(obj_text_damage_count) && global.fight_number == 2 && no_loop_damage_disjoint_count == false)
49
{
50
    sprite_index = spr_sir_slither_hurt
51
    time_elapsed = 0
52
    sign_modifier = 1
53
    damage_disjoint_count = 12
54
    no_loop_damage_disjoint_count = true
55
    audio_play_sound(enemy_hurt_noise, 1, 0, 1, 0, enemy_hurt_pitch)
56
}
57
else if (!instance_exists(obj_text_damage_count))
58
    no_loop_damage_disjoint_count = false
59
if (damage_disjoint_count == 12)
60
    damage_disjoint_x = -50
61
else if (damage_disjoint_count == 10)
62
    damage_disjoint_x = 50
63
else if (damage_disjoint_count == 8)
64
    damage_disjoint_x = -20
65
else if (damage_disjoint_count == 6)
66
    damage_disjoint_x = 20
67
else if (damage_disjoint_count == 4)
68
    damage_disjoint_x = -10
69
else if (damage_disjoint_count == 2)
70
    damage_disjoint_x = 10
71
else if (damage_disjoint_count == 0)
72
    damage_disjoint_x = 0
73
x = xstart + damage_disjoint_x
74
if (global.current_hp_enemy_2 <= 0)
75
    sprite_index = spr_sir_slither_hurt