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


PHP SR_Player::getInvItemByName方法代码示例

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


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

示例1: checkQuest

 public function checkQuest(SR_NPC $npc, SR_Player $player)
 {
     if (false === ($auris = $player->getInvItemByName('Auris'))) {
         return $npc->reply($this->lang('aww1'));
         // 			return $npc->reply('Oh, you don\'t have an Auris for me?');
     }
     if (!$this->rightInTime($player)) {
         return $npc->reply($this->lang('aww2'));
         // 			return $npc->reply('You got the Auris? :) ... Oh, it turned to stone already :(');
     }
     $auris->useAmount($player, 1);
     $player->message($this->lang('hand'));
     // 		$player->message('You hand the pot of fluid Auris to the gnome ...');
     $npc->reply($this->lang('thx1'));
     // 		$npc->reply('Wow. Thank you so very very much.');
     $npc->reply($this->lang('thx2'));
     // 		$npc->reply('You surely earned a special reward now ... Let me think ...');
     $npc->reply($this->lang('thx3'));
     // 		$npc->reply('Right ... I will teach you the teleportii spell. It is quite powerful!');
     $player->levelupSpell('teleportii');
     $player->message($this->lang('learned'));
     // 		$player->message('You learned a new spell: teleportii');
     $this->onSolve($player);
     return true;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:25,代码来源:Delaware_Exams5.php

示例2: onRoundtripShow

 public function onRoundtripShow(SR_Player $player, SR_TalkingNPC $johnson)
 {
     # Has crystal?
     if (false === ($crystal = $player->getInvItemByName('DataCrystal', false))) {
         return false;
     }
     # Is a johnson?
     $name = $johnson->getNPCClassName();
     if (!in_array($name, self::$JOHNSONS, true)) {
         echo "{$name} is NOT A JOHNSON!\n";
         return false;
     }
     # Already shown?
     $data = $this->getQuestData();
     if (in_array($name, $data, true)) {
         echo "ALREADY SHOWN TO A JOHNSON!\n";
         return false;
     }
     # Save it!
     $data[] = $name;
     $this->saveQuestData($data);
     $player->message(sprintf('You show Mr. Johnson the data crystal ...'));
     $johnson->reply('Thank you ... this was very important!');
     return true;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:25,代码来源:Chicago_OwlJohnsonRoundtrip.php

示例3: onItemUse

 public function onItemUse(SR_Player $player, array $args)
 {
     if (!$player->getInvItemByName('Lighter', false)) {
         $player->message('You don\'t have a lighter.');
         return false;
     }
     return true;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:8,代码来源:Cigar.php

示例4: onQuestSolve

 public function onQuestSolve(SR_Player $player)
 {
     $xp = $this->getRewardXP();
     $ny = $this->getRewardNuyen();
     $this->msg('solved', array(Shadowfunc::displayNuyen($ny), $xp));
     // 		$player->message(sprintf('The dwarf cheers and hands you %s. You also gained %s XP.', Shadowfunc::displayNuyen($ny), $xp));
     // 		$player->giveXP($xp);
     // 		$player->giveNuyen($ny);
     if (false !== ($scalps = $player->getInvItemByName('PunkScalp'))) {
         $scalps->deleteItem($player);
     }
     $quest1 = SR_Quest::getQuest($player, 'Redmond_AresDwarf_I');
     $quest1 instanceof Quest_Redmond_AresDwarf_I;
     if ($quest1->isDone($player)) {
         $this->onSolveDuo($player);
     }
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:17,代码来源:Redmond_AresDwarf_II.php

示例5: checkQuest

 public function checkQuest(SR_NPC $npc, SR_Player $player)
 {
     if (false == ($cards = $player->getInvItemByName('IDCard'))) {
         return;
     }
     if ($cards->getAmount() < 3) {
         return;
     }
     $cards->useAmount($player, 3);
     $player->message($this->lang('hand'));
     $npc->reply($this->lang('thx1'));
     $npc->reply($this->lang('thx2'));
     // 		$player->message('You hand 3 IDCards to Malois.');
     // 		$npc->reply('Thank you very much. Now we sneak into Renraku and find out what they did to us.');
     // 		$npc->reply('By the way... I remember you from the experiments there...');
     $this->onSolve($player);
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:17,代码来源:Seattle_IDS.php

示例6: checkQuestHotelier

 private function checkQuestHotelier(SR_NPC $npc, SR_Player $player)
 {
     $data = $this->getQuestData();
     if (isset($data['gave'])) {
         return false;
     }
     if (false === ($item = $player->getInvItemByName('Package'))) {
         return false;
     }
     if (false === $player->deleteFromInventory($item)) {
         return false;
     }
     $data['gave'] = 1;
     $this->saveQuestData($data);
     $player->message($this->lang('give1'));
     $npc->reply($this->lang('give2'));
     $player->message($this->lang('give3'));
     // 		$player->message('You give the package to the hotelier: "Here is a package for you from Mr.Johnson!"');
     // 		$npc->reply('Oh, Thank you. I am sure Mr.Johnson will reward you well.');
     // 		$player->message('The hotelier takes the package');
     return true;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:22,代码来源:Redmond_Johnson_3.php

示例7: checkQuest

 public function checkQuest(SR_NPC $npc, SR_Player $player)
 {
     if (false === ($auris = $player->getInvItemByName('Auris'))) {
         return $npc->reply('Oh, you don\'t have more Auris for me?');
     }
     if (!$this->rightInTime($player)) {
         return $npc->reply('You got the Auris? :) ... Oh, it turned to stone already :(');
     }
     $have_before = $this->getAmount();
     $need = $this->getNeededAmount();
     $have = $this->giveQuesties($player, $npc, 'Auris', $have_before, $need);
     if ($have > $have_before) {
         $npc->reply('Thank you a lot, chummer.');
         $this->saveAmount($have);
     }
     if ($have >= $need) {
         $npc->reply('Wow ... You really earned a great reward now ... I will take my time and teach you the teleportiii spell!');
         $player->levelupSpell('teleportiii');
         return $this->onSolve($player);
     } else {
         return $npc->reply(sprintf('I still need %d fluid Auris for my experiments.', $need - $have));
     }
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:23,代码来源:Chicago_Uni6.php

示例8: getCurrentCommands

 public static function getCurrentCommands(SR_Player $player, $show_hidden = true, $boldify = false, $long_versions = true, $translate = false, $filter_hidden = false, $hidden_only = false)
 {
     if ($player->isOptionEnabled(SR_Player::DEAD)) {
         return array_merge(self::$CMDS_ALWAYS_CREATE, array('reset'));
     }
     if (false === $player->isCreated()) {
         return self::$CMDS_ALWAYS_CREATE;
     }
     if (false === ($party = $player->getParty())) {
         return array();
     }
     $action = $party->getAction();
     $leader = $player->isLeader();
     $commands = array();
     # Allways commands
     if (!$hidden_only) {
         $commands = array_merge($commands, self::$CMDS_ALWAYS);
     }
     # Always
     if ($show_hidden) {
         $commands = array_merge($commands, self::$CMDS_ALWAYS_CREATE);
     }
     # GM commands
     if ($show_hidden && $player->isGM()) {
         $commands = array_merge($commands, self::$CMDS_GM);
     }
     # Hidden commands
     if ($show_hidden) {
         $commands = array_merge($commands, self::$CMDS_ALWAYS_HIDDEN);
     }
     # Player actions
     if (!$hidden_only) {
         $commands = array_merge($commands, self::$CMDS[$action]);
         if (false !== ($scanner = $player->getInvItemByName('Scanner_v6', false))) {
             $commands[] = 'spy';
         }
         if ($player->getBase('alchemy') >= 0) {
             $commands[] = 'brew';
         }
     }
     # Leader actions
     if ($leader) {
         if ($show_hidden) {
             $commands = array_merge($commands, self::$CMDS_LEADER_ALWAYS);
         }
         if (!$hidden_only) {
             # Outside location?
             if (false !== ($location = $party->getLocationClass('outside'))) {
                 if ($location->isEnterAllowed($player)) {
                     # We can enter
                     $commands[] = 'enter';
                 }
             }
             # Action
             $commands = array_merge($commands, self::$CMDS_LEADER[$action]);
         }
     }
     # Location commands
     if (!$hidden_only) {
         if (false !== ($location = $party->getLocationClass('inside'))) {
             # Leader
             if ($leader === true) {
                 // 				$commands = array_merge($commands, self::shortcutArray($location->getLeaderCommands($player)));
                 $commands = array_merge($commands, $location->getLeaderCommands($player));
                 if ($location->isPVP()) {
                     $commands[] = 'fight';
                 }
             }
             # Talk
             $commands = array_merge($commands, $location->getNPCTalkCommands($player));
             # Special
             // 			$commands = array_merge($commands, self::shortcutArray($location->getCommands($player)));
             $commands = array_merge($commands, $location->getCommands($player));
         } elseif (false !== ($location = $party->getLocationClass('outside'))) {
             if ($location->isHijackable()) {
                 $commands[] = 'hijack';
             }
             //			if ($location->isPVP())
             //			{
             $commands[] = 'fight';
             //			}
         }
     }
     // 		if ($long_versions === false)
     // 		{
     // 			$commands = array_map(array(__CLASS__, 'shortcut'), $commands);
     // 		}
     // 		if ($long_versions === true)
     // 		{
     // 			$commands = array_map(array(__CLASS__, 'unshortcut'), $commands);
     // 		}
     ##############
     ### FORMAT ###
     ##############
     if ($filter_hidden) {
         $commands = array_values(array_diff($commands, self::$REALLY_HIDDEN));
     }
     if ($boldify) {
         // 			if ($long_versions === true)
         // 			{
//.........这里部分代码省略.........
开发者ID:sinfocol,项目名称:gwf3,代码行数:101,代码来源:Shadowcmd.php


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