| 1 |
if (live_call()) |
| 2 |
return global.live_result; |
| 3 |
if (stage == 1) |
| 4 |
{ |
| 5 |
if (soul_shake == true) |
| 6 |
{ |
| 7 |
obj_heart_battle_fighting_red.x = obj_heart_battle_fighting_red.xstart; |
| 8 |
obj_heart_battle_fighting_red.y = obj_heart_battle_fighting_red.ystart; |
| 9 |
obj_heart_battle_fighting_red.x += random_range(-2, 2); |
| 10 |
obj_heart_battle_fighting_red.y += random_range(-2, 2); |
| 11 |
} |
| 12 |
if (soul_can_hurt == true) |
| 13 |
{ |
| 14 |
if (global.hit_self == true) |
| 15 |
{ |
| 16 |
var weaken_sound = audio_play_sound(snd_soul_gameover_hit, 1, 0); |
| 17 |
audio_sound_pitch(weaken_sound, 0.75); |
| 18 |
soul_shake = true; |
| 19 |
obj_heart_battle_fighting_parent.moveable = false; |
| 20 |
obj_heart_battle_fighting_parent.xstart = obj_heart_battle_fighting_parent.x; |
| 21 |
obj_heart_battle_fighting_parent.ystart = obj_heart_battle_fighting_parent.y; |
| 22 |
instance_create_depth(obj_heart_battle_fighting_parent.x, obj_heart_battle_fighting_parent.y, obj_heart_battle_fighting_parent.depth + 1, obj_ceroba_transform_soul_particles); |
| 23 |
audio_play_sound(snd_attackhitcrit, 1, 0); |
| 24 |
obj_heart_battle_fighting_parent.walk_speed -= 1; |
| 25 |
audio_sound_gain(global.battle_music, audio_sound_get_gain(global.battle_music) * 0.8, 300); |
| 26 |
if (obj_heart_battle_fighting_parent.walk_speed <= 0) |
| 27 |
{ |
| 28 |
scr_audio_fade_outscr_audio_fade_outfunction scr_audio_fade_out(arg0, arg1)
{
var snd = arg0;
var fade_len = arg1;
if (!audio_is_playing(snd))
return false;
audio_sound_gain(snd, 0, fade_len);
if (instance_exists(obj_audio_fade_helper))
{
with (obj_audio_fade_helper)
{
if (audio_to_fade == snd)
return false;
}
}
with (instance_create(0, 0, obj_audio_fade_helper))
audio_to_fade = snd;
} (global.battle_music, 1000); |
| 29 |
if (!alarm[3]) |
| 30 |
alarm[3] = 30; |
| 31 |
fade_out = true; |
| 32 |
alarm[0] = -1;gml_Object_obj_battle_enemy_attack_asgore_checker_Alarm_0.gmlif (live_call())
return global.live_result;
var random_number = irandom_range(0, ds_list_size(spawner_list) - 1);
var attack_instance = ds_list_find_value(spawner_list, random_number);
ds_list_delete(spawner_list, random_number);
instance_create(0, 0, attack_instance);
if (ds_list_empty(spawner_list))
ds_list_copy(spawner_list, spawner_list_original); |
| 33 |
with (obj_battle_enemy_attack_parent) |
| 34 |
instance_destroy(); |
| 35 |
instance_destroy(obj_battle_enemy_attack_spawner_asgore_circle); |
| 36 |
instance_destroy(obj_battle_enemy_attack_spawner_asgore_circle_full); |
| 37 |
instance_destroy(obj_battle_enemy_attack_spawner_asgore_hands); |
| 38 |
instance_destroy(obj_battle_enemy_attack_spawner_asgore_sinusoid); |
| 39 |
instance_destroy(obj_battle_enemy_attack_spawner_asgore_warning); |
| 40 |
instance_destroy(obj_battle_enemy_attack_asgore_warning); |
| 41 |
instance_destroy(obj_battle_enemy_attack_spawner_asgore_fire_circle); |
| 42 |
with (obj_battle_enemy_attack_asgore_hand_horizontal) |
| 43 |
instance_destroy(); |
| 44 |
with (obj_battle_enemy_attack_asgore_hand_vertical) |
| 45 |
instance_destroy(); |
| 46 |
} |
| 47 |
else |
| 48 |
{ |
| 49 |
alarm[2] = 10; |
| 50 |
} |
| 51 |
global.hit_self = false; |
| 52 |
} |
| 53 |
} |
| 54 |
else |
| 55 |
{ |
| 56 |
global.hit_self = false; |
| 57 |
} |
| 58 |
if (fade_out == true) |
| 59 |
{ |
| 60 |
alarm[0] = -1;gml_Object_obj_battle_enemy_attack_asgore_checker_Alarm_0.gmlif (live_call())
return global.live_result;
var random_number = irandom_range(0, ds_list_size(spawner_list) - 1);
var attack_instance = ds_list_find_value(spawner_list, random_number);
ds_list_delete(spawner_list, random_number);
instance_create(0, 0, attack_instance);
if (ds_list_empty(spawner_list))
ds_list_copy(spawner_list, spawner_list_original); |
| 61 |
if (draw_alpha < 1) |
| 62 |
draw_alpha += 0.05; |
| 63 |
else if (!alarm[4]) |
| 64 |
alarm[4] = 45; |
| 65 |
obj_heart_battle_fighting_parent.x = lerp(obj_heart_battle_fighting_parent.x, 320, 0.15); |
| 66 |
obj_heart_battle_fighting_parent.y = lerp(obj_heart_battle_fighting_parent.y, 240, 0.15); |
| 67 |
} |
| 68 |
} |
| 69 |
else |
| 70 |
{ |
| 71 |
var heart = obj_heart_battle_fighting_parent; |
| 72 |
switch (scene) |
| 73 |
{ |
| 74 |
case -3: |
| 75 |
obj_heart_battle_fighting_parent.x = obj_heart_battle_fighting_parent.xstart; |
| 76 |
obj_heart_battle_fighting_parent.y = obj_heart_battle_fighting_parent.ystart; |
| 77 |
obj_heart_battle_fighting_parent.x += random_range(0.3, -0.3); |
| 78 |
obj_heart_battle_fighting_parent.y += random_range(0.3, -0.3); |
| 79 |
cutscene_wait(3); |
| 80 |
break; |
| 81 |
case -2: |
| 82 |
instance_create_depth(obj_heart_battle_fighting_parent.x, obj_heart_battle_fighting_parent.y, obj_heart_battle_fighting_parent.depth + 1, obj_ceroba_transform_soul_particles); |
| 83 |
audio_play_sound(snd_attackhitcrit, 1, 0); |
| 84 |
obj_heart_battle_fighting_parent.x = obj_heart_battle_fighting_parent.xstart; |
| 85 |
obj_heart_battle_fighting_parent.y = obj_heart_battle_fighting_parent.ystart; |
| 86 |
cutscene_advance(); |
| 87 |
break; |
| 88 |
case -1: |
| 89 |
cutscene_wait(2); |
| 90 |
break; |
| 91 |
case 0: |
| 92 |
instance_create_depth(heart.x - 1, heart.y + 90, heart.depth + 1, obj_battle_enemy_attack_asgore_soul_capsule); |
| 93 |
obj_battle_enemy_attack_asgore_soul_capsule.image_index = obj_battle_enemy_attack_asgore_soul_capsule.image_number - 1; |
| 94 |
audio_play_sound(snd_undertale_appear, 1, 0); |
| 95 |
cutscene_advance(); |
| 96 |
break; |
| 97 |
case 1: |
| 98 |
obj_battle_enemy_attack_asgore_soul_capsule.image_alpha += 0.05; |
| 99 |
if (obj_battle_enemy_attack_asgore_soul_capsule.image_alpha >= 1) |
| 100 |
{ |
| 101 |
obj_battle_enemy_attack_asgore_soul_capsule.image_alpha = 1; |
| 102 |
cutscene_wait(2); |
| 103 |
} |
| 104 |
break; |
| 105 |
case 2: |
| 106 |
audio_play_sound(snd_undertale_swoosh, 1, 0); |
| 107 |
obj_battle_enemy_attack_asgore_soul_capsule.vspeed = -4; |
| 108 |
cutscene_advance(); |
| 109 |
break; |
| 110 |
case 3: |
| 111 |
if (obj_battle_enemy_attack_asgore_soul_capsule.y <= (heart.y + 30)) |
| 112 |
{ |
| 113 |
obj_battle_enemy_attack_asgore_soul_capsule.y = heart.y + 30; |
| 114 |
obj_battle_enemy_attack_asgore_soul_capsule.vspeed = 0; |
| 115 |
audio_play_sound(snd_undertale_impact, 1, 0); |
| 116 |
scr_screenshake_battle_customscr_screenshake_battle_customfunction scr_screenshake_battle_custom()
{
instance_destroy(obj_screenshake_battle);
var screenshake = instance_create(0, 0, obj_screenshake_battle);
screenshake.battle_screenshake_duration = argument[0];
screenshake.battle_screenshake_intensity = argument[1];
screenshake.battle_screenshake_dec = screenshake.battle_screenshake_intensity / screenshake.battle_screenshake_duration;
} (6, 2); |
| 117 |
cutscene_advance(); |
| 118 |
} |
| 119 |
break; |
| 120 |
case 4: |
| 121 |
cutscene_wait(1.5); |
| 122 |
break; |
| 123 |
case 5: |
| 124 |
obj_battle_enemy_attack_asgore_soul_capsule.image_speed = -1.5; |
| 125 |
if (obj_battle_enemy_attack_asgore_soul_capsule.image_index <= 4) |
| 126 |
{ |
| 127 |
audio_play_sound(snd_undertale_flash, 1, 0); |
| 128 |
obj_battle_enemy_attack_asgore_soul_capsule.flash_alpha = 1; |
| 129 |
obj_battle_enemy_attack_asgore_soul_capsule.sprite_index = spr_container_open; |
| 130 |
obj_battle_enemy_attack_asgore_soul_capsule.image_speed = 0; |
| 131 |
obj_battle_enemy_attack_asgore_soul_capsule.image_index = 0; |
| 132 |
obj_battle_enemy_attack_asgore_soul_capsule.soul_color = make_color_rgb(255, 255, 0); |
| 133 |
var new_soul = instance_create_depth(obj_battle_enemy_attack_asgore_soul_capsule.x, obj_battle_enemy_attack_asgore_soul_capsule.y, -1000, obj_barrier_soul_battle); |
| 134 |
new_soul.spawner = 2884; |
| 135 |
new_soul.image_alpha = 1; |
| 136 |
new_soul.image_xscale = 2; |
| 137 |
new_soul.image_yscale = 2; |
| 138 |
obj_heart_battle_fighting_parent.image_alpha = 0; |
| 139 |
cutscene_advance(); |
| 140 |
} |
| 141 |
break; |
| 142 |
case 6: |
| 143 |
cutscene_wait(2.5); |
| 144 |
break; |
| 145 |
case 7: |
| 146 |
soul_color[0] = make_color_rgb(0, 128, 0); |
| 147 |
soul_color[1] = make_color_rgb(255, 160, 64); |
| 148 |
soul_color[2] = make_color_rgb(128, 0, 128); |
| 149 |
soul_color[3] = make_color_rgb(0, 0, 255); |
| 150 |
soul_color[4] = make_color_rgb(0, 255, 255); |
| 151 |
for (var i = 0; i < 5; i++) |
| 152 |
{ |
| 153 |
var new_capsule = instance_create_depth(192 + (64 * i), 384, -1010, obj_battle_enemy_attack_asgore_soul_capsule); |
| 154 |
new_capsule.sprite_index = spr_container_open; |
| 155 |
new_capsule.image_speed = 0; |
| 156 |
new_capsule.image_index = 0; |
| 157 |
new_capsule.image_alpha = 0; |
| 158 |
new_capsule.soul_color = other.soul_color[i]; |
| 159 |
var new_soul = instance_create_depth(new_capsule.x, new_capsule.y, -1020, obj_barrier_soul_battle); |
| 160 |
new_soul.spawner = new_capsule; |
| 161 |
new_soul.image_alpha = 0; |
| 162 |
new_soul.image_xscale = 2; |
| 163 |
new_soul.image_yscale = 2; |
| 164 |
new_soul.image_index = obj_barrier_soul_battle.image_index; |
| 165 |
} |
| 166 |
audio_play_sound(snd_undertale_appear, 1, 0); |
| 167 |
cutscene_advance(); |
| 168 |
break; |
| 169 |
case 8: |
| 170 |
var yellow_col = make_color_rgb(255, 255, 0); |
| 171 |
with (obj_battle_enemy_attack_asgore_soul_capsule) |
| 172 |
{ |
| 173 |
if (image_alpha < 1) |
| 174 |
{ |
| 175 |
image_alpha += 0.05; |
| 176 |
} |
| 177 |
else if (soul_color != yellow_col) |
| 178 |
{ |
| 179 |
with (obj_barrier_soul_battle) |
| 180 |
image_alpha = 1; |
| 181 |
with (obj_battle_enemy_attack_asgore_soul_capsule) |
| 182 |
image_alpha = 1; |
| 183 |
other.scene = 9; |
| 184 |
} |
| 185 |
} |
| 186 |
with (obj_barrier_soul_battle) |
| 187 |
{ |
| 188 |
if (image_alpha < 1) |
| 189 |
image_alpha += 0.05; |
| 190 |
} |
| 191 |
break; |
| 192 |
case 9: |
| 193 |
cutscene_wait(3); |
| 194 |
break; |
| 195 |
case 10: |
| 196 |
if (!instance_exists(obj_dialogue_battle_asgore)) |
| 197 |
msg = instance_create(x, y, obj_dialogue_battle_asgore); |
| 198 |
else if (!global.dialogue_open) |
| 199 |
cutscene_advance(); |
| 200 |
with (msg) |
| 201 |
{ |
| 202 |
sndfnt = 267; |
| 203 |
message[0] = " Rest well, young one."; |
| 204 |
message[1] = " I am sorry."; |
| 205 |
skippable = false; |
| 206 |
message_timer = 50; |
| 207 |
} |
| 208 |
break; |
| 209 |
case 11: |
| 210 |
cutscene_wait(3); |
| 211 |
break; |
| 212 |
case 12: |
| 213 |
cymbal_sound = audio_play_sound(mus_cymbal, 1, 0); |
| 214 |
cutscene_advance(); |
| 215 |
break; |
| 216 |
case 13: |
| 217 |
fade_out_alpha = audio_sound_get_track_position(cymbal_sound) / audio_sound_length(cymbal_sound); |
| 218 |
if (fade_out_alpha >= 0.99) |
| 219 |
{ |
| 220 |
with (obj_battle_enemy_attack_asgore_soul_capsule) |
| 221 |
instance_destroy(); |
| 222 |
with (obj_barrier_soul_battle) |
| 223 |
instance_destroy(); |
| 224 |
fade_out_alpha = 1; |
| 225 |
scene++; |
| 226 |
} |
| 227 |
break; |
| 228 |
case 14: |
| 229 |
cutscene_wait(2); |
| 230 |
break; |
| 231 |
case 15: |
| 232 |
fade_out_alpha -= 0.03; |
| 233 |
if (fade_out_alpha <= 0) |
| 234 |
cutscene_wait(1.5); |
| 235 |
break; |
| 236 |
case 16: |
| 237 |
room = rm_credits; |
| 238 |
break; |
| 239 |
} |
| 240 |
} |