Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_starlo_boss_body_Step_0

(view raw script w/o annotations or w/e)
1
if (global.current_hp_enemy <= 0)
2
{
3
    if (!death_sprite)
4
        death_sprite = true
5
}
6
if (death_sprite == true && sprite_index != spr_starlo_body_dead)
7
{
8
    sprite_index = spr_starlo_body_dead
9
    image_index = 0
10
    obj_starlo_boss_head.image_alpha = 0
11
    image_xscale = 1
12
    image_yscale = 1
13
    alarm[0] = 45
alarm[0]

script_execute(gml_Script_scr_create_quote_bubble_battle_defeat) instance_create(380, 74, obj_quote_bubble_battle_yellow_3) instance_create(0, 0, obj_quote_battle_starlo_death)
14
}
15
if (death_sprite == true)
16
    image_index = obj_starlo_boss_head.image_index
17
if (global.turns_passed >= 17)
18
{
19
    if instance_exists(obj_target_bar_battle)
20
    {
21
        if (enemy_betrayal_noloop == false)
22
        {
23
            enemy_sparing_old = global.enemy_sparing
24
            enemy_betrayal_noloop = true
25
            global.enemy_sparing = true
26
        }
27
    }
28
    else if (enemy_betrayal_noloop == true)
29
    {
30
        global.enemy_sparing = enemy_sparing_old
31
        enemy_betrayal_noloop = false
32
    }
33
}
34
if (global.enemy_dead == true)
35
{
36
    instance_create(x, y, obj_starlo_dead)
37
    instance_destroy()
38
    return;
39
}
40
if (sprite_index != spr_starlo_body_dead)
41
{
42
    var anim_loop_time_half = anim_loop_time / 2
43
    var anim_inc_current = (anim_stretch_max - 1) / anim_loop_time_half * anim_inc_multiplier
44
    if (anim_stage == 1)
45
    {
46
        anim_stretch_current += anim_inc_current
47
        anim_inc_multiplier -= (anim_inc_multiplier_max / anim_loop_time_half)
48
        if (anim_stretch_current >= anim_stretch_max)
49
        {
50
            anim_stretch_current = anim_stretch_max
51
            anim_stage = 2
52
            anim_inc_multiplier = anim_inc_multiplier_max
53
        }
54
    }
55
    if (anim_stage == 2)
56
    {
57
        anim_stretch_current -= ((anim_stretch_max - 1) / anim_loop_time_half)
58
        anim_inc_multiplier -= (anim_inc_multiplier_max / anim_loop_time_half)
59
        if (anim_stretch_current <= 1)
60
        {
61
            anim_stretch_current = 1
62
            anim_stage = 1
63
            anim_inc_multiplier = anim_inc_multiplier_max
64
        }
65
    }
66
    if (set_outro_sprite == true && global.turns_passed == 17)
67
    {
68
        if (sprite_index != outro_sprite)
69
        {
70
            sprite_index = outro_sprite
71
            image_index = 0
72
            image_speed = (1/3)
73
            obj_starlo_boss_head.image_alpha = 1
74
        }
75
    }
76
    else if (global.turns_passed == 9 || global.turns_passed == 10)
77
    {
78
        if (instance_exists(obj_heart_battle_fighting_parent) && obj_heart_battle_fighting_parent.moveable == true)
79
            var attack_start = true
80
        else
81
            attack_start = false
82
        if (attack_start == true && sprite_index != shoot_sprite)
83
        {
84
            sprite_index = shoot_sprite
85
            image_index = 0
86
            image_speed = (1/3)
87
            obj_starlo_boss_head.image_alpha = 0
88
        }
89
        else if (attack_start == false && sprite_index != ready_sprite)
90
        {
91
            sprite_index = ready_sprite
92
            image_index = 0
93
            image_speed = (1/3)
94
            obj_starlo_boss_head.image_alpha = 1
95
        }
96
    }
97
    else
98
    {
99
        sprite_index = base_sprite
100
        obj_starlo_boss_head.image_alpha = 1
101
    }
102
    if (sprite_index == base_sprite || sprite_index == ready_sprite)
103
        image_yscale = anim_stretch_current
104
    else
105
        image_yscale = 1
106
    obj_starlo_boss_head.y = y - anim_head_offset * image_yscale
107
}
108
if (damage_disjoint_count > 0)
109
    damage_disjoint_count -= 1
110
if (instance_exists(obj_text_damage_count) && global.fight_number == 1 && no_loop_damage_disjoint_count == false)
111
{
112
    damage_disjoint_count = 12
113
    no_loop_damage_disjoint_count = true
114
}
115
else if (!instance_exists(obj_text_damage_count))
116
    no_loop_damage_disjoint_count = false
117
if (damage_disjoint_count == 12)
118
    damage_disjoint_x = -50
119
else if (damage_disjoint_count == 10)
120
    damage_disjoint_x = 50
121
else if (damage_disjoint_count == 8)
122
    damage_disjoint_x = -20
123
else if (damage_disjoint_count == 6)
124
    damage_disjoint_x = 20
125
else if (damage_disjoint_count == 4)
126
    damage_disjoint_x = -10
127
else if (damage_disjoint_count == 2)
128
    damage_disjoint_x = 10
129
else if (damage_disjoint_count == 0)
130
{
131
    damage_disjoint_x = 0
132
    if (sprite_index == hurt_sprite && (!instance_exists(obj_battle_hp_current_enemy)))
133
    {
134
        sprite_index = base_sprite
135
        if (global.turns_passed >= 17 && outro_sprite_noloop == true)
136
        {
137
            sprite_index = outro_sprite
138
            image_index = image_number - 1
139
            image_speed = 0
140
        }
141
    }
142
}
143
else if (damage_disjoint_count > 0 && (!death_sprite))
144
{
145
    sprite_index = hurt_sprite
146
    image_xscale = 1
147
    image_yscale = 1
148
    obj_starlo_boss_head.y = obj_starlo_boss_head.ystart
149
    obj_starlo_boss_head.sprite_index = spr_starlo_boss_head_hurt
150
}
151
x = starting_point_x + damage_disjoint_x
152
if instance_exists(obj_starlo_boss_head)
153
    obj_starlo_boss_head.x = obj_starlo_boss_head.xstart + damage_disjoint_x