當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。