Undertale Yellow script viewer

← back to main script listing

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