本文整理汇总了PHP中Shadowfunc::dicePoolB方法的典型用法代码示例。如果您正苦于以下问题:PHP Shadowfunc::dicePoolB方法的具体用法?PHP Shadowfunc::dicePoolB怎么用?PHP Shadowfunc::dicePoolB使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shadowfunc
的用法示例。
在下文中一共展示了Shadowfunc::dicePoolB方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: diceHits
public static function diceHits($mindmg, $arm, $atk, $def, SR_Player $player, SR_Player $target)
{
$ep = $target->getParty();
if ($player->isHuman()) {
if ($target->isHuman()) {
// $oops = rand(80, 250) / 10;
$oops = self::diceFloat(6.0, 9.0, 1);
} else {
// $oops = rand(80, 190) / 10;
$oops = $player->getBase('level') * 0.1;
$oops = self::diceFloat(6.0 + $oops, 9.0 + $oops, 1);
}
} else {
if ($target->isHuman()) {
// $rand = rand(12, 20) / 10;
// $oops = $rand + $ep->getMemberCount()*0.3; # + $ep->getMax('level', true)*0.01;
$oops = 0.2 + $target->getBase('level') * 0.05;
$oops *= Common::pow(1.28, $ep->getMemberCount());
} else {
// $oops = rand(80, 250) / 10;
$oops = self::diceFloat(0.8, 2.5, 1);
}
}
// $chances = (($atk*10 + $mindmg*5) / ($def*5 + $arm*2)) * $oops * 0.65;
$chances = ($atk * 20 + $mindmg * 50) / ($def * 5 + $arm * 2) * $oops * 0.7;
// echo "OOOOOOOPS: $oops\n";
// return Shadowfunc::dicePool(round($chances), round($def)+1, round(sqrt($def)));
return Shadowfunc::dicePoolB($chances, $def);
}
示例2: diceDefensive
private function diceDefensive(SR_Player $player, SR_Player $target, $level)
{
$dices = round($level * 10);
$int = $player->get('intelligence');
$int += Common::pow($level, 1.25);
$dices += round($int * 5);
$dices += round($target->get('essence') * 15);
// # To have supportive defense is bad.
$es = $target->get('essence');
echo "Target has {$es} essence\n";
$defense = 9 - $es * 1.5;
$defense = Common::clamp($defense, 1.0, 8.0);
echo "Dice Defensive with {$dices} dices and defense {$defense}\n";
return Shadowfunc::dicePoolB($dices, $defense);
// $hits = Shadowfunc::dicePool($dices, $defense, 4);
// return rand($hits/2, $hits);
// return $hits;
}