/** * 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; }
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())); }
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())); } } }
public function getMinLevel() { if (false === ($loc = Shadowrun4::getLocationByTarget($this->getCityLocation()))) { return -1; } if (false === ($city = $loc->getCityClass())) { return -1; } return $city->getMinLevel(); }
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)); } } }
/** * 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); }