story = ''; $eligible = $this->tribe->getAliveKobolds(); if (empty($eligible)) { return; } $kobold = $eligible[array_rand($eligible)]; // Disease types that can be randomly acquired $diseases = [ ['type' => 'smallCut', 'name' => 'small cut'], ['type' => 'sunburn', 'name' => 'sunburn'], ]; $disease = $diseases[array_rand($diseases)]; $kobold->addInjury($disease['type']); $nameA = $kobold->getName(); $illnessVariations = [ "{$nameA} developed a {$disease['name']} this month and is feeling poorly.", "Misfortune struck {$nameA}, who came down with a {$disease['name']}.", "{$nameA} is suffering from a {$disease['name']} and needs rest.", "A {$disease['name']} has plagued {$nameA} throughout the month.", "{$nameA} was afflicted with a {$disease['name']} and is quite uncomfortable.", "The elements were unkind to {$nameA}, leaving {$kobold->him()} with a {$disease['name']}.", "{$nameA} has been dealing with a {$disease['name']} that emerged this month.", ]; $this->story = $illnessVariations[array_rand($illnessVariations)]; $kobold->save(); } }