Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_pedla_body_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 (damage_disjoint_count > 0)
4
    damage_disjoint_count -= 1
5
if (instance_exists(obj_text_damage_count) && global.fight_number == 1 && no_loop_damage_disjoint_count == false)
6
{
7
    damage_disjoint_count = 12
8
    no_loop_damage_disjoint_count = true
9
    audio_play_sound(enemy_hurt_noise, 1, 0, 1, 0, enemy_hurt_pitch)
10
}
11
else if (!instance_exists(obj_text_damage_count))
12
    no_loop_damage_disjoint_count = false
13
if (damage_disjoint_count == 12)
14
    damage_disjoint_x = -50
15
else if (damage_disjoint_count == 10)
16
    damage_disjoint_x = 50
17
else if (damage_disjoint_count == 8)
18
    damage_disjoint_x = -20
19
else if (damage_disjoint_count == 6)
20
    damage_disjoint_x = 20
21
else if (damage_disjoint_count == 4)
22
    damage_disjoint_x = -10
23
else if (damage_disjoint_count == 2)
24
    damage_disjoint_x = 10
25
else if (damage_disjoint_count == 0)
26
    damage_disjoint_x = 0
27
x = starting_point_x + damage_disjoint_x
28
if (enemy_dead == true)
29
{
30
    x = starting_point_x
31
    y = starting_point_y
32
    image_xscale = 1
33
    image_yscale = 1
34
    instance_create(starting_point_x, starting_point_y, obj_flowergirls_dead)
35
    instance_destroy()
36
    instance_destroy(obj_pedla_head)
37
    instance_destroy(obj_pedla_hands)
38
    return;
39
}
40
else if (enemy_spared == true)
41
{
42
    sprite_index = spr_pedla_spared
43
    instance_destroy(obj_pedla_head)
44
    instance_destroy(obj_pedla_hands)
45
    x = starting_point_x
46
    y = starting_point_y
47
    image_xscale = 1
48
    image_yscale = 1
49
    image_speed = 0
50
    image_index = 0
51
    image_alpha = 0.5
52
    if (no_loop_create_clouds == false)
53
    {
54
        for (i = 0; i <= 11; i += 1)
55
            instance_create(x, (y - 22), obj_spare_cloud)
56
    }
57
    no_loop_create_clouds = true
58
}
59
if ((!enemy_dead) && (!enemy_spared))
60
{
61
    var anim_loop_time_half = anim_loop_time / 2
62
    var anim_inc_current = (anim_stretch_max - 1) / anim_loop_time_half * anim_inc_multiplier
63
    if (anim_stage == 1)
64
    {
65
        anim_stretch_current += anim_inc_current
66
        anim_inc_multiplier -= (anim_inc_multiplier_max / anim_loop_time_half)
67
        if (anim_stretch_current >= anim_stretch_max)
68
        {
69
            anim_stretch_current = anim_stretch_max
70
            anim_stage = 2
71
            anim_inc_multiplier = anim_inc_multiplier_max
72
        }
73
    }
74
    if (anim_stage == 2)
75
    {
76
        anim_stretch_current -= ((anim_stretch_max - 1) / anim_loop_time_half)
77
        anim_inc_multiplier -= (anim_inc_multiplier_max / anim_loop_time_half)
78
        if (anim_stretch_current <= 1)
79
        {
80
            anim_stretch_current = 1
81
            anim_stage = 1
82
            anim_inc_multiplier = anim_inc_multiplier_max
83
        }
84
    }
85
    image_yscale = anim_stretch_current
86
    obj_pedla_head.y = y - anim_head_offset * image_yscale
87
    obj_pedla_hands.y = y - anim_hands_offset * image_yscale
88
    obj_pedla_head.x = obj_pedla_head.xstart + damage_disjoint_x
89
    obj_pedla_hands.x = obj_pedla_hands.xstart + damage_disjoint_x
90
    if (damage_disjoint_x != 0)
91
        obj_pedla_head.sprite_index = spr_pedla_head_hurt
92
    else if global.enemy_low_hp
93
        obj_pedla_head.sprite_index = spr_pedla_head_lowhp
94
    else
95
        obj_pedla_head.sprite_index = spr_pedla_head
96
}