'Victory', self::LOSE => 'Defeat', self::DRAW => 'Draw', self::ESCAPE => 'Escaped', }; } /** * Check if the attacker won */ public function attackerWon(): bool { return $this === self::WIN; } /** * Check if the defender won (attacker lost) */ public function defenderWon(): bool { return $this === self::LOSE; } /** * Get the experience reward for this result (for attacker) */ public function experienceReward(): int { return match($this) { self::WIN => 200, self::LOSE => 50, self::DRAW => 100, self::ESCAPE => 25, }; } /** * Get the money reward for this result (for attacker) */ public function moneyReward(): int { return match($this) { self::WIN => 500, self::LOSE => 0, self::DRAW => 100, self::ESCAPE => 0, }; } }