1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-20 20:23:03 +02:00

change MANA_PER_KNOWLEGDE to percentage

This commit is contained in:
Kris-Ja 2024-03-23 19:57:56 +01:00
parent 6381a6f601
commit 05bbb45824
9 changed files with 13 additions and 13 deletions

View File

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

View File

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

View File

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

View File

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

View File

@ -708,7 +708,7 @@
"base" : {
"effects" : {
"main" : {
"type" : "MANA_PER_KNOWLEDGE",
"type" : "MANA_PER_KNOWLEDGE_PERCENTAGE",
"valueType" : "PERCENT_TO_BASE"
}
}

View File

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

View File

@ -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*/\

View File

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

View File

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