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


PHP Shadowfunc类代码示例

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


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

示例1: onNPCQuestTalkB

 public function onNPCQuestTalkB(SR_TalkingNPC $npc, SR_Player $player, $word, array $args = NULL)
 {
     switch ($word) {
         case 'confirm':
             $npc->reply($this->lang('confirm'));
             // 				$npc->reply('It would be so great if you could help me again, yes?');
             break;
         case 'shadowrun':
             $npc->reply($this->lang('shadowrun1'));
             $npc->reply($this->lang('shadowrun2'));
             $npc->reply($this->lang('shadowrun3', array(self::NEED_LEG, self::NEED_ARMOR, self::NEED_HELMET)));
             $npc->reply($this->lang('shadowrun4', array(Shadowfunc::displayNuyen(self::REWARD_NUYEN))));
             // 				$npc->reply('Thanks to you I have some runes now, and the customers are already coming.');
             // 				$npc->reply('However, I need Chain armory for the Arena and I have no time to smith it.');
             // 				$npc->reply(sprintf('Could you bring me %s ChainLegs, %s ChainBodies and %s ChainHelmets?', self::NEED_LEG, self::NEED_ARMOR, self::NEED_HELMET));
             // 				$npc->reply(sprintf('I can pay you %s for that job! Yes?', Shadowfunc::displayNuyen(self::REWARD_NUYEN)));
             break;
         case 'yes':
             $npc->reply($this->lang('yes'));
             // 				$npc->reply(sprintf('Thank you so very much. Please hurry. The Arena frequently needs melee armory.'));
             break;
         case 'no':
             $npc->reply($this->lang('no'));
             // 				$npc->reply('Anyway check out my offers!');
             break;
     }
     return true;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:28,代码来源:Seattle_BD3.php

示例2: execute

 public static function execute(SR_Player $player, array $args)
 {
     $bot = Shadowrap::instance($player);
     if (count($args) !== 2) {
         $bot->reply(Shadowhelp::getHelp($player, 'gmloot'));
         return false;
     }
     $target = Shadowrun4::getPlayerByShortName($args[0]);
     if ($target === -1) {
         $player->message('The username is ambigious.');
         return false;
     }
     if ($target === false) {
         $player->message('The player is not in memory or unknown.');
         return false;
     }
     if (false === $target->isCreated()) {
         $bot->reply(sprintf('The player %s has not started a game yet.', $args[0]));
         return false;
     }
     if (Common::isNumeric($args[1])) {
         $target->giveItems(Shadowfunc::randLoot($target, $args[1]), 'gmloot');
     } else {
     }
     return true;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:26,代码来源:gmloot.php

示例3: execute

 public static function execute(SR_Player $player, array $args)
 {
     $bot = Shadowrap::instance($player);
     # One arg is like examine.
     if (count($args) === 1) {
         return Shadowcmd_examine::execute($player, $args);
     }
     # Other than 2 args is error => help.
     if (count($args) !== 2) {
         $bot->reply(Shadowhelp::getHelp($player, 'show'));
         return false;
     }
     # Try to get target.
     if (false === ($target = Shadowfunc::getFriendlyTarget($player, $args[0]))) {
         $player->msg('1028', array($args[0]));
         // 			$player->message(sprintf('%s is not here or the name is ambigous.', $args[0]));
         return false;
     }
     # Show to yourself is like examine.
     if ($target->getID() === $player->getID()) {
         return Shadowcmd_examine::execute($player, array($args[1]));
     }
     # Try to get item.
     if (false === ($item = $player->getItem($args[1]))) {
         $player->msg('1029');
         // 			$bot->reply('You don`t have that item.');
         return false;
     }
     return $target->msg('5062', array($player->displayName(), $item->getItemInfo($target)));
     // 		$msg = sprintf('%s shows you: %s', $player->displayName(), $item->getItemInfo($player));
     // 		return $target->message($msg);
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:32,代码来源:show.php

示例4: onNPCQuestTalkB

 public function onNPCQuestTalkB(SR_TalkingNPC $npc, SR_Player $player, $word, array $args = NULL)
 {
     switch ($word) {
         case 'shadowrun':
             $npc->reply($this->lang('sr1'));
             $npc->reply($this->lang('sr2', array($this->getNeededAmount())));
             $npc->reply($this->lang('sr3'));
             // 				$npc->reply('Yo chummer, we need to get rid of Killers first, before we can get into business.');
             // 				$npc->reply(sprintf('Please kill %s killers and come back.', $this->getNeededAmount()));
             // 				$npc->reply('Do you accept?');
             break;
         case 'confirm':
             $ny = Shadowfunc::displayNuyen(self::REWARD_NUYEN);
             $npc->reply($this->lang('confirm', array($ny)));
             // 				$npc->reply(sprintf('I will pay you %s for this run.', $ny));
             break;
         case 'yes':
             $npc->reply($this->lang('yes'));
             // 				$npc->reply(sprintf('See you around, chummer.'));
             break;
         case 'no':
             $npc->reply($this->lang('no'));
             // 				$npc->reply(sprintf('See you around, chummer.'));
             break;
     }
     return true;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:27,代码来源:Seattle_GJohnson1.php

示例5: bribingTheGuard

 private function bribingTheGuard(SR_Player $player, $word, array $args)
 {
     $b = chr(2);
     $price = rand(2000, 8000);
     $price = Shadowfunc::calcBuyPrice($price, $player);
     if (!isset($args[0])) {
         $this->reply('Every person has it\'s <price> parameter.');
         $player->help('Use #talk bribe <amt> to try to bribe the guard.');
         return true;
     }
     $amt = (int) $args[0];
     if ($amt < $price) {
         $this->reply("{$b}Security !!!!{$b}");
         $p = $player->getParty();
         $p->pushAction(SR_Party::ACTION_OUTSIDE, 'Prison_Block2');
         $ep = SR_NPC::createEnemyParty('Prison_Ward', 'Prison_Ward', 'Prison_Ward', 'Prison_Guard', 'Prison_Guard');
         $p->fight($ep, true);
     } else {
         if (!$player->hasNuyen($amt)) {
             $this->reply('The idea of a bribe is usually that you can pay it ...');
         } else {
             $party = $player->getParty();
             $this->reply('Every bride has her pride ...');
             $this->reply('Ok buddy ... He is in cell 5, do quick, i will release the alarm as late as possible. Good luck ... ');
             $player->giveNuyen(-$amt);
             $party->pushAction(SR_Party::ACTION_OUTSIDE, 'PrisonB2_Exit');
         }
     }
     return true;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:30,代码来源:ExitGuard.php

示例6: on_sleep

 public function on_sleep(SR_Player $player, array $args)
 {
     $bot = Shadowrap::instance($player);
     $party = $player->getParty();
     $price = $this->calcPrice($player);
     if (!$party->needsToRest()) {
         return $bot->rply('1137');
         // 			return $bot->reply('You don`t need to rest.');
     }
     if (false === $player->pay($price)) {
         return $bot->rply('1063', array(Shadowfunc::displayNuyen($price), $player->displayNuyen()));
         // 			return $bot->reply(sprintf('To rent a room for your party, you need %s. You only got %s!', Shadowfunc::displayNuyen($price), $player->displayNuyen()));
     }
     if ($price > 0) {
         $player->msg('5143', array($price));
         // 			$player->message(sprintf('You pay %s nuyen.', $price));
     }
     $b = chr(2);
     $party->pushAction(SR_Party::ACTION_SLEEP);
     //		foreach ($party->getMembers() as $member)
     //		{
     //			$member instanceof SR_Player;
     //			$member->effectsReset();
     //		}
     return $party->ntice('5182');
     // 		$party->notice("The party goes to sleep. You go to your {$b}own{$b} bedroom.");
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:27,代码来源:SR_Hotel.php

示例7: onThrow

 public function onThrow(SR_Player $player, SR_Player $target)
 {
     $firearms = $player->get('firearms');
     $atk = 20 + $firearms;
     $mindmg = 1;
     $maxdmg = 6;
     $out_dmg = '';
     $out_dmgep = '';
     $out_eff = '';
     $inaccuracy = rand(2, 4) - ($firearms ? 1 : 0);
     $targets = $this->computeDistances($target, $inaccuracy);
     foreach ($targets as $data) {
         list($t, $d) = $data;
         $t instanceof SR_Player;
         $a = $atk - $d + rand(-1, 2);
         $a = Common::clamp($a, 0, $atk);
         $def = $t->get('defense');
         $arm = $t->get('marm');
         $hits = Shadowfunc::diceHits($mindmg, $arm, $atk, $def, $player, $t);
         $hits -= $arm;
         $hits = Common::clamp($hits, 0);
         if ($hits == 0) {
             continue;
         }
         $dmg = round($mindmg + $hits / 10, 2);
         if ($dmg <= 0) {
             continue;
         }
     }
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:30,代码来源:MolotovCocktail.php

示例8: execute

 public static function execute(SR_Player $player, array $args)
 {
     if ($player->isFighting()) {
         $player->msg('1036');
         // 			$player->message('This does not work in combat');
         return false;
     }
     $argc = count($args);
     if ($argc < 1 || $argc > 2) {
         $player->message(Shadowhelp::getHelp($player, 'givekw'));
         return false;
     }
     if ($argc === 2) {
         if (false === ($target = Shadowfunc::getFriendlyTarget($player, $args[0]))) {
             $player->msg('1028', array($args[0]));
             #$player->message(sprintf('%s is not here or the name is ambigous.', $args[0]));
             return false;
         }
         $word = $args[1];
         $targets = array($target);
     } else {
         $word = $args[0];
         $targets = $player->getParty()->getMembers();
     }
     if (false === $player->hasKnowledge('words', $word)) {
         $player->msg('1023');
         # You don`t have this knowledge.
         return false;
     }
     return self::giveKnow($player, $targets, 'words', $args[1]);
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:31,代码来源:givekw.php

示例9: decideCombat

 public static function decideCombat(SR_Player $player, array $args)
 {
     echo __METHOD__ . PHP_EOL;
     $min = isset($args[0]) ? (int) $args[0] : 1.0;
     $max = isset($args[1]) ? (int) $args[1] : 1.0;
     return array('attack', Shadowfunc::diceFloat($min, $max, 2));
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:7,代码来源:attackrandom.php

示例10: calcFirewallDamage

 private function calcFirewallDamage(SR_Player $player, SR_Player $target, $level, $hits)
 {
     // 		echo "Calc damage with $hits hits\n";
     $min = $level + 1;
     $max = $min + $hits * 1.0;
     return Shadowfunc::diceFloat($min, $max);
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:7,代码来源:firewall.php

示例11: checkQuest

 public function checkQuest(SR_NPC $npc, SR_Player $player)
 {
     if ($this->isDone($player)) {
         return false;
     }
     $need = $this->getNeededAmount();
     $have = $this->getAmount();
     $have = $this->giveQuesties($player, $npc, 'Tenugui', $have, $need);
     $this->saveAmount($have);
     if ($have >= $need) {
         $ny = Shadowfunc::displayNuyen(self::REWARD_NUYEN);
         $xp = self::REWARD_XP;
         $npc->reply($this->lang('thx1'));
         $npc->reply($this->lang('thx2', array($ny)));
         $player->message($this->lang('thx3', array($ny, $xp)));
         // 			$npc->reply('Haha, great! You are the best. This might have been a lesson for them.');
         // 			$npc->reply(sprintf('I am still a bit short on money. But you can have %s.', $ny));
         // 			$player->message(sprintf('The smith hands you %s. You also gain %s XP.', $ny, $xp));
         $player->giveNuyen(self::REWARD_NUYEN);
         $player->giveXP($xp);
         $this->onSolve($player);
         $npc->reply($this->lang('thx4'));
         // 			$npc->reply('You know what ... I will teach you how to use lockpicking.');
         $player->alterField('lockpicking', 1);
         $player->message($this->lang('thx5'));
         // 			$player->message(sprintf('Your lockpicking skill has increased by 1.'));
     } else {
         $npc->reply($this->lang('more', array($need - $have)));
         // 			$npc->reply(sprintf('Please bring me another %d Tenugui. I will reward you well.', $need-$have));
     }
     return true;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:32,代码来源:Seattle_BD4.php

示例12: onNPCQuestTalkB

 public function onNPCQuestTalkB(SR_TalkingNPC $npc, SR_Player $player, $word, array $args = NULL)
 {
     $need = $this->getNeededAmount();
     $ny = $this->getRewardNuyen();
     $dny = Shadowfunc::displayNuyen($ny);
     switch ($word) {
         case 'shadowrun':
             $npc->reply("Heh ... well ... lol ... well ...");
             $npc->reply("You can indeed do a job for me ^^");
             $player->message('The salesman whispers: "I messed up the yearly inventory" ... ');
             $npc->reply("I am going into own business and purchase Scanners and Credsticks.");
             $player->message('The salesman whispers: "I will compensate you ..." ');
             break;
         case 'confirm':
             $npc->reply("Thank you for your help in advance.");
             break;
         case 'yes':
             $npc->reply('Thank you chummer.');
             break;
         case 'no':
             $npc->reply('Laters chummer.');
             break;
     }
     return true;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:25,代码来源:Chicago_SaleSmith1.php

示例13: execute

 public static function execute(SR_Player $player, array $args)
 {
     if ($player->isFighting()) {
         $player->msg('1036');
         // 			$player->message('This does not work in combat');
         return false;
     }
     $argc = count($args);
     if ($argc < 1 || $argc > 2) {
         $player->message(Shadowhelp::getHelp($player, 'givekp'));
         return false;
     }
     if ($argc === 2) {
         if (false === ($target = Shadowfunc::getFriendlyTarget($player, $args[0]))) {
             $player->msg('1028', array($args[0]));
             // 			$player->message(sprintf('%s is not here or the name is ambigous.', $args[0]));
             return false;
         }
         $place = $args[1];
         $targets = array($target);
     } else {
         $place = $args[0];
         $targets = $player->getParty()->getMembers();
     }
     if (false === ($tlc = Shadowcmd_goto::getTLCByArgMulticity($player, $place))) {
         $player->msg('1023');
         return false;
     }
     return self::giveKnow($player, $targets, 'places', $tlc);
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:30,代码来源:givekp.php

示例14: execute

 public static function execute(SR_Player $player, array $args)
 {
     return self::rply($player, '5047', array(Shadowfunc::getEffects($player)));
     // 		$bot = Shadowrap::instance($player);
     // 		$bot->reply(sprintf('Your effects: %s.', Shadowfunc::getEffects($player)));
     // 		return true;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:7,代码来源:effects.php

示例15: onNPCQuestTalkB

 public function onNPCQuestTalkB(SR_TalkingNPC $npc, SR_Player $player, $word, array $args = NULL)
 {
     $ny = Shadowfunc::displayNuyen(self::REWARD_NUYEN);
     switch ($word) {
         case 'shadowrun':
             $npc->reply($this->lang('sr1'));
             $npc->reply($this->lang('sr2'));
             $npc->reply($this->lang('sr3', array($this->getNeededAmount())));
             // 				$npc->reply('Yo chummer, I have another important mission for you.');
             // 				$npc->reply('A contractor needs to get some ElectronicParts stolen from a ship delivery in the harbor.)');
             // 				$npc->reply(sprintf('You would need to bring me %s ElectronicParts to get the job done. What do you say?', $this->getNeededAmount()));
             break;
         case 'confirm':
             // 				$npc->reply(sprintf('I will pay you %s for this run.', $ny));
             // 				break;
         // 				$npc->reply(sprintf('I will pay you %s for this run.', $ny));
         // 				break;
         case 'yes':
             // 				$npc->reply(sprintf('See you around, chummer.'));
             // 				break;
         // 				$npc->reply(sprintf('See you around, chummer.'));
         // 				break;
         case 'no':
             // 				$npc->reply(sprintf('See you around, chummer.'));
             $npc->reply($this->lang($word));
             break;
     }
     return true;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:29,代码来源:Seattle_GJohnson4.php


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