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


PHP Shadowrun4::getCity方法代码示例

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


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

示例1: getRespawnLocation

 public function getRespawnLocation(SR_Player $player)
 {
     if ($player->getNuyen() > 200 && $player->hasKnowledge('places', 'Vegas_Hotel')) {
         return 'Vegas_Hotel';
     }
     return Shadowrun4::getCity('Chicago')->getRespawnLocation($player);
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:7,代码来源:Vegas.php

示例2: getCity

 public function getCity()
 {
     $arg = $this->getArg(0, 'Redmond');
     if (false === ($city = Shadowrun4::getCity($arg))) {
         return Shadowrun4::getCity('Redmond');
     }
     return $city;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:8,代码来源:traveller.php

示例3: getRespawnLocation

 public function getRespawnLocation(SR_Player $player)
 {
     if ($player->getNuyen() > 300 && $player->hasKnowledge('places', 'Chicago_Hotel')) {
         return 'Chicago_Hotel';
     } else {
         return Shadowrun4::getCity('Delaware')->getRespawnLocation($player);
     }
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:8,代码来源:Chicago.php

示例4: getRespawnLocation

 public function getRespawnLocation(SR_Player $player)
 {
     return Shadowrun4::getCity('Delaware')->getRespawnLocation($player);
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:4,代码来源:TrollHQ.php

示例5: onCast

 public function onCast(SR_Player $player, array $args, $wanted_level = true)
 {
     if ($this->isBrewMode()) {
         return $this->onBrew($player, 70, 4, 10);
     }
     $p = $player->getParty();
     if (!$p->isIdle()) {
         $player->msg('1033');
         // 			$player->message('This spell only works when your party is idle.');
         return false;
     }
     if (count($args) === 0) {
         $player->msg('1072');
         // 			$player->message('Please specify a target to teleport to.');
         return false;
     }
     $bot = Shadowrap::instance($player);
     if (false === ($tlc = Shadowcmd_goto::getTLCByArgMulticity($player, $args[0]))) {
         $player->msg('1069');
         // 			$player->message('The location does not exist or is ambigous.');
         return false;
     }
     $city = Common::substrUntil($tlc, '_');
     if (false === ($cityclass = Shadowrun4::getCity($city))) {
         $player->msg('1073');
         // 			$bot->reply('This city is unknown.');
         return false;
     }
     if ($cityclass->isDungeon()) {
         $player->msg('1079');
         // 			$bot->reply('You can not teleport into dungeons.');
         return false;
     }
     if (false === ($target = $cityclass->getLocation($tlc))) {
         $player->msg('1070', array($p->getCity()));
         // 			$bot->reply(sprintf('The location %s does not exist in %s.', $tlc, $city));
         return false;
     }
     $tlc = $target->getName();
     if (!$player->hasKnowledge('places', $tlc)) {
         $player->msg('1023');
         // 			$bot->reply(sprintf('You don`t know where the %s is.', $tlc));
         return false;
     }
     if ($p->getLocation() === $tlc) {
         $player->msg('1071', array($tlc));
         // 			$bot->reply(sprintf('You are already at the %s.', $tlc));
         return false;
     }
     # Imprisoned
     if (false !== ($loc = $p->getLocationClass('inside'))) {
         if (!$loc->isExitAllowed($player)) {
             $player->msg('1074');
             // 				$bot->reply('You cannot cast teleport inside this lcoation.');
             return false;
         }
     }
     # Minlevels (thx sabretooth)
     if (false === $this->checkCityTargetLimits($player, $target)) {
         return false;
     }
     $level = $this->getLevel($this->getCaster());
     $mc = $p->getMemberCount();
     $need_level = $mc / 2;
     if ($level < $need_level) {
         $player->msg('1076', array($this->getName(), $need_level, $mc));
         return false;
         // 			$bot->reply(sprintf('You need at least %s level %s to teleport %s party members.', $this->getName(), $need_level, $mc));
         // 			return false;
     }
     $need = $this->getManaCost($player, $need_level);
     $have = $player->getMP();
     if ($need > $have) {
         $player->msg('1055', array($need, $this->getName(), $need_level, $have));
         // 			$player->message(sprintf('You need %s MP to cast %s, but you only have %s.', $need, $this->getName(), $have));
         return false;
     }
     if (true === $this->isCastMode()) {
         $player->healMP(-$need);
     }
     $p->ntice('5133', array($player->getName(), $need, $this->getName(), $tlc));
     // 		$p->notice(sprintf('%s used %s MP to cast %s and your party is now outside of %s.', $player->getName(), $need, $this->getName(), $tlc));
     $p->pushAction('outside', $tlc);
     return true;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:85,代码来源:teleportiii.php

示例6: getElevatorFloorN

 private function getElevatorFloorN($n)
 {
     $cityname = $this->getElevatorCityNameN($n);
     if (false === ($city = Shadowrun4::getCity($cityname))) {
         return false;
     }
     return $city->getLocation($cityname . '_' . $this->getShortName());
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:8,代码来源:SR_Elevator.php

示例7: nervousAlert

 private function nervousAlert(SR_Player $player)
 {
     $party = $player->getParty();
     $party->notice($this->langNPC('nervous'));
     // 		$party->notice('The employee looks nervous ... ');
     $this->rply('bye');
     // 		$this->reply('I have to go now.');
     $party->notice($this->langNPC('alert'));
     // 		$party->notice('After a few seconds you hear the alert sound.');
     $renraku = Shadowrun4::getCity('Renraku');
     $renraku->setAlert($party, 1200);
     return $this->bye();
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:13,代码来源:Employee.php

示例8: 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

示例9: getNPCCityClass

 public function getNPCCityClass()
 {
     return Shadowrun4::getCity(Common::substrUntil($this->getNPCClassName(), '_'));
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:4,代码来源:SR_NPCBase.php

示例10: getCityClass

 /**
  * @return SR_City
  */
 public function getCityClass()
 {
     return Shadowrun4::getCity($this->getCity());
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:7,代码来源:SR_Party.php


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