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

Support for Titan's Thunder (creating Spellbook) & Titan's Lightning Bolt.

This commit is contained in:
DjWarmonger 2011-07-06 14:25:12 +00:00
parent 75d068bc03
commit c53c226820
5 changed files with 9 additions and 4 deletions

View File

@ -3015,6 +3015,7 @@ void CBattleInterface::spellCast( const BattleSpellCast * sc )
break; //for 15 and 16 cases
}
case 17: //lightning bolt
case 57: //Titan's Thunder
case 77: //thunderbolt
displayEffect(1, sc->tile);
displayEffect(spell.mainEffectAnim, sc->tile);
@ -3050,6 +3051,7 @@ void CBattleInterface::spellCast( const BattleSpellCast * sc )
if(sc->castedByHero)
{
boost::algorithm::replace_first(text, "%s", curInt->cb->battleGetFightingHero(sc->side)->name);
boost::algorithm::replace_first(text, "%s", CGI->spellh->spells[sc->id]->name); //spell name
boost::algorithm::replace_first(text, "%s", curInt->cb->battleGetStackByID(*sc->affectedCres.begin(), false)->getCreature()->namePl ); //target
}
else
@ -3143,7 +3145,7 @@ void CBattleInterface::spellCast( const BattleSpellCast * sc )
}
}
}
if (!customSpell)
if (!customSpell) //TODO: should not get here for direct damage spells
boost::algorithm::replace_first(text, "%s", CGI->spellh->spells[sc->id]->name); //simple spell name
if (text.size())
console->addText(text);

View File

@ -57,7 +57,7 @@
54 -1 19 0 0 0 X
55 1 28 0 0 0 0
56 1 17 0 0 0 0
57 -1 -1 0 0 0 0
57 -1 38 0 0 0 0
58 1 7 0 0 0 X
59 -1 35 0 0 0-1 0-2
60 -1 21 0 0 0 0

View File

@ -1010,6 +1010,8 @@ void CArtifactInstance::move(ArtifactLocation &src, ArtifactLocation &dst)
{
removeFrom(src.hero, src.slot);
putAt(dst.hero, dst.slot);
if (artType->id == 135 && dst.slot == Arts::RIGHT_HAND && !dst.hero->hasSpellbook()) //Titan's Thunder creates new spellbook on equip
dst.hero->giveArtifact(0);
}
CArtifactInstance * CArtifactInstance::createNewArtifactInstance(CArtifact *Art)

View File

@ -57,8 +57,8 @@ rett * createAny(std::string dllname, std::string methodName)
return ret;
}
//Currently AI libraries use "lib" prefix only on non-win systems.
//Currently AI libraries use "lib" prefix only on non-win systems.
//May be applied to Win systems as well to remove this ifdef
#ifdef _WIN32
std::string getAIFileName(std::string input)

View File

@ -3450,6 +3450,7 @@ void CGameHandler::handleSpellCasting( int spellID, int spellLvl, THex destinati
case 24: //death ripple
case 25: //destroy undead
case 26: //armageddon
case 57: //Titan's Lightning bolt
case 77: //Thunderbolt (thunderbirds)
{
StacksInjured si;