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