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


PHP SR_Player::giveNuyen方法代码示例

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


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

示例1: onTrollReward

 private function onTrollReward(SR_NPC $npc, SR_Player $player)
 {
     $max = $player->isRunner() ? Shadowcmd_lvlup::MAX_VAL_ATTRIBUTE_RUNNER : Shadowcmd_lvlup::MAX_VAL_ATTRIBUTE;
     $base = $player->getBase('magic');
     if ($base >= $max) {
         $ny = 5000;
         $player->giveNuyen($ny);
         return $player->message($this->lang('reward_ny', array($ny)));
         // 			return $player->message('Larry hands you another 5000 nuyen!');
     }
     $player->message($this->lang('reward1'));
     // 		$player->message('Larry leads you to a shamane: "This is our shamane, Srando, he can help you."');
     $race = $player->getRace();
     if ($race === 'Ork' || $race === 'Troll') {
         $player->message($this->lang('reward2', array($race)));
         // 			$player->message('The shamane says: "You are a strong '.$race.'. You just need to calm down sometime."');
         $player->message($this->lang('reward3'));
         // 			$player->message('You are starting to argue, but the shamane continues: "If you calm you have more time to strengthen yourself. Focus yourself, and the path is clear."');
         $player->message($this->lang('reward4'));
         // 			$player->message('The shamane touches your head: "Your mind is now clear from anything. You can focus yourself from now on."');
         $player->message($this->lang('reward5'));
         // 			$player->message('Your character is now allowed to learn magic and spells.');
     } else {
         $player->message($this->lang('reward5'));
         // 			$player->message('The shamane mumbles some magic spells and raises your base value for magic by 1.');
     }
     $player->alterField('magic', 1);
     $player->modify();
     return true;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:30,代码来源:Troll_Maniac.php

示例2: onHireB

 public function onHireB(SR_Player $player, $price, $time)
 {
     $p = $player->getParty();
     $player->giveNuyen(-$price);
     $npc = $this->spawn($p);
     $npc->onHireC($player, $time);
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:7,代码来源:SR_HireNPC.php

示例3: onQuestSolve

 public function onQuestSolve(SR_Player $player)
 {
     $nuyen = 750;
     $player->message($this->lang('hand_back', array($nuyen)));
     // 		$player->message('Malois sneakily hands you '.$nuyen.' Nuyen and a piece of paper.');
     $player->giveNuyen($nuyen);
     $note = SR_Item::createByName('Note');
     $player->giveItems(array($note));
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:9,代码来源:Seattle_IDS.php

示例4: getNPCLoot

 public function getNPCLoot(SR_Player $player)
 {
     $nuyen = 1200;
     $key = 'SEATTLE_ARENA_N';
     $player->setConst($key, $player->getConst($key) + 1);
     $player->msg('5125', array(Shadowfunc::displayNuyen($nuyen)));
     // 		$player->message("The fight is over. The director hands you $nuyen Nuyen.");
     $player->giveNuyen($nuyen);
     return array();
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:10,代码来源:AToughTroll.php

示例5: onQuestSolve

 public function onQuestSolve(SR_Player $player)
 {
     $xp = 6;
     $ny = 1000;
     $player->message($this->lang('reward1', array($ny, $xp)));
     // 		$player->message(sprintf('The barkeeper hands you %s Nuyen and smiles: "Good job. We surely will have more guests now.". You also gain %s XP.', $ny, $xp));
     $player->giveNuyen($ny);
     $player->giveXP($xp);
     $player->message($this->lang('reward2'));
     // 		$player->message(sprintf('Here, take this as a bonus reward. Guests forgot these items lately.'));
     $player->giveItems(Shadowfunc::randLootNItems($player, 15, 2));
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:12,代码来源:Seattle_Barkeeper.php

示例6: onQuestSolve

 public function onQuestSolve(SR_Player $player)
 {
     $nuyen = 1000;
     $xp = 5;
     $player->message($this->lang('thx1'));
     $player->message($this->lang('thx2'));
     $player->message($this->lang('thx3', array($nuyen, $xp)));
     // 		$player->message(sprintf('Mr.Johnson looks not really happy...'));
     // 		$player->message(sprintf('"Here chummer, take this as reward.", Mr.Johnson says, "But our client did a mistake when ordering my service...".'));
     // 		$player->message(sprintf('He hands you %s Nuyen and you also gain %s XP.', $nuyen, $xp));
     $player->giveNuyen($nuyen);
     $player->giveXP($xp);
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:13,代码来源:Seattle_Johnson1.php

示例7: onPraySins

 private function onPraySins(SR_Player $player, $price)
 {
     $nuyen = $player->getNuyen();
     $dp = Shadowfunc::displayNuyen($price);
     $dn = Shadowfunc::displayNuyen($nuyen);
     if ($price > $nuyen) {
         return $this->rply('cost', array($dp, $dn));
         // 			return $this->reply(sprintf('My son, it would cost %s to forgive your sins, but you have only %s.', $dp, $dn));
     }
     $player->giveNuyen(-$price);
     $dl = Shadowfunc::displayNuyen($nuyen - $price);
     $player->message($this->langNPC('pay', array($dp, $dl)));
     // 		$player->message("You pay the price of {$dp} and have {$dl} left.");
     $player->alterField('bad_karma', -1);
     $badkarma = $player->getBase('bad_karma');
     return $this->rply('thx', array($badkarma));
     // 		return $this->reply("Thank you my son. You now have only {$badkarma} bad karma left.");
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:18,代码来源:Priest.php

示例8: buyPermission

 private function buyPermission(SR_Player $player)
 {
     if ($player->hasConst("SEATTLE_BM", 1)) {
         return $player->message($this->langNPC('already'));
         // 			$player->message("You already have permission to enter the blackmarket in Seattle.");
         // 			return ;
     }
     $nuyen = $player->getNuyen();
     if ($nuyen < $this->price) {
         return $player->message($this->langNPC('poor', array($this->price, $nuyen)));
         // 			$player->message("The salesman is shaking his head...\"No!\", he says, \"I want $this->price, not $nuyen\".");
         // 			return;
     }
     $player->giveNuyen(-$this->price);
     $player->message($this->langNPC('give', array($this->price)));
     // 		$player->message("You give $this->price Nuyen to the salesman...");
     $player->setConst("SEATTLE_BM", 1);
     return $this->rply('purchase');
     // 		$this->reply('Ok, here is your permission to enter the blackmarket. And you don\'t know me!');
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:20,代码来源:AresMan.php

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

示例10: onKilledByHuman

 public static function onKilledByHuman(SR_Player $killer, SR_Player $victim)
 {
     $b = chr(2);
     $where = 'sr4bo_victim=' . $victim->getUID();
     $bounty = self::table(__CLASS__)->selectAll('sr4bo_id, sr4bo_bounty', $where, '');
     $sum = 0;
     foreach ($bounty as $data) {
         $b = $data['sr4bo_bounty'];
         //			SR_BountyHistory::onKilled($killer, $victim, $data['sr4bo_id']);
         $sum += $b;
     }
     $victim->updateField('bounty', 0);
     $killer->giveNuyen($sum);
     $killer->increase('sr4pl_bounty_done', $sum);
     self::table(__CLASS__)->deleteWhere($where);
     $killer->msg('5034', array(Shadowfunc::displayNuyen($sum)));
     // 		$killer->message(sprintf("You collected a {$b}bounty{$b}: %s.", Shadowfunc::displayNuyen($sum)));
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:18,代码来源:SR_Bounty.php

示例11: getNPCLoot

 public function getNPCLoot(SR_Player $player)
 {
     if ($this->arena_ny > 0) {
         $ny = $this->arena_ny;
         $player->msg('5125', array(Shadowfunc::displayNuyen($ny)));
         // 			$player->message(sprintf('You get a reward of %s for killing the enemy.', Shadowfunc::displayNuyen($ny)));
         $player->giveNuyen($ny);
     }
     if ($this->arena_key === NULL) {
         return array();
     }
     list($bit, $key) = explode(':', $this->arena_key);
     $bits = (int) SR_PlayerVar::getVal($player, $key, 0);
     $bits |= $bit;
     SR_PlayerVar::setVal($player, $key, $bits);
     return array();
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:17,代码来源:SR_NPCBase.php


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