mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-07-02 02:24:21 +00:00
06d1523d9d
The Brewery (building 35, Teuton-only) grants a +1% attack bonus per level to the whole empire, but only while a Mead-Festival is running (72h), and the building is capital-only. The attack-bonus block in calculateBattle() ignored both rules: it read the Brewery level from $AttackerWref (the *launching* village, which usually has no Brewery) and applied the bonus purely on the building level, with no festival check. As a result the bonus never reacted to the festival being started or expired: attacks with and without an active festival produced identical losses, so the army appeared unaffected by the festival (issue #294). Depending on whether the attack was launched from the capital, the bonus was either permanently on or permanently off, but never gated by the festival. Read the Brewery level from the attacker's capital and gate the bonus on the festival being active, mirroring the catapult-randomization gate in Units.php and the chief-penalty gate in Automation.php. The simulator passes AttackerID = 0, so it keeps a 0 bonus exactly as before. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>