feat: equipped weapon drives melee damage & swing time (#26) #27
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!27
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/equip-combat"
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 part of #26.
Summary
The equipped weapon now actually changes combat, server-side. Equipping a sword makes you hit for 10 (vs the unarmed 5) on a faster swing (8 ticks vs 12) — a rat dies in ~2 hits instead of ~4. Unequip and you're back to fists.
ItemCatalog(WeaponStats):sword = 10 dmg / 8-tick swing. No per-instance stats yet (a "sword" is always the same) — magic/variable weapons are future.CombatSystem.ApplyWeapon(player, stats?)sets damage + swing cooldown (null = unarmed baseline fromCombatOptions).Worldrecomputes from the Weapon slot on equip, unequip, and restore-on-reconnect — all under its single lock.ItemRegistrygainedEquippedWeaponKind. Invariants preserved: ItemRegistry = placement, CombatSystem = rules, World = orchestration.Scope note (honest)
This delivers the gameplay half of #26. The visual half — the sword animating on your body — is deliberately deferred to #18 (layered equipment): a 1H sword shares the same body attack action (UO action 9) as unarmed, so the difference is the weapon sprite overlaid on the body, not a different animation. Weapon-specific body actions (2H, bow) come when we add those weapon types. The equip effect is already visible today via the damage numbers (
-10vs-5).How it was tested
New unit tests (
WorldTests): equipping overrides damage; equipping overrides swing cadence (lands exactly on the weapon's swing time); unequip reverts to the unarmed baseline; a weapon restored already equipped at reconnect re-arms the wielder. Existing combat/equip/persistence tests unchanged and green.Checklist
just lintclean (CSharpier + analyzers)just testgreen (180 tests)