本文整理汇总了PHP中SR_Player::healMP方法的典型用法代码示例。如果您正苦于以下问题:PHP SR_Player::healMP方法的具体用法?PHP SR_Player::healMP怎么用?PHP SR_Player::healMP使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SR_Player
的用法示例。
在下文中一共展示了SR_Player::healMP方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onConsume
public function onConsume(SR_Player $player)
{
$es = $player->get('essence');
$min = 3 + $es * 2;
# 15
$max = $min * 2;
# 30
$gain = rand($min, $max);
$gained = $player->healMP($gain);
$player->message(sprintf('You gained +%s MP!', $gained));
}
示例2: cast
public function cast(SR_Player $player, SR_Player $target, $level, $hits, SR_Player $potion_player)
{
echo "Casting " . $this->getName() . " with level {$level} and {$hits} hits.\n";
$min = 0.0;
$max = $hits * 1.5;
$sucked = Shadowfunc::diceFloat($min, $max, 1);
$target->healMP(-$sucked);
// $append = sprintf('%s lost %s MP.', $target->getName(), $sucked);
$this->announceADV($player, $target, $level, '10090', $sucked);
return true;
}
示例3: onBrew
public function onBrew(SR_Player $player, $mp, $diff, $hits)
{
if ($player->getMP() < $mp) {
$player->msg('1077', array($mp, $player->getMP()));
// $player->message(sprintf('You need %s MP to brew this potion, but you got only %s.', $mp, $player->getMP()));
return false;
}
$player->healMP(-$mp);
$es = $player->get('essence');
$al = $player->get('alchemy');
$wi = $player->get('wisdom');
$dices = $es * 3 + $al * 2 + $wi;
$hit = Shadowfunc::dicePool($dices, $diff, $diff);
return $hit >= $hits;
}