1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-26 03:52:01 +02:00

vcmi: remove BLOCKS_MORALE bonus

To block morale, just set INDEPENDENT_MAX and INDEPENDENT_MIN
to 0, there is no need for separate bonus.
This commit is contained in:
Konstantin 2023-03-09 11:59:38 +03:00
parent ba2a35464a
commit c07e74250b
4 changed files with 4 additions and 12 deletions

View File

@ -393,7 +393,6 @@ void MoraleLuckBox::set(const IBonusBearer * node)
boost::algorithm::replace_first(text,"%s",CGI->generaltexth->arraytxt[neutralDescr[morale]-mrlt]);
if (morale && node && (node->hasBonusOfType(Bonus::UNDEAD)
|| node->hasBonusOfType(Bonus::BLOCK_MORALE)
|| node->hasBonusOfType(Bonus::NON_LIVING)))
{
text += CGI->generaltexth->arraytxt[113]; //unaffected by morale

View File

@ -111,6 +111,7 @@ const std::set<std::string> deprecatedBonusSet = {
"KING1",
"KING2",
"KING3",
"BLOCK_MORALE",
};
///CBonusProxy
@ -663,8 +664,7 @@ CSelector IBonusBearer::anaffectedByMoraleSelector =
Selector::type()(Bonus::NON_LIVING)
.Or(Selector::type()(Bonus::UNDEAD))
.Or(Selector::type()(Bonus::SIEGE_WEAPON))
.Or(Selector::type()(Bonus::NO_MORALE))
.Or(Selector::type()(Bonus::BLOCK_MORALE));
.Or(Selector::type()(Bonus::NO_MORALE));
CSelector IBonusBearer::moraleSelector = Selector::type()(Bonus::MORALE);
CSelector IBonusBearer::luckSelector = Selector::type()(Bonus::LUCK);

View File

@ -190,7 +190,6 @@ public:
BONUS_NAME(WATER_WALKING) /*value - penalty percentage*/ \
BONUS_NAME(NEGATE_ALL_NATURAL_IMMUNITIES) \
BONUS_NAME(STACK_HEALTH) \
BONUS_NAME(BLOCK_MORALE) \
BONUS_NAME(BLOCK_LUCK) \
BONUS_NAME(FIRE_SPELLS) \
BONUS_NAME(AIR_SPELLS) \

View File

@ -6571,10 +6571,7 @@ void CGameHandler::runBattle()
//check for bad morale => freeze
int nextStackMorale = next->MoraleVal();
if (nextStackMorale < 0 &&
!(NBonus::hasOfType(gs->curB->battleGetFightingHero(0), Bonus::BLOCK_MORALE)
|| NBonus::hasOfType(gs->curB->battleGetFightingHero(1), Bonus::BLOCK_MORALE)) //checking if gs->curB->heroes have (or don't have) morale blocking bonuses)
)
if (nextStackMorale < 0)
{
if (getRandomGenerator().nextInt(23) < -2 * nextStackMorale)
{
@ -6762,10 +6759,7 @@ void CGameHandler::runBattle()
&& !next->waited()
&& !next->fear
&& next->alive()
&& nextStackMorale > 0
&& !(NBonus::hasOfType(gs->curB->battleGetFightingHero(0), Bonus::BLOCK_MORALE)
|| NBonus::hasOfType(gs->curB->battleGetFightingHero(1), Bonus::BLOCK_MORALE)) //checking if gs->curB->heroes have (or don't have) morale blocking bonuses
)
&& nextStackMorale > 0)
{
if(getRandomGenerator().nextInt(23) < nextStackMorale) //this stack hasn't got morale this turn
{