2022-07-05 15:55:47 +02:00
|
|
|
<?php
|
|
|
|
|
2024-02-02 15:16:11 +00:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2022-07-05 15:55:47 +02:00
|
|
|
namespace DNW\Skills;
|
2010-09-18 21:19:51 -04:00
|
|
|
|
|
|
|
class PartialPlay
|
|
|
|
{
|
2023-08-02 12:39:42 +00:00
|
|
|
public static function getPartialPlayPercentage(Player $player): float
|
2010-09-18 21:19:51 -04:00
|
|
|
{
|
2010-09-25 19:26:57 -04:00
|
|
|
$partialPlayPercentage = $player->getPartialPlayPercentage();
|
2010-09-18 21:19:51 -04:00
|
|
|
|
|
|
|
// HACK to get around bug near 0
|
|
|
|
$smallestPercentage = 0.0001;
|
2016-05-24 14:10:39 +02:00
|
|
|
if ($partialPlayPercentage < $smallestPercentage) {
|
2010-09-18 21:19:51 -04:00
|
|
|
$partialPlayPercentage = $smallestPercentage;
|
|
|
|
}
|
|
|
|
|
|
|
|
return $partialPlayPercentage;
|
|
|
|
}
|
2022-07-05 15:55:47 +02:00
|
|
|
}
|