mirror of
https://github.com/vcmi/vcmi.git
synced 2025-02-03 13:01:33 +02:00
only blocking non positive spells; counterstrike
This commit is contained in:
parent
43666ec987
commit
899d3a14a0
@ -794,7 +794,7 @@ DamageEstimation CBattleInfoCallback::battleEstimateDamage(const BattleAttackInf
|
|||||||
if (!bai.defender->ableToRetaliate())
|
if (!bai.defender->ableToRetaliate())
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
if (bai.attacker->hasBonusOfType(BonusType::BLOCKS_RETALIATION))
|
if (bai.attacker->hasBonusOfType(BonusType::BLOCKS_RETALIATION) || bai.attacker->hasBonusOfType(BonusType::INVINCIBLE))
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
//TODO: rewrite using boost::numeric::interval
|
//TODO: rewrite using boost::numeric::interval
|
||||||
|
@ -231,7 +231,7 @@ bool BattleSpellMechanics::canBeCastAt(const Target & target, Problem & problem)
|
|||||||
if(mainTarget && mainTarget == caster)
|
if(mainTarget && mainTarget == caster)
|
||||||
return false; // can't cast on self
|
return false; // can't cast on self
|
||||||
|
|
||||||
if(mainTarget && mainTarget->hasBonusOfType(BonusType::INVINCIBLE))
|
if(mainTarget && mainTarget->hasBonusOfType(BonusType::INVINCIBLE) && !getSpell()->getPositiveness())
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -276,7 +276,7 @@ bool BattleActionProcessor::doAttackAction(const CBattleInfoCallback & battle, c
|
|||||||
for (int i = 0; i < totalAttacks; ++i)
|
for (int i = 0; i < totalAttacks; ++i)
|
||||||
{
|
{
|
||||||
//first strike
|
//first strike
|
||||||
if(i == 0 && firstStrike && retaliation && !stack->hasBonusOfType(BonusType::BLOCKS_RETALIATION))
|
if(i == 0 && firstStrike && retaliation && !stack->hasBonusOfType(BonusType::BLOCKS_RETALIATION) && !stack->hasBonusOfType(BonusType::INVINCIBLE))
|
||||||
{
|
{
|
||||||
makeAttack(battle, destinationStack, stack, 0, stack->getPosition(), true, false, true);
|
makeAttack(battle, destinationStack, stack, 0, stack->getPosition(), true, false, true);
|
||||||
}
|
}
|
||||||
@ -303,6 +303,7 @@ bool BattleActionProcessor::doAttackAction(const CBattleInfoCallback & battle, c
|
|||||||
//we check retaliation twice, so if it unblocked during attack it will work only on next attack
|
//we check retaliation twice, so if it unblocked during attack it will work only on next attack
|
||||||
if(stack->alive()
|
if(stack->alive()
|
||||||
&& !stack->hasBonusOfType(BonusType::BLOCKS_RETALIATION)
|
&& !stack->hasBonusOfType(BonusType::BLOCKS_RETALIATION)
|
||||||
|
&& !stack->hasBonusOfType(BonusType::INVINCIBLE)
|
||||||
&& (i == 0 && !firstStrike)
|
&& (i == 0 && !firstStrike)
|
||||||
&& retaliation && destinationStack->ableToRetaliate())
|
&& retaliation && destinationStack->ableToRetaliate())
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user