Implement Nebula sectors (Galactic Events expansion) - #378
Open
guygranger wants to merge 2 commits into
Open
Conversation
Closes AsyncEclipse#303. Adds full support for the Nebula sector mechanic from the Galactic Events expansion. Uses synthetic subsector position codes (295A/295B/295C) layered onto the existing single-position-string model — the parent hex acts as a render anchor and the three subsectors are exposed as first-class board entries that mirror the regular sector schema. Highlights: - helpers/NebulaHelper.py: subsector model, internal/external adjacency, parent neighbour-rewrite with rotation - helpers/GamestateHelper.add_tile: branches on enable_nebulas to build parent + 3 subsector records, places ai-anc in the Ancient subsector - helpers/GamestateHelper.setup_techs_and_outer_rim: shuffles 295 into ring II and 395 into ring III when nebulas are enabled (per rulebook p. 4 the ring-III tile is appended after the regular sector_draws) - Buttons/Move.getTilesInRange: skips parent records, walks subsector adjacency including internal sibling hops (matches rulebook example of 'two Move Activations' to cross an internal wormhole) - Buttons/Influence: areTwoTilesAdjacent returns True for sibling subsectors; getTilesToInfluence excludes any tile of type='nebula' (parent or subsector) — nebulas may never contain Influence Discs - Buttons/Explore: handles the nebula-as-explore-source case via the parent-rewrite, and shows a one-line explanation when a nebula is placed (no influence prompt, no immediate discovery prompt) - Buttons/DiscoveryTile._maybe_reroll_for_nebula: implements the Ancient Orbital / Ancient Monolith reroll rule — if either is drawn for a nebula subsector, shuffle it back and draw again before presenting the player's choice - helpers/CombatHelper.claimNebulaDiscoveries + Turn.runUpkeep hook: end-of-Combat-Phase discovery resolution. A discovery in a nebula subsector is claimed only by a single non-AI player whose ships remain there at that point. Errors surface to the channel so a GM can recover via /tile resolve_specific_discovery_tile - helpers/DrawHelper: subsector positions return None from board_tile_image (their ships are drawn on top of the parent's hex); _render_ships extracted so the parent hex can render all three subsectors' ships using each subsector's *_snap coords - commands/setup_commands + setup/GameInit: enable_nebulas flag on /setup create_new_game (default True) - tests/test_nebulas.py: 19 cases covering setup, three-subsector creation, disctile/ancient distribution, internal + external + rotated adjacency, the influence-target type filter, deck population with the flag on/off, and the orbital/monolith reroll edge cases Verified subsector layout against printed art for both NGC 5189 (295) and NGC 1952 (395) — Ancient in the right subsector (B), Discoveries in the top (A) and bottom-left (C). All 23 tests pass.
Moved message delete into the loops. I believe if the button is pressed but then the user receives a "bot busy" error...then the buttons are deleted but the user is not added to the draw queue
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.
Closes #303.
Adds full support for the Nebula sector mechanic from the Galactic Events expansion. Uses synthetic subsector position codes (295A/295B/295C) layered onto the existing single-position-string model — the parent hex acts as a render anchor and the three subsectors are exposed as first-class board entries that mirror the regular sector schema.
Highlights:
Verified subsector layout against printed art for both NGC 5189 (295) and NGC 1952 (395) — Ancient in the right subsector (B), Discoveries in the top (A) and bottom-left (C). All 23 tests pass.