diff --git a/config/bonuses_texts.json b/config/bonuses_texts.json index 1ed5b625a..1c17d8aba 100644 --- a/config/bonuses_texts.json +++ b/config/bonuses_texts.json @@ -17,6 +17,12 @@ "name": "Additional retaliations", "description": "May Retaliate ${val} extra times" }, + + "CATAPULT_EXTRA_SHOTS": + { + "name": "Additional siege attacks", + "description": "Can hit siege walls ${val} extra times per attack" + }, "AIR_IMMUNITY": { diff --git a/config/creatures/stronghold.json b/config/creatures/stronghold.json index 95ab5a7a3..a5610ea49 100644 --- a/config/creatures/stronghold.json +++ b/config/creatures/stronghold.json @@ -269,6 +269,14 @@ "index": 95, "level": 6, "faction": "stronghold", + "abilities": + { + "siegeDoubleAttack" : + { + "type" : "CATAPULT_EXTRA_SHOTS", + "val" : 1 + } + }, "graphics" : { "animation": "CCYCLLOR.DEF", diff --git a/lib/HeroBonus.h b/lib/HeroBonus.h index b1a72848f..95431cf63 100644 --- a/lib/HeroBonus.h +++ b/lib/HeroBonus.h @@ -216,6 +216,7 @@ public: BONUS_NAME(DISGUISED) /* subtype - spell level */\ BONUS_NAME(VISIONS) /* subtype - spell level */\ BONUS_NAME(NO_TERRAIN_PENALTY) /* subtype - terrain type */\ + BONUS_NAME(CATAPULT_EXTRA_SHOTS) /*val - number of additional shots, requires CATAPULT bonus to work*/\ /* end of list */ diff --git a/server/CGameHandler.cpp b/server/CGameHandler.cpp index 773ce6c7b..cf4c14654 100644 --- a/server/CGameHandler.cpp +++ b/server/CGameHandler.cpp @@ -3954,7 +3954,15 @@ bool CGameHandler::makeBattleAction(BattleAction &ba) auto wrapper = wrapAction(ba); 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::CATAPULT_EXTRA_SHOTS), 0); + } auto wallPart = gs->curB->battleHexToWallPart(ba.destinationTile); if (!gs->curB->isWallPartPotentiallyAttackable(wallPart))