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


PHP SR_Player::busy方法代码示例

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


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

示例1: onConsume

 public function onConsume(SR_Player $player)
 {
     $p = $player->getParty();
     $oldhp = $player->getHP();
     $maxhp = $player->getMaxHP();
     $gain = $player->healHP(0.1);
     $newhp = $player->getHP();
     $gainmsg = Shadowfunc::displayHPGain($oldhp, $gain, $maxhp);
     $last = $this->getAmount() === 0 ? 'the last' : 'a';
     if ($p->isFighting()) {
         $busy = $this->getItemUsetime();
         $player->busy($busy);
         $busytext = sprintf(' %s busy.', GWF_Time::humanDuration($busy));
         $p->message($player, sprintf(' eats %s potatoe chip from his roll of Pringles: %s.%s', $last, $gainmsg, $busytext));
         $p->getEnemyParty()->message($player, sprintf(' eats %s chip from his roll of Pringles.', $last));
     } else {
         $player->message(sprintf('You eat %s chip from your Pringles: %s', $last, $gainmsg));
     }
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:19,代码来源:Pringles.php

示例2: announceUsage

 public function announceUsage(SR_Player $player, SR_Player $target, $message = '', $message2 = '', $useamt = 1)
 {
     if ($player->isFighting()) {
         $busy = $player->busy($this->getItemUsetime());
         $busymsg = $player->lang('busy', array($busy));
         #sprintf(' %ds busy.', $busy);
     } else {
         $busymsg = '';
     }
     $player->getParty()->ntice('5228', array($player->displayNameNB(), $this->getName(), $target->displayNameNB(), $busymsg, $message));
     // 		$player->getParty()->notice(sprintf('%s used %s on %s.%s%s', $player->getName(), $this->getName(), $target->getName(), $busymsg, $message));
     if ($player->isFighting()) {
         $player->getEnemyParty()->ntice('5229', array($player->displayNameNB(), $this->getName(), $target->displayNameNB(), $busymsg, $message2));
         // 			$player->getEnemyParty()->notice(sprintf('%s used %s on %s.%s', $player->getName(), $this->getName(), $target->getName(), $message2));
     }
     if ($useamt > 0) {
         return $this->useAmount($player, $useamt);
     }
     return true;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:20,代码来源:SR_Usable.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


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