~bigbes/game-prototype-ftl: cbe6e623

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

Eugene Blikh <bigbes@gmail.com> — 2026-04-28 01:21:12 UTC

Commit cbe6e62362e646c22aa14ba9e17901858dc88813view raw patch

Parent(s): 036d6feb

2 changed file(s)

FileStatus+
combat.go A +127
combat_test.go A +295