1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00
This commit is contained in:
AlexVinS 2017-07-10 08:53:29 +03:00
parent 1fe01b7254
commit e677373241

View File

@ -3876,13 +3876,13 @@ bool CGameHandler::makeBattleAction(BattleAction &ba)
Bonus bonus1(Bonus::STACK_GETS_TURN, Bonus::PRIMARY_SKILL, Bonus::OTHER, 20, -1, PrimarySkill::DEFENSE, Bonus::PERCENT_TO_ALL);
Bonus bonus2(Bonus::STACK_GETS_TURN, Bonus::PRIMARY_SKILL, Bonus::OTHER, stack->valOfBonuses(Bonus::DEFENSIVE_STANCE),
-1, PrimarySkill::DEFENSE, Bonus::ADDITIVE_VALUE);
TBonusListPtr defence = stack->getBonuses(Selector::typeSubtype(Bonus::PRIMARY_SKILL, PrimarySkill::DEFENSE));
int oldDefenceValue = defence->totalValue();
BonusList defence = *stack->getBonuses(Selector::typeSubtype(Bonus::PRIMARY_SKILL, PrimarySkill::DEFENSE));
int oldDefenceValue = defence.totalValue();
defence->push_back(std::make_shared<Bonus>(bonus1));
defence->push_back(std::make_shared<Bonus>(bonus2));
defence.push_back(std::make_shared<Bonus>(bonus1));
defence.push_back(std::make_shared<Bonus>(bonus2));
int difference = defence->totalValue() - oldDefenceValue;
int difference = defence.totalValue() - oldDefenceValue;
MetaString text;
stack->addText(text, MetaString::GENERAL_TXT, 120);