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


PHP SR_Player::getTemp方法代码示例

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


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

示例1: onNPCQuestTalkB

 public function onNPCQuestTalkB(SR_TalkingNPC $npc, SR_Player $player, $word, array $args = NULL)
 {
     echo "HERE\n";
     $temp = 'QT_LILLY';
     switch ($word) {
         default:
             $t = $player->getTemp($temp, 0);
             $player->setTemp($temp, $t + 1);
             echo "HERE {$t}\n";
             switch ($t) {
                 case 0:
                     $npc->reply($this->lang('sr1'));
                     $npc->reply($this->lang('sr2'));
                     return false;
                 case 1:
                     $npc->reply($this->lang('sr3'));
                     $npc->reply($this->lang('sr4'));
                     return false;
                 case 2:
                     $npc->reply($this->lang('sr5'));
                     $npc->reply($this->lang('sr6'));
                 default:
                     return $npc->reply($this->lang('confirm'));
             }
         case 'confirm':
             return $npc->reply($this->lang('confirm'));
         case 'yes':
             return $npc->reply($this->lang('yes'));
         case 'no':
             return $npc->reply($this->lang('no'));
     }
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:32,代码来源:Seattle_Florist1.php

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

示例3: getStoreItemsB

 /**
  * Filter Store Items through availability.
  * @param SR_Player $player
  */
 public function getStoreItemsB(SR_Player $player)
 {
     $key = $this->getStoreItemsKey();
     if ($player->hasTemp($key)) {
         return $player->getTemp($key);
     }
     $rep = Common::clamp($player->get('reputation'), 0, 25) * 0.5;
     $items = $this->getStoreItems($player);
     if (!is_array($items)) {
         return array();
     }
     $back = array();
     $unique = false;
     foreach ($items as $i => $data) {
         $avail = isset($data[1]) ? $data[1] : 100.0;
         $avail += $rep;
         if (Shadowfunc::dicePercent($avail)) {
             $back[] = $data;
         } else {
             $unique = true;
         }
     }
     if ($unique === true) {
         $player->setTemp($key, $back);
     }
     return $back;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:31,代码来源:SR_Store.php

示例4: getShoutWait

 private static function getShoutWait(SR_Player $player)
 {
     $range = self::MAX_DELAY - self::MIN_DELAY;
     $tpl = $range / self::MAX_LEVEL;
     $level = Common::clamp($player->getBase('level'), 0, self::MAX_LEVEL);
     $delay = self::MIN_DELAY + $tpl * (self::MAX_LEVEL - $level);
     $last = $player->hasTemp(self::TEMP_KEY) ? $player->getTemp(self::TEMP_KEY) : 0;
     $next = $last + $delay;
     return $next - time();
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:10,代码来源:Shadowshout.php

示例5: onNPCTalk

 public function onNPCTalk(SR_Player $player, $word, array $args)
 {
     $t = 'Redmond_Soldier_Hire';
     $price = 400 - Common::clamp($player->get('negotiation'), 0, 10) * 10;
     $time = 600 * $player->get('charisma') * 60;
     $b = chr(2);
     switch ($word) {
         case 'renraku':
             $msg = "I like their {$b}hardware{$b}, but they have too much influence to the market.";
             break;
         case 'hardware':
             $msg = "Yeah... Hardware and stuff. You don't know Renraku? Are you a crackhead?";
             break;
         case 'shadowrun':
             $msg = "You need to {$b}hire{$b} a runner?";
             break;
         case 'gizmore':
             $msg = "If you are here for a special quest, I can only say I have no idea. Is there a city full of you?";
             break;
         case 'hire':
             if ($player->getTemp($t)) {
                 $msg = "What do you say, chummer?";
             } else {
                 $msg = "I will follow you for a while for... Let's say... {$price} bucks.";
                 $player->setTemp($t, 1);
             }
             break;
         case 'yes':
             if ($player->hasTemp($t)) {
                 $msg = $this->onHire($player, $price, $time);
                 $player->unsetTemp($t);
             } else {
                 $msg = "Yes! Have a seat.";
             }
             break;
         case 'no':
             if ($player->getTemp($t)) {
                 $player->unsetTemp($t);
             }
             $msg = "Then not.";
             break;
         default:
             $msg = "What's up, chummer?";
             break;
     }
     $this->reply($msg);
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:47,代码来源:Soldier.php

示例6: on_search

 public function on_search(SR_Player $player, array $args)
 {
     $key = $this->getTempKey();
     $attemp = $player->getTemp($key, 0);
     if ($attemp >= $this->getSearchMaxAttemps()) {
         $player->msg('1148');
         // 			$player->message('Not again.');
         return;
     }
     $attemp++;
     $player->setTemp($key, $attemp);
     $loot = array_merge(Shadowfunc::randLoot($player, $this->getSearchLevel(), array(), $this->getSearchChanceNone()), $this->getSearchLoot($player));
     if (count($loot) > 0) {
         $player->msg('5185', array($this->getName()));
         // 			$player->message(sprintf('You search the %s...', $this->getName()));
         $player->giveItems($loot, 'searching ' . $this->getName());
     } else {
         $player->msg('5186', array($this->getName()));
         // 			$player->message(sprintf('You search the %s... But find nothing.', $this->getName()));
     }
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:21,代码来源:SR_SearchRoom.php

示例7: getFields

 public function getFields(SR_Player $player)
 {
     $p = $player->getTemp(Seattle_Shamane::TEMP_PISSED, 0) * 250;
     return array(array('fireball', 4500 + $p), array('firebolt', 2500 + $p), array('firewall', 8500 + $p), array('flu', 2000 + $p), array('poison_dart', 4000 + $p), array('vulcano', 25000 + $p));
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:5,代码来源:BlackTemple.php

示例8: onDoctorTalk

 public function onDoctorTalk(Delaware_Doctor $npc, SR_Player $player, $word)
 {
     $price = $this->displayRewardNuyen();
     $key = 'DLW_DOC_HAND';
     if (false === $player->hasTemp($key)) {
         $player->setTemp($key, 1);
     }
     $temp = $player->getTemp($key);
     switch ($word) {
         case 'yes':
             switch ($temp) {
                 case 1:
                     return $npc->reply($this->lang('doc_yes'));
                     // 						return $npc->reply('Yes');
                 // 						return $npc->reply('Yes');
                 case 2:
                     $player->setTemp($key, 1);
                     return $npc->reply($this->lang('doc_haha'));
                     // 						return $npc->reply('Hahahah ^^');
                 // 						return $npc->reply('Hahahah ^^');
                 case 3:
                     return $this->onConvince($npc, $player);
             }
         case 'no':
             switch ($temp) {
                 case 1:
                     break;
                 case 2:
                     $player->setTemp($key, $temp + 1);
                     return $npc->reply($this->lang('doc_ok', array($price)));
                     // 						return $npc->reply("Okok ... I will do it for {$price}.");
                 // 						return $npc->reply("Okok ... I will do it for {$price}.");
                 case 3:
                     $player->setTemp($key, 1);
                     return $npc->reply($this->lang('doc_haha_ok'));
                     // 						return $npc->reply("Haha ok :)");
             }
         case 'hand':
             switch ($temp) {
                 case 1:
                     $player->setTemp($key, $temp + 1);
                 default:
                     return $npc->reply($this->lang('doc_oh'));
                     // 						return $npc->reply("Haha, the old dwarf sent you? That's funny.");
             }
     }
     return $npc->reply($this->lang('doc_mh'));
     // 		return $npc->reply('Pardon?');
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:49,代码来源:Delaware_Seraphim1.php

示例9: getFields

 public function getFields(SR_Player $player)
 {
     $p = $player->getTemp(Seattle_Shamane::TEMP_PISSED, 0) * 250;
     return array(array('magic', 1500 + $p), array('casting', 2500 + $p), array('orcas', 4000 + $p), array('berzerk', 4500 + $p), array('freeze', 4000 + $p), array('calm', 2000 + $p), array('heal', 3500 + $p), array('flu', 1000 + $p), array('poison_dart', 3000 + $p), array('firebolt', 2500 + $p), array('fireball', 5000 + $p), array('blow', 2500 + $p));
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:5,代码来源:Temple.php

示例10: getFields

 public function getFields(SR_Player $player)
 {
     $p = $player->getTemp(Seattle_Shamane::TEMP_PISSED, 0) * 250;
     return array(array('berzerk', 3500 + $p), array('blow', 2500 + $p), array('chameleon', 3500 + $p), array('freeze', 4500 + $p), array('goliath', 3500 + $p), array('hawkeye', 3500 + $p), array('turtle', 6500 + $p));
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:5,代码来源:GrayTemple.php

示例11: getFields

 public function getFields(SR_Player $player)
 {
     $p = $player->getTemp(Redmond_Teacher::TEMP_PISSED, 0) * 150;
     return array(array('magic', 1000 + $p), array('calm', 2000 + $p), array('goliath', 1000 + $p), array('hawkeye', 1000 + $p), array('hummingbird', 1500 + $p), array('turtle', 2500 + $p), array('firebolt', 1500 + $p));
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:5,代码来源:Temple.php

示例12: getFields

 public function getFields(SR_Player $player)
 {
     $p = $player->getTemp(Seattle_Shamane::TEMP_PISSED, 0) * 250;
     return array(array('calm', 2500 + $p), array('heal', 4500 + $p));
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:5,代码来源:WhiteTemple.php

示例13: onNo

 private function onNo(SR_Player $player)
 {
     $tmp = $player->getTemp(self::TMP_SCROLL, 0);
     if ($tmp === 0) {
         $this->reply('No, i get it.');
     } else {
         $this->onCheckNo($player);
     }
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:9,代码来源:Alchemist_NPC.php


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