feat: support curated abilities and objective victory

This commit is contained in:
Keith Solomon
2026-07-05 19:49:06 -05:00
committed by Keith Solomon
parent 088e85c9b4
commit 6befe7b3e2
3 changed files with 477 additions and 17 deletions
+9
View File
@@ -112,6 +112,15 @@ final readonly class UnitState
return $this->copy(health: max(0, $this->health - max(0, $damage)));
}
public function restoreHealth(int $amount): self
{
if ($amount < 0) {
throw new InvalidArgumentException('Restore health amount cannot be negative.');
}
return $this->copy(health: min($this->maxHealth, $this->health + $amount));
}
public function markAttacked(): self
{
return $this->copy(hasAttacked: true);