mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-29 21:56:54 +02:00
Extend creature siege support. Fix bug #2600
This commit is contained in:
parent
76d3c98b85
commit
a8f04aede7
@ -18,6 +18,12 @@
|
|||||||
"description": "May Retaliate ${val} extra times"
|
"description": "May Retaliate ${val} extra times"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"ADVANCED_CATAPULT":
|
||||||
|
{
|
||||||
|
"name": "Advanced wall breaker",
|
||||||
|
"description": "Can hit siege walls ${val} extra times per attack"
|
||||||
|
},
|
||||||
|
|
||||||
"AIR_IMMUNITY":
|
"AIR_IMMUNITY":
|
||||||
{
|
{
|
||||||
"name": "Air immunity",
|
"name": "Air immunity",
|
||||||
|
@ -269,6 +269,14 @@
|
|||||||
"index": 95,
|
"index": 95,
|
||||||
"level": 6,
|
"level": 6,
|
||||||
"faction": "stronghold",
|
"faction": "stronghold",
|
||||||
|
"abilities":
|
||||||
|
{
|
||||||
|
"siegeDoubleAttack" :
|
||||||
|
{
|
||||||
|
"type" : "ADVANCED_CATAPULT",
|
||||||
|
"val" : 1
|
||||||
|
}
|
||||||
|
},
|
||||||
"graphics" :
|
"graphics" :
|
||||||
{
|
{
|
||||||
"animation": "CCYCLLOR.DEF",
|
"animation": "CCYCLLOR.DEF",
|
||||||
|
@ -216,6 +216,7 @@ public:
|
|||||||
BONUS_NAME(DISGUISED) /* subtype - spell level */\
|
BONUS_NAME(DISGUISED) /* subtype - spell level */\
|
||||||
BONUS_NAME(VISIONS) /* subtype - spell level */\
|
BONUS_NAME(VISIONS) /* subtype - spell level */\
|
||||||
BONUS_NAME(NO_TERRAIN_PENALTY) /* subtype - terrain type */\
|
BONUS_NAME(NO_TERRAIN_PENALTY) /* subtype - terrain type */\
|
||||||
|
BONUS_NAME(ADVANCED_CATAPULT) /*val - number of additional shots, requires CATAPULT bonus to work*/\
|
||||||
/* end of list */
|
/* end of list */
|
||||||
|
|
||||||
|
|
||||||
|
@ -3954,7 +3954,15 @@ bool CGameHandler::makeBattleAction(BattleAction &ba)
|
|||||||
auto wrapper = wrapAction(ba);
|
auto wrapper = wrapAction(ba);
|
||||||
|
|
||||||
const CGHeroInstance * attackingHero = gs->curB->battleGetFightingHero(ba.side);
|
const CGHeroInstance * attackingHero = gs->curB->battleGetFightingHero(ba.side);
|
||||||
CHeroHandler::SBallisticsLevelInfo sbi = VLC->heroh->ballistics.at(attackingHero->getSecSkillLevel(SecondarySkill::BALLISTICS));
|
|
||||||
|
CHeroHandler::SBallisticsLevelInfo sbi;
|
||||||
|
if(stack->getCreature()->idNumber == CreatureID::CATAPULT)
|
||||||
|
sbi = VLC->heroh->ballistics.at(attackingHero->getSecSkillLevel(SecondarySkill::BALLISTICS));
|
||||||
|
else //may need to use higher ballistics level for creatures in future for some cases to match original H3 (upgraded cyclops etc)
|
||||||
|
{
|
||||||
|
sbi = VLC->heroh->ballistics.at(1);
|
||||||
|
sbi.shots += std::max(stack->valOfBonuses(Bonus::ADVANCED_CATAPULT), 0);
|
||||||
|
}
|
||||||
|
|
||||||
auto wallPart = gs->curB->battleHexToWallPart(ba.destinationTile);
|
auto wallPart = gs->curB->battleHexToWallPart(ba.destinationTile);
|
||||||
if (!gs->curB->isWallPartPotentiallyAttackable(wallPart))
|
if (!gs->curB->isWallPartPotentiallyAttackable(wallPart))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user