1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +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" : [
{
"subtype" : "skill.eagleEye",
"type" : "SECONDARY_SKILL_PREMY",
"subtype" : 0,
"type" : "LEARN_BATTLE_SPELL_CHANCE",
"val" : 5,
"valueType" : "ADDITIVE_VALUE"
}
@ -1003,8 +1003,8 @@
{
"bonuses" : [
{
"subtype" : "skill.eagleEye",
"type" : "SECONDARY_SKILL_PREMY",
"subtype" : 0,
"type" : "LEARN_BATTLE_SPELL_CHANCE",
"val" : 10,
"valueType" : "ADDITIVE_VALUE"
}
@ -1016,8 +1016,8 @@
{
"bonuses" : [
{
"subtype" : "skill.eagleEye",
"type" : "SECONDARY_SKILL_PREMY",
"subtype" : 0,
"type" : "LEARN_BATTLE_SPELL_CHANCE",
"val" : 15,
"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":
{
"graphics":

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -313,13 +313,13 @@
"base" : {
"effects" : {
"main" : {
"subtype" : "skill.eagleEye",
"type" : "SECONDARY_SKILL_PREMY",
"subtype" : 0,
"type" : "LEARN_BATTLE_SPELL_CHANCE",
"valueType" : "BASE_NUMBER"
},
"val2" : {
"subtype" : "skill.eagleEye",
"type" : "SECONDARY_SKILL_VAL2",
"subtype" : -1,
"type" : "LEARN_BATTLE_SPELL_LEVEL_LIMIT",
"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(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(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 */

View File

@ -743,9 +743,9 @@ void CGameHandler::endBattle(int3 tile, const CGHeroInstance * heroAttacker, con
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)
{
auto spell = spellId.toSpell(VLC->spells());