|
|
|
@ -5,7 +5,7 @@
|
|
|
|
|
* Copyright (C) 2011, Lukas Weber <laochailan@web.de>
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <complex.h>
|
|
|
|
|
#include <assert.h>
|
|
|
|
|
|
|
|
|
|
#include "stage.h"
|
|
|
|
|
#include "tscomplex.h"
|
|
|
|
@ -33,12 +33,12 @@ StageInfo stages[] = {
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
// id loop type title subtitle titleclr bosstitleclr spell difficulty
|
|
|
|
|
{1, stage1_loop, STAGE_STORY, "Stage 1", "Misty Lake", {1, 1, 1}, {1, 1, 1}, NULL, D_Any},
|
|
|
|
|
{2, stage2_loop, STAGE_STORY, "Stage 2", "Walk Along the Border", {1, 1, 1}, {1, 1, 1}, NULL, D_Any},
|
|
|
|
|
{3, stage3_loop, STAGE_STORY, "Stage 3", "Through the Tunnel of Light", {0, 0, 0}, {0, 0, 0}, NULL, D_Any},
|
|
|
|
|
{4, stage4_loop, STAGE_STORY, "Stage 4", "Forgotten Mansion", {0, 0, 0}, {1, 1, 1}, NULL, D_Any},
|
|
|
|
|
{5, stage5_loop, STAGE_STORY, "Stage 5", "Climbing the Tower of Babel", {1, 1, 1}, {1, 1, 1}, NULL, D_Any},
|
|
|
|
|
{6, stage6_loop, STAGE_STORY, "Stage 6", "Roof of the World", {1, 1, 1}, {1, 1, 1}, NULL, D_Any},
|
|
|
|
|
{1, &stage1_procs, STAGE_STORY, "Stage 1", "Misty Lake", {1, 1, 1}, {1, 1, 1}, NULL, D_Any},
|
|
|
|
|
{2, &stage2_procs, STAGE_STORY, "Stage 2", "Walk Along the Border", {1, 1, 1}, {1, 1, 1}, NULL, D_Any},
|
|
|
|
|
{3, &stage3_procs, STAGE_STORY, "Stage 3", "Through the Tunnel of Light", {0, 0, 0}, {0, 0, 0}, NULL, D_Any},
|
|
|
|
|
{4, &stage4_procs, STAGE_STORY, "Stage 4", "Forgotten Mansion", {0, 0, 0}, {1, 1, 1}, NULL, D_Any},
|
|
|
|
|
{5, &stage5_procs, STAGE_STORY, "Stage 5", "Climbing the Tower of Babel", {1, 1, 1}, {1, 1, 1}, NULL, D_Any},
|
|
|
|
|
{6, &stage6_procs, STAGE_STORY, "Stage 6", "Roof of the World", {1, 1, 1}, {1, 1, 1}, NULL, D_Any},
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// Spell practice stages
|
|
|
|
@ -48,160 +48,160 @@ StageInfo stages[] = {
|
|
|
|
|
|
|
|
|
|
#define S STAGE_SPELL_BIT
|
|
|
|
|
// Freeze Sign ~ Perfect Freeze
|
|
|
|
|
{S| 0, stage1_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage1_spells+0, D_Easy},
|
|
|
|
|
{S| 1, stage1_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage1_spells+0, D_Normal},
|
|
|
|
|
{S| 2, stage1_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage1_spells+0, D_Hard},
|
|
|
|
|
{S| 3, stage1_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage1_spells+0, D_Lunatic},
|
|
|
|
|
{S| 0, &stage1_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage1_spells+0, D_Easy},
|
|
|
|
|
{S| 1, &stage1_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage1_spells+0, D_Normal},
|
|
|
|
|
{S| 2, &stage1_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage1_spells+0, D_Hard},
|
|
|
|
|
{S| 3, &stage1_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage1_spells+0, D_Lunatic},
|
|
|
|
|
|
|
|
|
|
// Freeze Sign ~ Crystal Rain
|
|
|
|
|
{S| 4, stage1_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage1_spells+1, D_Easy},
|
|
|
|
|
{S| 5, stage1_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage1_spells+1, D_Normal},
|
|
|
|
|
{S| 6, stage1_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage1_spells+1, D_Hard},
|
|
|
|
|
{S| 7, stage1_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage1_spells+1, D_Lunatic},
|
|
|
|
|
{S| 4, &stage1_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage1_spells+1, D_Easy},
|
|
|
|
|
{S| 5, &stage1_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage1_spells+1, D_Normal},
|
|
|
|
|
{S| 6, &stage1_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage1_spells+1, D_Hard},
|
|
|
|
|
{S| 7, &stage1_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage1_spells+1, D_Lunatic},
|
|
|
|
|
|
|
|
|
|
// Doom Sign ~ Icicle Fall
|
|
|
|
|
{S| 8, stage1_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage1_spells+2, D_Easy},
|
|
|
|
|
{S| 9, stage1_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage1_spells+2, D_Normal},
|
|
|
|
|
{S| 10, stage1_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage1_spells+2, D_Hard},
|
|
|
|
|
{S| 11, stage1_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage1_spells+2, D_Lunatic},
|
|
|
|
|
{S| 8, &stage1_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage1_spells+2, D_Easy},
|
|
|
|
|
{S| 9, &stage1_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage1_spells+2, D_Normal},
|
|
|
|
|
{S| 10, &stage1_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage1_spells+2, D_Hard},
|
|
|
|
|
{S| 11, &stage1_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage1_spells+2, D_Lunatic},
|
|
|
|
|
|
|
|
|
|
// Shard ~ Amulet of Harm
|
|
|
|
|
{S| 12, stage2_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage2_spells+0, D_Easy},
|
|
|
|
|
{S| 13, stage2_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage2_spells+0, D_Normal},
|
|
|
|
|
{S| 14, stage2_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage2_spells+0, D_Hard},
|
|
|
|
|
{S| 15, stage2_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage2_spells+0, D_Lunatic},
|
|
|
|
|
{S| 12, &stage2_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage2_spells+0, D_Easy},
|
|
|
|
|
{S| 13, &stage2_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage2_spells+0, D_Normal},
|
|
|
|
|
{S| 14, &stage2_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage2_spells+0, D_Hard},
|
|
|
|
|
{S| 15, &stage2_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage2_spells+0, D_Lunatic},
|
|
|
|
|
|
|
|
|
|
// Lottery Sign ~ Bad Pick
|
|
|
|
|
{S| 16, stage2_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage2_spells+1, D_Easy},
|
|
|
|
|
{S| 17, stage2_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage2_spells+1, D_Normal},
|
|
|
|
|
{S| 18, stage2_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage2_spells+1, D_Hard},
|
|
|
|
|
{S| 19, stage2_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage2_spells+1, D_Lunatic},
|
|
|
|
|
{S| 16, &stage2_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage2_spells+1, D_Easy},
|
|
|
|
|
{S| 17, &stage2_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage2_spells+1, D_Normal},
|
|
|
|
|
{S| 18, &stage2_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage2_spells+1, D_Hard},
|
|
|
|
|
{S| 19, &stage2_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage2_spells+1, D_Lunatic},
|
|
|
|
|
|
|
|
|
|
// Lottery Sign ~ Wheel of Fortune
|
|
|
|
|
{S| 20, stage2_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage2_spells+2, D_Easy},
|
|
|
|
|
{S| 21, stage2_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage2_spells+2, D_Normal},
|
|
|
|
|
{S| 22, stage2_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage2_spells+2, D_Hard},
|
|
|
|
|
{S| 23, stage2_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage2_spells+2, D_Lunatic},
|
|
|
|
|
{S| 20, &stage2_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage2_spells+2, D_Easy},
|
|
|
|
|
{S| 21, &stage2_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage2_spells+2, D_Normal},
|
|
|
|
|
{S| 22, &stage2_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage2_spells+2, D_Hard},
|
|
|
|
|
{S| 23, &stage2_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage2_spells+2, D_Lunatic},
|
|
|
|
|
|
|
|
|
|
// Venom Sign ~ Deadly Dance
|
|
|
|
|
{S| 24, stage3_spellpractice_loop, STAGE_SPELL, NULL, NULL, {0, 0, 0}, {0, 0, 0}, stage3_spells+0, D_Easy},
|
|
|
|
|
{S| 25, stage3_spellpractice_loop, STAGE_SPELL, NULL, NULL, {0, 0, 0}, {0, 0, 0}, stage3_spells+0, D_Normal},
|
|
|
|
|
{S| 26, stage3_spellpractice_loop, STAGE_SPELL, NULL, NULL, {0, 0, 0}, {0, 0, 0}, stage3_spells+0, D_Hard},
|
|
|
|
|
{S| 27, stage3_spellpractice_loop, STAGE_SPELL, NULL, NULL, {0, 0, 0}, {0, 0, 0}, stage3_spells+0, D_Lunatic},
|
|
|
|
|
{S| 24, &stage3_spell_procs, STAGE_SPELL, NULL, NULL, {0, 0, 0}, {0, 0, 0}, stage3_spells+0, D_Easy},
|
|
|
|
|
{S| 25, &stage3_spell_procs, STAGE_SPELL, NULL, NULL, {0, 0, 0}, {0, 0, 0}, stage3_spells+0, D_Normal},
|
|
|
|
|
{S| 26, &stage3_spell_procs, STAGE_SPELL, NULL, NULL, {0, 0, 0}, {0, 0, 0}, stage3_spells+0, D_Hard},
|
|
|
|
|
{S| 27, &stage3_spell_procs, STAGE_SPELL, NULL, NULL, {0, 0, 0}, {0, 0, 0}, stage3_spells+0, D_Lunatic},
|
|
|
|
|
|
|
|
|
|
// Venom Sign ~ Acid Rain
|
|
|
|
|
{S| 28, stage3_spellpractice_loop, STAGE_SPELL, NULL, NULL, {0, 0, 0}, {0, 0, 0}, stage3_spells+1, D_Hard},
|
|
|
|
|
{S| 29, stage3_spellpractice_loop, STAGE_SPELL, NULL, NULL, {0, 0, 0}, {0, 0, 0}, stage3_spells+1, D_Lunatic},
|
|
|
|
|
{S| 28, &stage3_spell_procs, STAGE_SPELL, NULL, NULL, {0, 0, 0}, {0, 0, 0}, stage3_spells+1, D_Hard},
|
|
|
|
|
{S| 29, &stage3_spell_procs, STAGE_SPELL, NULL, NULL, {0, 0, 0}, {0, 0, 0}, stage3_spells+1, D_Lunatic},
|
|
|
|
|
|
|
|
|
|
// Firefly Sign ~ Moonlight Rocket
|
|
|
|
|
{S| 30, stage3_spellpractice_loop, STAGE_SPELL, NULL, NULL, {0, 0, 0}, {0, 0, 0}, stage3_spells+2, D_Easy},
|
|
|
|
|
{S| 31, stage3_spellpractice_loop, STAGE_SPELL, NULL, NULL, {0, 0, 0}, {0, 0, 0}, stage3_spells+2, D_Normal},
|
|
|
|
|
{S| 32, stage3_spellpractice_loop, STAGE_SPELL, NULL, NULL, {0, 0, 0}, {0, 0, 0}, stage3_spells+2, D_Hard},
|
|
|
|
|
{S| 33, stage3_spellpractice_loop, STAGE_SPELL, NULL, NULL, {0, 0, 0}, {0, 0, 0}, stage3_spells+2, D_Lunatic},
|
|
|
|
|
{S| 30, &stage3_spell_procs, STAGE_SPELL, NULL, NULL, {0, 0, 0}, {0, 0, 0}, stage3_spells+2, D_Easy},
|
|
|
|
|
{S| 31, &stage3_spell_procs, STAGE_SPELL, NULL, NULL, {0, 0, 0}, {0, 0, 0}, stage3_spells+2, D_Normal},
|
|
|
|
|
{S| 32, &stage3_spell_procs, STAGE_SPELL, NULL, NULL, {0, 0, 0}, {0, 0, 0}, stage3_spells+2, D_Hard},
|
|
|
|
|
{S| 33, &stage3_spell_procs, STAGE_SPELL, NULL, NULL, {0, 0, 0}, {0, 0, 0}, stage3_spells+2, D_Lunatic},
|
|
|
|
|
|
|
|
|
|
// Light Source ~ Wriggle Night Ignite
|
|
|
|
|
{S| 34, stage3_spellpractice_loop, STAGE_SPELL, NULL, NULL, {0, 0, 0}, {0, 0, 0}, stage3_spells+3, D_Easy},
|
|
|
|
|
{S| 35, stage3_spellpractice_loop, STAGE_SPELL, NULL, NULL, {0, 0, 0}, {0, 0, 0}, stage3_spells+3, D_Normal},
|
|
|
|
|
{S| 36, stage3_spellpractice_loop, STAGE_SPELL, NULL, NULL, {0, 0, 0}, {0, 0, 0}, stage3_spells+3, D_Hard},
|
|
|
|
|
{S| 37, stage3_spellpractice_loop, STAGE_SPELL, NULL, NULL, {0, 0, 0}, {0, 0, 0}, stage3_spells+3, D_Lunatic},
|
|
|
|
|
{S| 34, &stage3_spell_procs, STAGE_SPELL, NULL, NULL, {0, 0, 0}, {0, 0, 0}, stage3_spells+3, D_Easy},
|
|
|
|
|
{S| 35, &stage3_spell_procs, STAGE_SPELL, NULL, NULL, {0, 0, 0}, {0, 0, 0}, stage3_spells+3, D_Normal},
|
|
|
|
|
{S| 36, &stage3_spell_procs, STAGE_SPELL, NULL, NULL, {0, 0, 0}, {0, 0, 0}, stage3_spells+3, D_Hard},
|
|
|
|
|
{S| 37, &stage3_spell_procs, STAGE_SPELL, NULL, NULL, {0, 0, 0}, {0, 0, 0}, stage3_spells+3, D_Lunatic},
|
|
|
|
|
|
|
|
|
|
// Bug Sign ~ Phosphaenus Hemipterus
|
|
|
|
|
{S| 38, stage3_spellpractice_loop, STAGE_SPELL, NULL, NULL, {0, 0, 0}, {0, 0, 0}, stage3_spells+4, D_Easy},
|
|
|
|
|
{S| 39, stage3_spellpractice_loop, STAGE_SPELL, NULL, NULL, {0, 0, 0}, {0, 0, 0}, stage3_spells+4, D_Normal},
|
|
|
|
|
{S| 40, stage3_spellpractice_loop, STAGE_SPELL, NULL, NULL, {0, 0, 0}, {0, 0, 0}, stage3_spells+4, D_Hard},
|
|
|
|
|
{S| 41, stage3_spellpractice_loop, STAGE_SPELL, NULL, NULL, {0, 0, 0}, {0, 0, 0}, stage3_spells+4, D_Lunatic},
|
|
|
|
|
{S| 38, &stage3_spell_procs, STAGE_SPELL, NULL, NULL, {0, 0, 0}, {0, 0, 0}, stage3_spells+4, D_Easy},
|
|
|
|
|
{S| 39, &stage3_spell_procs, STAGE_SPELL, NULL, NULL, {0, 0, 0}, {0, 0, 0}, stage3_spells+4, D_Normal},
|
|
|
|
|
{S| 40, &stage3_spell_procs, STAGE_SPELL, NULL, NULL, {0, 0, 0}, {0, 0, 0}, stage3_spells+4, D_Hard},
|
|
|
|
|
{S| 41, &stage3_spell_procs, STAGE_SPELL, NULL, NULL, {0, 0, 0}, {0, 0, 0}, stage3_spells+4, D_Lunatic},
|
|
|
|
|
|
|
|
|
|
// Bloodless ~ Gate of Walachia
|
|
|
|
|
{S| 42, stage4_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage4_spells+0, D_Easy},
|
|
|
|
|
{S| 43, stage4_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage4_spells+0, D_Normal},
|
|
|
|
|
{S| 44, stage4_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage4_spells+0, D_Hard},
|
|
|
|
|
{S| 45, stage4_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage4_spells+0, D_Lunatic},
|
|
|
|
|
{S| 42, &stage4_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage4_spells+0, D_Easy},
|
|
|
|
|
{S| 43, &stage4_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage4_spells+0, D_Normal},
|
|
|
|
|
{S| 44, &stage4_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage4_spells+0, D_Hard},
|
|
|
|
|
{S| 45, &stage4_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage4_spells+0, D_Lunatic},
|
|
|
|
|
|
|
|
|
|
// Bloodless ~ Dry Fountain
|
|
|
|
|
{S| 46, stage4_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage4_spells+1, D_Easy},
|
|
|
|
|
{S| 47, stage4_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage4_spells+1, D_Normal},
|
|
|
|
|
{S| 46, &stage4_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage4_spells+1, D_Easy},
|
|
|
|
|
{S| 47, &stage4_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage4_spells+1, D_Normal},
|
|
|
|
|
|
|
|
|
|
// Bloodless ~ Red Spike
|
|
|
|
|
{S| 48, stage4_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage4_spells+2, D_Hard},
|
|
|
|
|
{S| 49, stage4_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage4_spells+2, D_Lunatic},
|
|
|
|
|
{S| 48, &stage4_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage4_spells+2, D_Hard},
|
|
|
|
|
{S| 49, &stage4_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage4_spells+2, D_Lunatic},
|
|
|
|
|
|
|
|
|
|
// Limit ~ Animate Wall
|
|
|
|
|
{S| 50, stage4_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage4_spells+3, D_Easy},
|
|
|
|
|
{S| 51, stage4_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage4_spells+3, D_Normal},
|
|
|
|
|
{S| 50, &stage4_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage4_spells+3, D_Easy},
|
|
|
|
|
{S| 51, &stage4_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage4_spells+3, D_Normal},
|
|
|
|
|
|
|
|
|
|
// Summoning ~ Demon Wall
|
|
|
|
|
{S| 52, stage4_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage4_spells+4, D_Hard},
|
|
|
|
|
{S| 53, stage4_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage4_spells+4, D_Lunatic},
|
|
|
|
|
{S| 52, &stage4_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage4_spells+4, D_Hard},
|
|
|
|
|
{S| 53, &stage4_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage4_spells+4, D_Lunatic},
|
|
|
|
|
|
|
|
|
|
// Power Sign ~ Blow the Walls
|
|
|
|
|
{S| 54, stage4_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage4_spells+5, D_Easy},
|
|
|
|
|
{S| 55, stage4_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage4_spells+5, D_Normal},
|
|
|
|
|
{S| 56, stage4_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage4_spells+5, D_Hard},
|
|
|
|
|
{S| 57, stage4_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage4_spells+5, D_Lunatic},
|
|
|
|
|
{S| 54, &stage4_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage4_spells+5, D_Easy},
|
|
|
|
|
{S| 55, &stage4_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage4_spells+5, D_Normal},
|
|
|
|
|
{S| 56, &stage4_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage4_spells+5, D_Hard},
|
|
|
|
|
{S| 57, &stage4_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage4_spells+5, D_Lunatic},
|
|
|
|
|
|
|
|
|
|
// Fear Sign ~ Bloody Danmaku
|
|
|
|
|
{S| 58, stage4_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage4_spells+6, D_Hard},
|
|
|
|
|
{S| 59, stage4_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage4_spells+6, D_Lunatic},
|
|
|
|
|
{S| 58, &stage4_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage4_spells+6, D_Hard},
|
|
|
|
|
{S| 59, &stage4_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage4_spells+6, D_Lunatic},
|
|
|
|
|
|
|
|
|
|
// High Voltage ~ Atmospheric Discharge
|
|
|
|
|
{S| 60, stage5_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage5_spells+0, D_Easy},
|
|
|
|
|
{S| 61, stage5_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage5_spells+0, D_Normal},
|
|
|
|
|
{S| 62, stage5_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage5_spells+0, D_Hard},
|
|
|
|
|
{S| 63, stage5_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage5_spells+0, D_Lunatic},
|
|
|
|
|
{S| 60, &stage5_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage5_spells+0, D_Easy},
|
|
|
|
|
{S| 61, &stage5_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage5_spells+0, D_Normal},
|
|
|
|
|
{S| 62, &stage5_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage5_spells+0, D_Hard},
|
|
|
|
|
{S| 63, &stage5_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage5_spells+0, D_Lunatic},
|
|
|
|
|
|
|
|
|
|
// Charge Sign ~ Artificial Lightning
|
|
|
|
|
{S| 64, stage5_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage5_spells+1, D_Easy},
|
|
|
|
|
{S| 65, stage5_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage5_spells+1, D_Normal},
|
|
|
|
|
{S| 66, stage5_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage5_spells+1, D_Hard},
|
|
|
|
|
{S| 67, stage5_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage5_spells+1, D_Lunatic},
|
|
|
|
|
{S| 64, &stage5_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage5_spells+1, D_Easy},
|
|
|
|
|
{S| 65, &stage5_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage5_spells+1, D_Normal},
|
|
|
|
|
{S| 66, &stage5_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage5_spells+1, D_Hard},
|
|
|
|
|
{S| 67, &stage5_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage5_spells+1, D_Lunatic},
|
|
|
|
|
|
|
|
|
|
// Spark Sign ~ Natural Cathode
|
|
|
|
|
{S| 68, stage5_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage5_spells+2, D_Easy},
|
|
|
|
|
{S| 69, stage5_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage5_spells+2, D_Normal},
|
|
|
|
|
{S| 70, stage5_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage5_spells+2, D_Hard},
|
|
|
|
|
{S| 71, stage5_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage5_spells+2, D_Lunatic},
|
|
|
|
|
{S| 68, &stage5_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage5_spells+2, D_Easy},
|
|
|
|
|
{S| 69, &stage5_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage5_spells+2, D_Normal},
|
|
|
|
|
{S| 70, &stage5_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage5_spells+2, D_Hard},
|
|
|
|
|
{S| 71, &stage5_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage5_spells+2, D_Lunatic},
|
|
|
|
|
|
|
|
|
|
// Current Sign ~ Induction
|
|
|
|
|
{S| 72, stage5_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage5_spells+3, D_Easy},
|
|
|
|
|
{S| 73, stage5_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage5_spells+3, D_Normal},
|
|
|
|
|
{S| 74, stage5_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage5_spells+3, D_Hard},
|
|
|
|
|
{S| 75, stage5_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage5_spells+3, D_Lunatic},
|
|
|
|
|
{S| 72, &stage5_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage5_spells+3, D_Easy},
|
|
|
|
|
{S| 73, &stage5_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage5_spells+3, D_Normal},
|
|
|
|
|
{S| 74, &stage5_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage5_spells+3, D_Hard},
|
|
|
|
|
{S| 75, &stage5_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage5_spells+3, D_Lunatic},
|
|
|
|
|
|
|
|
|
|
// Newton Sign ~ 2.5 Laws of Movement
|
|
|
|
|
{S| 76, stage6_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage6_spells+0, D_Easy},
|
|
|
|
|
{S| 77, stage6_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage6_spells+0, D_Normal},
|
|
|
|
|
{S| 78, stage6_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage6_spells+0, D_Hard},
|
|
|
|
|
{S| 79, stage6_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage6_spells+0, D_Lunatic},
|
|
|
|
|
{S| 76, &stage6_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage6_spells+0, D_Easy},
|
|
|
|
|
{S| 77, &stage6_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage6_spells+0, D_Normal},
|
|
|
|
|
{S| 78, &stage6_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage6_spells+0, D_Hard},
|
|
|
|
|
{S| 79, &stage6_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage6_spells+0, D_Lunatic},
|
|
|
|
|
|
|
|
|
|
// Maxwell Sign ~ Wave Theory
|
|
|
|
|
{S| 80, stage6_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage6_spells+1, D_Easy},
|
|
|
|
|
{S| 81, stage6_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage6_spells+1, D_Normal},
|
|
|
|
|
{S| 82, stage6_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage6_spells+1, D_Hard},
|
|
|
|
|
{S| 83, stage6_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage6_spells+1, D_Lunatic},
|
|
|
|
|
{S| 80, &stage6_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage6_spells+1, D_Easy},
|
|
|
|
|
{S| 81, &stage6_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage6_spells+1, D_Normal},
|
|
|
|
|
{S| 82, &stage6_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage6_spells+1, D_Hard},
|
|
|
|
|
{S| 83, &stage6_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage6_spells+1, D_Lunatic},
|
|
|
|
|
|
|
|
|
|
// Eigenstate ~ Many-World Interpretation
|
|
|
|
|
{S| 84, stage6_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage6_spells+2, D_Easy},
|
|
|
|
|
{S| 85, stage6_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage6_spells+2, D_Normal},
|
|
|
|
|
{S| 86, stage6_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage6_spells+2, D_Hard},
|
|
|
|
|
{S| 87, stage6_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage6_spells+2, D_Lunatic},
|
|
|
|
|
{S| 84, &stage6_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage6_spells+2, D_Easy},
|
|
|
|
|
{S| 85, &stage6_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage6_spells+2, D_Normal},
|
|
|
|
|
{S| 86, &stage6_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage6_spells+2, D_Hard},
|
|
|
|
|
{S| 87, &stage6_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage6_spells+2, D_Lunatic},
|
|
|
|
|
|
|
|
|
|
// Ricci Sign ~ Space Time Curvature
|
|
|
|
|
{S| 88, stage6_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage6_spells+3, D_Easy},
|
|
|
|
|
{S| 89, stage6_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage6_spells+3, D_Normal},
|
|
|
|
|
{S| 90, stage6_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage6_spells+3, D_Hard},
|
|
|
|
|
{S| 91, stage6_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage6_spells+3, D_Lunatic},
|
|
|
|
|
{S| 88, &stage6_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage6_spells+3, D_Easy},
|
|
|
|
|
{S| 89, &stage6_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage6_spells+3, D_Normal},
|
|
|
|
|
{S| 90, &stage6_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage6_spells+3, D_Hard},
|
|
|
|
|
{S| 91, &stage6_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage6_spells+3, D_Lunatic},
|
|
|
|
|
|
|
|
|
|
// LHC ~ Higgs Boson Uncovered
|
|
|
|
|
{S| 92, stage6_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage6_spells+4, D_Easy},
|
|
|
|
|
{S| 93, stage6_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage6_spells+4, D_Normal},
|
|
|
|
|
{S| 94, stage6_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage6_spells+4, D_Hard},
|
|
|
|
|
{S| 95, stage6_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage6_spells+4, D_Lunatic},
|
|
|
|
|
{S| 92, &stage6_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage6_spells+4, D_Easy},
|
|
|
|
|
{S| 93, &stage6_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage6_spells+4, D_Normal},
|
|
|
|
|
{S| 94, &stage6_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage6_spells+4, D_Hard},
|
|
|
|
|
{S| 95, &stage6_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage6_spells+4, D_Lunatic},
|
|
|
|
|
|
|
|
|
|
// Tower of Truth ~ Theory of Everything
|
|
|
|
|
{S| 96, stage6_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage6_spells+5, D_Easy},
|
|
|
|
|
{S| 97, stage6_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage6_spells+5, D_Normal},
|
|
|
|
|
{S| 98, stage6_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage6_spells+5, D_Hard},
|
|
|
|
|
{S| 99, stage6_spellpractice_loop, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage6_spells+5, D_Lunatic},
|
|
|
|
|
{S| 96, &stage6_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage6_spells+5, D_Easy},
|
|
|
|
|
{S| 97, &stage6_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage6_spells+5, D_Normal},
|
|
|
|
|
{S| 98, &stage6_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage6_spells+5, D_Hard},
|
|
|
|
|
{S| 99, &stage6_spell_procs, STAGE_SPELL, NULL, NULL, {1, 1, 1}, {1, 1, 1}, stage6_spells+5, D_Lunatic},
|
|
|
|
|
#undef S
|
|
|
|
|
|
|
|
|
|
{0}
|
|
|
|
@ -210,7 +210,7 @@ StageInfo stages[] = {
|
|
|
|
|
void stage_init_array(void) {
|
|
|
|
|
int spellnum = 0;
|
|
|
|
|
|
|
|
|
|
for(int i = 0; stages[i].loop; ++i) {
|
|
|
|
|
for(int i = 0; stages[i].procs; ++i) {
|
|
|
|
|
// we will allocate this later on demand
|
|
|
|
|
stages[i].progress = NULL;
|
|
|
|
|
|
|
|
|
@ -231,7 +231,7 @@ void stage_init_array(void) {
|
|
|
|
|
errx(-1, "Spell stage has an ID without the spell bit set: %u", stages[i].id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for(int j = 0; stages[j].loop; ++j) {
|
|
|
|
|
for(int j = 0; stages[j].procs; ++j) {
|
|
|
|
|
if(i != j && stages[i].id == stages[j].id) {
|
|
|
|
|
errx(-1, "Duplicate ID in stages array: %u", stages[i].id);
|
|
|
|
|
}
|
|
|
|
@ -241,7 +241,7 @@ void stage_init_array(void) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void stage_free_array(void) {
|
|
|
|
|
for(StageInfo *stg = stages; stg->loop; ++stg) {
|
|
|
|
|
for(StageInfo *stg = stages; stg->procs; ++stg) {
|
|
|
|
|
if(stg->type == STAGE_SPELL) {
|
|
|
|
|
free(stg->subtitle);
|
|
|
|
|
}
|
|
|
|
@ -252,7 +252,7 @@ void stage_free_array(void) {
|
|
|
|
|
|
|
|
|
|
// NOTE: This returns the stage BY ID, not by the array index!
|
|
|
|
|
StageInfo* stage_get(uint16_t n) {
|
|
|
|
|
for(StageInfo *stg = stages; stg->loop; ++stg)
|
|
|
|
|
for(StageInfo *stg = stages; stg->procs; ++stg)
|
|
|
|
|
if(stg->id == n)
|
|
|
|
|
return stg;
|
|
|
|
|
return NULL;
|
|
|
|
@ -262,7 +262,7 @@ StageInfo* stage_get_by_spellcard(AttackInfo *spell, Difficulty diff) {
|
|
|
|
|
if(!spell)
|
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
|
|
for(StageInfo *stg = stages; stg->loop; ++stg)
|
|
|
|
|
for(StageInfo *stg = stages; stg->procs; ++stg)
|
|
|
|
|
if(stg->spell == spell && stg->difficulty == diff)
|
|
|
|
|
return stg;
|
|
|
|
|
|
|
|
|
@ -306,7 +306,7 @@ StageProgress* stage_get_progress(uint16_t id, Difficulty diff, bool allocate) {
|
|
|
|
|
return stage_get_progress_from_info(stage_get(id), diff, allocate);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void stage_start(void) {
|
|
|
|
|
static void stage_start(StageInfo *stage) {
|
|
|
|
|
global.timer = 0;
|
|
|
|
|
global.frames = 0;
|
|
|
|
|
global.stageuiframes = 0;
|
|
|
|
@ -318,6 +318,11 @@ void stage_start(void) {
|
|
|
|
|
global.fps.fpstime = SDL_GetTicks();
|
|
|
|
|
|
|
|
|
|
prepare_player_for_next_stage(&global.plr);
|
|
|
|
|
|
|
|
|
|
if(stage->type == STAGE_SPELL) {
|
|
|
|
|
global.plr.lifes = 0;
|
|
|
|
|
global.plr.bombs = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void stage_pause(void) {
|
|
|
|
@ -330,11 +335,20 @@ void stage_pause(void) {
|
|
|
|
|
|
|
|
|
|
void stage_gameover(void) {
|
|
|
|
|
MenuData menu;
|
|
|
|
|
save_bgm();
|
|
|
|
|
start_bgm("bgm_gameover");
|
|
|
|
|
create_gameover_menu(&menu);
|
|
|
|
|
|
|
|
|
|
bool interrupt_bgm = (global.stage->type != STAGE_SPELL);
|
|
|
|
|
|
|
|
|
|
if(interrupt_bgm) {
|
|
|
|
|
save_bgm();
|
|
|
|
|
start_bgm("bgm_gameover");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
menu_loop(&menu);
|
|
|
|
|
restore_bgm();
|
|
|
|
|
|
|
|
|
|
if(interrupt_bgm) {
|
|
|
|
|
restore_bgm();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void stage_input_event(EventType type, int key, void *arg) {
|
|
|
|
@ -342,7 +356,7 @@ void stage_input_event(EventType type, int key, void *arg) {
|
|
|
|
|
case E_PlrKeyDown:
|
|
|
|
|
if(key == KEY_HAHAIWIN) {
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
|
global.game_over = GAMEOVER_WIN;
|
|
|
|
|
stage_finish(GAMEOVER_WIN);
|
|
|
|
|
#endif
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
@ -506,12 +520,15 @@ void draw_hud(void) {
|
|
|
|
|
draw_texture(VIEWPORT_X+creal(global.boss->pos), 590, "boss_indicator");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void stage_draw(StageInfo *info, StageRule bgdraw, ShaderRule *shaderrules, int time) {
|
|
|
|
|
static void apply_bg_shaders(ShaderRule *shaderrules);
|
|
|
|
|
static void draw_stage_title(StageInfo *info);
|
|
|
|
|
|
|
|
|
|
static void stage_draw(StageInfo *stage) {
|
|
|
|
|
if(!config_get_int(CONFIG_NO_SHADER)) {
|
|
|
|
|
glBindFramebuffer(GL_FRAMEBUFFER, resources.fbg[0].fbo);
|
|
|
|
|
glViewport(0,0,SCREEN_W,SCREEN_H);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
|
|
|
|
glPushMatrix();
|
|
|
|
|
glTranslatef(-(VIEWPORT_X+VIEWPORT_W/2.0), -(VIEWPORT_Y+VIEWPORT_H/2.0),0);
|
|
|
|
@ -528,7 +545,7 @@ void stage_draw(StageInfo *info, StageRule bgdraw, ShaderRule *shaderrules, int
|
|
|
|
|
global.nostagebg = true;
|
|
|
|
|
|
|
|
|
|
if(!global.nostagebg)
|
|
|
|
|
bgdraw();
|
|
|
|
|
stage->procs->draw();
|
|
|
|
|
|
|
|
|
|
glPopMatrix();
|
|
|
|
|
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
|
|
|
@ -539,7 +556,7 @@ void stage_draw(StageInfo *info, StageRule bgdraw, ShaderRule *shaderrules, int
|
|
|
|
|
glTranslatef(VIEWPORT_X,VIEWPORT_Y,0);
|
|
|
|
|
|
|
|
|
|
if(!config_get_int(CONFIG_NO_SHADER))
|
|
|
|
|
apply_bg_shaders(shaderrules);
|
|
|
|
|
apply_bg_shaders(stage->procs->shader_rules);
|
|
|
|
|
|
|
|
|
|
if(global.boss) {
|
|
|
|
|
glPushMatrix();
|
|
|
|
@ -577,7 +594,7 @@ void stage_draw(StageInfo *info, StageRule bgdraw, ShaderRule *shaderrules, int
|
|
|
|
|
if(global.dialog)
|
|
|
|
|
draw_dialog(global.dialog);
|
|
|
|
|
|
|
|
|
|
draw_stage_title(info);
|
|
|
|
|
draw_stage_title(stage);
|
|
|
|
|
|
|
|
|
|
if(!config_get_int(CONFIG_NO_SHADER)) {
|
|
|
|
|
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
|
|
|
@ -594,17 +611,13 @@ void stage_draw(StageInfo *info, StageRule bgdraw, ShaderRule *shaderrules, int
|
|
|
|
|
glPopMatrix();
|
|
|
|
|
|
|
|
|
|
draw_hud();
|
|
|
|
|
draw_transition();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int apply_shaderrules(ShaderRule *shaderrules, int fbonum) {
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
static int apply_shaderrules(ShaderRule *shaderrules, int fbonum) {
|
|
|
|
|
if(!global.nostagebg) {
|
|
|
|
|
for(i = 0; shaderrules != NULL && shaderrules[i] != NULL; i++) {
|
|
|
|
|
for(ShaderRule *rule = shaderrules; *rule; ++rule) {
|
|
|
|
|
glBindFramebuffer(GL_FRAMEBUFFER, resources.fbg[!fbonum].fbo);
|
|
|
|
|
shaderrules[i](fbonum);
|
|
|
|
|
|
|
|
|
|
(*rule)(fbonum);
|
|
|
|
|
fbonum = !fbonum;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -612,7 +625,7 @@ int apply_shaderrules(ShaderRule *shaderrules, int fbonum) {
|
|
|
|
|
return fbonum;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void apply_bg_shaders(ShaderRule *shaderrules) {
|
|
|
|
|
static void apply_bg_shaders(ShaderRule *shaderrules) {
|
|
|
|
|
int fbonum = 0;
|
|
|
|
|
|
|
|
|
|
if(global.boss && global.boss->current && global.boss->current->draw_rule) {
|
|
|
|
@ -682,7 +695,7 @@ void apply_bg_shaders(ShaderRule *shaderrules) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void stage_logic(int time) {
|
|
|
|
|
static void stage_logic(void) {
|
|
|
|
|
player_logic(&global.plr);
|
|
|
|
|
|
|
|
|
|
process_enemies(&global.enemies);
|
|
|
|
@ -706,18 +719,11 @@ void stage_logic(int time) {
|
|
|
|
|
if(!global.dialog && !global.boss)
|
|
|
|
|
global.timer++;
|
|
|
|
|
|
|
|
|
|
if(global.timer == time - FADE_TIME ||
|
|
|
|
|
(
|
|
|
|
|
global.replaymode == REPLAY_PLAY &&
|
|
|
|
|
global.frames == global.replay_stage->events[global.replay_stage->numevents-1].frame - FADE_TIME
|
|
|
|
|
)
|
|
|
|
|
) {
|
|
|
|
|
set_transition(TransFadeBlack, FADE_TIME, FADE_TIME*2);
|
|
|
|
|
if(global.frames == global.replay_stage->events[global.replay_stage->numevents-1].frame - FADE_TIME &&
|
|
|
|
|
global.game_over != GAMEOVER_TRANSITIONING) {
|
|
|
|
|
stage_finish(GAMEOVER_DEFEAT);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(time && global.timer >= time)
|
|
|
|
|
global.game_over = GAMEOVER_WIN;
|
|
|
|
|
|
|
|
|
|
// BGM handling
|
|
|
|
|
if(global.dialog && global.dialog->messages[global.dialog->pos].side == BGM) {
|
|
|
|
|
start_bgm(global.dialog->messages[global.dialog->pos].msg);
|
|
|
|
@ -725,7 +731,7 @@ void stage_logic(int time) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void stage_end(void) {
|
|
|
|
|
static void stage_free(void) {
|
|
|
|
|
delete_enemies(&global.enemies);
|
|
|
|
|
delete_items();
|
|
|
|
|
delete_lasers();
|
|
|
|
@ -744,7 +750,25 @@ void stage_end(void) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void stage_loop(StageRule start, StageRule end, StageRule draw, StageRule event, ShaderRule *shaderrules, int endtime, char *bgmname) {
|
|
|
|
|
static void stage_finalize(void *arg) {
|
|
|
|
|
global.game_over = (intptr_t)arg;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void stage_finish(int gameover) {
|
|
|
|
|
assert(global.game_over != GAMEOVER_TRANSITIONING);
|
|
|
|
|
global.game_over = GAMEOVER_TRANSITIONING;
|
|
|
|
|
set_transition_callback(TransFadeBlack, FADE_TIME, FADE_TIME*2, stage_finalize, (void*)(intptr_t)gameover);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void stage_loop(StageInfo *stage) {
|
|
|
|
|
assert(stage);
|
|
|
|
|
assert(stage->procs);
|
|
|
|
|
assert(stage->procs->begin);
|
|
|
|
|
assert(stage->procs->end);
|
|
|
|
|
assert(stage->procs->draw);
|
|
|
|
|
assert(stage->procs->event);
|
|
|
|
|
assert(stage->procs->shader_rules);
|
|
|
|
|
|
|
|
|
|
if(global.game_over == GAMEOVER_WIN) {
|
|
|
|
|
global.game_over = 0;
|
|
|
|
|
} else if(global.game_over) {
|
|
|
|
@ -752,16 +776,16 @@ void stage_loop(StageRule start, StageRule end, StageRule draw, StageRule event,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// I really want to separate all of the game state from the global struct sometime
|
|
|
|
|
StageInfo *info = global.stage;
|
|
|
|
|
global.stage = stage;
|
|
|
|
|
|
|
|
|
|
uint32_t seed = (uint32_t)time(0);
|
|
|
|
|
tsrand_switch(&global.rand_game);
|
|
|
|
|
tsrand_seed_p(&global.rand_game, seed);
|
|
|
|
|
stage_start();
|
|
|
|
|
stage_start(stage);
|
|
|
|
|
|
|
|
|
|
if(global.replaymode == REPLAY_RECORD) {
|
|
|
|
|
if(config_get_int(CONFIG_SAVE_RPY)) {
|
|
|
|
|
global.replay_stage = replay_create_stage(&global.replay, info, seed, global.diff, global.plr.points, &global.plr);
|
|
|
|
|
global.replay_stage = replay_create_stage(&global.replay, stage, seed, global.diff, global.plr.points, &global.plr);
|
|
|
|
|
|
|
|
|
|
// make sure our player state is consistent with what goes into the replay
|
|
|
|
|
init_player(&global.plr);
|
|
|
|
@ -771,11 +795,6 @@ void stage_loop(StageRule start, StageRule end, StageRule draw, StageRule event,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
printf("Random seed: %u\n", seed);
|
|
|
|
|
|
|
|
|
|
if(info->type == STAGE_SPELL) {
|
|
|
|
|
global.plr.lifes = 0;
|
|
|
|
|
global.plr.bombs = 0;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if(!global.replay_stage) {
|
|
|
|
|
errx(-1, "Attemped to replay a NULL stage");
|
|
|
|
@ -806,27 +825,35 @@ void stage_loop(StageRule start, StageRule end, StageRule draw, StageRule event,
|
|
|
|
|
|
|
|
|
|
player_set_power(&global.plr, power);
|
|
|
|
|
|
|
|
|
|
start();
|
|
|
|
|
start_bgm(bgmname);
|
|
|
|
|
stage->procs->begin();
|
|
|
|
|
|
|
|
|
|
if(info->type == STAGE_SPELL) {
|
|
|
|
|
endtime = 0;
|
|
|
|
|
}
|
|
|
|
|
int transition_delay = 0;
|
|
|
|
|
|
|
|
|
|
while(global.game_over <= 0) {
|
|
|
|
|
if(!global.boss && !global.dialog)
|
|
|
|
|
event();
|
|
|
|
|
if(global.game_over != GAMEOVER_TRANSITIONING) {
|
|
|
|
|
if(!global.boss && !global.dialog) {
|
|
|
|
|
stage->procs->event();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(!endtime && info->type == STAGE_SPELL && !global.boss) {
|
|
|
|
|
endtime = global.timer + 60;
|
|
|
|
|
if(stage->type == STAGE_SPELL && !global.boss) {
|
|
|
|
|
stage_finish(GAMEOVER_WIN);
|
|
|
|
|
transition_delay = 60;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
((global.replaymode == REPLAY_PLAY) ? replay_input : stage_input)();
|
|
|
|
|
replay_stage_check_desync(global.replay_stage, global.frames, (tsrand() ^ global.plr.points) & 0xFFFF, global.replaymode);
|
|
|
|
|
|
|
|
|
|
stage_logic(endtime);
|
|
|
|
|
stage_logic();
|
|
|
|
|
|
|
|
|
|
if(transition_delay) {
|
|
|
|
|
--transition_delay;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(global.frameskip && global.frames % global.frameskip) {
|
|
|
|
|
if(!transition_delay) {
|
|
|
|
|
update_transition();
|
|
|
|
|
}
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -834,11 +861,14 @@ void stage_loop(StageRule start, StageRule end, StageRule draw, StageRule event,
|
|
|
|
|
|
|
|
|
|
tsrand_lock(&global.rand_game);
|
|
|
|
|
tsrand_switch(&global.rand_visual);
|
|
|
|
|
stage_draw(info, draw, shaderrules, endtime);
|
|
|
|
|
stage_draw(stage);
|
|
|
|
|
tsrand_unlock(&global.rand_game);
|
|
|
|
|
tsrand_switch(&global.rand_game);
|
|
|
|
|
|
|
|
|
|
// print_state_checksum();
|
|
|
|
|
draw_transition();
|
|
|
|
|
if(!transition_delay) {
|
|
|
|
|
update_transition();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SDL_GL_SwapWindow(video.window);
|
|
|
|
|
|
|
|
|
@ -853,13 +883,12 @@ void stage_loop(StageRule start, StageRule end, StageRule draw, StageRule event,
|
|
|
|
|
replay_stage_event(global.replay_stage, global.frames, EV_OVER, 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
end();
|
|
|
|
|
stage_end();
|
|
|
|
|
stage->procs->end();
|
|
|
|
|
stage_free();
|
|
|
|
|
tsrand_switch(&global.rand_visual);
|
|
|
|
|
global.stage = NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void draw_title(int t, StageInfo *info, Alignment al, int x, int y, const char *text, TTF_Font *font, Color *color) {
|
|
|
|
|
static void draw_title(int t, StageInfo *info, Alignment al, int x, int y, const char *text, TTF_Font *font, Color *color) {
|
|
|
|
|
int i;
|
|
|
|
|
float f = 0;
|
|
|
|
|
if(t < 30 || t > 220)
|
|
|
|
@ -890,7 +919,7 @@ void draw_title(int t, StageInfo *info, Alignment al, int x, int y, const char *
|
|
|
|
|
glUseProgram(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void draw_stage_title(StageInfo *info) {
|
|
|
|
|
static void draw_stage_title(StageInfo *info) {
|
|
|
|
|
int t = global.stageuiframes;
|
|
|
|
|
|
|
|
|
|
draw_title(t, info, AL_Center, VIEWPORT_W/2, VIEWPORT_H/2-40, info->title, _fonts.mainmenu, &info->titleclr);
|
|
|
|
|