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


PHP SR_Player::displayNameNB方法代码示例

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


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

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

示例2: moveTowards

 public function moveTowards(SR_Player $player, SR_Player $target)
 {
     $move = $player->getMovePerSecond();
     $d1 = $player->getY();
     $d2 = $target->getY();
     $dt = $d1 - $d2;
     if ($dt < 0) {
         $dt = -$dt;
         if ($move > $dt) {
             $move = $dt;
         }
         $move = -$move;
     } else {
         if ($move > $dt) {
             $move = $dt;
         }
     }
     $pid = $player->getID();
     $move = -$move;
     $new_d = 0;
     $move = round($move, 1);
     $this->movePlayerB($pid, $move, $new_d);
     $new_d = round($new_d, 1);
     $busy = $player->busy(25);
     $name = $player->displayNameNB();
     $tn = $target->displayNameNB();
     $ep = $this->getEnemyParty();
     $args = array($name, abs($move), $tn, $new_d, $busy);
     $this->ntice('5097', $args);
     $ep->ntice('5097', $args);
     // 		$ep->ntice('5098', array($name, abs($move), $tn, $new_d));
     // 		$this->notice(sprintf('%s moves %.01f meters towards %s and is now on position %.01f meters. %ds busy.', $name, abs($move), $tn, $new_d, $busy));
     // 		$this->getEnemyParty()->notice(sprintf('%s moves %.01f meters towards %s and is now on position %.01f meters.', $name, abs($move), $tn, $new_d));
     return true;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:35,代码来源:SR_Party.php


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