本文整理汇总了PHP中Shadowfunc::calcBuyPrice方法的典型用法代码示例。如果您正苦于以下问题:PHP Shadowfunc::calcBuyPrice方法的具体用法?PHP Shadowfunc::calcBuyPrice怎么用?PHP Shadowfunc::calcBuyPrice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shadowfunc
的用法示例。
在下文中一共展示了Shadowfunc::calcBuyPrice方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: calcPrice
public function calcPrice(SR_Player $player)
{
if (0 >= ($base = $this->getTransactionPrice())) {
return 0;
}
return Shadowfunc::calcBuyPrice($base, $player);
}
示例2: bribingTheGuard
private function bribingTheGuard(SR_Player $player, $word, array $args)
{
$b = chr(2);
$price = rand(2000, 8000);
$price = Shadowfunc::calcBuyPrice($price, $player);
if (!isset($args[0])) {
$this->reply('Every person has it\'s <price> parameter.');
$player->help('Use #talk bribe <amt> to try to bribe the guard.');
return true;
}
$amt = (int) $args[0];
if ($amt < $price) {
$this->reply("{$b}Security !!!!{$b}");
$p = $player->getParty();
$p->pushAction(SR_Party::ACTION_OUTSIDE, 'Prison_Block2');
$ep = SR_NPC::createEnemyParty('Prison_Ward', 'Prison_Ward', 'Prison_Ward', 'Prison_Guard', 'Prison_Guard');
$p->fight($ep, true);
} else {
if (!$player->hasNuyen($amt)) {
$this->reply('The idea of a bribe is usually that you can pay it ...');
} else {
$party = $player->getParty();
$this->reply('Every bride has her pride ...');
$this->reply('Ok buddy ... He is in cell 5, do quick, i will release the alarm as late as possible. Good luck ... ');
$player->giveNuyen(-$amt);
$party->pushAction(SR_Party::ACTION_OUTSIDE, 'PrisonB2_Exit');
}
}
return true;
}
示例3: bmguyFakesID
public function bmguyFakesID(SR_Player $player, $word)
{
$price = 6000;
$price = Shadowfunc::calcBuyPrice($price, $player);
$tmp1 = '_BMGMQ_F';
# fake
$tmp2 = '_BMGMQ_M';
# malo
$tmp3 = '_BMGMQ_A';
# acpt
$is_poor = $player->getNuyen() < $price;
switch ($word) {
case 'yes':
if ($player->hasTemp($tmp1)) {
$player->unsetTemp($tmp1);
$player->setTemp($tmp2, 1);
return $this->rply('buy1');
// return $this->reply('LOL ok ... who you are gonna be today?');
} elseif ($player->hasTemp($tmp3)) {
$player->unsetTemp($tmp3);
if ($is_poor) {
return $this->rply('poor');
// return $this->reply('Are you kidding me ... you didn\'t get the money!');
} else {
$player->giveNuyen(-$price);
$player->setConst('MALOIS_ID', 1);
return $this->rply('buy2');
// return $this->reply('Ok Mr.Peltzer, here is your new ID card.');
}
}
return $this->rply('yes');
// return $this->reply('Yes what?');
// return $this->reply('Yes what?');
case 'no':
$player->unsetTemps(array($tmp1, $tmp2, $tmp3));
return $this->rply('buyno');
// return $this->reply('I just wanted to test you.');
// return $this->reply('I just wanted to test you.');
case 'fakeid':
$player->unsetTemps(array($tmp2, $tmp3));
$player->setTemp($tmp1, 1);
return $this->rply('fakeid', array(Shadowfunc::displayNuyen($price)));
// return $this->reply(sprintf('You need a fake id? ... this will cost you at least %s. Do you have that much money?', Shadowfunc::displayNuyen($price)));
// return $this->reply(sprintf('You need a fake id? ... this will cost you at least %s. Do you have that much money?', Shadowfunc::displayNuyen($price)));
case 'malois':
if ($player->hasTemp($tmp2)) {
$player->unsetTemp($tmp2);
$player->setTemp($tmp3, 1);
$this->rply('purchase1');
$this->rply('purchase2');
return $this->rply('purchase3', array(Shadowfunc::displayNuyen($price)));
// $this->reply('A family member of Malois Peltzer? Interesting ...');
// $this->reply('I have an ID card almost ready for that ... just let me get the photo straigth...');
// return $this->reply(sprintf('Ok chummer, that will be %s. You got that?', Shadowfunc::displayNuyen($price)));
}
return $this->rply('unknown');
// return $this->reply('Never heard of that guy.');
}
}
示例4: on_learn
public function on_learn(SR_Player $player, array $args)
{
$bot = Shadowrap::instance($player);
if (count($args) !== 1) {
$this->on_courses($player, array());
return false;
}
if (false !== ($data = $this->getFieldData($player, $args[0]))) {
$price = Shadowfunc::calcBuyPrice($data[1], $player);
return $this->onLearn($player, $data[0], $price);
}
$this->on_courses($player, array());
return false;
}
示例5: calcPrice
private function calcPrice(SR_Player $player, $badkarma)
{
$price = ($badkarma + 1) * 4000;
return Shadowfunc::calcBuyPrice($price, $player);
}
示例6: calcSplitPrice
public function calcSplitPrice(SR_Player $player, $item_price)
{
return Shadowfunc::calcBuyPrice($item_price * ($this->getSplitPercentPrice($player) / 100) + $this->getSplitPrice($player), $player);
}
示例7: calcPrice
public function calcPrice(SR_Player $player)
{
$p = $this->getSleepPrice($player);
$n = $player->getParty()->getMemberCount();
return Shadowfunc::calcBuyPrice($n * $p, $player);
}
示例8: on_unplant
public function on_unplant(SR_Player $player, array $args)
{
$bot = Shadowrap::instance($player);
if (count($args) !== 1) {
$bot->reply(Shadowhelp::getHelp($player, 'unplant'));
return false;
}
$id = $args[0];
if (is_numeric($id)) {
$item = $player->getCyberwareByID($id);
} else {
$item = $player->getCyberwareByName($id);
}
if ($item === false) {
$bot->rply('1029');
// $bot->reply('You don`t have this cyberware implanted.');
return false;
}
$item instanceof SR_Cyberware;
$price = Shadowfunc::calcBuyPrice($item->getItemPrice() * 0.1, $player);
$p1 = Shadowfunc::displayNuyen($price);
if (false === $player->pay($price)) {
$bot->rply('1144', array($p1, $player->displayNuyen()));
// $bot->reply(sprintf('The doctor shakes his head: "My friend, removing this from your body will cost %s, but you only have %s."', $p1, $player->displayNuyen()));
return false;
}
$player->removeCyberware($item);
$player->modify();
$bot->rply('5181', array($p1, $item->getItemName()));
// $bot->reply(sprintf('You pay %s and got your %s removed.', $p1, $item->getItemName()));
return true;
}
示例9: on_unpierce
public function on_unpierce(SR_Player $player, array $args)
{
$bot = Shadowrap::instance($player);
if (count($args) > 1) {
$bot->reply(Shadowhelp::getHelp($player, 'unpierce'));
return false;
}
if (!$player->hasEquipment('piercing')) {
$bot->rply('1182');
return false;
}
if (false === ($piercing = $player->getEquipment('piercing'))) {
$bot->reply('Database error 3');
return false;
}
$price = Shadowfunc::calcBuyPrice($this->getPriceUnpierce(), $player);
$dprice = Shadowfunc::displayNuyen($price);
if (!isset($args[0]) || $args[0] !== self::CONFIRM_UNPIERCE) {
return $bot->rply('5288', array($dprice, $piercing->displayFullName($player), Shadowcmd::translate('unpierce'), self::CONFIRM_UNPIERCE));
}
if (!$player->hasNuyen($price)) {
$bot->rply('1063', array($dprice, $player->displayNuyen()));
return false;
}
$player->unsetEquipment('piercing');
// if (!$player->updateEquipment('piercing', NULL))
// {
// $bot->reply('Database error 1');
// return false;
// }
if (!$piercing->deleteItem($player)) {
$bot->reply('Database error 2');
return false;
}
$player->modify();
return $bot->rply('5289', array($dprice, $piercing->displayFullName($player)));
}
示例10: createItemFromData
private function createItemFromData(SR_Player $player, array $data, $amount = false)
{
$avail = isset($data[1]) ? $data[1] : 100.0;
if ($amount === false) {
$amount = isset($data[3]) ? $data[3] : true;
}
if (false === ($item = SR_Item::createByName($data[0], $amount, false))) {
return false;
}
$price = isset($data[2]) ? $data[2] : $item->getItemPrice();
$price = Shadowfunc::calcBuyPrice($price, $player);
$item->setStorePrice($price);
return $item;
}
示例11: calcPopFee
public function calcPopFee(SR_Player $player, $amt = 1)
{
$fee = self::POP_FEE * $amt;
return Shadowfunc::calcBuyPrice($fee, $player);
}