1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-27 22:49:25 +02:00

Support for combat spell sounds.

This commit is contained in:
Frank Zago
2009-05-14 04:49:04 +00:00
parent bbf4394ecc
commit 1f337764bd
7 changed files with 101 additions and 2 deletions

View File

@@ -1794,11 +1794,16 @@ void CBattleInterface::battleFinished(const BattleResult& br)
void CBattleInterface::spellCast(SpellCast * sc)
{
CSpell &spell = CGI->spellh->spells[sc->id];
if(sc->side == !LOCPLINT->cb->battleGetStackByID(activeStack)->attackerOwned)
bSpell->block(true);
std::vector< std::string > anims; //for magic arrow and ice bolt
if (spell.soundID != soundBase::invalid)
CGI->audioh->playSound(spell.soundID);
switch(sc->id)
{
case 15: //magic arrow
@@ -1861,9 +1866,9 @@ void CBattleInterface::spellCast(SpellCast * sc)
}
case 17: //lightning bolt
displayEffect(1, sc->tile);
displayEffect(CGI->spellh->spells[sc->id].mainEffectAnim, sc->tile);
displayEffect(spell.mainEffectAnim, sc->tile);
case 35: //dispel
displayEffect(CGI->spellh->spells[sc->id].mainEffectAnim, sc->tile);
displayEffect(spell.mainEffectAnim, sc->tile);
} //switch(sc->id)
}