Selaa lähdekoodia

vcmi: remove BLOCKS_MORALE bonus

To block morale, just set INDEPENDENT_MAX and INDEPENDENT_MIN
to 0, there is no need for separate bonus.
Konstantin 2 vuotta sitten
vanhempi
sitoutus
c07e74250b
4 muutettua tiedostoa jossa 4 lisäystä ja 12 poistoa
  1. 0 1
      client/widgets/MiscWidgets.cpp
  2. 2 2
      lib/HeroBonus.cpp
  3. 0 1
      lib/HeroBonus.h
  4. 2 8
      server/CGameHandler.cpp

+ 0 - 1
client/widgets/MiscWidgets.cpp

@@ -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

+ 2 - 2
lib/HeroBonus.cpp

@@ -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);

+ 0 - 1
lib/HeroBonus.h

@@ -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) \

+ 2 - 8
server/CGameHandler.cpp

@@ -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
 						{