1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-15 01:24:45 +02:00

* corrected per-stack spell immunity handling

* support for new artifacts: * of Legion, shackles of war
This commit is contained in:
mateuszb
2009-08-16 13:44:17 +00:00
parent 2b44cd35b6
commit 4fc25c7b98
9 changed files with 66 additions and 13 deletions

View File

@ -1373,6 +1373,21 @@ bool CGameState::battleShootCreatureStack(int ID, int dest)
return true;
}
bool CGameState::battleCanFlee(int player)
{
if(!curB) //there is no battle
return false;
const CGHeroInstance *h1 = getHero(curB->hero1);
const CGHeroInstance *h2 = getHero(curB->hero2);
if(h1->hasBonusOfType(HeroBonus::ENEMY_CANT_ESCAPE) //eg. one of heroes is wearing shakles of war
|| h2->hasBonusOfType(HeroBonus::ENEMY_CANT_ESCAPE))
return false;
return true;
}
int CGameState::battleGetStack(int pos, bool onlyAlive)
{
if(!curB)