1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-13 19:54:17 +02:00

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
This commit is contained in:
Konstantin
2023-02-14 01:24:30 +03:00
parent 0ed89e77d4
commit 43f09dd2e4
3 changed files with 5 additions and 4 deletions

View File

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

View File

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

View File

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