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


PHP SR_Player::unequip方法代码示例

本文整理汇总了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;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:40,代码来源:SR_FireWeapon.php

示例2: onItemUnequip

 public function onItemUnequip(SR_Player $player)
 {
     return $player->unequip($this, true);
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:4,代码来源:SR_Equipment.php


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