本文整理匯總了PHP中Shadowfunc::displayMPGain方法的典型用法代碼示例。如果您正苦於以下問題:PHP Shadowfunc::displayMPGain方法的具體用法?PHP Shadowfunc::displayMPGain怎麽用?PHP Shadowfunc::displayMPGain使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Shadowfunc
的用法示例。
在下文中一共展示了Shadowfunc::displayMPGain方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: announceADV
public function announceADV(SR_Player $player, SR_Player $target, $level, $key = '10000', $arg1 = '', $arg2 = '', $arg3 = '', $arg4 = '')
{
# Pick right keys. Each spell has own 4 keys for all 4 possibilities.
$key_friend = $key;
$key_foe = $key + 2;
if ($this->isCastMode()) {
$key_friend++;
$key_foe++;
}
$key_friend = (string) $key_friend;
$key_foe = (string) $key_foe;
# 9 args
$args = array($player->displayName(), $level, $this->getName(), $target->displayName(), $arg1, $arg2, $arg3, Shadowfunc::displayBusy($player->getBusyLeft()));
# Announce
$p = $player->getParty();
$ep = $target->getParty();
if ($ep->getID() !== $p->getID()) {
$ep->ntice($key_foe, $args);
}
if ($this->isCastMode()) {
# 10 args
# TODO: this 12 args
// $args[] = $this->getManaCost($player, $level);
// $args[] = $player->getMP();
// $args[] = $player->getMaxMP();
# Old spell style 10 args
$gain = $this->getManaCost($player, $level);
$oldmp = $player->getMP() + $gain;
$maxmp = $player->getMaxMP();
$args[] = Shadowfunc::displayMPGain($oldmp, -$gain, $maxmp);
}
$args[] = $arg4;
$p->ntice($key_friend, $args);
}