1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-27 00:41:08 +02:00

Start moving server side spell mechanics

This commit is contained in:
AlexVinS
2014-11-25 14:19:13 +03:00
parent f2bf3d7f7b
commit 0fda90c67d
4 changed files with 172 additions and 19 deletions

View File

@ -101,6 +101,12 @@ CSpell::~CSpell()
delete mechanics;
}
void CSpell::battleCast(const SpellCastEnvironment * env, const BattleSpellCastParameters & parameters) const
{
if(!mechanics->battleCast(env, parameters))
logGlobal->errorStream() << "Internal error during spell cast";
}
bool CSpell::isCastableBy(const IBonusBearer * caster, bool hasSpellBook, const std::set<SpellID> & spellBook) const
{
if(!hasSpellBook)
@ -552,6 +558,9 @@ void CSpell::setupMechanics()
case SpellID::FORCE_FIELD:
mechanics = new WallMechanics(this);
break;
case SpellID::LAND_MINE:
case SpellID::QUICKSAND:
mechanics = new ObstacleMechanics(this);
default:
if(isRisingSpell())
mechanics = new SpecialRisingSpellMechanics(this);