mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
vcmi: convert learning to global effect
Now hero experience is a global effect, and secondary skill gives exactly same bonus. Can be modified by PERCENT_TO_TARGET_TYPE.
This commit is contained in:
parent
a85f3b63ec
commit
f641ed2015
@ -63,6 +63,11 @@
|
||||
"type" : "SIGHT_RADIUS", //default sight radius
|
||||
"val" : 5,
|
||||
"valueType" : "BASE_NUMBER"
|
||||
},
|
||||
{
|
||||
"type" : "HERO_EXPERIENCE_GAIN_PERCENT", //default hero xp
|
||||
"val" : 100,
|
||||
"valueType" : "BASE_NUMBER"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -622,9 +622,8 @@
|
||||
"base" : {
|
||||
"effects" : {
|
||||
"main" : {
|
||||
"subtype" : "skill.learning",
|
||||
"type" : "SECONDARY_SKILL_PREMY",
|
||||
"valueType" : "BASE_NUMBER"
|
||||
"type" : "HERO_EXPERIENCE_GAIN_PERCENT",
|
||||
"valueType" : "PERCENT_TO_BASE"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -340,6 +340,7 @@ public:
|
||||
BONUS_NAME(WANDERING_CREATURES_JOIN_BONUS) /*skill-agnostic diplomacy*/\
|
||||
BONUS_NAME(BEFORE_BATTLE_REPOSITION) /*skill-agnostic tactics, bonus for allowing tactics*/\
|
||||
BONUS_NAME(BEFORE_BATTLE_REPOSITION_BLOCK) /*skill-agnostic tactics, bonus for blocking opposite tactics. For now donble side tactics is TODO.*/\
|
||||
BONUS_NAME(HERO_EXPERIENCE_GAIN_PERCENT) /*skill-agnostic learning, and we can use it as a global effect also*/\
|
||||
/* end of list */
|
||||
|
||||
|
||||
|
@ -581,7 +581,7 @@ ui64 CGHeroInstance::getTotalStrength() const
|
||||
|
||||
TExpType CGHeroInstance::calculateXp(TExpType exp) const
|
||||
{
|
||||
return static_cast<TExpType>(exp * (100 + valOfBonuses(Bonus::SECONDARY_SKILL_PREMY, SecondarySkill::LEARNING)) / 100.0);
|
||||
return static_cast<TExpType>(exp * (valOfBonuses(Bonus::HERO_EXPERIENCE_GAIN_PERCENT)) / 100.0);
|
||||
}
|
||||
|
||||
int32_t CGHeroInstance::getCasterUnitId() const
|
||||
|
Loading…
Reference in New Issue
Block a user