1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Store penalty in value of FLYING_MOVEMENT and WATER_WALKING

This commit is contained in:
ArseniyShestakov 2015-10-26 18:30:11 +03:00
parent 44ca00cd16
commit 68bd37aa45
4 changed files with 14 additions and 22 deletions

View File

@ -1058,10 +1058,9 @@
{
"bonuses" : [
{
"subtype" : 3,
"type" : "FLYING_MOVEMENT",
"val" : 0,
"valueType" : "BASE_NUMBER"
"valueType" : "INDEPENDENT_MIN"
}
],
"index" : 72,
@ -1276,10 +1275,9 @@
{
"bonuses" : [
{
"subtype" : 3,
"type" : "WATER_WALKING",
"val" : 0,
"valueType" : "BASE_NUMBER"
"valueType" : "INDEPENDENT_MIN"
}
],
"index" : 90,

View File

@ -176,23 +176,23 @@
"effects" : {
"fly" : {
"type" : "FLYING_MOVEMENT",
"subtype" : 1,
"duration" : "ONE_DAY",
"val" : 0 //in fact unused
"val" : 40,
"valueType" : "INDEPENDENT_MIN"
}
}
},
"advanced":{
"effects" : {
"fly" : {
"subtype" : 2
"val" : 20
}
}
},
"expert":{
"effects" : {
"fly" : {
"subtype" : 3
"val" : 0
}
}
}
@ -214,23 +214,23 @@
"effects" : {
"waterWalk" : {
"type" : "WATER_WALKING",
"subtype" : 1,
"duration" : "ONE_DAY",
"val" : 0 //in fact unused
"val" : 40,
"valueType" : "INDEPENDENT_MIN"
}
}
},
"advanced":{
"effects" : {
"waterWalk" : {
"subtype" : 2
"val" : 20
}
}
},
"expert":{
"effects" : {
"waterWalk" : {
"subtype" : 3
"val" : 0
}
}
}

View File

@ -2112,10 +2112,7 @@ int CGameState::getMovementCost(const CGHeroInstance *h, const int3 &src, const
if(d.blocked && h->canFly())
{
if(h->hasBonusOfType(Bonus::FLYING_MOVEMENT, 1)) // base flying
ret *= 1.4; //40% penalty for movement over blocked tile
else if(h->hasBonusOfType(Bonus::FLYING_MOVEMENT, 2)) // advanced flying
ret *= 1.2;
ret *= (100.0 + h->valOfBonuses(Bonus::FLYING_MOVEMENT)) / 100.0;
}
else if(d.terType == ETerrainType::WATER)
{
@ -2123,10 +2120,7 @@ int CGameState::getMovementCost(const CGHeroInstance *h, const int3 &src, const
ret *= 0.666;
else if(!h->boat && h->canWalkOnSea())
{
if(h->hasBonusOfType(Bonus::WATER_WALKING, 1)) // base
ret *= 1.4; //40% penalty for water walking
else if(h->hasBonusOfType(Bonus::WATER_WALKING, 2)) // advanced
ret *= 1.2;
ret *= (100.0 + h->valOfBonuses(Bonus::WATER_WALKING)) / 100.0;
}
}

View File

@ -86,13 +86,13 @@ public:
BONUS_NAME(SECONDARY_SKILL_PREMY) /*%*/ \
BONUS_NAME(SURRENDER_DISCOUNT) /*%*/ \
BONUS_NAME(STACKS_SPEED) /*additional info - percent of speed bonus applied after direct bonuses; >0 - added, <0 - subtracted to this part*/ \
BONUS_NAME(FLYING_MOVEMENT) /*subtype 1 - 40% penalty, 2 - 20% penalty, 3 - without penalty*/ \
BONUS_NAME(FLYING_MOVEMENT) /*value - penalty percentage*/ \
BONUS_NAME(SPELL_DURATION) \
BONUS_NAME(AIR_SPELL_DMG_PREMY) \
BONUS_NAME(EARTH_SPELL_DMG_PREMY) \
BONUS_NAME(FIRE_SPELL_DMG_PREMY) \
BONUS_NAME(WATER_SPELL_DMG_PREMY) \
BONUS_NAME(WATER_WALKING) /*subtype 1 - 40% penalty, 2 - 20% penalty, 3 - without penalty*/ \
BONUS_NAME(WATER_WALKING) /*value - penalty percentage*/ \
BONUS_NAME(NEGATE_ALL_NATURAL_IMMUNITIES) \
BONUS_NAME(STACK_HEALTH) \
BONUS_NAME(BLOCK_MORALE) \