Files
TravianZ/GameEngine
Ferywir 06d1523d9d fix(combat): gate Brewery attack bonus on an active Mead-Festival [#294] (#321)
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>
2026-06-30 15:06:44 +03:00
..
2026-06-30 14:29:13 +03:00
2026-06-29 08:02:09 +03:00
2026-05-15 08:17:14 +03:00
2026-06-29 08:02:09 +03:00
2026-05-07 08:24:40 +03:00
2026-05-28 12:25:28 +03:00
2026-06-30 10:32:01 +03:00
2026-05-15 08:17:14 +03:00
2026-05-15 08:17:14 +03:00
2026-06-09 15:15:27 +03:00
2026-05-15 08:17:14 +03:00
2026-06-29 07:49:49 +03:00
2026-05-15 08:17:14 +03:00
2026-06-30 08:24:37 +03:00
2026-06-29 08:02:09 +03:00
2026-06-29 08:02:09 +03:00