2021-05-17 18:47:39 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
|
|
|
*
|
2021-12-26 17:47:58 +00:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
2021-05-17 18:47:39 +00:00
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* aint32 with this program; if not, write to the Free Software
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Based on the original sources
|
|
|
|
* Faery Tale II -- The Halls of the Dead
|
|
|
|
* (c) 1993-1996 The Wyrmkeep Entertainment Co.
|
|
|
|
*/
|
|
|
|
|
2021-06-23 12:41:01 +00:00
|
|
|
#include "saga2/saga2.h"
|
2021-05-31 22:55:54 +00:00
|
|
|
#include "saga2/spelshow.h"
|
|
|
|
|
2021-05-17 18:47:39 +00:00
|
|
|
namespace Saga2 {
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
// Spell Status functions
|
|
|
|
// These routines are checked each display cycle to see if a given
|
|
|
|
// effectron should still be shown
|
|
|
|
// Return values
|
|
|
|
// 0 : show normally
|
2022-10-29 12:29:02 +00:00
|
|
|
// kEffectronHidden: hide but don't remove effectron
|
|
|
|
// kEffectronDead : permanently hide effectron. when all
|
2021-05-17 18:47:39 +00:00
|
|
|
// effectrons have this status the effect ends
|
|
|
|
//
|
|
|
|
|
|
|
|
/* ===================================================================== *
|
|
|
|
Effect specific code
|
|
|
|
* ===================================================================== */
|
|
|
|
|
|
|
|
// null spell
|
|
|
|
|
|
|
|
SPELLSTATUSFUNCTION(invisibleSpellSta) {
|
2022-10-29 12:29:02 +00:00
|
|
|
return kEffectronDead;
|
2021-05-17 18:47:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// semi permanent aura
|
|
|
|
|
|
|
|
SPELLSTATUSFUNCTION(auraSpellSta) {
|
2022-09-27 11:34:43 +00:00
|
|
|
if (effectron->_stepNo > effectron->_totalSteps)
|
2022-10-29 12:29:02 +00:00
|
|
|
return kEffectronDead;
|
2021-05-17 18:47:39 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
SPELLSTATUSFUNCTION(wallSpellSta) {
|
2022-09-27 11:34:43 +00:00
|
|
|
if (effectron->_stepNo > effectron->_totalSteps)
|
2022-10-29 12:29:02 +00:00
|
|
|
return kEffectronDead;
|
2021-05-17 18:47:39 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// projectile spell ( also used as first half of exploding spells
|
|
|
|
|
|
|
|
SPELLSTATUSFUNCTION(projectileSpellSta) {
|
2022-09-27 11:34:43 +00:00
|
|
|
if (effectron->_stepNo > effectron->_totalSteps)
|
2022-10-29 12:29:02 +00:00
|
|
|
return kEffectronDead;
|
2021-05-17 18:47:39 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
SPELLSTATUSFUNCTION(exchangeSpellSta) {
|
2022-09-27 11:34:43 +00:00
|
|
|
if (effectron->_stepNo < effectron->_partno / 2)
|
2022-10-29 12:29:02 +00:00
|
|
|
return kEffectronHidden;
|
2022-09-27 11:34:43 +00:00
|
|
|
if (effectron->_stepNo >= effectron->_totalSteps)
|
2022-10-29 12:29:02 +00:00
|
|
|
return kEffectronDead;
|
2021-05-17 18:47:39 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
SPELLSTATUSFUNCTION(boltSpellSta) {
|
2022-09-27 11:34:43 +00:00
|
|
|
if (effectron->_stepNo - (effectron->_partno / 9) > effectron->_totalSteps)
|
2022-10-29 12:29:02 +00:00
|
|
|
return kEffectronDead;
|
2022-09-27 11:34:43 +00:00
|
|
|
if ((effectron->_partno / 9) >= effectron->_stepNo)
|
2022-10-29 12:29:02 +00:00
|
|
|
return kEffectronHidden;
|
2021-05-17 18:47:39 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
SPELLSTATUSFUNCTION(beamSpellSta) {
|
2022-09-27 11:34:43 +00:00
|
|
|
if ((effectron->_partno > effectron->_totalSteps) ||
|
|
|
|
(effectron->_stepNo > effectron->_totalSteps))
|
2022-10-29 12:29:02 +00:00
|
|
|
return kEffectronDead;
|
2021-05-17 18:47:39 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
SPELLSTATUSFUNCTION(coneSpellSta) {
|
2022-09-27 11:34:43 +00:00
|
|
|
if (effectron->_stepNo - (effectron->_partno / 9) > effectron->_totalSteps)
|
2022-10-29 12:29:02 +00:00
|
|
|
return kEffectronDead;
|
2022-09-27 11:34:43 +00:00
|
|
|
if (effectron->_partno / 9 >= effectron->_stepNo)
|
2022-10-29 12:29:02 +00:00
|
|
|
return kEffectronHidden;
|
2021-05-17 18:47:39 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
SPELLSTATUSFUNCTION(waveSpellSta) {
|
2022-09-27 11:34:43 +00:00
|
|
|
if (effectron->_stepNo - (effectron->_partno / 17) > effectron->_totalSteps)
|
2022-10-29 12:29:02 +00:00
|
|
|
return kEffectronDead;
|
2022-09-27 11:34:43 +00:00
|
|
|
if (effectron->_partno / 17 < effectron->_stepNo)
|
2022-10-29 12:29:02 +00:00
|
|
|
return kEffectronHidden;
|
2021-05-17 18:47:39 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
SPELLSTATUSFUNCTION(ballSpellSta) {
|
|
|
|
if (effectron->isBumped() ||
|
2022-09-27 11:34:43 +00:00
|
|
|
effectron->_stepNo > effectron->_totalSteps)
|
2022-10-29 12:29:02 +00:00
|
|
|
return kEffectronDead;
|
2021-05-17 18:47:39 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
SPELLSTATUSFUNCTION(squareSpellSta) {
|
|
|
|
if (effectron->isBumped() ||
|
2022-09-27 11:34:43 +00:00
|
|
|
effectron->_stepNo > effectron->_totalSteps)
|
2022-10-29 12:29:02 +00:00
|
|
|
return kEffectronDead;
|
2021-05-17 18:47:39 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
SPELLSTATUSFUNCTION(stormSpellSta) {
|
|
|
|
if (effectron->isBumped() ||
|
2022-09-27 11:34:43 +00:00
|
|
|
effectron->_stepNo > effectron->_totalSteps)
|
2022-10-29 12:29:02 +00:00
|
|
|
return kEffectronDead;
|
2021-05-17 18:47:39 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
} // end of namespace Saga2
|