本文整理汇总了PHP中SR_Player::getNuyen方法的典型用法代码示例。如果您正苦于以下问题:PHP SR_Player::getNuyen方法的具体用法?PHP SR_Player::getNuyen怎么用?PHP SR_Player::getNuyen使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SR_Player
的用法示例。
在下文中一共展示了SR_Player::getNuyen方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getRespawnLocation
public function getRespawnLocation(SR_Player $player)
{
if ($player->getNuyen() > 100 && $player->hasKnowledge('places', 'Seattle_Hotel')) {
return 'Seattle_Hotel';
}
return parent::getRespawnLocation($player);
}
示例2: getRespawnLocation
public function getRespawnLocation(SR_Player $player)
{
if ($player->getNuyen() > 200 && $player->hasKnowledge('places', 'Vegas_Hotel')) {
return 'Vegas_Hotel';
}
return Shadowrun4::getCity('Chicago')->getRespawnLocation($player);
}
示例3: getRespawnLocation
public function getRespawnLocation(SR_Player $player)
{
if ($player->getNuyen() > 300 && $player->hasKnowledge('places', 'Chicago_Hotel')) {
return 'Chicago_Hotel';
} else {
return Shadowrun4::getCity('Delaware')->getRespawnLocation($player);
}
}
示例4: onHire
public function onHire(SR_Player $player, $price, $time)
{
$p = $player->getParty();
if ($p->hasHireling()) {
return "You already have a runner. I work alone.";
}
if ($price > 0) {
if ($player->getNuyen() < $price) {
return "I want {$price} nuyen to join join your party.";
}
}
$this->onHireB($player, $price, $time);
return "Ok chummers, let's go!";
}
示例5: onPraySins
private function onPraySins(SR_Player $player, $price)
{
$nuyen = $player->getNuyen();
$dp = Shadowfunc::displayNuyen($price);
$dn = Shadowfunc::displayNuyen($nuyen);
if ($price > $nuyen) {
return $this->rply('cost', array($dp, $dn));
// return $this->reply(sprintf('My son, it would cost %s to forgive your sins, but you have only %s.', $dp, $dn));
}
$player->giveNuyen(-$price);
$dl = Shadowfunc::displayNuyen($nuyen - $price);
$player->message($this->langNPC('pay', array($dp, $dl)));
// $player->message("You pay the price of {$dp} and have {$dl} left.");
$player->alterField('bad_karma', -1);
$badkarma = $player->getBase('bad_karma');
return $this->rply('thx', array($badkarma));
// return $this->reply("Thank you my son. You now have only {$badkarma} bad karma left.");
}
示例6: buyPermission
private function buyPermission(SR_Player $player)
{
if ($player->hasConst("SEATTLE_BM", 1)) {
return $player->message($this->langNPC('already'));
// $player->message("You already have permission to enter the blackmarket in Seattle.");
// return ;
}
$nuyen = $player->getNuyen();
if ($nuyen < $this->price) {
return $player->message($this->langNPC('poor', array($this->price, $nuyen)));
// $player->message("The salesman is shaking his head...\"No!\", he says, \"I want $this->price, not $nuyen\".");
// return;
}
$player->giveNuyen(-$this->price);
$player->message($this->langNPC('give', array($this->price)));
// $player->message("You give $this->price Nuyen to the salesman...");
$player->setConst("SEATTLE_BM", 1);
return $this->rply('purchase');
// $this->reply('Ok, here is your permission to enter the blackmarket. And you don\'t know me!');
}
示例7: getStatus
/**
* Return status string for a player.
* @param SR_Player $player
*/
public static function getStatus(SR_Player $player, $key = '5014')
{
$args = array();
# Scanner in Use?
if ($key > 5015) {
$args[] = $player->getName();
}
# Pre magic
$args = array_merge($args, array($player->getGender(), $player->getRace(), $player->getBase('level'), $player->get('level'), $player->getHP(), $player->getMaxHP()));
# Magic?
if ($player->getBase('magic') >= 0) {
$key++;
# different event
$args = array_merge($args, array($player->getMP(), $player->getMaxMP()));
}
# After magic
$args = array_merge($args, array($player->get('attack'), $player->get('defense'), $player->get('min_dmg'), $player->get('max_dmg'), $player->get('marm'), $player->get('farm'), round($player->getBase('xp'), 2), $player->getBase('karma'), round($player->getNuyen(), 2), $player->displayWeight(), $player->displayMaxWeight()));
return Shadowrun4::lang($key, $args);
# Status message
// if ($player->getBase('magic') >= 0)
// {
// return Shadowrun4::lang('5014', array(
// $player->getGender(), $player->getRace(), $player->getBase('level'), $player->get('level'),
// $player->getHP(), $player->getMaxHP(),
// $player->getMP(), $player->getMaxMP(),
// $player->get('attack'), $player->get('defense'),
// $player->get('min_dmg'), $player->get('max_dmg'),
// $player->get('marm'), $player->get('farm'),
// round($player->getBase('xp'), 2), $player->getBase('karma'),
// round($player->getNuyen(), 2),
// $player->displayWeight(), $player->displayMaxWeight(),
// ));
// }
// else
// {
// return Shadowrun4::lang('5015', array(
// $player->getGender(), $player->getRace(), $player->getBase('level'), $player->get('level'),
// $player->getHP(), $player->getMaxHP(),
// $player->get('attack'), $player->get('defense'),
// $player->get('min_dmg'), $player->get('max_dmg'),
// $player->get('marm'), $player->get('farm'),
// round($player->getBase('xp'), 2), $player->getBase('karma'),
// round($player->getNuyen(), 2),
// $player->displayWeight(), $player->displayMaxWeight(),
// ));
// }
}
示例8: onItemUsePush
public function onItemUsePush(SR_Player $player, $amount)
{
$have = $player->getNuyen();
$cost = $this->getTransactionCost();
if ($amount <= $cost) {
$this->reply($player, "You want to send {$amount} Nuyen to your Bank account, but that's below the cost per transaction of {$cost}.");
return false;
}
if ($have < $amount) {
$this->reply($player, sprintf("You want to send %s Nuyen to your bank account, but you only have %s.", $amount, $have));
return false;
}
$player->giveNuyen(-$amount);
$player->increase('sr4pl_bank_nuyen', $amount - $cost);
$this->reply($player, sprintf("You send %s(+%s)=%s Nuyen to your bank account (%s now). You now carry %s.", $amount - $cost, $cost, $amount, $player->getBankNuyen(), $player->displayNuyen()));
return true;
}