当前位置: 首页>>代码示例>>PHP>>正文


PHP Shadowrun4::getCurrentPlayer方法代码示例

本文整理汇总了PHP中Shadowrun4::getCurrentPlayer方法的典型用法代码示例。如果您正苦于以下问题:PHP Shadowrun4::getCurrentPlayer方法的具体用法?PHP Shadowrun4::getCurrentPlayer怎么用?PHP Shadowrun4::getCurrentPlayer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Shadowrun4的用法示例。


在下文中一共展示了Shadowrun4::getCurrentPlayer方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getLocationByAbbrev

 /**
  * @param string $cityname
  * @param string $arg
  * @return SR_Location
  */
 public static function getLocationByAbbrev($cityname, $arg)
 {
     $player = Shadowrun4::getCurrentPlayer();
     if (false !== ($c = Common::substrUntil($arg, '_', false))) {
         $cityname = $c;
         $arg = Common::substrFrom($arg, '_', $arg);
     }
     if (false === ($city = Shadowrun4::getCityByAbbrev($cityname))) {
         self::reply($player, 'Unknown city: ' . $cityname);
         return false;
     }
     $city instanceof SR_City;
     return $city->getLocationByAbbrev($arg);
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:19,代码来源:gml.php

示例2: displayItemNameS

 public static function displayItemNameS($itemname)
 {
     return self::displayItemnameFull(Shadowrun4::getCurrentPlayer(), SR_Item::createByName($itemname, 1, false));
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:4,代码来源:Shadowlang.php

示例3: getItemPage

 public static function getItemPage($page, $indexedItems, $is_store, $ipp = 10)
 {
     $nItems = count($indexedItems);
     $page = (int) $page;
     $nPages = (int) (($nItems + $ipp - 1) / $ipp);
     if ($page < 1 || $page > $nPages) {
         return false;
     }
     $from = ($page - 1) * $ipp;
     $indexedItems = array_slice($indexedItems, $from, $ipp, true);
     $b = chr(2);
     $back = '';
     $price = '0';
     $dprice = '';
     $format = Shadowrun4::getCurrentPlayer()->lang('fmt_itemindex');
     foreach ($indexedItems as $idx => $data) {
         $itemname = $data[0];
         $count = $data[1];
         $dcount = $count > 1 ? "({$count})" : '';
         if ($is_store) {
             $price = $data[2];
             $dprice = sprintf("(%s)", Shadowfunc::displayNuyen($price));
         }
         $back .= sprintf($format, $idx + 1, $itemname, $dcount, $dprice, $count, $price);
         // 			$back .= sprintf(', %s%d%s-%s%s%s', $b, $idx+1, $b, $itemname, $count, $dprice);
     }
     return Shadowrun4::lang('page', array($page, $nPages, ltrim($back, ',; ')));
     // 		$back = sprintf('page %d/%d: %s.', $page, $nPages, $back);
     // 		return $back;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:30,代码来源:Shadowfunc.php

示例4: getLocationTreeB

 private static function getLocationTreeB($cityname)
 {
     if (false === ($city = Shadowrun4::getCity($cityname))) {
         echo 'Unknown City in get location tree: ' . $cityname . PHP_EOL;
         return array();
     }
     $player = Shadowrun4::getCurrentPlayer();
     $back = array();
     foreach ($city->getLocations() as $location) {
         $location instanceof SR_Location;
         if ($location->getFoundPercentage() <= 0) {
             continue;
         }
         $loc_name = $location->getName();
         if ($location instanceof SR_Entrance && $location->getExitLocation() !== false) {
             $exit_loc = $location->getExitCity();
             $back[$exit_loc] = sprintf('%s: %s', $loc_name, $location->getFoundText($player));
             $back[] = self::getLocationTreeB($exit_loc);
         } else {
             $back[$loc_name] = sprintf('%s: %s', $loc_name, $location->getFoundText($player));
         }
     }
     return $back;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:24,代码来源:Shadowhelp.php

示例5: isMixedRune

 public function isMixedRune()
 {
     $have_mount = false;
     $have_equip = false;
     $mods = array_merge($this->getItemModifiersA(Shadowrun4::getCurrentPlayer()), $this->getItemModifiersB());
     foreach ($mods as $k => $v) {
         if ($this->isMountModifier($k)) {
             $have_mount = true;
         } else {
             $have_equip = true;
         }
     }
     return $have_mount && $have_equip;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:14,代码来源:SR_Rune.php


注:本文中的Shadowrun4::getCurrentPlayer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。