mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-15 01:24:45 +02:00
vcmi: replace archery and offence to new bonus
Add PERCENTAGE_DAMAGE_BOOST bonus, which will work exactly as old archery or offence. Subtype is actually boolean which select ranged (1) and melee (0)
This commit is contained in:
@ -912,8 +912,8 @@
|
|||||||
{
|
{
|
||||||
"bonuses" : [
|
"bonuses" : [
|
||||||
{
|
{
|
||||||
"subtype" : "skill.archery",
|
"type" : "PERCENTAGE_DAMAGE_BOOST",
|
||||||
"type" : "SECONDARY_SKILL_PREMY",
|
"subtype" : 1,
|
||||||
"val" : 5,
|
"val" : 5,
|
||||||
"valueType" : "ADDITIVE_VALUE",
|
"valueType" : "ADDITIVE_VALUE",
|
||||||
"limiters" : [
|
"limiters" : [
|
||||||
@ -938,8 +938,8 @@
|
|||||||
{
|
{
|
||||||
"bonuses" : [
|
"bonuses" : [
|
||||||
{
|
{
|
||||||
"subtype" : "skill.archery",
|
"type" : "PERCENTAGE_DAMAGE_BOOST",
|
||||||
"type" : "SECONDARY_SKILL_PREMY",
|
"subtype" : 1,
|
||||||
"val" : 10,
|
"val" : 10,
|
||||||
"valueType" : "ADDITIVE_VALUE",
|
"valueType" : "ADDITIVE_VALUE",
|
||||||
"limiters" : [
|
"limiters" : [
|
||||||
@ -964,8 +964,8 @@
|
|||||||
{
|
{
|
||||||
"bonuses" : [
|
"bonuses" : [
|
||||||
{
|
{
|
||||||
"subtype" : "skill.archery",
|
"type" : "PERCENTAGE_DAMAGE_BOOST",
|
||||||
"type" : "SECONDARY_SKILL_PREMY",
|
"subtype" : 1,
|
||||||
"val" : 15,
|
"val" : 15,
|
||||||
"valueType" : "ADDITIVE_VALUE",
|
"valueType" : "ADDITIVE_VALUE",
|
||||||
"limiters" : [
|
"limiters" : [
|
||||||
|
@ -403,6 +403,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"PERCENTAGE_DAMAGE_BOOST":
|
||||||
|
{
|
||||||
|
"hidden": true
|
||||||
|
},
|
||||||
|
|
||||||
"RECEPTIVE":
|
"RECEPTIVE":
|
||||||
{
|
{
|
||||||
"graphics":
|
"graphics":
|
||||||
|
@ -12,11 +12,12 @@
|
|||||||
"specialty" : {
|
"specialty" : {
|
||||||
"bonuses" : {
|
"bonuses" : {
|
||||||
"archery" : {
|
"archery" : {
|
||||||
"subtype" : "skill.archery",
|
"type" : "PERCENTAGE_DAMAGE_BOOST",
|
||||||
"type" : "SECONDARY_SKILL_PREMY",
|
"subtype" : 1,
|
||||||
"updater" : "TIMES_HERO_LEVEL",
|
"updater" : "TIMES_HERO_LEVEL",
|
||||||
"val" : 5,
|
"val" : 5,
|
||||||
"valueType" : "PERCENT_TO_BASE"
|
"valueType" : "PERCENT_TO_TARGET_TYPE",
|
||||||
|
"targetSourceType" : "SECONDARY_SKILL"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -95,11 +95,12 @@
|
|||||||
"specialty" : {
|
"specialty" : {
|
||||||
"bonuses" : {
|
"bonuses" : {
|
||||||
"offence" : {
|
"offence" : {
|
||||||
"subtype" : "skill.offence",
|
"subtype" : 0,
|
||||||
"type" : "SECONDARY_SKILL_PREMY",
|
"type" : "PERCENTAGE_DAMAGE_BOOST",
|
||||||
"updater" : "TIMES_HERO_LEVEL",
|
"updater" : "TIMES_HERO_LEVEL",
|
||||||
"val" : 5,
|
"val" : 5,
|
||||||
"valueType" : "PERCENT_TO_BASE"
|
"valueType" : "PERCENT_TO_TARGET_TYPE",
|
||||||
|
"targetSourceType" : "SECONDARY_SKILL"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,8 +31,8 @@
|
|||||||
"base" : {
|
"base" : {
|
||||||
"effects" : {
|
"effects" : {
|
||||||
"main" : {
|
"main" : {
|
||||||
"subtype" : "skill.archery",
|
"type" : "PERCENTAGE_DAMAGE_BOOST",
|
||||||
"type" : "SECONDARY_SKILL_PREMY",
|
"subtype" : 1,
|
||||||
"valueType" : "BASE_NUMBER"
|
"valueType" : "BASE_NUMBER"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -645,8 +645,8 @@
|
|||||||
"base" : {
|
"base" : {
|
||||||
"effects" : {
|
"effects" : {
|
||||||
"main" : {
|
"main" : {
|
||||||
"subtype" : "skill.offence",
|
"subtype" : 0,
|
||||||
"type" : "SECONDARY_SKILL_PREMY",
|
"type" : "PERCENTAGE_DAMAGE_BOOST",
|
||||||
"valueType" : "BASE_NUMBER"
|
"valueType" : "BASE_NUMBER"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -334,6 +334,7 @@ public:
|
|||||||
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_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(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*/\
|
||||||
/* end of list */
|
/* end of list */
|
||||||
|
|
||||||
|
|
||||||
|
@ -201,18 +201,16 @@ double DamageCalculator::getAttackBlessFactor() const
|
|||||||
|
|
||||||
double DamageCalculator::getAttackOffenseArcheryFactor() const
|
double DamageCalculator::getAttackOffenseArcheryFactor() const
|
||||||
{
|
{
|
||||||
|
|
||||||
if(info.shooting)
|
if(info.shooting)
|
||||||
{
|
{
|
||||||
const std::string cachingStrArchery = "type_SECONDARY_SKILL_PREMYs_ARCHERY";
|
const std::string cachingStrArchery = "type_PERCENTAGE_DAMAGE_BOOSTs_1";
|
||||||
static const auto selectorArchery = Selector::typeSubtype(Bonus::SECONDARY_SKILL_PREMY, SecondarySkill::ARCHERY);
|
static const auto selectorArchery = Selector::typeSubtype(Bonus::PERCENTAGE_DAMAGE_BOOST, 1);
|
||||||
return info.attacker->valOfBonuses(selectorArchery, cachingStrArchery) / 100.0;
|
return info.attacker->valOfBonuses(selectorArchery, cachingStrArchery) / 100.0;
|
||||||
}
|
}
|
||||||
else
|
const std::string cachingStrOffence = "type_PERCENTAGE_DAMAGE_BOOSTs_0";
|
||||||
{
|
static const auto selectorOffence = Selector::typeSubtype(Bonus::PERCENTAGE_DAMAGE_BOOST, 0);
|
||||||
const std::string cachingStrOffence = "type_SECONDARY_SKILL_PREMYs_OFFENCE";
|
return info.attacker->valOfBonuses(selectorOffence, cachingStrOffence) / 100.0;
|
||||||
static const auto selectorOffence = Selector::typeSubtype(Bonus::SECONDARY_SKILL_PREMY, SecondarySkill::OFFENCE);
|
|
||||||
return info.attacker->valOfBonuses(selectorOffence, cachingStrOffence) / 100.0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
double DamageCalculator::getAttackLuckFactor() const
|
double DamageCalculator::getAttackLuckFactor() const
|
||||||
|
Reference in New Issue
Block a user