public function getRespawnLocation(SR_Player $player) { if ($player->getNuyen() > 200 && $player->hasKnowledge('places', 'Vegas_Hotel')) { return 'Vegas_Hotel'; } return Shadowrun4::getCity('Chicago')->getRespawnLocation($player); }
public function getCity() { $arg = $this->getArg(0, 'Redmond'); if (false === ($city = Shadowrun4::getCity($arg))) { return Shadowrun4::getCity('Redmond'); } return $city; }
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); } }
public function getRespawnLocation(SR_Player $player) { return Shadowrun4::getCity('Delaware')->getRespawnLocation($player); }
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; }
private function getElevatorFloorN($n) { $cityname = $this->getElevatorCityNameN($n); if (false === ($city = Shadowrun4::getCity($cityname))) { return false; } return $city->getLocation($cityname . '_' . $this->getShortName()); }
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(); }
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; }
public function getNPCCityClass() { return Shadowrun4::getCity(Common::substrUntil($this->getNPCClassName(), '_')); }
/** * @return SR_City */ public function getCityClass() { return Shadowrun4::getCity($this->getCity()); }