mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-03 00:46:55 +02:00
* fixed project files for RD configuration
* fixed crash when creature is casting Hypnosis (ie. exped Vampire Lords) * fixed crash when creature is casting Cure before attack (ie. exped Unicorns) * fixed crash when creature is summoning elemental (TODO fix it) * fixed crash when doing a bonus system operation with a hero liberated from prison (ie. entering town or battle) * fixed deadlock when StupidAI tried to assault the turrets * fixed never ending siege when StupidAI has to use catapult (no more deadlocks on AI-AI siege) * fixed deadlock when a hero received a level during another player's turn (ie. when he successfully defended) * AI can win the game by defeating all enemies if there is a specific victory condition applying only to human players * added options to help testing adventure map AI (--onlyAI, --autoSkip and --oneGoodAI). * many minor changes
This commit is contained in:
@ -2203,7 +2203,7 @@ ESpellCastProblem::ESpellCastProblem BattleInfo::battleIsImmune(const CGHeroInst
|
||||
return ESpellCastProblem::OK;
|
||||
}
|
||||
|
||||
std::vector<ui32> BattleInfo::calculateResistedStacks( const CSpell * sp, const CGHeroInstance * caster, const CGHeroInstance * hero2, const std::set<CStack*> affectedCreatures, int casterSideOwner, ECastingMode::ECastingMode mode ) const
|
||||
std::vector<ui32> BattleInfo::calculateResistedStacks(const CSpell * sp, const CGHeroInstance * caster, const CGHeroInstance * hero2, const std::set<CStack*> affectedCreatures, int casterSideOwner, ECastingMode::ECastingMode mode, int usedSpellPower, int spellLevel) const
|
||||
{
|
||||
std::vector<ui32> ret;
|
||||
for(std::set<CStack*>::const_iterator it = affectedCreatures.begin(); it != affectedCreatures.end(); ++it)
|
||||
@ -2241,7 +2241,7 @@ std::vector<ui32> BattleInfo::calculateResistedStacks( const CSpell * sp, const
|
||||
if( (*it)->hasBonusOfType(Bonus::SPELL_IMMUNITY, sp->id) //100% sure spell immunity
|
||||
|| ( (*it)->count - 1 ) * (*it)->MaxHealth() + (*it)->firstHPleft
|
||||
>
|
||||
caster->getPrimSkillLevel(2) * 25 + sp->powers[caster->getSpellSchoolLevel(sp)]
|
||||
usedSpellPower * 25 + sp->powers[spellLevel]
|
||||
)
|
||||
{
|
||||
ret.push_back((*it)->ID);
|
||||
|
Reference in New Issue
Block a user