story = ''; $eligible = array_filter($this->tribe->getAliveKobolds(), fn($k) => $k->getAge() >= $this->getMinAge()); $eligible = array_values($eligible); if (empty($eligible)) { return; } $kobold = $eligible[array_rand($eligible)]; $foodCost = rand(2, 5); $this->tribe->removeFood($foodCost); $nameA = $kobold->getName(); $reasons = [ 'grew a significant appetite', 'was always hungry', 'had an insatiable appetite this month', 'seemed particularly famished', 'ate with vigor', ]; $reason = $reasons[array_rand($reasons)]; $variations = [ "{$nameA} {$reason}, consuming more food than usual.", "This month, {$nameA} {$reason} and the food stores are diminished.", "{$nameA} {$reason}, putting extra strain on the tribe's resources.", "The tribe noticed {$nameA} {$reason}, draining more of their supplies.", "{$nameA} {$reason}, and the food situation became slightly more dire.", ]; $this->story = $variations[array_rand($variations)]; } }