mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	vcmi: remove SELF_MORALE bonus
It is easily handled by MORALE bonus with INDEPENDENT_MAX Harmless due to converter.
This commit is contained in:
		| @@ -261,7 +261,9 @@ | |||||||
| 		{ | 		{ | ||||||
| 			"fearless" : | 			"fearless" : | ||||||
| 			{ | 			{ | ||||||
| 				"type" : "SELF_MORALE" | 				"type" : "MORALE", | ||||||
|  | 				"val" : 1, | ||||||
|  | 				"valueType" : "INDEPENDENT_MAX" | ||||||
| 			} | 			} | ||||||
| 		 }, | 		 }, | ||||||
| 		"upgrades": ["minotaurKing"], | 		"upgrades": ["minotaurKing"], | ||||||
| @@ -287,7 +289,9 @@ | |||||||
| 		{ | 		{ | ||||||
| 			"fearless" : | 			"fearless" : | ||||||
| 			{ | 			{ | ||||||
| 				"type" : "SELF_MORALE" | 				"type" : "MORALE", | ||||||
|  | 				"val" : 1, | ||||||
|  | 				"valueType" : "INDEPENDENT_MAX" | ||||||
| 			} | 			} | ||||||
| 		 }, | 		 }, | ||||||
| 		"graphics" : | 		"graphics" : | ||||||
|   | |||||||
| @@ -1080,7 +1080,10 @@ void CCreatureHandler::loadStackExp(Bonus & b, BonusList & bl, CLegacyConfigPars | |||||||
| 			case 'F': | 			case 'F': | ||||||
| 				b.type = Bonus::FLYING; break; | 				b.type = Bonus::FLYING; break; | ||||||
| 			case 'm': | 			case 'm': | ||||||
| 				b.type = Bonus::SELF_MORALE; break; | 				b.type = Bonus::MORALE; break; | ||||||
|  | 				b.val = 1; | ||||||
|  | 				b.valType = Bonus::INDEPENDENT_MAX; | ||||||
|  | 				break; | ||||||
| 			case 'M': | 			case 'M': | ||||||
| 				b.type = Bonus::NO_MORALE; break; | 				b.type = Bonus::NO_MORALE; break; | ||||||
| 			case 'p': //Mind spells | 			case 'p': //Mind spells | ||||||
|   | |||||||
| @@ -113,6 +113,7 @@ const std::set<std::string> deprecatedBonusSet = { | |||||||
| 	"KING3", | 	"KING3", | ||||||
| 	"BLOCK_MORALE", | 	"BLOCK_MORALE", | ||||||
| 	"BLOCK_LUCK", | 	"BLOCK_LUCK", | ||||||
|  | 	"SELF_MORALE", | ||||||
| }; | }; | ||||||
|  |  | ||||||
| ///CBonusProxy | ///CBonusProxy | ||||||
| @@ -669,14 +670,12 @@ Selector::type()(Bonus::NON_LIVING) | |||||||
|  |  | ||||||
| CSelector IBonusBearer::moraleSelector = Selector::type()(Bonus::MORALE); | CSelector IBonusBearer::moraleSelector = Selector::type()(Bonus::MORALE); | ||||||
| CSelector IBonusBearer::luckSelector = Selector::type()(Bonus::LUCK); | CSelector IBonusBearer::luckSelector = Selector::type()(Bonus::LUCK); | ||||||
| CSelector IBonusBearer::selfMoraleSelector = Selector::type()(Bonus::SELF_MORALE); |  | ||||||
| CSelector IBonusBearer::selfLuckSelector = Selector::type()(Bonus::SELF_LUCK); | CSelector IBonusBearer::selfLuckSelector = Selector::type()(Bonus::SELF_LUCK); | ||||||
|  |  | ||||||
| IBonusBearer::IBonusBearer() | IBonusBearer::IBonusBearer() | ||||||
| 	:anaffectedByMorale(this, anaffectedByMoraleSelector), | 	:anaffectedByMorale(this, anaffectedByMoraleSelector), | ||||||
| 	moraleValue(this, moraleSelector, 0), | 	moraleValue(this, moraleSelector, 0), | ||||||
| 	luckValue(this, luckSelector, 0), | 	luckValue(this, luckSelector, 0), | ||||||
| 	selfMorale(this, selfMoraleSelector), |  | ||||||
| 	selfLuck(this, selfLuckSelector) | 	selfLuck(this, selfLuckSelector) | ||||||
| { | { | ||||||
| } | } | ||||||
| @@ -752,9 +751,6 @@ int IBonusBearer::MoraleVal() const | |||||||
|  |  | ||||||
| 	int ret = moraleValue.getValue(); | 	int ret = moraleValue.getValue(); | ||||||
|  |  | ||||||
| 	if(selfMorale.getHasBonus()) //eg. minotaur |  | ||||||
| 		vstd::amax(ret, +1); |  | ||||||
|  |  | ||||||
| 	return vstd::abetween(ret, -3, +3); | 	return vstd::abetween(ret, -3, +3); | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -781,9 +777,6 @@ int IBonusBearer::MoraleValAndBonusList(TConstBonusListPtr & bonusList) const | |||||||
| 	} | 	} | ||||||
| 	int ret = moraleValue.getValueAndList(bonusList); | 	int ret = moraleValue.getValueAndList(bonusList); | ||||||
|  |  | ||||||
| 	if(selfMorale.getHasBonus()) //eg. minotaur |  | ||||||
| 		vstd::amax(ret, +1); |  | ||||||
|  |  | ||||||
| 	return vstd::abetween(ret, -3, +3); | 	return vstd::abetween(ret, -3, +3); | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -1974,6 +1967,14 @@ BonusParams::BonusParams(std::string deprecatedTypeStr, std::string deprecatedSu | |||||||
| 	} | 	} | ||||||
| 	else if (deprecatedTypeStr == "SIGHT_RADIOUS") | 	else if (deprecatedTypeStr == "SIGHT_RADIOUS") | ||||||
| 		type = Bonus::SIGHT_RADIUS; | 		type = Bonus::SIGHT_RADIUS; | ||||||
|  | 	else if (deprecatedTypeStr == "SELF_MORALE") | ||||||
|  | 	{ | ||||||
|  | 		type = Bonus::MORALE; | ||||||
|  | 		val = 1; | ||||||
|  | 		valRelevant = true; | ||||||
|  | 		valueType = Bonus::INDEPENDENT_MAX; | ||||||
|  | 		valueTypeRelevant = true; | ||||||
|  | 	} | ||||||
| 	else | 	else | ||||||
| 		isConverted = false; | 		isConverted = false; | ||||||
| } | } | ||||||
|   | |||||||
| @@ -247,7 +247,6 @@ public: | |||||||
| 	BONUS_NAME(LIFE_DRAIN)								\ | 	BONUS_NAME(LIFE_DRAIN)								\ | ||||||
| 	BONUS_NAME(DOUBLE_DAMAGE_CHANCE) /*value in %, eg. dread knight*/ \ | 	BONUS_NAME(DOUBLE_DAMAGE_CHANCE) /*value in %, eg. dread knight*/ \ | ||||||
| 	BONUS_NAME(RETURN_AFTER_STRIKE)						\ | 	BONUS_NAME(RETURN_AFTER_STRIKE)						\ | ||||||
| 	BONUS_NAME(SELF_MORALE) /*eg. minotaur*/			\ |  | ||||||
| 	BONUS_NAME(SPELLCASTER) /*subtype - spell id, value - level of school, additional info - weighted chance. use SPECIFIC_SPELL_POWER, CREATURE_SPELL_POWER or CREATURE_ENCHANT_POWER for calculating the power*/ \ | 	BONUS_NAME(SPELLCASTER) /*subtype - spell id, value - level of school, additional info - weighted chance. use SPECIFIC_SPELL_POWER, CREATURE_SPELL_POWER or CREATURE_ENCHANT_POWER for calculating the power*/ \ | ||||||
| 	BONUS_NAME(CATAPULT)								\ | 	BONUS_NAME(CATAPULT)								\ | ||||||
| 	BONUS_NAME(ENEMY_DEFENCE_REDUCTION) /*in % (value) eg. behemots*/ \ | 	BONUS_NAME(ENEMY_DEFENCE_REDUCTION) /*in % (value) eg. behemots*/ \ | ||||||
| @@ -710,8 +709,6 @@ private: | |||||||
| 	CTotalsProxy moraleValue; | 	CTotalsProxy moraleValue; | ||||||
| 	static CSelector luckSelector; | 	static CSelector luckSelector; | ||||||
| 	CTotalsProxy luckValue; | 	CTotalsProxy luckValue; | ||||||
| 	static CSelector selfMoraleSelector; |  | ||||||
| 	CCheckProxy selfMorale; |  | ||||||
| 	static CSelector selfLuckSelector; | 	static CSelector selfLuckSelector; | ||||||
| 	CCheckProxy selfLuck; | 	CCheckProxy selfLuck; | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user