本文整理汇总了PHP中Shadowfunc::displayDistance方法的典型用法代码示例。如果您正苦于以下问题:PHP Shadowfunc::displayDistance方法的具体用法?PHP Shadowfunc::displayDistance怎么用?PHP Shadowfunc::displayDistance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shadowfunc
的用法示例。
在下文中一共展示了Shadowfunc::displayDistance方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: displayRange
private function displayRange(SR_Player $player)
{
$range = $this->getItemRange();
// return $range <= 0 ? '' : sprintf(" \X02Range\X02: %s.", Shadowfunc::displayDistance($range, 1));
return $range <= 0 ? '' : $player->lang('range', array(Shadowfunc::displayDistance($range, 1)));
}
示例2: onASLShowPartyB
public static function onASLShowPartyB(SR_Player $player, $field)
{
$out = '';
$sum = 0;
$format = Shadowrun4::lang('fmt_sumlist');
foreach ($player->getParty()->getMembers() as $member) {
$member instanceof SR_Player;
$val = Common::clamp(intval($member->getBase($field)), 0);
$sum += $val;
switch ($field) {
case 'age':
$out2 = "{$val}y";
break;
case 'bmi':
$out2 = Shadowfunc::displayWeight($val);
break;
case 'height':
$out2 = Shadowfunc::displayDistance($val, 2);
break;
default:
self::reply($player, 'Error unknown field in onASLShowPartyB()');
return false;
}
$out .= sprintf($format, $member->getEnum(), $member->getName(), $out2);
}
switch ($field) {
case 'age':
$sumtxt = "{$sum}y";
break;
case 'bmi':
$sumtxt = Shadowfunc::displayWeight($sum);
break;
case 'height':
$sumtxt = Shadowfunc::displayDistance($sum, 2);
break;
default:
self::reply($player, 'Error unknown field2 in onASLShowPartyB()');
return false;
}
self::rply($player, '', array(Shadowrun4::lang('sum_' . $field), $sumtxt, ltrim($out, ',; ')));
return true;
}