本文整理汇总了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);
}
示例2: getCity
public function getCity()
{
$arg = $this->getArg(0, 'Redmond');
if (false === ($city = Shadowrun4::getCity($arg))) {
return Shadowrun4::getCity('Redmond');
}
return $city;
}
示例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);
}
}
示例4: getRespawnLocation
public function getRespawnLocation(SR_Player $player)
{
return Shadowrun4::getCity('Delaware')->getRespawnLocation($player);
}
示例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;
}
示例6: getElevatorFloorN
private function getElevatorFloorN($n)
{
$cityname = $this->getElevatorCityNameN($n);
if (false === ($city = Shadowrun4::getCity($cityname))) {
return false;
}
return $city->getLocation($cityname . '_' . $this->getShortName());
}
示例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();
}
示例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;
}
示例9: getNPCCityClass
public function getNPCCityClass()
{
return Shadowrun4::getCity(Common::substrUntil($this->getNPCClassName(), '_'));
}
示例10: getCityClass
/**
* @return SR_City
*/
public function getCityClass()
{
return Shadowrun4::getCity($this->getCity());
}