mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 20:19:44 +00:00
fixed chance
This commit is contained in:
parent
1ce5292981
commit
355c2167d1
3 changed files with 8 additions and 5 deletions
|
|
@ -653,15 +653,18 @@ class Entity extends Position{
|
|||
*/
|
||||
|
||||
public function sheepColor(){
|
||||
$pink = 0.1558;
|
||||
$brown = 2.85;
|
||||
$lightgray_black_gray = 14.25;
|
||||
$chance = Utils::randomFloat() * 100;
|
||||
switch($chance){
|
||||
case $chance <= 0.1558:
|
||||
case($chance <= $pink):
|
||||
$color = 6;
|
||||
break;
|
||||
case $chance <= 2.85:
|
||||
case($chance > $pink and $chance <= ($brown+$pink)):
|
||||
$color = 12;
|
||||
break;
|
||||
case $chance <= 4.75:
|
||||
case($chance > ($brown+$pink) and $chance <= ($lightgray_black_gray+$brown+$pink)):
|
||||
$rand = mt_rand(1,3);
|
||||
if($rand == 1) $color = 15;
|
||||
elseif($rand == 2) $color = 7;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue