feat: ranged combat (archery) — bow, line-of-sight, generic projectile #175
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!175
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/ranged-archery"
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 #111.
Summary
Adds ranged combat (archery) as a general ranged path in
CombatSystem, not a bow special-case. Weapon reach is now data onBaseWeapon(melee = 1, bow = 8); combat validates Chebyshev range and line of sight at both swing start and resolution, so a target that steps out of range or ducks behind a wall dodges the shot — the same server-paced honesty as the spell bolt. LOS is checked unconditionally: it's a no-op for adjacent melee (no cell between the tiles) and the real gate for a ranged shot.Adds the
Archeryskill and aBow(auto-discovered like the other weapons;/give bowworks with no command change). Following the issue's steer to "reuse the spell projectile broadcast",SpellBoltis generalised to a singleProjectilemessage (SourceId/TargetId/ProjectileKind/Damage/Hit) shared by spell bolts and bow shots — soProtocolVersionis bumped to 11. Nothing shows an arrow that was dodged: the projectile is emitted at resolution, AoI-scoped, carrying only damage (never HP).Also the archery presentation: the character plays a bow-shoot pose (UO people action 18) instead of the melee swing when a bow is wielded, the bow is drawn worn on the body in-world and on the paperdoll, and the arrow launches ahead of the shooter rotated to its flight path.
No persistence version bump: the bow persists as an ordinary item and
Archeryrides the existing skill list; both re-derive on restore.Screenshots / recording
Captured by piloting the client via the debug harness (fresh DB →
just dev), commands per state below.Bow given (item in backpack)
Bow worn on the paperdoll
Arrow in flight at 6-tile range, rotated to its path, -12 hit
Harness commands (abridged):
login test→ chat/give bow→ double-click the bow in the backpack (equip) →open doll(paperdoll) → chat/spawn dummy+ click a tile 6 away → click the dummy (engage) → burstscreenshotto catch the arrow at resolution.How it was tested
tests/.../Gameplay/RangedCombatTests.cs, againstWorld/CombatSystem): bow hits a target 6 tiles away as anArrowprojectile; a melee weapon can't reach that far; a target that leaves range or ducks behind a static before resolution whiffs; a shot with no LOS at start is refused; adjacent melee still lands (LOS no-op); an equipped bow +Archeryround-trips through persistence and re-arms the archer on restore.Projectilemessage (ProtocolJsonTests);HumanArtLayoutTestsupdated for the newshootkey.just testgreen (461 tests),just lintzero warnings, whole solution builds.Checklist
just lintpasses (CSharpier + analyzers, zero warnings)just testis green