Exemplo n.º 1
0
 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)));
 }
Exemplo n.º 2
0
 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;
 }