~bigbes/game-prototype-ftl

ref: 7b6452c695e408ecebfca1c9d810baf6eca03620 game-prototype-ftl/combat.go -rw-r--r-- 3.3 KiB
cbe6e623 — Eugene Blikh 30 days ago
combat: Combat data + updateCombat with tests

PH1 of combat task: pure tick logic.

- combat.go: GameResult/CombatSide/Combat types, NewCombat,
  playerShieldMax, resolveIncoming, updateCombat. Constants
  WeaponChargeMax/ShieldRegen/EnemyFireInterval/HitFlashDuration/
  PlayerHullMax/EnemyHullMax. Imports math/rand only (IV1).
- combat_test.go: 17 tests covering initial state, shield max,
  shield absorb / hull damage / hull clamp / evasion miss-and-hit
  in resolveIncoming, post-result no-op, hit-flash tick, shield
  regen and clamp-on-power-drop, weapon fires / no-charge-when-zero,
  enemy fires on timer, victory and defeat transitions, determinism.

Tests cannot execute in this Claude Code session (Ebitengine GLFW
init requires a display); compile + vet are clean.

Refs: docs/tasks/combat.md PH1