Created
June 21, 2018 08:57
-
-
Save tianvay/af173c9c2a97f2a739de839b2d0d929a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static function motd() | |
{ | |
$maxrandom = Monster::count('id'); | |
$randomid = random_int(1,$maxrandom); | |
$monster = Monster::find($randomid); | |
// we don't want: | |
// -unawakened monsters | |
// -previously featured | |
// -special monsters | |
// as our monster of the day! | |
while($monster->awakens_from == null | |
or $monster->article != null | |
or str_contains($monster->awakens_from, [ | |
'Angelmon', | |
'Rainbowmon', | |
'Imperfect', | |
'(Attack)', | |
'(Support)' | |
])){ | |
$randomid = random_int(1,$maxrandom); | |
$monster = Monster::find($randomid); | |
} | |
return $monster; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment