feat: targeting system (cursor) — foundation for spells & GM commands (#32) #37
No reviewers
Labels
No labels
alpha:wave-0
alpha:wave-1
alpha:wave-2
alpha:wave-3
area:assets
area:combat
area:ecology
area:infra
area:render
area:scripting
area:ui
area:world
enhancement
epic
migration
post-alpha
roadmap
tech-debt
type:bug
type:chore
type:design
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
marco/IsoMmo!37
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/targeting"
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?
Closes #32.
Summary
A general target-selection system (UO-style cursor) — the foundation for the spell system (#36) and a cleanup of GM commands.
NeedsTarget(TargetSpec); the server sends aTargetRequest; the client enters a crosshair cursor and replies with aTargetResponse(a picked mobile, a tile, or cancel).TileMap.HasLineOfSight, Bresenham) — then re-dispatches the action with a typed, polymorphicResolvedTarget(MobileTarget/TileTarget).Mobile, range 5, LoS) and a "create object" (Tile, range, no LoS).GM commands retrofit
Commands now return
CommandResult(Feedback|NeedsTarget):/spawn rat→ target a tile (rejected if blocked)./kill→ target a creature (LoS + within view) — replaces the old client-side_attackTargethack./resurrect→ target a dead player (ghost).Architecture / invariants
Worldstays a thin facade — targeting lives in the command pipeline + a pureTargetValidator;Worldonly gained a thinTryGetMobilePositionread. The formula/spec is the client's intent; the server is authoritative. Off-tick.How it was tested
TileMap.HasLineOfSight(clear / blocked / endpoints not tested);TargetValidator(kind / range / LoS / missing); command flow (kill/spawn/resurrectrequest a target, resume with aResolvedTarget; blocked-tile rejected); protocol round-trips (TargetRequest/TargetResponse). 218 tests green, zero warnings, CSharpier clean.docs/gm-commands.mdupdated.Needs your eyes (GUI)
/kill→ crosshair → click a rat → it dies./spawn rat→ click a tile → rat appears (click a wall → "blocked"). Die, then/resurrect→ click your ghost → back at spawn. The crosshair is a placeholder; the real UO cursor gump is #19.Checklist
just lintclean · [x]just testgreen (218) · [x] whole solution builds, 0 warnings · [x] multi-platform preserved · [x] tests added