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


PHP SR_Player::displayNuyen方法代码示例

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


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

示例1: onItemUsePop

 public function onItemUsePop(SR_Player $player, $amount)
 {
     $b = chr(2);
     $have = $player->getNuyen();
     $bank = $player->getBankNuyen();
     if ($amount <= 0) {
         $message = sprintf("Your bank account is {$b}%s Nuyen{$b}. You carry %s Nuyen. In total you have %s Nuyen.", $player->displayBankNuyen(), $player->displayNuyen(), Shadowfunc::displayNuyen($bank + $have));
         return $this->reply($player, $message);
     }
     $cost = $this->getTransactionCost();
     $need = $amount + $cost;
     if ($bank < $need) {
         $this->reply($player, sprintf("You want to pop %s(+%s)=%s Nuyen from your bank account, but you only have %s.", $amount, $cost, $need, $bank));
         return false;
     }
     $player->giveNuyen($amount);
     $player->increase('sr4pl_bank_nuyen', -$need);
     $this->reply($player, sprintf("You booked %s(+%s)=%s Nuyen from your bank account (%s left). You now carry %s.", $amount, $cost, $need, $player->getBankNuyen(), $player->displayNuyen()));
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:19,代码来源:Credstick.php

示例2: onBuyMembers

 private function onBuyMembers(SR_Player $player, SR_Clan $clan, array $args)
 {
     $dadd = self::ADD_MEMBERS;
     $dcost = Shadowfunc::displayNuyen(self::COST_MEMBERS);
     if (count($args) !== 2 || $args[1] !== self::CONFIRM_PHRASE) {
         return $player->msg('5170', array($clan->displayMaxMembercount(), $dadd, $dcost, self::CONFIRM_PHRASE));
         // 			$player->message(sprintf(
         // 				'Your clan currently can have a maximum of %s members. Raising this maximum by %s would cost you %s. Please type #manage buystorage %s to confirm.',
         // 				$clan->getMaxMembercount(), $dadd, $dcost, self::CONFIRM_PHRASE
         // 			));
         return true;
     }
     if ($clan->getMaxMembercount() >= SR_Clan::MAX_MEMBERCOUNT) {
         $player->msg('5171', array($clan->getMembercount(), $clan->displayMaxMembercount()));
         // 			$player->message(sprintf('Your clan has already reached the maximum of %s/%s storage.', $clan->displayStorage(), $clan->displayMaxStorage()));
         return false;
     }
     if (false === $player->hasNuyen(self::COST_MEMBERS)) {
         $player->msg('1063', array($dcost, $player->displayNuyen()));
         // 			$player->message(sprintf('It would cost %s to raise your max members by %s, but you only got %s.',
         // 				$dcost, $dadd, $player->displayNuyen()
         // 			));
         return false;
     }
     if (false === $player->giveNuyen(-self::COST_MEMBERS)) {
         $player->message('DB ERROR 2');
         return false;
     }
     if (false === $clan->addMembercount(self::ADD_MEMBERS)) {
         $player->message('DB ERROR 2');
         return false;
     }
     $player->msg('5172', array($dcost, $clan->getMembercount(), $clan->displayMaxMembercount()));
     // 		$player->message(sprintf(
     // 			'You paid %s and your clan has now of %s/%s members.',
     // 			$dcost, $clan->getMembercount(), $clan->getMaxMembercount()
     // 		));
     return SR_ClanHistory::onAddMembers($clan, $player);
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:39,代码来源:SR_ClanHQ.php


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