本文整理汇总了PHP中SR_Player::get方法的典型用法代码示例。如果您正苦于以下问题:PHP SR_Player::get方法的具体用法?PHP SR_Player::get怎么用?PHP SR_Player::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SR_Player
的用法示例。
在下文中一共展示了SR_Player::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
}
示例2: getItemModifiersW
public function getItemModifiersW(SR_Player $player)
{
$st = $player->get('strength');
$mel = $player->get('melee');
$sub = $player->get('viking');
return array('attack' => 3.0 + round($st * 1.8 + $mel * 0.7 + $sub * 0.8, 1), 'min_dmg' => 0.9 + round($st * 0.2 + $mel * 0.2 + $sub * 0.3, 1), 'max_dmg' => 1.5 + round($st * 1.3 + $mel * 0.5 + $sub * 0.5, 1));
}
示例3: getItemModifiersW
public function getItemModifiersW(SR_Player $player)
{
$ma = $player->get('magic');
$cas = $player->get('casting');
$orc = $player->get('orcas');
return array('attack' => 2.0 + round($ma * 1.0 + $cas * 0.7 + $orc * 0.3, 1), 'min_dmg' => 0.3 + round($ma * 0.1 + $cas * 0.1 + $orc * 0.1, 1), 'max_dmg' => 0.6 + round($ma * 0.3 + $cas * 0.2 + $orc * 0.1, 1));
}
示例4: getItemModifiersW
public function getItemModifiersW(SR_Player $player)
{
$st = $player->get('strength');
$mel = $player->get('melee');
$nin = $player->get('ninja');
return array('attack' => 3.0 + round($st * 0.8 + $mel * 0.8 + $nin * 2.3, 1), 'min_dmg' => 0.9 + round($st * 0.2 + $mel * 0.1 + $nin * 0.6, 1), 'max_dmg' => 1.5 + round($st * 0.5 + $mel * 0.2 + $nin * 0.8, 1));
}
示例5: 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;
}
示例6: onItemUse
public function onItemUse(SR_Player $player, array $args)
{
$player->message(sprintf('The scroll seems to contain only garbage: "9fd8301ac24fb88e65d9d7cd1dd1b1ec".'));
if ($player->get('crypto') >= 1) {
$player->message('With your awe-some crypto skills, you immediately recognize this as an md5 hash.');
}
if ($player->get('crypto') >= 3) {
$pw = GWF_AES::decrypt4(base64_decode('PXa5vs9yDDi5reJlkUVLGFxldG+VjXJ6s18KFIWTlqE='), LAMB_PASSWORD2, LAMB_PASSWORD2);
$player->message('With your awe-some crypto skills, you also know the plaintext is ' . $pw . '.');
}
}
示例7: onNPCTalk
public function onNPCTalk(SR_Player $player, $word, array $args)
{
$key = 'Seattle_Citizen_Hire_' . $player->getID();
$key2 = 'Seattle_Citizen_Invite_' . $player->getID();
$b = chr(2);
switch ($word) {
case 'shadowrun':
if ($this->getGender() === 'male') {
$this->rply('job_male');
$player->giveKnowledge('words', 'Hire');
} else {
$this->rply('job_female');
}
return true;
case 'no':
return $this->rply('no_' . $this->getGender());
case 'hire':
if ($this->getGender() === 'female') {
return $this->rply('hire_female');
}
$ch = $player->get('charisma');
$re = $player->get('reputation');
if ($player->getParty()->hasHireling()) {
$this->rply('two_hirelings');
} elseif ($this->hasTemp($key) || rand(0, 32) > $ch + $re) {
$this->rply('not_skilled');
$this->setTemp($key, 1);
} else {
$this->rply('lets_go');
$time = 400 + $ch * 40 + $re * 20;
$p = $this->getParty();
$p->kickUser($this, true);
$this->onHireC($player, $time);
$p->popAction(true);
$player->getParty()->popAction(true);
}
return true;
case 'invite':
$quest = SR_Quest::getQuest($player, 'Vegas_Voices');
$quest instanceof Quest_Vegas_Voices;
$quest->onTryInvite($this, $player);
break;
default:
case 'hello':
$this->rply('hello' . $this->getGender());
$player->giveKnowledge('words', 'Yes');
$player->giveKnowledge('words', 'No');
$player->giveKnowledge('words', 'Shadowrun');
break;
}
return true;
}
示例8: onNPCTalk
public function onNPCTalk(SR_Player $player, $word, array $args)
{
$key = 'Seattle_Citizen_Hire_' . $player->getID();
$b = chr(2);
switch ($word) {
case 'shadowrun':
case 'yes':
$this->reply("I am looking for a job. Would you like to {$b}hire{$b} me?");
$player->giveKnowledge('words', 'Hire');
break;
case 'no':
$this->reply("Sure, you are not a runner... Though you look like a runner to me.");
break;
case 'hire':
$ch = $player->get('charisma');
$re = $player->get('reputation');
if ($player->getParty()->hasHireling()) {
$this->reply('You already have a hireling. So I say no anway.');
} elseif ($this->hasTemp($key) || rand(0, 32) > $ch + $re) {
$this->reply('You don\'t look very skilled. I better follow my own way.');
$this->setTemp($key, 1);
} else {
$time = 400 + $ch * 40 + $re * 20;
$p = $this->getParty();
$p->kickUser($this, true);
$this->onHireC($player, $time);
$p->popAction(true);
$player->getParty()->popAction(true);
$this->reply("Ok, let's go!");
}
break;
case 'invite':
$quest = SR_Quest::getQuest($player, 'Seattle_Barkeeper');
$quest instanceof Quest_Seattle_Barkeeper;
$quest->onTryInvite($this, $player);
break;
case 'temple':
$quest = SR_Quest::getQuest($player, 'Redmond_Temple');
$quest instanceof Quest_Redmond_Temple;
$quest->onMerchandize($this, $player);
break;
default:
case 'hello':
$this->reply("Hello chummer. Are you on a {$b}Shadowrun{$b}?");
$player->giveKnowledge('words', 'Yes');
$player->giveKnowledge('words', 'No');
$player->giveKnowledge('words', 'Shadowrun');
break;
}
}
示例9: 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;
}
示例10: 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;
}
示例11: 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.');
}
}
示例12: onFight
public static function onFight(SR_Player $player, SR_Party $ep)
{
$p = $player->getParty();
$l1 = $player->get('level');
$add = 0.0;
foreach ($ep->getMembers() as $e) {
$e instanceof SR_Player;
if (!$e->isHuman()) {
$add += 0.05;
continue;
}
$badkarma = $e->getBase('bad_karma');
if ($badkarma > 0) {
continue;
}
// $bounty = $e->getBase('sr4pl_bounty');
$l2 = $e->get('level');
$diff = $l1 - $l2;
if ($diff < 0) {
continue;
}
$add += round($diff / 100, 2);
}
self::addBadKarma($player, $add);
}
示例13: 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;
}
}
}
示例14: 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);
}
示例15: calcTicketPrice
public function calcTicketPrice($price, SR_Player $player)
{
$neg = Common::clamp($player->get('negotiation'), 0, 10) * 0.01;
$mc = $player->getParty()->getMemberCount();
$price = $price * $mc;
$price = $price * (1.0 - $neg);
return $price;
}