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;
gml_Object_obj_starlo_boss_body_Alarm_0.gml

script_execute(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
    exit;
39
    image_alpha = 0.5;
40
}
41
if (sprite_index != spr_starlo_body_dead)
42
{
43
    var anim_loop_time_half = anim_loop_time / 2;
44
    var anim_inc_current = ((anim_stretch_max - 1) / anim_loop_time_half) * anim_inc_multiplier;
45
    if (anim_stage == 1)
46
    {
47
        anim_stretch_current += anim_inc_current;
48
        anim_inc_multiplier -= (anim_inc_multiplier_max / anim_loop_time_half);
49
        if (anim_stretch_current >= anim_stretch_max)
50
        {
51
            anim_stretch_current = anim_stretch_max;
52
            anim_stage = 2;
53
            anim_inc_multiplier = anim_inc_multiplier_max;
54
        }
55
    }
56
    if (anim_stage == 2)
57
    {
58
        anim_stretch_current -= ((anim_stretch_max - 1) / anim_loop_time_half);
59
        anim_inc_multiplier -= (anim_inc_multiplier_max / anim_loop_time_half);
60
        if (anim_stretch_current <= 1)
61
        {
62
            anim_stretch_current = 1;
63
            anim_stage = 1;
64
            anim_inc_multiplier = anim_inc_multiplier_max;
65
        }
66
    }
67
    if (set_outro_sprite == true && global.turns_passed == 17)
68
    {
69
        if (sprite_index != outro_sprite)
70
        {
71
            sprite_index = outro_sprite;
72
            image_index = 0;
73
            image_speed = 1/3;
74
            obj_starlo_boss_head.image_alpha = 1;
75
        }
76
    }
77
    else if (global.turns_passed == 9 || global.turns_passed == 10)
78
    {
79
        var attack_start;
80
        if (instance_exists(obj_heart_battle_fighting_parent) && obj_heart_battle_fighting_parent.moveable == true)
81
            attack_start = true;
82
        else
83
            attack_start = false;
84
        if (attack_start == true && sprite_index != shoot_sprite)
85
        {
86
            sprite_index = shoot_sprite;
87
            image_index = 0;
88
            image_speed = 1/3;
89
            obj_starlo_boss_head.image_alpha = 0;
90
        }
91
        else if (attack_start == false && sprite_index != ready_sprite)
92
        {
93
            sprite_index = ready_sprite;
94
            image_index = 0;
95
            image_speed = 1/3;
96
            obj_starlo_boss_head.image_alpha = 1;
97
        }
98
    }
99
    else
100
    {
101
        sprite_index = base_sprite;
102
        obj_starlo_boss_head.image_alpha = 1;
103
    }
104
    if (sprite_index == base_sprite || sprite_index == ready_sprite)
105
        image_yscale = anim_stretch_current;
106
    else
107
        image_yscale = 1;
108
    obj_starlo_boss_head.y = y - (anim_head_offset * image_yscale);
109
}
110
if (damage_disjoint_count > 0)
111
    damage_disjoint_count -= 1;
112
if (instance_exists(obj_text_damage_count) && global.fight_number == 1 && no_loop_damage_disjoint_count == false)
113
{
114
    damage_disjoint_count = 12;
115
    no_loop_damage_disjoint_count = true;
116
}
117
else if (!instance_exists(obj_text_damage_count))
118
{
119
    no_loop_damage_disjoint_count = false;
120
}
121
if (damage_disjoint_count == 12)
122
{
123
    damage_disjoint_x = -50;
124
}
125
else if (damage_disjoint_count == 10)
126
{
127
    damage_disjoint_x = 50;
128
}
129
else if (damage_disjoint_count == 8)
130
{
131
    damage_disjoint_x = -20;
132
}
133
else if (damage_disjoint_count == 6)
134
{
135
    damage_disjoint_x = 20;
136
}
137
else if (damage_disjoint_count == 4)
138
{
139
    damage_disjoint_x = -10;
140
}
141
else if (damage_disjoint_count == 2)
142
{
143
    damage_disjoint_x = 10;
144
}
145
else if (damage_disjoint_count == 0)
146
{
147
    damage_disjoint_x = 0;
148
    if (sprite_index == hurt_sprite && !instance_exists(obj_battle_hp_current_enemy))
149
    {
150
        sprite_index = base_sprite;
151
        if (global.turns_passed >= 17 && outro_sprite_noloop == true)
152
        {
153
            sprite_index = outro_sprite;
154
            image_index = image_number - 1;
155
            image_speed = 0;
156
        }
157
    }
158
}
159
else if (damage_disjoint_count > 0 && !death_sprite)
160
{
161
    sprite_index = hurt_sprite;
162
    image_xscale = 1;
163
    image_yscale = 1;
164
    obj_starlo_boss_head.y = obj_starlo_boss_head.ystart;
165
    obj_starlo_boss_head.sprite_index = spr_starlo_boss_head_hurt;
166
}
167
x = starting_point_x + damage_disjoint_x;
168
if (instance_exists(obj_starlo_boss_head))
169
    obj_starlo_boss_head.x = obj_starlo_boss_head.xstart + damage_disjoint_x;