本文整理汇总了PHP中SR_Player::unequip方法的典型用法代码示例。如果您正苦于以下问题:PHP SR_Player::unequip方法的具体用法?PHP SR_Player::unequip怎么用?PHP SR_Player::unequip使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SR_Player
的用法示例。
在下文中一共展示了SR_Player::unequip方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onReload
public function onReload(SR_Player $player)
{
if (false === ($ammo = $player->getItemByName($this->getAmmoName()))) {
$player->msg('5205');
// $player->message('You are out of ammo!');
$player->unequip($this);
$player->modify();
return true;
}
$p = $player->getParty();
$now = $this->getAmmo();
$max = $this->getBulletsMax();
$avail = $ammo->getAmount();
$put = Common::clamp($max - $now, 0, $avail);
if ($put == 0) {
$player->msg('1156');
// $player->message('Your weapon is already loaded.');
return false;
}
// Dog_Log::debug(sprintf('%s reloads his %s: Nee'))
$ammo->useAmount($player, $put);
$this->increase('sr4it_ammo', $put);
if ($p->isFighting()) {
$ep = $p->getEnemyParty();
$busy = $player->busy(round($this->getReloadTime() + rand(0, 10)));
$p->ntice('5206', array($player->getName(), $put, $this->getName(), $busy));
$ep->ntice('5206', array($player->getName(), $put, $this->getName(), $busy));
// $message = sprintf(' load(s) %d bullet(s) into his %s. %s', $put, $this->getItemName(), Shadowfunc::displayBusy($busy));
// $message = sprintf(' load(s) %d bullet(s) into his %s. %s busy.', $put, $this->getItemName(), $player->busy(round($this->getReloadTime()+rand(0, 10))));
// $p->message($player, $message);
// $p->getEnemyParty()->message($player, $message);
} else {
// $message = sprintf('You load %d bullet(s) into your %s.', $put, $this->getItemName());
// $bot = Shadowrap::instance($player);
// $bot->rply('5207', array($put, $this->getName()));
$player->msg('5207', array($put, $this->getName()));
// $bot->reply($message);
}
return true;
}
示例2: onItemUnequip
public function onItemUnequip(SR_Player $player)
{
return $player->unequip($this, true);
}