本文整理汇总了PHP中SR_Player::getParty方法的典型用法代码示例。如果您正苦于以下问题:PHP SR_Player::getParty方法的具体用法?PHP SR_Player::getParty怎么用?PHP SR_Player::getParty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SR_Player
的用法示例。
在下文中一共展示了SR_Player::getParty方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkIDCards
private function checkIDCards(SR_Player $player)
{
$p = $player->getParty();
$names = array();
foreach ($p->getMembers() as $member) {
$member instanceof SR_Player;
if (!$member->getInvItemByName('IDCard')) {
$names[] = $member->getName();
}
}
if (count($names) > 0) {
$this->rply('no_card', array(implode(', ', $names)));
// $p->notice(sprintf("It seems like %s is/are missing an IDCard.", GWF_Array::implodeHuman($names)));
$this->rply('everyone');
// $this->reply('Every person needs an own ID card. Move along.');
return;
}
$this->rply('revoke');
// $this->reply('These ID cards need to be revoked and you have to get a new one. I will also have to keep them for investigation. I may let you pass as your security level is below 2.');
$this->rply('hand');
// $p->notice("Each member hands an IDCard to the guards and you enter the Renraku tower.");
foreach ($p->getMembers() as $member) {
$member instanceof SR_Player;
$card = $member->getInvItemByName('IDCard');
$card->useAmount($member, 1);
}
// Delete guards
$this->getParty()->popAction(true);
$p->popAction(false);
$renraku = $player->getParty()->getLocationClass();
$renraku instanceof Seattle_Renraku;
$renraku->beam($player, 'Renraku_Exit', SR_Party::ACTION_INSIDE);
}
示例2: onEnter
public function onEnter(SR_Player $player)
{
$p = $player->getParty();
# We know the mafia :)
$quest = SR_Quest::getQuest($player, 'HiJack');
if ($quest->isAccepted($player)) {
return parent::onEnter($player);
}
# Check how many guards have been killed in total
$killed = 0;
foreach ($p->getMembers() as $member) {
$member instanceof SR_Player;
$killed += SR_PlayerVar::getVal($member, 'mgkills', 0);
}
if ($killed >= 6) {
return parent::onEnter($player);
}
# Guarded!
foreach ($p->getMembers() as $member) {
$member instanceof SR_Player;
$member->message($this->lang($member, 'guarded'));
}
$guards = array();
for ($i = 0; $i < 6; $i++) {
$guards[] = 'Vegas_MafiaGuard';
}
SR_NPC::createEnemyParty($guards)->fight($p);
return false;
}
示例3: onEnter
public function onEnter(SR_Player $player)
{
$party = $player->getParty();
$this->partyMessage($player, 'cracked');
// $party->notice('You easily manage to crack the rotten front door open...');
$this->teleportInside($player, 'OrkHQ_Exit');
}
示例4: 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;
}
示例5: getNPCLoot
public function getNPCLoot(SR_Player $player)
{
$leader = $player->getParty()->getLeader();
$leader->giveItems(array(SR_Item::createByName(Forest_Clearing::THESWORD)), $this->getName());
SR_PlayerVar::setVal($leader, Forest_Clearing::SWORDKEY, '2');
return array();
}
示例6: onEnter
public function onEnter(SR_Player $player)
{
$party = $player->getParty();
$dice = rand(0, 6);
if ($dice < 2) {
$this->partyMessage($player, 'lucky');
// $party->notice('You silently search the door and windows for an entrance. You were lucky and sneak in...');
$this->teleportInside($player, 'Hideout_Exit');
} else {
if ($dice < 4) {
$this->partyMessage($player, 'noluck');
// $party->notice('You silently search the door and windows for an entrance. You have no luck, everything\'s closed.');
} else {
if ($dice < 6) {
$this->partyMessage($player, 'fight2');
// $party->notice('You silently search the door and windows for an entrance. Two punks notice you and attack!');
SR_NPC::createEnemyParty('Redmond_Cyberpunk', 'Redmond_Cyberpunk')->fight($party, true);
} else {
$this->partyMessage($player, 'fight4');
// $party->notice('You take a look through the doors keyhole. A party of four punks opens the door and surprises you.');
SR_NPC::createEnemyParty('Redmond_Cyberpunk', 'Redmond_Cyberpunk', 'Redmond_Pinkhead', 'Redmond_Lamer')->fight($party, true);
}
}
}
}
示例7: onEnter
public function onEnter(SR_Player $player)
{
$party = $player->getParty();
$player->message($this->lang($player, 'no_enter'));
// $player->message('You cannot find any open entrance to the ship ... Yet.');
return false;
}
示例8: execute
public static function execute(SR_Player $player, array $args)
{
if ('' === ($message = trim(implode(' ', $args)))) {
return false;
}
$p = $player->getParty();
$ep = $p->getEnemyParty();
$pname = $player->getName();
if ($p->isTalking() && $ep !== false) {
$p->ntice('5085', array($pname, $message));
$ep->ntice('5085', array($pname, $message));
$p->setContactEta(60);
$el = $ep->getLeader();
if ($el->isNPC()) {
$ep->setContactEta(60);
$el->onNPCTalkA($player, isset($args[0]) ? $args[0] : 'hello', $args);
}
} elseif ($p->isAtLocation()) {
Shadowshout::onLocationGlobalMessage($player, '5085', array($pname, $message));
} elseif ($p->isFighting()) {
$p->ntice('5085', array($pname, $message));
$ep->ntice('5085', array($pname, $message));
} else {
$p->ntice('5085', array($pname, $message));
}
return true;
}
示例9: onFight
public static function onFight(SR_Player $player, SR_Party $ep)
{
$p = $player->getParty();
$l1 = $player->get('level');
$add = 0.0;
foreach ($ep->getMembers() as $e) {
$e instanceof SR_Player;
if (!$e->isHuman()) {
$add += 0.05;
continue;
}
$badkarma = $e->getBase('bad_karma');
if ($badkarma > 0) {
continue;
}
// $bounty = $e->getBase('sr4pl_bounty');
$l2 = $e->get('level');
$diff = $l1 - $l2;
if ($diff < 0) {
continue;
}
$add += round($diff / 100, 2);
}
self::addBadKarma($player, $add);
}
示例10: onHPMP
protected static function onHPMP(SR_Player $player, $what, $key)
{
// $i = 1;
$b = chr(2);
// $bot = Shadowrap::instance($player);
$party = $player->getParty();
$members = $party->getMembers();
$format = $player->lang('fmt_hp_mp');
$back = '';
foreach ($members as $member) {
$member instanceof SR_Player;
$hpmp = $member->getBase($what);
$hpmmpm = $member->get('max_' . $what);
$b2 = '';
$b1 = 0;
if ($what === 'hp') {
if ($member->needsHeal()) {
$b2 = $b;
$b1 = 1;
}
} elseif ($what === 'mp') {
if ($member->getBase('magic') >= 0) {
if ($member->needsEther()) {
$b2 = $b;
$b1 = 1;
}
}
}
$back .= sprintf($format, $member->getEnum(), $member->getName(), $hpmp, $hpmmpm, $b2, $b1);
// $back .= sprintf(", %s-%s%s(%s/%s)%s", $b.($member->getEnum()).$b, $b2, $member->getName(), $hpmp, $hpmmpm, $b2);
}
return self::rply($player, $key, array(ltrim($back, ',; ')));
// $bot->reply(sprintf('Your parties %s: %s.', $text, substr($back, 2)));
// return true;
}
示例11: execute
public static function execute(SR_Player $player, array $args)
{
$p = $player->getParty();
if (false !== ($city = $p->getCityClass())) {
if ($city->isDungeon()) {
self::rply($player, '1035');
return false;
// Shadowrap::instance($player)->reply('In dungeons you don\'t have mounts.');
}
}
// $i = 1;
$format = $player->lang('fmt_sumlist');
$out = '';
$total = 0.0;
$total_max = 0.0;
foreach ($p->getMembers() as $member) {
$member instanceof SR_Player;
$mount = $member->getMount();
$we = $mount->calcMountWeight();
$max = $mount->getMountWeightB();
$total += $we;
$total_max += $max;
if ('' !== ($weight = $mount->displayWeight())) {
// $weight = "({$weight})";
}
$out .= sprintf($format, $member->getEnum(), $mount->getName(), $weight);
// $out .= sprintf(", \x02%s\x02-%s%s", $member->getEnum(), $mount->getName(), $weight);
}
return self::rply($player, '5083', array(Shadowfunc::displayWeight($total), Shadowfunc::displayWeight($total_max), ltrim($out, ',; ')));
// $message = sprintf('Party Mounts(%s/%s): %s.', Shadowfunc::displayWeight($total), Shadowfunc::displayWeight($total_max), substr($out, 2));
return Shadowrap::instance($player)->reply($message);
}
示例12: onEnter
public function onEnter(SR_Player $player)
{
$p = $player->getParty();
if ($p->getMin('level', true) < 1) {
$this->partyMessage($player, 'afraid', array(1));
// $p->notice('You are too afraid to go in there. (Each party member needs a minimum level of 1)');
return true;
}
foreach ($p->getMembers() as $member) {
$member instanceof SR_Player;
if ($member->isHuman()) {
$quest = SR_Quest::getQuest($member, 'Renraku_I');
$quest instanceof Quest_Renraku_I;
if (false === $quest->checkOrk($player)) {
$this->partyMessage($player, 'angryork');
// $p->notice('A big angry Ork shouts to you: "You not welcome here!" - The Ork attacks you with a tbs-pocket-knife.');
SR_NPC::createEnemyParty('Redmond_Ork')->fight($p, true);
return true;
}
}
}
parent::onEnter($player);
// $p->pushAction(SR_Party::ACTION_INSIDE);
$b = chr(2);
$c = Shadowrun4::SR_SHORTCUT;
$this->partyMessage($player, 'enter1');
$this->partyMessage($player, 'enter2');
// $p->notice('The guys in there stare quiet at their drinks when you enter the Trolls\' Inn.');
// $p->notice('You see a barkeeper, a suspicious person in a dark corner, a soldier and some guests, mostly orks and trolls. One of the guests greets and beckons you.');
$this->partyHelpMessage($player, 'help');
// $p->help("Use {$b}{$c}ttb{$b}(arkeeper), {$b}{$c}ttg{$b}(uest), {$b}{$c}ttj{$b}(ohnson) and {$b}{$c}tts{$b}(oldier) to talk to the persons.");
return true;
}
示例13: cast
public function cast(SR_Player $player, SR_Player $target, $level, $hits, SR_Player $potion_player)
{
// echo "Casting Firewall with level $level and $hits hits.\n";
# Firebolt ads 0.20 per level
$firebolt = $potion_player->getSpell('firebolt');
$firebolt = $firebolt === false ? 0 : $firebolt->getLevel($potion_player);
$firebolt = round($firebolt / 5, 1);
$level += $firebolt;
# Fireball ads 0.25 per level
$fireball = $potion_player->getSpell('fireball');
$fireball = $fireball === false ? 0 : $fireball->getLevel($potion_player);
$fireball = round($fireball / 4, 1);
$level += $fireball;
$line = $target->getY();
$damage = array();
$ep = $target->getParty();
foreach ($ep->getMembers() as $t) {
$t instanceof SR_Player;
$d = abs($line - $t->getY());
// echo "Distance to target is $d\n";
$l = $level - $d;
if ($l >= 0) {
$hits = $this->dice($potion_player, $t, $l);
$damage[$t->getID()] = $this->calcFirewallDamage($player, $t, $level, $hits);
}
}
$this->announceADV($player, $target, $level);
Shadowfunc::multiDamage($player, $damage);
return true;
}
示例14: isMaloisHere
private function isMaloisHere(SR_Player $player)
{
if (false === ($party = $player->getParty())) {
return false;
}
return $party->hasNPCNamed('Malois') || $party->hasConst('RESCUED_MALOIS') ? false : true;
}
示例15: onItemUse
public function onItemUse(SR_Player $player, array $args)
{
# Have ATM?
$p = $player->getParty();
if (!$p->isInsideLocation() || !$p->getLocationClass()->hasATM()) {
$this->reply($player, "You are not inside a location with an ATM. Towers and dungeons usually don't have those.");
return false;
}
# Fallback for credstick
$amount = isset($args[1]) ? (int) $args[1] : 0;
if (count($args) === 0) {
$args = array('popy');
}
# Do it!
switch (strtolower($args[0])) {
case 'pushy':
return $this->onItemUsePush($player, $amount);
case 'popy':
return $this->onItemUsePop($player, $amount);
case 'push':
return $this->onItemUsePushi($player, $args);
case 'view':
return $this->onItemUseViewi($player, $args);
default:
$player->message('Try #u Holostick pushy <nuyen>. Try #u Holostick popy <nuyen>. Try #u Holostick push <item> [<amt>]. Try #u Holostick view [<pattern>] [<page>].');
return false;
}
}