1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

- Fixed Remove Obstacle spell

- Fixed freeze at Chain Lightning
This commit is contained in:
DjWarmonger 2012-04-28 15:18:21 +00:00
parent 66418f43a9
commit 192de453af
2 changed files with 9 additions and 6 deletions

View File

@ -697,7 +697,7 @@ void CBattleInterface::show(SDL_Surface * to)
activate();
//activation of next stack
if(pendingAnims.size() == 0 && stackToActivate != NULL)
if(pendingAnims.size() == 0 && stackToActivate != NULL) //FIXME: Faerie Dragon's Chain Lightning doesn't have animation ATM
{
activateStack();
}
@ -1601,6 +1601,8 @@ void CBattleInterface::spellCast( const BattleSpellCast * sc )
case Spells::SUMMON_WATER_ELEMENTAL:
case Spells::SUMMON_AIR_ELEMENTAL:
case Spells::CLONE: //TODO: make it smarter?
case Spells::REMOVE_OBSTACLE:
case Spells::CHAIN_LIGHTNING:
addNewAnim(new CDummyAnimation(this, 2));
break;
} //switch(sc->id)
@ -1836,8 +1838,8 @@ void CBattleInterface::castThisSpell(int spellID)
if(sp->getTargetType() == CSpell::OBSTACLE)
{
spellSelMode = OBSTACLE;
}
if(sp->range[ castingHero->getSpellSchoolLevel(sp) ] == "X") //spell has no range
} //FIXME: Remove Obstacle has range X, unfortunatelly :(
else if(sp->range[ castingHero->getSpellSchoolLevel(sp) ] == "X") //spell has no range
{
spellSelMode = NO_LOCATION;
}
@ -2756,7 +2758,8 @@ void CBattleInterface::handleHex(BattleHex myNumber, int eventType)
}
break;
case OBSTACLE:
legalAction = false; //TODO
if (isCastingPossibleHere (sactive, shere, myNumber))
legalAction = true; //TODO
break;
case TELEPORT:
{
@ -2913,7 +2916,7 @@ void CBattleInterface::handleHex(BattleHex myNumber, int eventType)
case OBSTACLE:
consoleMsg = CGI->generaltexth->allTexts[550];
isCastingPossible = true;
break;;
break;
case HEAL:
cursorFrame = ECursor::COMBAT_HEAL;
consoleMsg = (boost::format(CGI->generaltexth->allTexts[419]) % shere->getName()).str(); //Apply first aid to the %s

View File

@ -190,7 +190,7 @@ std::set<ui16> CSpell::rangeInHexes(unsigned int centralHex, ui8 schoolLvl ) con
return ret;
}
CSpell::ETargetType CSpell::getTargetType() const
CSpell::ETargetType CSpell::getTargetType() const //TODO: parse these at game launch
{
if(attributes.find("CREATURE_TARGET_1") != std::string::npos
|| attributes.find("CREATURE_TARGET_2") != std::string::npos)