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


PHP SR_Player::getName方法代码示例

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


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

示例1: 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;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:27,代码来源:say.php

示例2: giveNuyen

 public static function giveNuyen(SR_Player $player, SR_Player $target, $what, $amt)
 {
     if ($amt <= 0) {
         $player->msg('1062');
         // 			$player->message(sprintf('You can only give away a positive amount of %s.', $what));
         return false;
     }
     $have = $player->getBase($what);
     if ($amt > $have) {
         $player->msg('1063', array(Shadowfunc::displayNuyen($amt), Shadowfunc::displayNuyen($have)));
         // 			$player->message(sprintf('You only have %s %s.', $have, $what));
         return false;
     }
     # Thx jjk
     //		if (($have - $amt) <= SR_Player::START_NUYEN)
     //		{
     //			$player->message(sprintf('You can\'t give all your money away, you need at least %s', Shadowfunc::displayNuyen(SR_Player::START_NUYEN)));
     //			$player->message(sprintf('Maximum you can give is %s', Shadowfunc::displayNuyen($have-SR_Player::START_NUYEN)));
     //			return false;
     //		}
     if (false === $target->alterField($what, $amt)) {
         $player->message('Database error in giveNyKa()... 1');
         return false;
     }
     if (false === $player->alterField($what, -$amt)) {
         $player->message('Database error II in giveNyKa()... 2');
         return false;
     }
     $target->msg('5118', array(Shadowfunc::displayNuyen($amt), $player->getName()));
     $player->msg('5119', array(Shadowfunc::displayNuyen($amt), $target->getName()));
     // 		$target->message(sprintf('You received %s %s from %s.', $amt, $what, $player->getName()));
     // 		$player->message(sprintf('You gave %s %s %s.', $target->getName(), $amt, $what));
     return true;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:34,代码来源:giveny.php

示例3: onConsume

 public function onConsume(SR_Player $player)
 {
     $m = array('alc' => 0.1);
     $player->addEffects(new SR_Effect(GWF_Time::ONE_HOUR * 1, $m));
     $player->addEffects(new SR_Effect(GWF_Time::ONE_HOUR * 2, $m));
     $player->addEffects(new SR_Effect(GWF_Time::ONE_HOUR * 3, $m));
     $player->getParty()->notice(sprintf('%s drunk an alcopop and got alcoholized (+0.3).', $player->getName()));
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:8,代码来源:Alcopop.php

示例4: onHacked

 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()));
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:9,代码来源:Room4.php

示例5: onConsume

 public function onConsume(SR_Player $player)
 {
     $m = array('alc' => 0.1);
     $player->addEffects(new SR_Effect(GWF_Time::ONE_HOUR * 1, $m));
     $player->addEffects(new SR_Effect(GWF_Time::ONE_HOUR * 2, $m));
     $oldhp = $player->getHP();
     $gain = $player->healHP(0.3);
     $player->getParty()->notice(sprintf('%s drank a beer and got alcoholized (+0.2) %s.', $player->getName(), Shadowfunc::displayHPGain($oldhp, $gain, $player->getMaxHP())));
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:9,代码来源:SmallBeer.php

示例6: giveKnowB

 private static function giveKnowB(SR_Player $player, SR_Player $target, $what, $which)
 {
     if (false === $target->hasKnowledge($what, $which)) {
         $target->giveKnowledge($what, $which);
         $player->getParty()->ntice('5117', array($player->getName(), $target->getName(), $which));
         // 			$player->getParty()->message($player, sprintf(' told %s about %s.', $target->getName(), $which));
     }
     return true;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:9,代码来源:givekp.php

示例7: execute

 public static function execute(SR_Player $player, array $args)
 {
     return $player->getParty()->ntice('5084', array($player->getName(), implode(' ', $args)));
     // 		$b = chr(2);
     // 		$bot = Shadowrap::instance($player);
     // 		$message = sprintf('%s pm: "%s"', $b.$player->getName().$b, implode(' ', $args));
     // 		$player->getParty()->notice($message);
     // 		return true;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:9,代码来源:party_message.php

示例8: deletePlayer

 private static function deletePlayer(SR_Player $player)
 {
     $epname = GDO::escape($player->getName());
     if (false === GDO::table('SR_BazarShop')->deleteWhere("sr4bs_pname='{$epname}'")) {
         return false;
     }
     if (false === GDO::table('SR_BazarItem')->deleteWhere("sr4ba_pname='{$epname}'")) {
         return false;
     }
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:10,代码来源:reset.php

示例9: onFlee

 public static function onFlee(SR_Player $player)
 {
     $party = $player->getParty();
     $ep = $party->getEnemyParty();
     $party->ntice('5113', array($player->getName()));
     $ep->ntice('5114', array($player->getName()));
     // 		$party->notice(sprintf('%s has fled from the enemy.', $player->getName()));
     // 		$ep->notice(sprintf('%s has fled from combat.', $player->getName()));
     $player->resetXP();
     $party->kickUser($player, true);
     $np = SR_Party::createParty();
     $np->addUser($player, true);
     $np->cloneAction($party);
     $np->clonePreviousAction($party);
     $np->popAction(true);
     if ($np->isInsideLocation()) {
         $np->pushAction(SR_Party::ACTION_OUTSIDE);
     }
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:19,代码来源:flee.php

示例10: displayBountyPlayer

 public static function displayBountyPlayer(SR_Player $player)
 {
     $bounty = $player->getBase('bounty');
     if ($bounty <= 0) {
         return $player->lang('no_bounty');
         # This player has no bounty.
     }
     $total = Shadowfunc::displayNuyen($bounty);
     return $player->lang('total_bounty', array($total, $player->getName(), self::displayBountyPlayerDetails($player)));
     // 		return sprintf("There is a total {$b}bounty of %s{$b} for %s: %s.", $total, $player->getName(), self::displayBountyPlayerDetails($player));
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:11,代码来源:SR_Bounty.php

示例11: onGMNS

 private static function onGMNS(SR_Player $player, SR_Player $target, $arg)
 {
     $pid = $target->getID();
     if (strtolower($arg) === 'on') {
         if (false === SR_NoShout::setNoShout($pid, -1)) {
             return false;
         }
         return $player->message(sprintf('Banned %s from shouting.', $target->getName()));
     } elseif (strtolower($arg) === 'off') {
         if (false === SR_NoShout::setShout($pid)) {
             return false;
         }
         return $player->message(sprintf('Allowed %s to shout again.', $target->getName()));
     } elseif (0 < ($seconds = GWF_TimeConvert::humanToSeconds($arg))) {
         if (false === SR_NoShout::setNoShout($pid, $seconds)) {
             return false;
         }
         return $player->message(sprintf('Banned %s from shouting for %s.', $target->getName(), GWF_TimeConvert::humanDuration($seconds)));
     } else {
         $player->message(Shadowhelp::getHelp($player, 'gmns'));
         return false;
     }
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:23,代码来源:gmns.php

示例12: onPayOwner

 public function onPayOwner(SR_Player $buyer, $amt)
 {
     $price = $this->getVar('sr4ba_price') * $amt;
     $pname = $this->getVar('sr4ba_pname');
     if (false === ($seller = Shadowrun4::getPlayerByName($pname))) {
         if (false === ($seller = SR_Player::getByLongName($pname))) {
             return false;
         }
     }
     if (false === $seller->giveBankNuyen($price)) {
         return false;
     }
     $iname = $this->getVar('sr4ba_iname');
     $seller->msg('5035', array(Shadowfunc::displayNuyen($price), $amt, $iname, $buyer->getName()));
     // 		$seller->message(sprintf('%s have been booked to your bank account for selling %s %s to %s.', Shadowfunc::displayNuyen($price), $amt, $iname, $buyer->getName()));
     return true;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:17,代码来源:SR_BazarItem.php

示例13: giveItem

 public static function giveItem(SR_Player $player, SR_Player $target, $id, $amt = 1)
 {
     if ($amt < 1) {
         $player->msg('1038');
         // 			$player->message('Please give a positive amount of items.');
         return false;
     }
     if (false === ($item = $player->getInvItem($id))) {
         $player->msg('1029');
         // 			$player->message('You don`t have that item.');
         return false;
     }
     // 		if (false === $item->isItemTradeable())
     // 		{
     // 			$player->message('You are not allowed to trade this item.');
     // 			return false;
     // 		}
     if ($item->isItemStackable()) {
         if ($amt > $item->getAmount()) {
             $player->msg('1040', array($item->getItemName()));
             // 				$player->message(sprintf('You only have %d %s.', $item->getAmount(), $item->getName()));
             return false;
         }
         $giveItem = SR_Item::createByName($item->getItemName(), $amt, true);
         $item->useAmount($player, $amt);
     } else {
         if ($amt !== 1) {
             $player->message('Currently you can only give one equipment at a time.');
             return false;
         }
         $player->removeFromInventory($item);
         $giveItem = $item;
     }
     $busymsg = $player->isFighting() ? Shadowfunc::displayBusy($player->busy(SR_Player::GIVE_TIME)) : '';
     self::rply($player, '5115', array($amt, $giveItem->displayFullName($player), $target->getName(), $busymsg));
     // 		$player->message(sprintf('You gave %d %s to %s.%s', $amt, $giveItem->getName(), $target->getName(), $busymsg));
     $target->giveItems(array($giveItem), $player->getName());
     // 		if ($target instanceof SR_TalkingNPC)
     // 		{
     // 			$target->onNPCGive($player, $items);
     // 		}
     return true;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:43,代码来源:give.php

示例14: isGM

 public static function isGM(SR_Player $player)
 {
     if (NULL === self::$GMS) {
         /**
          * @Example GameMasters.php in this directory:
          *
          * <? return array('gizmore{14}'); ?>
          */
         if (false === (self::$GMS = @(include_once 'GameMasters.php'))) {
             self::$GMS = array('gizmore{1}');
         }
     }
     if (false === ($user = $player->getUser())) {
         return false;
     }
     if (!$user->isLoggedIn()) {
         return false;
     }
     return in_array($player->getName(), self::$GMS, true);
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:20,代码来源:Shadowrun4.php

示例15: getSolution

 public function getSolution(SR_Player $player)
 {
     $pname = strtolower($player->getName());
     $hash = substr(md5(LAMB_PASSWORD2 . md5($pname) . LAMB_PASSWORD2), 2, 16);
     return sprintf('%s!%s!gunda', $pname, $hash);
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:6,代码来源:Block1.php


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