Drilling counts in the fight it was drilled for
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
b5dfb713de
commit
fa43661a33
2 changed files with 6 additions and 1 deletions
6
game.py
6
game.py
|
|
@ -5231,12 +5231,13 @@ def raid_readiness(world: dict, event: dict) -> list[dict]:
|
||||||
|
|
||||||
|
|
||||||
def _fire(world: dict, event: dict, now: float, rng: random.Random) -> None:
|
def _fire(world: dict, event: dict, now: float, rng: random.Random) -> None:
|
||||||
event["status"] = "done"
|
|
||||||
event["resolved"] = now
|
event["resolved"] = now
|
||||||
|
# Still upcoming while it resolves: the defence counts the drilling done against it.
|
||||||
if event["kind"] == "raid":
|
if event["kind"] == "raid":
|
||||||
_resolve_raid(world, event, now, rng)
|
_resolve_raid(world, event, now, rng)
|
||||||
elif event["kind"] == "dragon":
|
elif event["kind"] == "dragon":
|
||||||
_resolve_dragon(world, event, now, rng)
|
_resolve_dragon(world, event, now, rng)
|
||||||
|
event["status"] = "done"
|
||||||
if event["kind"] in THREATS:
|
if event["kind"] in THREATS:
|
||||||
won = event["report"]["title"].startswith("Victory")
|
won = event["report"]["title"].startswith("Victory")
|
||||||
for entry in event["report"]["garrison"] if won else []:
|
for entry in event["report"]["garrison"] if won else []:
|
||||||
|
|
@ -6843,6 +6844,9 @@ ORDER_RECIPES, ORDER_RAW = _order_sources()
|
||||||
# What changed, shown on the Patch notes page. Newest first; every shipped change adds a
|
# What changed, shown on the Patch notes page. Newest first; every shipped change adds a
|
||||||
# line here (new / balance / fix), and a new release a new entry on top.
|
# line here (new / balance / fix), and a new release a new entry on top.
|
||||||
PATCH_NOTES = [
|
PATCH_NOTES = [
|
||||||
|
{"date": "2026-11-02", "title": "Militia drilling", "notes": [
|
||||||
|
("fix", "Drilling the militia is no longer wiped before a raid is calculated. Last raid losses recalculated."),
|
||||||
|
]},
|
||||||
{"date": "2026-10-30", "title": "Armoury", "notes": [
|
{"date": "2026-10-30", "title": "Armoury", "notes": [
|
||||||
("new", "Added armoury to raid readiness."),
|
("new", "Added armoury to raid readiness."),
|
||||||
]},
|
]},
|
||||||
|
|
|
||||||
|
|
@ -1456,6 +1456,7 @@ class FavourTest(unittest.TestCase):
|
||||||
self.assertEqual(game.defence(world)["parts"]["drilled"], 20.0)
|
self.assertEqual(game.defence(world)["parts"]["drilled"], 20.0)
|
||||||
self.assertIsNone(p["action"]) # stops once the militia is fully drilled
|
self.assertIsNone(p["action"]) # stops once the militia is fully drilled
|
||||||
game.tick(world, raid["fire_at"], random.Random(1))
|
game.tick(world, raid["fire_at"], random.Random(1))
|
||||||
|
self.assertGreaterEqual(raid["report"]["parts"]["drilled"], 20.0) # the drill counts in the fight
|
||||||
self.assertEqual(game.defence(world)["parts"]["drilled"], 0)
|
self.assertEqual(game.defence(world)["parts"]["drilled"], 0)
|
||||||
|
|
||||||
def test_seasoned_fighters_drill_a_little_faster(self):
|
def test_seasoned_fighters_drill_a_little_faster(self):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue