3 Commits
Author SHA1 Message Date
西风逍遥游 fa18e77b75 weapon: multi-form weapon system (kind/resource/stage) + P0 combat features
Generalize the weapon module from gun-only into a data-driven, cuttable
multi-form system supporting hot / melee / magic / missile weapons for
RPG / RTS / ARPG.

Core (WeaponTypes.h / WeaponSystem.cpp):
- WeaponKind (melee/ranged/magic/missile/custom) selects the attack form.
- AttackResource gates triggers by ammo/mana/charges/stamina/none.
- AttackStage machine (Idle->Windup->Active->Recover) replaces the hard-coded
  reload/burst path for non-ranged forms; hot weapons keep the mature pipeline
  so ranged behavior is byte-identical (regression baseline).
- IWeaponLogic gains begin/channel/end hooks (default no-op, backward compat).
- AttackRequest generalizes FireRequest (target handle, arc, aoe).
- WeaponRigEntity for hand-held weapons; WeaponMountEntity (turret) unchanged.

P0 combat features (data fields + event payloads, no arch change):
- Multi-pellet (shotgun), spread bloom, recoil model, runtime fire selector
  (safe/semi/auto), shared ammo pool (AmmoPoolEntity), damage type/element,
  ADS/zoom with aim_in/aim_out events.

Docs: 通用武器系统设计.md, 武器系统-对比Unity插件-差距分析.md.
Tests: test/weapon.cpp grows to 25 cases / 210 assertions, all passing.
2026-08-25 22:15:01 +08:00
西风逍遥游 097444bfc2 fix(vehicle): RTS orders arrive and fire, weapons auto-reload, demo uses sprites + HUD
- kinematic RTS orders decelerate when turning/approaching so moveTo actually
  arrives inside arriveRadius instead of orbiting forever
- attack order now auto-fires auto-aim mounts within weapon range
  (attack_move keeps aim-only behavior)
- weapon module auto-starts reload when mag empty, cooldown done, reserve left;
  events still emitted, game can override/cancel
- vehicle demo: real Kenney CC0 sprites (body rotates, turret rotates by
  mount yaw, destroyed greys out), readable ImGui HUD log, capture-mouse
  guard so clicks on HUD don't issue orders
- tests: weapon.fire.autoReloadOnEmpty; README + design doc updated
2026-08-23 20:32:43 +08:00
西风逍遥游 cf10c46bb5 feat(weapon): add generic weapon module (defs, entities, mounts, fire logic) 2026-08-23 18:30:52 +08:00