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


PHP Shadowrun4::getLocationByTarget方法代码示例

本文整理汇总了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;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:32,代码来源:SR_Tower.php

示例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()));
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:9,代码来源:Room4.php

示例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()));
         }
     }
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:9,代码来源:SR_Exit.php

示例4: getMinLevel

 public function getMinLevel()
 {
     if (false === ($loc = Shadowrun4::getLocationByTarget($this->getCityLocation()))) {
         return -1;
     }
     if (false === ($city = $loc->getCityClass())) {
         return -1;
     }
     return $city->getMinLevel();
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:10,代码来源:SR_Dungeon.php

示例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));
         }
     }
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:9,代码来源:SR_Subway.php

示例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);
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:9,代码来源:SR_Party.php


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