本文整理汇总了PHP中SR_Player::hasTemp方法的典型用法代码示例。如果您正苦于以下问题:PHP SR_Player::hasTemp方法的具体用法?PHP SR_Player::hasTemp怎么用?PHP SR_Player::hasTemp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SR_Player
的用法示例。
在下文中一共展示了SR_Player::hasTemp方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: onNPCTalk
public function onNPCTalk(SR_Player $player, $word, array $args)
{
$price = 800 - Common::clamp($player->get('negotiation'), 0, 10) * 10;
$time = 1000 * $player->get('charisma') * 60;
$b = chr(2);
switch ($word) {
case 'shadowrun':
return $this->reply("I am in for a run, Do you want to {$b}hire{$b} my hacking skills?");
case 'yes':
return $this->reply("Yes, {$b}hire{$b} me and i'll aid you in combat and hacking.");
case 'no':
if ($player->hasTemp(self::MANIFESTO)) {
return $this->reply('Yes, no, what else?');
} else {
$this->reply("This is our world now... The world of the electron and the switch, the beauty of the baud.");
$this->reply("We make use of a service already existing without paying for what could be dirt-cheap if it wasn't run by profiteering gluttons, and you call us criminals.");
$this->reply("We explore... And you call us criminals. We seek after knowledge... And you call us criminals. We exist without skin color, without nationality, without religious bias... And you call us criminals.");
$this->reply("You build atomic bombs, you wage wars, you murder, cheat, and lie to us and try to make us believe it's for our own good, yet we're the criminals.");
$this->reply("Yes, I am a criminal. My crime is that of curiosity. My crime is that of judging people by what they say and think, not what they look like. My crime is that of outsmarting you, something that you will never forgive me for.");
$this->reply("I am a hacker, and this is my manifesto. You may stop this individual, but you can't stop us all... After all, we're all alike.");
$player->setTemp(self::MANIFESTO, 1);
return true;
}
break;
case 'hire':
return $this->reply($this->onHire($player, $price, $time));
default:
return $this->reply("Need a hacker?");
break;
}
}
示例3: onNPCTalk
public function onNPCTalk(SR_Player $player, $word, array $args)
{
$b = chr(2);
$bm = 'Seattle_AresMan_BM';
switch ($word) {
case 'gizmore':
return $this->rply('gizmore');
#$msg = 'We have multiple gizmo and gadgets.'; break;
#$msg = 'We have multiple gizmo and gadgets.'; break;
case "blackmarket":
if ($player->hasTemp($bm)) {
return $this->rply('bm1');
// $msg = "If someone asks, you did not get the permission from me, chummer. So you want one?";
} else {
// $msg = "Hmm yes, I know the guys in the blackmarket. If you like I can give you a life-long permission for $this->price Nuyen, {$b}yes{$b}?";
$player->setTemp($bm, 1);
return $this->rply('bm2', array($this->price));
}
case 'yes':
if ($player->hasTemp($bm)) {
$this->buyPermission($player);
$player->unsetTemp($bm);
return;
} else {
return $this->rply('yes');
// $msg = "Yes, have a good day sir.";
}
break;
case 'no':
if ($player->hasTemp($bm)) {
$player->unsetTemp($bm);
}
return $this->rply('no');
// $msg = "If life gives you lemons... You might be interested in a few fireweapons.";
break;
case 'malois':
return $this->rply('malois');
// $msg = 'Never heard of that.'; break;
// $msg = 'Never heard of that.'; break;
default:
return $this->rply('default');
// $msg = "Good day sir. How can I help you?"; break;
}
return $this->reply($msg);
}
示例4: getEnterText
public function getEnterText(SR_Player $player)
{
if ($player->hasTemp('OHQ_SR_ONCE')) {
return $this->lang($player, 'enter1');
// return 'You enter the storage room. You see a lot of garbage.';
} else {
return $this->lang($player, 'enter2');
// return 'You enter the storage room. You see a fat ork and attack him.';
}
}
示例5: 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();
}
示例6: on_wakeup
public function on_wakeup(SR_Player $player, array $args)
{
if (!$player->hasTemp('HIDE_R2_ONCE')) {
$player->setTemp('HIDE_R2_ONCE', 1);
$party = $player->getParty();
$this->partyMessage($player, 'wakeup');
// $party->notice('You wake the three lamers kindly... As they realize what`s happening they attack.');
SR_NPC::createEnemyParty('Redmond_Lamer', 'Redmond_Pinkhead', 'Redmond_Lamer')->fight($party, true);
} else {
$player->message($this->lang($player, 'no_wake'));
// $player->message("There are no lamers to wake.");
}
return true;
}
示例7: 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);
}
示例8: isEnterAllowed
public function isEnterAllowed(SR_Player $player)
{
return $player->hasTemp('PSTIDVIS');
}
示例9: 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?');
}