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

vcmi: replace SecondarySkillPremy:EAGLE_EYE

Replace this bonus to new ArcaneIntuition bonus, which
will work independently from the rest of skill bonuses.
Proof of concept for other skills.
This commit is contained in:
Konstantin
2023-01-28 21:19:58 +03:00
parent a0a78d0596
commit 4a89418ada
12 changed files with 52 additions and 33 deletions

View File

@@ -990,8 +990,8 @@
{ {
"bonuses" : [ "bonuses" : [
{ {
"subtype" : "skill.eagleEye", "subtype" : 0,
"type" : "SECONDARY_SKILL_PREMY", "type" : "LEARN_BATTLE_SPELL_CHANCE",
"val" : 5, "val" : 5,
"valueType" : "ADDITIVE_VALUE" "valueType" : "ADDITIVE_VALUE"
} }
@@ -1003,8 +1003,8 @@
{ {
"bonuses" : [ "bonuses" : [
{ {
"subtype" : "skill.eagleEye", "subtype" : 0,
"type" : "SECONDARY_SKILL_PREMY", "type" : "LEARN_BATTLE_SPELL_CHANCE",
"val" : 10, "val" : 10,
"valueType" : "ADDITIVE_VALUE" "valueType" : "ADDITIVE_VALUE"
} }
@@ -1016,8 +1016,8 @@
{ {
"bonuses" : [ "bonuses" : [
{ {
"subtype" : "skill.eagleEye", "subtype" : 0,
"type" : "SECONDARY_SKILL_PREMY", "type" : "LEARN_BATTLE_SPELL_CHANCE",
"val" : 15, "val" : 15,
"valueType" : "ADDITIVE_VALUE" "valueType" : "ADDITIVE_VALUE"
} }

View File

@@ -271,6 +271,16 @@
} }
}, },
"LEARN_BATTLE_SPELL_CHANCE":
{
"hidden": true
},
"LEARN_BATTLE_SPELL_LEVEL_LIMIT":
{
"hidden": true
},
"LEVEL_SPELL_IMMUNITY": "LEVEL_SPELL_IMMUNITY":
{ {
"graphics": "graphics":

View File

@@ -264,11 +264,12 @@
"specialty" : { "specialty" : {
"bonuses" : { "bonuses" : {
"eagleEye" : { "eagleEye" : {
"subtype" : "skill.eagleEye", "subtype" : 0,
"type" : "SECONDARY_SKILL_PREMY", "type" : "LEARN_BATTLE_SPELL_CHANCE",
"updater" : "TIMES_HERO_LEVEL", "updater" : "TIMES_HERO_LEVEL",
"val" : 5, "val" : 5,
"valueType" : "PERCENT_TO_BASE" "valueType" : "PERCENT_TO_TARGET_TYPE",
"targetSourceType" : "SECONDARY_SKILL"
} }
} }
} }

View File

@@ -227,11 +227,12 @@
"specialty" : { "specialty" : {
"bonuses" : { "bonuses" : {
"eagleEye" : { "eagleEye" : {
"subtype" : "skill.eagleEye", "subtype" : 0,
"type" : "SECONDARY_SKILL_PREMY", "type" : "LEARN_BATTLE_SPELL_CHANCE",
"updater" : "TIMES_HERO_LEVEL", "updater" : "TIMES_HERO_LEVEL",
"val" : 5, "val" : 5,
"valueType" : "PERCENT_TO_BASE" "valueType" : "PERCENT_TO_TARGET_TYPE",
"targetSourceType" : "SECONDARY_SKILL"
} }
} }
} }

View File

@@ -303,11 +303,12 @@
"specialty" : { "specialty" : {
"bonuses" : { "bonuses" : {
"eagleEye" : { "eagleEye" : {
"subtype" : "skill.eagleEye", "subtype" : 0,
"type" : "SECONDARY_SKILL_PREMY", "type" : "LEARN_BATTLE_SPELL_CHANCE",
"updater" : "TIMES_HERO_LEVEL", "updater" : "TIMES_HERO_LEVEL",
"val" : 5, "val" : 5,
"valueType" : "PERCENT_TO_BASE" "valueType" : "PERCENT_TO_TARGET_TYPE",
"targetSourceType" : "SECONDARY_SKILL"
} }
} }
} }

View File

@@ -213,11 +213,12 @@
"specialty" : { "specialty" : {
"bonuses" : { "bonuses" : {
"eagleEye" : { "eagleEye" : {
"subtype" : "skill.eagleEye", "subtype" : 0,
"type" : "SECONDARY_SKILL_PREMY", "type" : "LEARN_BATTLE_SPELL_CHANCE",
"updater" : "TIMES_HERO_LEVEL", "updater" : "TIMES_HERO_LEVEL",
"val" : 5, "val" : 5,
"valueType" : "PERCENT_TO_BASE" "valueType" : "PERCENT_TO_TARGET_TYPE",
"targetSourceType" : "SECONDARY_SKILL"
} }
} }
} }

View File

@@ -242,11 +242,12 @@
"specialty" : { "specialty" : {
"bonuses" : { "bonuses" : {
"eagleEye" : { "eagleEye" : {
"subtype" : "skill.eagleEye", "subtype" : 0,
"type" : "SECONDARY_SKILL_PREMY", "type" : "LEARN_BATTLE_SPELL_CHANCE",
"updater" : "TIMES_HERO_LEVEL", "updater" : "TIMES_HERO_LEVEL",
"val" : 5, "val" : 5,
"valueType" : "PERCENT_TO_BASE" "valueType" : "PERCENT_TO_TARGET_TYPE",
"targetSourceType" : "SECONDARY_SKILL"
} }
} }
} }

View File

@@ -258,11 +258,12 @@
"specialty" : { "specialty" : {
"bonuses" : { "bonuses" : {
"eagleEye" : { "eagleEye" : {
"subtype" : "skill.eagleEye", "subtype" : 0,
"type" : "SECONDARY_SKILL_PREMY", "type" : "LEARN_BATTLE_SPELL_CHANCE",
"updater" : "TIMES_HERO_LEVEL", "updater" : "TIMES_HERO_LEVEL",
"val" : 5, "val" : 5,
"valueType" : "PERCENT_TO_BASE" "valueType" : "PERCENT_TO_TARGET_TYPE",
"targetSourceType" : "SECONDARY_SKILL"
} }
} }
} }

View File

@@ -190,11 +190,12 @@
"specialty" : { "specialty" : {
"bonuses" : { "bonuses" : {
"eagleEye" : { "eagleEye" : {
"subtype" : "skill.eagleEye", "subtype" : 0,
"type" : "SECONDARY_SKILL_PREMY", "type" : "LEARN_BATTLE_SPELL_CHANCE",
"updater" : "TIMES_HERO_LEVEL", "updater" : "TIMES_HERO_LEVEL",
"val" : 5, "val" : 5,
"valueType" : "PERCENT_TO_BASE" "valueType" : "PERCENT_TO_TARGET_TYPE",
"targetSourceType" : "SECONDARY_SKILL"
} }
} }
} }

View File

@@ -313,13 +313,13 @@
"base" : { "base" : {
"effects" : { "effects" : {
"main" : { "main" : {
"subtype" : "skill.eagleEye", "subtype" : 0,
"type" : "SECONDARY_SKILL_PREMY", "type" : "LEARN_BATTLE_SPELL_CHANCE",
"valueType" : "BASE_NUMBER" "valueType" : "BASE_NUMBER"
}, },
"val2" : { "val2" : {
"subtype" : "skill.eagleEye", "subtype" : -1,
"type" : "SECONDARY_SKILL_VAL2", "type" : "LEARN_BATTLE_SPELL_LEVEL_LIMIT",
"valueType" : "BASE_NUMBER" "valueType" : "BASE_NUMBER"
} }
} }

View File

@@ -332,6 +332,8 @@ public:
BONUS_NAME(SPECIAL_FIXED_VALUE_ENCHANT) /*specialty spell like Melody has, constant spell effect (i.e. 3 luck), additionalInfo = value to fix.*/\ BONUS_NAME(SPECIAL_FIXED_VALUE_ENCHANT) /*specialty spell like Melody has, constant spell effect (i.e. 3 luck), additionalInfo = value to fix.*/\
BONUS_NAME(TOWN_MAGIC_WELL) /*one-time pseudo-bonus to implement Magic Well in the town*/\ BONUS_NAME(TOWN_MAGIC_WELL) /*one-time pseudo-bonus to implement Magic Well in the town*/\
BONUS_NAME(LIMITED_SHOOTING_RANGE) /*limits range of shooting creatures, doesn't adjust any other mechanics (half vs full damage etc). val - range in hexes, additional info - optional new range for broken arrow mechanic */\ BONUS_NAME(LIMITED_SHOOTING_RANGE) /*limits range of shooting creatures, doesn't adjust any other mechanics (half vs full damage etc). val - range in hexes, additional info - optional new range for broken arrow mechanic */\
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*/\
/* end of list */ /* end of list */

View File

@@ -743,9 +743,9 @@ void CGameHandler::endBattle(int3 tile, const CGHeroInstance * heroAttacker, con
if (finishingBattle->winnerHero) if (finishingBattle->winnerHero)
{ {
if (int eagleEyeLevel = finishingBattle->winnerHero->valOfBonuses(Bonus::SECONDARY_SKILL_VAL2, SecondarySkill::EAGLE_EYE)) if (int eagleEyeLevel = finishingBattle->winnerHero->valOfBonuses(Bonus::LEARN_BATTLE_SPELL_LEVEL_LIMIT, -1))
{ {
double eagleEyeChance = finishingBattle->winnerHero->valOfBonuses(Bonus::SECONDARY_SKILL_PREMY, SecondarySkill::EAGLE_EYE); double eagleEyeChance = finishingBattle->winnerHero->valOfBonuses(Bonus::LEARN_BATTLE_SPELL_CHANCE, 0);
for(auto & spellId : gs->curB->sides.at(!battleResult.data->winner).usedSpellsHistory) for(auto & spellId : gs->curB->sides.at(!battleResult.data->winner).usedSpellsHistory)
{ {
auto spell = spellId.toSpell(VLC->spells()); auto spell = spellId.toSpell(VLC->spells());