2
0
Эх сурвалжийг харах

change MANA_PER_KNOWLEGDE to percentage

Kris-Ja 1 жил өмнө
parent
commit
05bbb45824

+ 2 - 2
config/gameConfig.json

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

+ 1 - 1
config/heroes/fortress.json

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

+ 1 - 1
config/heroes/inferno.json

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

+ 1 - 1
config/heroes/rampart.json

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

+ 1 - 1
config/skills.json

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

+ 3 - 3
docs/modders/Bonus/Bonus_Types.md

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

+ 1 - 1
lib/bonuses/BonusEnum.h

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

+ 1 - 1
lib/bonuses/BonusParams.cpp

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

+ 2 - 2
lib/mapObjects/CGHeroInstance.cpp

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