mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #8109] [Feature]: Pluggable combat-style seam in GameSurface (start / render / top-chrome / active) #7564
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#7564
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @bahaynes on GitHub (Oct 22, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8109
Originally assigned to: @kolacheee on GitHub.
What problem does this solve?
GameCombatStyleis a closed union ("classic" | "tactical",packages/shared/src/types/game.ts:33, plus 6 more hardcoded["classic", "tactical"]copies).GameSurface.tsx(~14.3k lines) branches on that union inline in several places. There's no seam a combat style can plug into, so adding one means hand-editing the same file in all of these places:generateCombatStateForMessage(GameSurface.tsx:9557). A style that sets up its own encounter state has to return early before the classic party/enemies generation pass.DirectedCombatUI/effectiveCombatStyle === "tactical" ? <TacticalCombatUI> : <GameCombatUI>ternary (~13438) is the only place a combat surface can mount.tacticalCombatActive ? "top-[calc(var(--tactical-chrome-height…" : topOverlayOffsetClasschecks (~12995, ~13081), pluscontrolRowOffset, decide whether the HUD yields to a combat top bar. Onlytacticalcan opt in.combatUiActive(8949) means "classic party/enemies are populated". A surface that keeps its own state never counts as active, so the persistent map/party overlays stay drawn on top of it.I maintain a small downstream fork that carries one extra combat style. On every rebase onto
staging, nearly all of the conflict volume lands inGameSurface.tsx. A trial merge againststaging@8f8770cb6gives 9 conflict hunks there, more than every other file combined. Most of them are just upstream JSX moving next to the ~20 small insertion points listed above, not real logic clashes. The same friction applies to anyone, upstream or downstream, who wants to try a combat style without touching the 14k-line surface.Proposed solution
Additive and client-only. Combat mechanics stay vanilla, in the spirit of #5094.
A small combat-style lookup that
GameSurfaceconsults instead of branching on string literals:classicandtacticalthrough it, so behavior doesn't change.surface.ownsTopChromeandcombatUiActive || surface.isActive?.(chatId).GameCombatStyleto"classic" | "tactical" | (string & {}), or derive it from the registry, and validate setup-schema values against the registered keys.Doing this would also shrink
GameSurface.tsx, because the tactical branch moves out of it.Alternatives considered
GameSurfacedownstream. This is what we do today. It works, but it's the single largest source of rebase conflicts.Additional context
Verified against
staging@8f8770cb6by trial-merging the fork onto it (git merge-tree). Line numbers above refer to that commit. Happy to send a PR for the registry withclassic/tacticalmigrated and no behavior change, if the shape is acceptable.Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:
@SpicyMarinara commented on GitHub (Oct 22, 2026):
@kolacheee