本文整理汇总了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;
}
示例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;
}