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


PHP Shadowfunc::displayBusy方法代码示例

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


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

示例1: 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

示例2: announceADV

 public function announceADV(SR_Player $player, SR_Player $target, $level, $key = '10000', $arg1 = '', $arg2 = '', $arg3 = '', $arg4 = '')
 {
     # Pick right keys. Each spell has own 4 keys for all 4 possibilities.
     $key_friend = $key;
     $key_foe = $key + 2;
     if ($this->isCastMode()) {
         $key_friend++;
         $key_foe++;
     }
     $key_friend = (string) $key_friend;
     $key_foe = (string) $key_foe;
     # 9 args
     $args = array($player->displayName(), $level, $this->getName(), $target->displayName(), $arg1, $arg2, $arg3, Shadowfunc::displayBusy($player->getBusyLeft()));
     # Announce
     $p = $player->getParty();
     $ep = $target->getParty();
     if ($ep->getID() !== $p->getID()) {
         $ep->ntice($key_foe, $args);
     }
     if ($this->isCastMode()) {
         # 10 args
         # TODO: this 12 args
         // 			$args[] = $this->getManaCost($player, $level);
         // 			$args[] = $player->getMP();
         // 			$args[] = $player->getMaxMP();
         # Old spell style 10 args
         $gain = $this->getManaCost($player, $level);
         $oldmp = $player->getMP() + $gain;
         $maxmp = $player->getMaxMP();
         $args[] = Shadowfunc::displayMPGain($oldmp, -$gain, $maxmp);
     }
     $args[] = $arg4;
     $p->ntice($key_friend, $args);
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:34,代码来源:SR_Spell.php

示例3: forwardB

 private function forwardB(SR_Player $player, $dir, $fwbw, $busy = -1)
 {
     $by = $dir * $player->getMovePerSecond();
     $pid = $player->getID();
     $new_d = 0;
     $this->movePlayerB($pid, $by, $new_d);
     $busy = $busy > 0 ? ', ' . Shadowfunc::displayBusy($player->busy($busy)) : '.';
     $by = round($by, 1);
     $new_d = round($new_d, 1);
     $ep = $this->getEnemyParty();
     $pname = $player->getName();
     $this->ntice('5090', array($pname, abs($by), $fwbw, $new_d, $busy));
     $ep->ntice('5091', array($pname, abs($by), $fwbw, $new_d, $busy));
     // 		$message = sprintf(' moves %.01f meters %s and is now on position %.01f meters%s', abs($by), $fwbw, $new_d, $busy);
     // 		$this->message($player, $message);
     // 		$this->getEnemyParty()->message($player, $message);
     return true;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:18,代码来源:SR_Party.php


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