[P1][D10] 金币落地:生成地面金币堆(flpgld 三级贴图),移除直接入包 #419

Closed
opened 2026-09-24 03:25:58 +00:00 by troytt · 1 comment
Owner

现状

src/game/engine.ts:885-886:

if (drop.base.id === 'gold' || drop.code?.trim() === 'gld') {
  this.bag.add(drop)   // 直接进钱包,凭空到账
}

金币绕过了整个地面实体系统:没有掉落物、没有弹跳、没有贴图、无法拾取、无法被别人捡走。

1.13c 真实行为

  • 金币作为 gld 地面实体落地,需玩家走上去/点击拾取。
  • 贴图按堆大小三档:flpgld_1 / flpgld_2 / flpgld_3。
  • 单堆有上限,超出部分拆分为多堆落地。
  • 拾取时受角色 Gold 上限(ulvl × 10000 + 储藏箱规则)约束,超出部分留在地面。
  • 地面标签显示 <数量> Gold(中文「金币」)。

验收标准

  • 金币经 this.groundItems.add() 落地,走与物品一致的弹跳与落点逻辑。
  • 实现单堆上限与多堆拆分。
  • 三级贴图按堆大小正确选取(离线 packer 需确保 flpgld_1..3 已烘焙,见 D14)。
  • 拾取时应用角色携带上限,超额部分保留在地面。
  • vitest:覆盖落地、拆分、三级贴图选取、上限拒收。
## 现状 `src/game/engine.ts:885-886`: ```ts if (drop.base.id === 'gold' || drop.code?.trim() === 'gld') { this.bag.add(drop) // 直接进钱包,凭空到账 } ``` 金币绕过了整个地面实体系统:没有掉落物、没有弹跳、没有贴图、无法拾取、无法被别人捡走。 ## 1.13c 真实行为 - 金币作为 `gld` 地面实体落地,需玩家走上去/点击拾取。 - 贴图按堆大小三档:`flpgld_1` / `flpgld_2` / `flpgld_3`。 - 单堆有上限,超出部分拆分为多堆落地。 - 拾取时受角色 Gold 上限(`ulvl × 10000` + 储藏箱规则)约束,超出部分留在地面。 - 地面标签显示 `<数量> Gold`(中文「金币」)。 ## 验收标准 - [ ] 金币经 `this.groundItems.add()` 落地,走与物品一致的弹跳与落点逻辑。 - [ ] 实现单堆上限与多堆拆分。 - [ ] 三级贴图按堆大小正确选取(离线 packer 需确保 `flpgld_1..3` 已烘焙,见 D14)。 - [ ] 拾取时应用角色携带上限,超额部分保留在地面。 - [ ] vitest:覆盖落地、拆分、三级贴图选取、上限拒收。
troytt added this to the [M18] 打怪掉落物品:怪物死亡掉落全链路 1.13c 还原 milestone 2026-09-24 03:25:58 +00:00
Author
Owner

Resolution Summary (Issue #419 — Commit 9022579)

  • Changed monster gold drops in src/game/engine.ts to spawn physical gld ground items with 3 authentic visual tiers (flpgld_0 1-49, flpgld_1 50-499, flpgld_2 500+) in src/ui/inventory.ts.\n- Enforced 10,000 * player.level inventory gold capacity with partial-pickup remainder piles.

  • Verification: npx tsc --noEmit (0 errors), full Vitest drop/combat/item/E2E parity suites (100% pass), and scripts/verify-m5.ts / scripts/verify-net.ts (0 problems).

### Resolution Summary (Issue #419 — Commit `9022579`) - Changed monster gold drops in `src/game/engine.ts` to spawn physical `gld` ground items with 3 authentic visual tiers (`flpgld_0` 1-49, `flpgld_1` 50-499, `flpgld_2` 500+) in `src/ui/inventory.ts`.\n- Enforced `10,000 * player.level` inventory gold capacity with partial-pickup remainder piles. - **Verification**: `npx tsc --noEmit` (0 errors), full Vitest drop/combat/item/E2E parity suites (100% pass), and `scripts/verify-m5.ts` / `scripts/verify-net.ts` (0 problems).
Sign in to join this conversation.
No Label
No project
No Assignees
1 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: troytt/diablo2-web#419
No description provided.