Group rest: everyone heals at their own pace

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rope 2026-10-25 20:21:08 +00:00
parent 67a1ab876a
commit 1bf3f3b62f
3 changed files with 20 additions and 5 deletions

View file

@ -2343,7 +2343,7 @@ def draw_fight(world: dict, players: list, action: dict, rng: random.Random, sta
for player in players:
seconds, eaten = rest_plan(world, player)
member = fight_member(world, player)
member.update(eaten=eaten, hp_in=member["top"])
member.update(eaten=eaten, hp_in=member["top"], rest=seconds) # full after your own rest, then wait
rest = max(rest, seconds)
members.append(member)
fight = {"seed": rng.random(), "pace": speed(world), "rest": rest, "enemy": action["enemy"]["name"],
@ -3349,7 +3349,7 @@ def draw_pull(world: dict, players: list, action: dict, run: dict, rng: random.R
for player in players:
seconds, eaten = rest_plan(world, player)
member = fight_member(world, player)
member.update(eaten=eaten, hp_in=member["top"])
member.update(eaten=eaten, hp_in=member["top"], rest=seconds) # full after your own rest, then wait
rest = max(rest, seconds)
members.append(member)
fight = {"seed": rng.random(), "pace": speed(world), "rest": rest, "enemy": name, "members": members,
@ -3447,8 +3447,8 @@ def pull_now(world: dict, player: dict, now: float) -> str | None:
if rested >= fight["rest"]:
return "Already fighting"
rested = math.ceil(rested / combat.STEP) * combat.STEP
share = rested / fight["rest"] if fight["rest"] else 1
for member in fight["members"]:
share = min(1, rested / member["rest"]) if member.get("rest") else 1
member["hp_in"] = member["start_hp"] + (member["hp_in"] - member["start_hp"]) * share
member["eaten"] = {food: int(count * share) for food, count in member["eaten"].items() if int(count * share)}
member["watch"] += fight["rest"] - rested
@ -6071,6 +6071,8 @@ PATCH_NOTES = [
("fix", "Combat page shows your health potion: drunk on its own, no need to equip. The other card now reads \"No combat potion\"."),
("fix", "Combat page no longer jumps around: cast bars hold their space and the fight log stays 7 lines tall."),
("new", "Enemy casts that can't be interrupted show a 🔒 and a grey bar. Stuns still stop them, except on bosses."),
("fix", "Resting in a group: everyone heals at their own pace, so good food tops you up first. The pull still "
"waits for the slowest, and Pull now sends each in as healed as they really are."),
]},
{"date": "2026-10-24", "title": "Dungeon loot", "notes": [
("new", "Masterwork patterns: every dungeon boss can drop one of 7 (15% from a mini-boss, 35% from the last boss, "