mirror of
https://github.com/vcmi/vcmi.git
synced 2025-04-23 12:08:45 +02:00
vcmi: remove BLOCK_LUCK bonus
To block a luck, just set both INDEPENDENT_MAX and INDEPENDENT_MIN to 0 of LUCK bonus
This commit is contained in:
parent
ae535384f7
commit
ebbc8cf208
@ -398,12 +398,6 @@ void MoraleLuckBox::set(const IBonusBearer * node)
|
|||||||
text += CGI->generaltexth->arraytxt[113]; //unaffected by morale
|
text += CGI->generaltexth->arraytxt[113]; //unaffected by morale
|
||||||
bonusValue = 0;
|
bonusValue = 0;
|
||||||
}
|
}
|
||||||
else if(!morale && node && node->hasBonusOfType(Bonus::BLOCK_LUCK))
|
|
||||||
{
|
|
||||||
// TODO: there is no text like "Unaffected by luck" so probably we need own text
|
|
||||||
text += CGI->generaltexth->arraytxt[noneTxtId];
|
|
||||||
bonusValue = 0;
|
|
||||||
}
|
|
||||||
else if(morale && node && node->hasBonusOfType(Bonus::NO_MORALE))
|
else if(morale && node && node->hasBonusOfType(Bonus::NO_MORALE))
|
||||||
{
|
{
|
||||||
auto noMorale = node->getBonus(Selector::type()(Bonus::NO_MORALE));
|
auto noMorale = node->getBonus(Selector::type()(Bonus::NO_MORALE));
|
||||||
|
@ -112,6 +112,7 @@ const std::set<std::string> deprecatedBonusSet = {
|
|||||||
"KING2",
|
"KING2",
|
||||||
"KING3",
|
"KING3",
|
||||||
"BLOCK_MORALE",
|
"BLOCK_MORALE",
|
||||||
|
"BLOCK_LUCK",
|
||||||
};
|
};
|
||||||
|
|
||||||
///CBonusProxy
|
///CBonusProxy
|
||||||
|
@ -190,7 +190,6 @@ public:
|
|||||||
BONUS_NAME(WATER_WALKING) /*value - penalty percentage*/ \
|
BONUS_NAME(WATER_WALKING) /*value - penalty percentage*/ \
|
||||||
BONUS_NAME(NEGATE_ALL_NATURAL_IMMUNITIES) \
|
BONUS_NAME(NEGATE_ALL_NATURAL_IMMUNITIES) \
|
||||||
BONUS_NAME(STACK_HEALTH) \
|
BONUS_NAME(STACK_HEALTH) \
|
||||||
BONUS_NAME(BLOCK_LUCK) \
|
|
||||||
BONUS_NAME(FIRE_SPELLS) \
|
BONUS_NAME(FIRE_SPELLS) \
|
||||||
BONUS_NAME(AIR_SPELLS) \
|
BONUS_NAME(AIR_SPELLS) \
|
||||||
BONUS_NAME(WATER_SPELLS) \
|
BONUS_NAME(WATER_SPELLS) \
|
||||||
|
@ -1025,10 +1025,6 @@ void CGameHandler::makeAttack(const CStack * attacker, const CStack * defender,
|
|||||||
|
|
||||||
const int attackerLuck = attacker->LuckVal();
|
const int attackerLuck = attacker->LuckVal();
|
||||||
|
|
||||||
auto sideHeroBlocksLuck = [](const SideInBattle &side){ return NBonus::hasOfType(side.hero, Bonus::BLOCK_LUCK); };
|
|
||||||
|
|
||||||
if (!vstd::contains_if (gs->curB->sides, sideHeroBlocksLuck))
|
|
||||||
{
|
|
||||||
if (attackerLuck > 0 && getRandomGenerator().nextInt(23) < attackerLuck)
|
if (attackerLuck > 0 && getRandomGenerator().nextInt(23) < attackerLuck)
|
||||||
{
|
{
|
||||||
bat.flags |= BattleAttack::LUCKY;
|
bat.flags |= BattleAttack::LUCKY;
|
||||||
@ -1040,7 +1036,6 @@ void CGameHandler::makeAttack(const CStack * attacker, const CStack * defender,
|
|||||||
bat.flags |= BattleAttack::UNLUCKY;
|
bat.flags |= BattleAttack::UNLUCKY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (getRandomGenerator().nextInt(99) < attacker->valOfBonuses(Bonus::DOUBLE_DAMAGE_CHANCE))
|
if (getRandomGenerator().nextInt(99) < attacker->valOfBonuses(Bonus::DOUBLE_DAMAGE_CHANCE))
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user