本文整理汇总了PHP中Shadowrun4::getLocationByTarget方法的典型用法代码示例。如果您正苦于以下问题:PHP Shadowrun4::getLocationByTarget方法的具体用法?PHP Shadowrun4::getLocationByTarget怎么用?PHP Shadowrun4::getLocationByTarget使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shadowrun4
的用法示例。
在下文中一共展示了Shadowrun4::getLocationByTarget方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: beam
/**
* Beam a party to a target location.
* @param SR_Player $player
* @param string $target
* @param string $action
*/
public function beam(SR_Player $player, $target = 'Redmond_Hotel', $action = 'inside')
{
if (false === ($location = Shadowrun4::getLocationByTarget($target))) {
$player->message('Unknown location to beam to, report to gizmore!');
Dog_Log::error('Unknown $target "' . $target . '" for ' . __METHOD__ . ' in ' . __FILE__ . ' line ' . __LINE__ . '.');
return false;
}
$party = $player->getParty();
# City changed?
$oldcity = $party->getCity();
$party->pushAction($action, $target);
$newcity = $party->getCity();
if ($oldcity !== $newcity) {
$city = $party->getCityClass();
$city->onCityEnter($party);
}
// if ($action === 'inside')
// {
// foreach ($party->getMembers() as $member)
// {
// $member->message($location->getEnterText($member));
// }
// }
$party->giveKnowledge('places', $target);
return true;
}
示例2: onHacked
public function onHacked(SR_Player $player, $hits)
{
$party = $player->getParty();
$player->message(sprintf('This computer is able to activate the elevator to floor 2 and 3.'));
$elevator = Shadowrun4::getLocationByTarget('Renraku_Elevator');
$elevator instanceof Renraku_Elevator;
$elevator->setElevatorFlagsParty($party, 6, true);
$party->notice(sprintf('%s managed to unlock the elevator to floor 2 and 3.', $player->getName()));
}
示例3: checkLocation
public function checkLocation()
{
parent::checkLocation();
if (false !== ($exit_location = $this->getExitLocation())) {
if (false === Shadowrun4::getLocationByTarget($exit_location)) {
die(sprintf("%s has an invalid Exit location!\n", $this->getName()));
}
}
}
示例4: getMinLevel
public function getMinLevel()
{
if (false === ($loc = Shadowrun4::getLocationByTarget($this->getCityLocation()))) {
return -1;
}
if (false === ($city = $loc->getCityClass())) {
return -1;
}
return $city->getMinLevel();
}
示例5: checkLocation
public function checkLocation()
{
foreach ($this->getSubwayTargets(Shadowrun4::getDummyPlayer()) as $data) {
$target = $data[0];
if (false === ($location = Shadowrun4::getLocationByTarget($target))) {
die(sprintf('The subway %s has an invalid target: %s.', $this->getName(), $target));
}
}
}
示例6: getLocationClass
/**
* Get the current location class for a party.
* @param string $where
* @return SR_Location
*/
public function getLocationClass($action = NULL)
{
return false === ($location = $this->getLocation($action)) ? false : Shadowrun4::getLocationByTarget($location);
}