本文整理汇总了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);
}
示例2: displayItemNameS
public static function displayItemNameS($itemname)
{
return self::displayItemnameFull(Shadowrun4::getCurrentPlayer(), SR_Item::createByName($itemname, 1, false));
}
示例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;
}
示例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;
}
示例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;
}