mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-24 08:32:34 +02:00
Merge pull request #3673 from Kris-Ja/develop
change MANA_PER_KNOWLEGDE to percentage
This commit is contained in:
commit
96c7e593bb
@ -429,8 +429,8 @@
|
||||
},
|
||||
"manaPerKnowledge" :
|
||||
{
|
||||
"type" : "MANA_PER_KNOWLEDGE", //10 mana per knowledge
|
||||
"val" : 10,
|
||||
"type" : "MANA_PER_KNOWLEDGE_PERCENTAGE", //1000% mana per knowledge
|
||||
"val" : 1000,
|
||||
"valueType" : "BASE_NUMBER"
|
||||
},
|
||||
"landMovement" :
|
||||
|
@ -285,7 +285,7 @@
|
||||
"bonuses" : {
|
||||
"intelligence" : {
|
||||
"targetSourceType" : "SECONDARY_SKILL",
|
||||
"type" : "MANA_PER_KNOWLEDGE",
|
||||
"type" : "MANA_PER_KNOWLEDGE_PERCENTAGE",
|
||||
"updater" : "TIMES_HERO_LEVEL",
|
||||
"val" : 5,
|
||||
"valueType" : "PERCENT_TO_TARGET_TYPE"
|
||||
|
@ -129,7 +129,7 @@
|
||||
"bonuses" : {
|
||||
"intelligence" : {
|
||||
"targetSourceType" : "SECONDARY_SKILL",
|
||||
"type" : "MANA_PER_KNOWLEDGE",
|
||||
"type" : "MANA_PER_KNOWLEDGE_PERCENTAGE",
|
||||
"updater" : "TIMES_HERO_LEVEL",
|
||||
"val" : 5,
|
||||
"valueType" : "PERCENT_TO_TARGET_TYPE"
|
||||
|
@ -199,7 +199,7 @@
|
||||
"bonuses" : {
|
||||
"intelligence" : {
|
||||
"targetSourceType" : "SECONDARY_SKILL",
|
||||
"type" : "MANA_PER_KNOWLEDGE",
|
||||
"type" : "MANA_PER_KNOWLEDGE_PERCENTAGE",
|
||||
"updater" : "TIMES_HERO_LEVEL",
|
||||
"val" : 5,
|
||||
"valueType" : "PERCENT_TO_TARGET_TYPE"
|
||||
|
@ -708,7 +708,7 @@
|
||||
"base" : {
|
||||
"effects" : {
|
||||
"main" : {
|
||||
"type" : "MANA_PER_KNOWLEDGE",
|
||||
"type" : "MANA_PER_KNOWLEDGE_PERCENTAGE",
|
||||
"valueType" : "PERCENT_TO_BASE"
|
||||
}
|
||||
}
|
||||
|
@ -172,11 +172,11 @@ Defines percentage of enemy troops that will be raised after battle into own arm
|
||||
|
||||
- val: percentage of raised troops
|
||||
|
||||
### MANA_PER_KNOWLEDGE
|
||||
### MANA_PER_KNOWLEDGE_PERCENTAGE
|
||||
|
||||
Defines amount of mana points that hero gains per each point of knowledge (Intelligence)
|
||||
Defines percentage of mana points that hero gains per each point of knowledge (Intelligence)
|
||||
|
||||
- val: Amount of mana points per knowledge
|
||||
- val: percentage of mana points per knowledge
|
||||
|
||||
### HERO_GRANTS_ATTACKS
|
||||
|
||||
|
@ -105,6 +105,11 @@ struct DLL_LINKAGE Bonus : public std::enable_shared_from_this<Bonus>
|
||||
h & updater;
|
||||
h & propagationUpdater;
|
||||
h & targetSourceType;
|
||||
if (h.version < Handler::Version::MANA_LIMIT && type == BonusType::MANA_PER_KNOWLEDGE_PERCENTAGE)
|
||||
{
|
||||
if (valType == BonusValueType::ADDITIVE_VALUE || valType == BonusValueType::BASE_NUMBER)
|
||||
val *= 100;
|
||||
}
|
||||
}
|
||||
|
||||
template <typename Ptr>
|
||||
|
@ -162,7 +162,7 @@ class JsonNode;
|
||||
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*/\
|
||||
BONUS_NAME(UNDEAD_RAISE_PERCENTAGE) /*Percentage of killed enemy creatures to be raised after battle as undead*/\
|
||||
BONUS_NAME(MANA_PER_KNOWLEDGE) /*Percentage rate of translating 10 hero knowledge to mana, used to intelligence and global bonus*/\
|
||||
BONUS_NAME(MANA_PER_KNOWLEDGE_PERCENTAGE) /*Percentage rate of translating hero knowledge to 10 mana, used to intelligence and global bonus*/\
|
||||
BONUS_NAME(HERO_GRANTS_ATTACKS) /*If hero can grant additional attacks to creature, value is number of attacks, subtype is creatureID*/\
|
||||
BONUS_NAME(BONUS_DAMAGE_PERCENTAGE) /*If hero can grant conditional damage to creature, value is percentage, subtype is creatureID*/\
|
||||
BONUS_NAME(BONUS_DAMAGE_CHANCE) /*If hero can grant additional damage to creature, value is chance, subtype is creatureID*/\
|
||||
|
@ -78,7 +78,7 @@ BonusParams::BonusParams(std::string deprecatedTypeStr, std::string deprecatedSu
|
||||
type = BonusType::SIGHT_RADIUS;
|
||||
else if(deprecatedSubtype == SecondarySkill::INTELLIGENCE || deprecatedSubtypeStr == "skill.intelligence")
|
||||
{
|
||||
type = BonusType::MANA_PER_KNOWLEDGE;
|
||||
type = BonusType::MANA_PER_KNOWLEDGE_PERCENTAGE;
|
||||
valueType = BonusValueType::PERCENT_TO_BASE;
|
||||
}
|
||||
else if(deprecatedSubtype == SecondarySkill::SORCERY || deprecatedSubtypeStr == "skill.sorcery")
|
||||
|
@ -390,7 +390,7 @@ void CGHeroInstance::initHero(CRandomGenerator & rand)
|
||||
// load base hero bonuses, TODO: per-map loading of base hero bonuses
|
||||
// must be done separately from global bonuses since recruitable heroes in taverns
|
||||
// are not attached to global bonus node but need access to some global bonuses
|
||||
// e.g. MANA_PER_KNOWLEDGE for correct preview and initial state after recruit for(const auto & ob : VLC->modh->heroBaseBonuses)
|
||||
// e.g. MANA_PER_KNOWLEDGE_PERCENTAGE for correct preview and initial state after recruit for(const auto & ob : VLC->modh->heroBaseBonuses)
|
||||
// or MOVEMENT to compute initial movement before recruiting is finished
|
||||
const JsonNode & baseBonuses = VLC->settings()->getValue(EGameSettings::BONUSES_PER_HERO);
|
||||
for(const auto & b : baseBonuses.Struct())
|
||||
@ -1082,7 +1082,7 @@ std::string CGHeroInstance::nodeName() const
|
||||
si32 CGHeroInstance::manaLimit() const
|
||||
{
|
||||
return si32(getPrimSkillLevel(PrimarySkill::KNOWLEDGE)
|
||||
* (valOfBonuses(BonusType::MANA_PER_KNOWLEDGE)));
|
||||
* (valOfBonuses(BonusType::MANA_PER_KNOWLEDGE_PERCENTAGE))) / 100;
|
||||
}
|
||||
|
||||
HeroTypeID CGHeroInstance::getPortraitSource() const
|
||||
|
@ -37,6 +37,7 @@ enum class ESerializationVersion : int32_t
|
||||
DESTROYED_OBJECTS, // 834 +list of objects destroyed by player
|
||||
CAMPAIGN_MAP_TRANSLATIONS, // 835 +campaigns include translations for its maps
|
||||
JSON_FLAGS, // 836 json uses new format for flags
|
||||
MANA_LIMIT, // 837 change MANA_PER_KNOWLEGDE to percentage
|
||||
|
||||
CURRENT = JSON_FLAGS
|
||||
CURRENT = MANA_LIMIT
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user