Repository navigation
Show each member's distance, reach, and sight in the encounter view - #219
Merged
Merged
Conversation
The player view now reports each member's advance, each member's distance to each group, who can fight each group hand to hand, the formation width, the party's free round after a surprise, and each member's encounter rate. Each group's front rank comes from the same helper as group_front_rank, so the two always agree. The encounter's own front rank is now the first row toward the nearest group instead of the first rank of the marching order. Each group also reports whether the party's light reaches it and which members can see it. A group is lit when a living member carrying a light stands within that light's radius of it. A member sees a lit group, or a group within the range of their working infravision. Blind members see nothing, and darkness puts out the light and can stop infravision. The session refuses nothing new because of sight. The ring of protection's 5' radius now shields the defender's rank-mates toward the attacking group, the members at the same distance from it, instead of the defender's marching-order rank. Claude-Session: https://claude.ai/code/session_01V7ErtnsmhaP7aLwcfmzohD
…after it The battle module's docstring now walks through the round step by step: the judgement of every declaration at the places its moves would reach, the party's movement step, missiles and spells from each member's own place, melee only within reach and in the front rank, and monsters that close and attack in the same round. It also points a battle screen at the encounter view. MemberMovedEvent and GroupMovedEvent report a distance right after the move, before any shift of the party line, so their docstrings now tell a client to narrate the move from the event and to read EncounterView.advance_feet after the round to draw positions. preview_battle_round's docstring now says that a partial plan judges a defensive move as one member's own move, and that the complete plan can turn into a formation move when every declarer makes the same one. The rejection reference for combat.attack.out_of_reach and combat.attack.out_of_range now says the distance is the member's own, after any close the same declaration makes. Claude-Session: https://claude.ai/code/session_01V7ErtnsmhaP7aLwcfmzohD
The encounter view tests for positions, reach, and sight pass, including the round-by-round battle with the thief's back-stab, the elf's bow, the fighters' close, and the magic-user's spell, so their expected-to-fail markers come off. Claude-Session: https://claude.ai/code/session_01V7ErtnsmhaP7aLwcfmzohD
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the view chunk of issue #209. The encounter view now gives a battle screen what it needs once party members stand at their own distances:
member_distance_feet,front_rank(who can make a melee attack on it this round without moving, and whom its melee reaches),lit, andseen_by.EncounterView.advance_feet,formation_width, andparty_free_round, the round in which a back-stab is legal.MemberView.encounter_rate_feet, the member's feet per round after encumbrance and haste.EncounterGroupView.front_rankalways equalsgroup_front_rankfor the same group. Light and sight are reported only, so nothing new is refused. Every new field reads party state and the group distances the view already shows, so the player view reveals nothing referee-only. The Ring of Protection's 5' radius now counts the defender's rank-mates toward the attacking group.The docstrings of
MemberMovedEventandGroupMovedEventnow say to read positions from the view after the round, because a shift of the party line changes them with no event.preview_battle_roundsays how a partial plan judges a defensive move. The battle module's docstring describes the round as it now works.The test of the maintainer's goal battle passes: the thief closes and back-stabs in the free round, the elf shoots from 30', the fighters close, and the magic-user casts magic missile from the back.
https://claude.ai/code/session_01V7ErtnsmhaP7aLwcfmzohD