feat: stackable currency with coin art, and drag ground items onto the backpack to pick up #104

Merged
marco merged 6 commits from feat/backpack-stacking into main 2026-07-20 22:54:40 +02:00
Collaborator

Phase 2 of the weight-bounded backpack (#99): stackable kinds collapse into one entry with an amount and combined weight, plus the coin art and the ground display/interaction. Builds on #100 (Phase 1, merged). All rules are generic (per MaxStack), not coin-specific.

Changes

  • Stacking (c97d2c1): BaseItem.MaxStack (Coin 60000); Item.Amount (serialized, v1→v2 backward-compatible). Give/PickUp merge into existing stacks up to MaxStack then spill; a pickup that nothing absorbs keeps the ground item's id. CarriedWeight is amount-aware; the pickup cap is per whole stack. Protocol OwnedItem.Amount; ProtocolVersion → 2.
  • /clearbag (eb53c33): GM command to empty a backpack (testing).
  • Coin art (6fbf9db): three RGBA sprites picked by amount — single coin (1), pile (2–500), big stack (>500) — a coin sized to match a coin in the >500 mound. Ground items scaled to a tile-ish size. The client selects sprites generically via <kind>/<kind>_pile/<kind>_stack.
  • Ground display + interaction (452a457): GroundItem.Amount so a dropped pile shows the tiered sprite on the ground too. Single-click reads an item (name + amount); double-click (or E) picks it up.

Verification

  • Whole-solution dotnet build: 0 warnings; csharpier check . clean; dotnet test: 314 passing (stacking, spill, non-stackable, pickup-merge, persistence round-trip, /clearbag).
  • Driven in the client: /give coin 500 ×n → one pile with the count and the combined weight in the readout; single→pile→stack sprites in the bag and on the ground; single-click reads "coin (400)"; double-click picks it up.
Phase 2 of the weight-bounded backpack (#99): stackable kinds collapse into one entry with an amount and combined weight, plus the coin art and the ground display/interaction. Builds on #100 (Phase 1, merged). All rules are generic (per `MaxStack`), not coin-specific. ## Changes - **Stacking** (`c97d2c1`): `BaseItem.MaxStack` (Coin 60000); `Item.Amount` (serialized, v1→v2 backward-compatible). `Give`/`PickUp` merge into existing stacks up to MaxStack then spill; a pickup that nothing absorbs keeps the ground item's id. `CarriedWeight` is amount-aware; the pickup cap is per whole stack. Protocol `OwnedItem.Amount`; `ProtocolVersion` → 2. - **`/clearbag`** (`eb53c33`): GM command to empty a backpack (testing). - **Coin art** (`6fbf9db`): three RGBA sprites picked by amount — single coin (1), pile (2–500), big stack (>500) — a coin sized to match a coin in the >500 mound. Ground items scaled to a tile-ish size. The client selects sprites generically via `<kind>`/`<kind>_pile`/`<kind>_stack`. - **Ground display + interaction** (`452a457`): `GroundItem.Amount` so a dropped pile shows the tiered sprite on the ground too. **Single-click reads** an item (name + amount); **double-click (or E) picks it up**. ## Verification - Whole-solution `dotnet build`: 0 warnings; `csharpier check .` clean; `dotnet test`: 314 passing (stacking, spill, non-stackable, pickup-merge, persistence round-trip, /clearbag). - Driven in the client: `/give coin 500` ×n → one pile with the count and the combined weight in the readout; single→pile→stack sprites in the bag and on the ground; single-click reads "coin (400)"; double-click picks it up.
Merge branch 'main' into feat/backpack-stacking
All checks were successful
ci / Lint & Test (pull_request) Successful in 1m29s
c32adf539e
# Conflicts:
#	client/IsoMmo.Client/assets/assets.isoa
#	src/IsoMmo.GameServer/Gameplay/Items/BaseItem.cs
#	src/IsoMmo.GameServer/Gameplay/Items/Item.cs
#	src/IsoMmo.GameServer/Gameplay/Items/ItemCatalog.cs
#	src/IsoMmo.GameServer/Gameplay/Items/OwnedItemView.cs
#	src/IsoMmo.Shared/Protocol/ProtocolVersion.cs
marco force-pushed feat/backpack-stacking from 1b1e1ed8a0
Some checks failed
ci / Lint & Test (pull_request) Has been cancelled
to 38072f5bf2
All checks were successful
ci / Lint & Test (pull_request) Successful in 1m35s
2026-07-20 22:41:34 +02:00
Compare
marco changed title from Currency stacking + coin art (#99 phase 2) to feat: stackable currency with coin art, and drag ground items onto the backpack to pick up 2026-07-20 22:54:27 +02:00
marco merged commit ecfa48d113 into main 2026-07-20 22:54:40 +02:00
marco deleted branch feat/backpack-stacking 2026-07-20 22:54:40 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
marco/IsoMmo!104
No description provided.