瀏覽代碼

vcmi: convert scholar to new bonus

Convert scholar to new skill-agnostic bonus. Now works only for any
school (not from specific). In all schools form identical to
past's SECONDARY_SKILL_PREMY::SCHOLAR
Konstantin 2 年之前
父節點
當前提交
43f09dd2e4
共有 3 個文件被更改,包括 5 次插入4 次删除
  1. 2 2
      config/skills.json
  2. 1 0
      lib/HeroBonus.h
  3. 2 2
      server/CGameHandler.cpp

+ 2 - 2
config/skills.json

@@ -517,8 +517,8 @@
 		"base" : {
 			"effects" : {
 				"main" : {
-					"subtype" : "skill.scholar",
-					"type" : "SECONDARY_SKILL_PREMY",
+					"subtype" : -1,
+					"type" : "LEARN_MEETING_SPELL_LIMIT",
 					"valueType" : "BASE_NUMBER"
 				}
 			}

+ 1 - 0
lib/HeroBonus.h

@@ -335,6 +335,7 @@ public:
 	BONUS_NAME(LEARN_BATTLE_SPELL_CHANCE) /*skill-agnostic eagle eye chance. subtype = 0 - from enemy, 1 - TODO: from entire battlefield*/\
 	BONUS_NAME(LEARN_BATTLE_SPELL_LEVEL_LIMIT) /*skill-agnostic eagle eye limit, subtype - school (-1 for all), others TODO*/\
 	BONUS_NAME(PERCENTAGE_DAMAGE_BOOST) /*skill-agnostic archery and offence, subtype is 0 for offence and 1 for archery*/\
+	BONUS_NAME(LEARN_MEETING_SPELL_LIMIT) /*skill-agnostic scholar, subtype is -1 for all, TODO for others (> 0)*/
 	/* end of list */
 
 

+ 2 - 2
server/CGameHandler.cpp

@@ -2781,8 +2781,8 @@ void CGameHandler::useScholarSkill(ObjectInstanceID fromHero, ObjectInstanceID t
 {
 	const CGHeroInstance * h1 = getHero(fromHero);
 	const CGHeroInstance * h2 = getHero(toHero);
-	int h1_scholarSpellLevel = h1->valOfBonuses(Bonus::SECONDARY_SKILL_PREMY, SecondarySkill::SCHOLAR);
-	int h2_scholarSpellLevel = h2->valOfBonuses(Bonus::SECONDARY_SKILL_PREMY, SecondarySkill::SCHOLAR);
+	int h1_scholarSpellLevel = h1->valOfBonuses(Bonus::LEARN_MEETING_SPELL_LIMIT, -1);
+	int h2_scholarSpellLevel = h2->valOfBonuses(Bonus::LEARN_MEETING_SPELL_LIMIT, -1);
 
 	if (h1_scholarSpellLevel < h2_scholarSpellLevel)
 	{