1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-28 08:48:48 +02:00

vcmi: remove SELF_LUCK bonus

This bonus also now handled by LUCK bonus with INDEPENDENT_MAX of 1
This commit is contained in:
Konstantin 2023-03-09 12:31:04 +03:00
parent c7e197e1ff
commit ff5f828031
3 changed files with 13 additions and 13 deletions

View File

@ -400,7 +400,9 @@
{
"lucky" :
{
"type" : "SELF_LUCK"
"type" : "LUCK",
"val" : 1,
"valueType" : "INDEPENDENT_MAX"
}
},
"graphics" :

View File

@ -114,6 +114,7 @@ const std::set<std::string> deprecatedBonusSet = {
"BLOCK_MORALE",
"BLOCK_LUCK",
"SELF_MORALE",
"SELF_LUCK"
};
///CBonusProxy
@ -670,13 +671,11 @@ Selector::type()(Bonus::NON_LIVING)
CSelector IBonusBearer::moraleSelector = Selector::type()(Bonus::MORALE);
CSelector IBonusBearer::luckSelector = Selector::type()(Bonus::LUCK);
CSelector IBonusBearer::selfLuckSelector = Selector::type()(Bonus::SELF_LUCK);
IBonusBearer::IBonusBearer()
:anaffectedByMorale(this, anaffectedByMoraleSelector),
moraleValue(this, moraleSelector, 0),
luckValue(this, luckSelector, 0),
selfLuck(this, selfLuckSelector)
luckValue(this, luckSelector, 0)
{
}
@ -761,9 +760,6 @@ int IBonusBearer::LuckVal() const
int ret = luckValue.getValue();
if(selfLuck.getHasBonus()) //eg. halfling
vstd::amax(ret, +1);
return vstd::abetween(ret, -3, +3);
}
@ -790,9 +786,6 @@ int IBonusBearer::LuckValAndBonusList(TConstBonusListPtr & bonusList) const
}
int ret = luckValue.getValueAndList(bonusList);
if(selfLuck.getHasBonus()) //eg. halfling
vstd::amax(ret, +1);
return vstd::abetween(ret, -3, +3);
}
@ -1975,6 +1968,14 @@ BonusParams::BonusParams(std::string deprecatedTypeStr, std::string deprecatedSu
valueType = Bonus::INDEPENDENT_MAX;
valueTypeRelevant = true;
}
else if (deprecatedTypeStr == "SELF_LUCK")
{
type = Bonus::LUCK;
val = 1;
valRelevant = true;
valueType = Bonus::INDEPENDENT_MAX;
valueTypeRelevant = true;
}
else
isConverted = false;
}

View File

@ -258,7 +258,6 @@ public:
BONUS_NAME(FEAR) \
BONUS_NAME(FEARLESS) \
BONUS_NAME(NO_DISTANCE_PENALTY) \
BONUS_NAME(SELF_LUCK) /*halfling*/ \
BONUS_NAME(ENCHANTER)/* for Enchanter spells, val - skill level, subtype - spell id, additionalInfo - cooldown */ \
BONUS_NAME(HEALER) \
BONUS_NAME(SIEGE_WEAPON) \
@ -709,8 +708,6 @@ private:
CTotalsProxy moraleValue;
static CSelector luckSelector;
CTotalsProxy luckValue;
static CSelector selfLuckSelector;
CCheckProxy selfLuck;
public:
//new bonusing node interface