• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP SR_Player类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

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


示例2: onNPCTalk

 public function onNPCTalk(SR_Player $player, $word, array $args)
 {
     // 		$b = chr(2);
     switch ($word) {
         case 'magic':
             return $this->rply($word);
             // 				return $this->reply('Yeah, I even sell some magic potions and elixirs.');
         // 				return $this->reply('Yeah, I even sell some magic potions and elixirs.');
         case 'chemistry':
             $this->rply($word);
             // 				$this->reply("You can buy similar things here for chemistry or even {$b}magic{$b} potions.");
             $player->giveKnowledge('words', 'Magic');
             return true;
         case 'hello':
             return $this->rply($word, array($this->getName()));
             // 				return $this->reply("Hello, my name is ".$this->getName()." and I sell items for {$b}chemistry{$b} and similar stuff.");
         // 				return $this->reply("Hello, my name is ".$this->getName()." and I sell items for {$b}chemistry{$b} and similar stuff.");
         case 'gizmore':
         case 'somerandomnick':
             return $this->rply('brother', array($word));
             // 				return $this->reply(sprintf('Oh you mean my brother %s in Amerindian.', $word));
         // 				return $this->reply(sprintf('Oh you mean my brother %s in Amerindian.', $word));
         default:
             return $this->rply('default', array($word));
             // 				return $this->reply("What do you mean with $word?");
     }
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:27,代码来源:Alchemist_NPC.php


示例3: getStoreItems

 public function getStoreItems(SR_Player $player)
 {
     $back = array();
     $rep = $player->get('reputation');
     $back[] = array('Headcomputer');
     $back[] = array('SmartGoggles');
     $back[] = array('Sporn');
     $back[] = array('Cybermuscles');
     $back[] = array('CybermusclesV2');
     $back[] = array('CybermusclesV3');
     $back[] = array('DermalPlates');
     if ($rep >= 1) {
         $back[] = array('DermalPlatesV2');
     }
     if ($rep >= 2) {
         $back[] = array('DermalPlatesV3');
     }
     $back[] = array('WiredReflexes');
     if ($rep >= 2) {
         $back[] = array('WiredReflexesV2');
     }
     if ($rep >= 3) {
         $back[] = array('WiredReflexesV3');
     }
     return $back;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:26,代码来源:Hospital.php


示例4: onSolveCrypto

 public function onSolveCrypto(SR_Player $player, $word, array $args)
 {
     if (count($args) !== 1) {
         $this->rply('crypto1');
         // 			$this->reply('I wrote down some message and cannot decipher it myself again -.- Please tell me the password with #talk crypto <password>.');
         $this->rply('crypto2');
         // 			$this->reply('eht swordsap ot ym fase si ont xenophi tub gimmuhnbrid.');
         $cry = $player->get('crypto');
         if ($cry >= 1) {
             $player->message($this->langNPC('skills1'));
             // 				$player->message('With your awesome crypto skills you can easily read the message: "the password to my safe is not phoenix but hummingbird."');
         } elseif ($cry >= 0) {
             $player->message($this->langNPC('skills2'));
             // 				$player->message('With your awesome crypto skills you immediately recognize it\'s a simple anagram for each word.');
         }
         return true;
     }
     $answer = $args[0];
     switch ($answer) {
         case 'hummingbird':
             return $this->onQuestSolved($player, $word, $args);
         case 'phoenix':
             return $this->rply('almost');
             // 				return $this->reply('Yeah this rings a bell ... Let me try ... Darn wrong!');
         // 				return $this->reply('Yeah this rings a bell ... Let me try ... Darn wrong!');
         default:
             return $this->rply('wrong');
             // 				return $this->reply('Sweet let me try it on my safe ... Darn wrong.');
     }
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:30,代码来源:TomRiddle.php


示例5: calcNegPrice

 private function calcNegPrice(SR_Player $player)
 {
     $price = 10000;
     $try = $player->getTemp(self::TEMP_WORDN);
     $price -= $try * 1000;
     return $price;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:7,代码来源:Hotelier.php


示例6: giveNuyen

 public static function giveNuyen(SR_Player $player, SR_Player $target, $what, $amt)
 {
     if ($amt <= 0) {
         $player->msg('1062');
         // 			$player->message(sprintf('You can only give away a positive amount of %s.', $what));
         return false;
     }
     $have = $player->getBase($what);
     if ($amt > $have) {
         $player->msg('1063', array(Shadowfunc::displayNuyen($amt), Shadowfunc::displayNuyen($have)));
         // 			$player->message(sprintf('You only have %s %s.', $have, $what));
         return false;
     }
     # Thx jjk
     //		if (($have - $amt) <= SR_Player::START_NUYEN)
     //		{
     //			$player->message(sprintf('You can\'t give all your money away, you need at least %s', Shadowfunc::displayNuyen(SR_Player::START_NUYEN)));
     //			$player->message(sprintf('Maximum you can give is %s', Shadowfunc::displayNuyen($have-SR_Player::START_NUYEN)));
     //			return false;
     //		}
     if (false === $target->alterField($what, $amt)) {
         $player->message('Database error in giveNyKa()... 1');
         return false;
     }
     if (false === $player->alterField($what, -$amt)) {
         $player->message('Database error II in giveNyKa()... 2');
         return false;
     }
     $target->msg('5118', array(Shadowfunc::displayNuyen($amt), $player->getName()));
     $player->msg('5119', array(Shadowfunc::displayNuyen($amt), $target->getName()));
     // 		$target->message(sprintf('You received %s %s from %s.', $amt, $what, $player->getName()));
     // 		$player->message(sprintf('You gave %s %s %s.', $target->getName(), $amt, $what));
     return true;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:34,代码来源:giveny.php


示例7: getPocketsTuneup

 public function getPocketsTuneup(SR_Player $player)
 {
     $bo = $player->get('body') * 0.02;
     $st = $player->get('strength') * 0.03;
     $qu = $player->get('quickness') * 0.05;
     return $bo + $st + $qu;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:7,代码来源:Pockets.php


示例8: execute

 public static function execute(SR_Player $player, array $args)
 {
     $pp = Shadowrun4::getParties();
     foreach ($pp as $i => $p) {
         $p instanceof SR_Party;
         if (!$p->isHuman()) {
             unset($pp[$i]);
         }
     }
     $page = isset($args[0]) ? intval($args[0]) : 1;
     $nItems = count($pp);
     $nPages = GWF_PageMenu::getPagecount(self::PPP, $nItems);
     $page = Common::clamp($page, 1, $nPages);
     $from = GWF_PageMenu::getFrom($page, self::PPP);
     $slice = array_slice($pp, $from, self::PPP);
     $out = '';
     $format = $player->lang('fmt_list');
     foreach ($slice as $p) {
         $p instanceof SR_Party;
         $leader = $p->getLeader()->displayName();
         $l = $p->getSum('level', true);
         $ll = $p->getSum('level', false);
         $mc = $p->getMemberCount();
         $item = sprintf('%s(L%s(%s))(M%s)', $leader, $l, $ll, $mc);
         $out .= sprintf($format, $item);
         // 			$out .= sprintf(', %s(L%s(%s))(M%s)', $leader, $l, $ll, $mc);
     }
     return self::rply($player, '5248', array($page, $nPages, ltrim($out, ',; ')));
     // 		$bot = Shadowrap::instance($player);
     // 		$bot->reply(sprintf('Parties page %s from %s: %s.', $page, $nPages, substr($out, 2)));
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:31,代码来源:parties.php


示例9: getRespawnLocation

 public function getRespawnLocation(SR_Player $player)
 {
     if ($player->getNuyen() > 100 && $player->hasKnowledge('places', 'Seattle_Hotel')) {
         return 'Seattle_Hotel';
     }
     return parent::getRespawnLocation($player);
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:7,代码来源:Seattle.php


示例10: checkQuest

 public function checkQuest(SR_NPC $npc, SR_Player $player)
 {
     $have = $this->getAmount();
     $need = $this->getNeededAmount();
     $give = 0;
     foreach ($player->getInventory() as $item) {
         if ($item instanceof SR_Rune) {
             $player->deleteFromInventory($item);
             $have++;
             $give++;
             if ($have >= $need) {
                 break;
             }
         }
     }
     if ($give > 0) {
         $this->increase('sr4qu_amount', $give);
         $player->message($this->lang('gave', array($give, $npc->getName())));
         // 			$player->message(sprintf('You gave %s %s to %s.', $give, 'Runes', $npc->getName()));
     }
     if ($have >= $need) {
         $npc->reply($this->lang('thanks1'));
         // 			$npc->reply('Thank you very much my friend. Now I can also craft some equipment again.');
         $this->onSolve($player);
         $npc->reply($this->lang('thanks2', array(self::REWARD_RUNES)));
         // 			$npc->reply('As a reward I let you create '.self::REWARD_RUNES.' new runes via #reward.');
         $player->increaseConst(Seattle_Blacksmith::REWARD_RUNES, self::REWARD_RUNES);
     } else {
         $npc->reply($this->lang('more', array($have, $need)));
         // 			$npc->reply(sprintf('You gave me %s of %s Runes... Give me a few more and I will reward you greatly :)', $have, $need));
     }
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:32,代码来源:Seattle_BD2.php


示例11: onNPCQuestTalkB

 public function onNPCQuestTalkB(SR_TalkingNPC $npc, SR_Player $player, $word, array $args = NULL)
 {
     $need = $this->getNeededAmount();
     $dp = $this->displayRewardNuyen();
     switch ($word) {
         case 'shadowrun':
             $npc->reply("Haha ... you want to be a runner ... kill 20 bums and i reward your with {$dp}.");
             break;
         case 'confirm':
             $npc->reply("So?");
             break;
         case 'yes':
             $npc->reply('I was just kidding!');
             break;
         case 'no':
             $npc->reply('Hehe yeah, i was just kidding.');
             if (count($args) === 0 || $args[0] !== 'SURE') {
                 $player->message("Use #talk no SURE to decline this quest forever.");
             } else {
                 $this->decline($player);
             }
             break;
     }
     return true;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:25,代码来源:Chicago_RazorBarkeeper1.php


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


示例13: onEnter

 public function onEnter(SR_Player $player)
 {
     $party = $player->getParty();
     $dice = rand(0, 6);
     if ($dice < 2) {
         $this->partyMessage($player, 'lucky');
         // 			$party->notice('You silently search the door and windows for an entrance. You were lucky and sneak in...');
         $this->teleportInside($player, 'Hideout_Exit');
     } else {
         if ($dice < 4) {
             $this->partyMessage($player, 'noluck');
             // 			$party->notice('You silently search the door and windows for an entrance. You have no luck, everything\'s closed.');
         } else {
             if ($dice < 6) {
                 $this->partyMessage($player, 'fight2');
                 // 			$party->notice('You silently search the door and windows for an entrance. Two punks notice you and attack!');
                 SR_NPC::createEnemyParty('Redmond_Cyberpunk', 'Redmond_Cyberpunk')->fight($party, true);
             } else {
                 $this->partyMessage($player, 'fight4');
                 // 			$party->notice('You take a look through the doors keyhole. A party of four punks opens the door and surprises you.');
                 SR_NPC::createEnemyParty('Redmond_Cyberpunk', 'Redmond_Cyberpunk', 'Redmond_Pinkhead', 'Redmond_Lamer')->fight($party, true);
             }
         }
     }
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:25,代码来源:Hideout.php


示例14: getHelpText

 public function getHelpText(SR_Player $player)
 {
     return $player->lang('hlp_hotel', array($this->displaySleepPrice($player)));
     // 		$price = $this->calcPrice($player);
     // 		$c = Shadowrun4::SR_SHORTCUT;
     // 		return sprintf('You can pay %s to %ssleep here and restore your party`s HP/MP.', $price, $c);
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:7,代码来源:SR_Hotel.php


示例15: execute

 public static function execute(SR_Player $player, array $args)
 {
     $p = $player->getParty();
     if (false !== ($city = $p->getCityClass())) {
         if ($city->isDungeon()) {
             self::rply($player, '1035');
             return false;
             // 				Shadowrap::instance($player)->reply('In dungeons you don\'t have mounts.');
         }
     }
     //		$i = 1;
     $format = $player->lang('fmt_sumlist');
     $out = '';
     $total = 0.0;
     $total_max = 0.0;
     foreach ($p->getMembers() as $member) {
         $member instanceof SR_Player;
         $mount = $member->getMount();
         $we = $mount->calcMountWeight();
         $max = $mount->getMountWeightB();
         $total += $we;
         $total_max += $max;
         if ('' !== ($weight = $mount->displayWeight())) {
             // 				$weight = "({$weight})";
         }
         $out .= sprintf($format, $member->getEnum(), $mount->getName(), $weight);
         // 			$out .= sprintf(", \x02%s\x02-%s%s", $member->getEnum(), $mount->getName(), $weight);
     }
     return self::rply($player, '5083', array(Shadowfunc::displayWeight($total), Shadowfunc::displayWeight($total_max), ltrim($out, ',; ')));
     // 		$message = sprintf('Party Mounts(%s/%s): %s.', Shadowfunc::displayWeight($total), Shadowfunc::displayWeight($total_max), substr($out, 2));
     return Shadowrap::instance($player)->reply($message);
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:32,代码来源:mounts.php


示例16: onNPCTalk

 public function onNPCTalk(SR_Player $player, $word, array $args)
 {
     // 		$c = Shadowrun4::SR_SHORTCUT;
     // 		$b = chr(2);
     switch ($word) {
         case 'malois':
             // 				return $this->reply('I do not talk about customers.');
         // 				return $this->reply('I do not talk about customers.');
         case 'heal':
             return $this->rply($word);
             // 				return $this->reply("We can heal you for some nuyen. Just use {$c}heal here.");
         // 				return $this->reply("We can heal you for some nuyen. Just use {$c}heal here.");
         case 'yes':
         case 'no':
         case 'cyberware':
             return $this->rply('cyber');
             // 				return $this->reply("We have the best Renraku Cyberware available. Use {$c}view, {$c}implant and {$c}unplant to manage your accessoires.");
         // 				return $this->reply("We have the best Renraku Cyberware available. Use {$c}view, {$c}implant and {$c}unplant to manage your accessoires.");
         case 'hello':
         default:
             $this->rply('default');
             // 				$this->reply("Hello chummer, need some {$b}heal{$b} or {$b}cyberware{$b}?");
             $player->giveKnowledge('words', 'Cyberware', 'Yes', 'No');
             return true;
     }
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:26,代码来源:Doctor.php


示例17: onEnter

 public function onEnter(SR_Player $player)
 {
     $party = $player->getParty();
     $player->message($this->lang($player, 'no_enter'));
     // 		$player->message('You cannot find any open entrance to the ship ... Yet.');
     return false;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:7,代码来源:Ship1.php


示例18: isMaloisHere

 private function isMaloisHere(SR_Player $player)
 {
     if (false === ($party = $player->getParty())) {
         return false;
     }
     return $party->hasNPCNamed('Malois') || $party->hasConst('RESCUED_MALOIS') ? false : true;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:7,代码来源:Cell5.php


示例19: getNPCS

 public function getNPCS(SR_Player $player)
 {
     if ($player->hasConst('RESCUED_MALOIS')) {
         return array('talk' => 'Chicago_StoreMalois');
     }
     return array();
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:7,代码来源:Store.php


示例20: execute

 public static function execute(SR_Player $player, array $args)
 {
     if ('' === ($message = trim(implode(' ', $args)))) {
         return false;
     }
     $p = $player->getParty();
     $ep = $p->getEnemyParty();
     $pname = $player->getName();
     if ($p->isTalking() && $ep !== false) {
         $p->ntice('5085', array($pname, $message));
         $ep->ntice('5085', array($pname, $message));
         $p->setContactEta(60);
         $el = $ep->getLeader();
         if ($el->isNPC()) {
             $ep->setContactEta(60);
             $el->onNPCTalkA($player, isset($args[0]) ? $args[0] : 'hello', $args);
         }
     } elseif ($p->isAtLocation()) {
         Shadowshout::onLocationGlobalMessage($player, '5085', array($pname, $message));
     } elseif ($p->isFighting()) {
         $p->ntice('5085', array($pname, $message));
         $ep->ntice('5085', array($pname, $message));
     } else {
         $p->ntice('5085', array($pname, $message));
     }
     return true;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:27,代码来源:say.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP SSP类代码示例发布时间:2022-05-23
下一篇:
PHP SQLite3类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap