本文整理汇总了PHP中SR_Player::getMaxHP方法的典型用法代码示例。如果您正苦于以下问题:PHP SR_Player::getMaxHP方法的具体用法?PHP SR_Player::getMaxHP怎么用?PHP SR_Player::getMaxHP使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SR_Player
的用法示例。
在下文中一共展示了SR_Player::getMaxHP方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onConsume
public function onConsume(SR_Player $player)
{
$m = array('alc' => 0.1);
$player->addEffects(new SR_Effect(GWF_Time::ONE_HOUR * 1, $m));
$player->addEffects(new SR_Effect(GWF_Time::ONE_HOUR * 2, $m));
$oldhp = $player->getHP();
$gain = $player->healHP(0.3);
$player->getParty()->notice(sprintf('%s drank a beer and got alcoholized (+0.2) %s.', $player->getName(), Shadowfunc::displayHPGain($oldhp, $gain, $player->getMaxHP())));
}
示例2: cast
public function cast(SR_Player $player, SR_Player $target, $level, $hits, SR_Player $potion_player)
{
$min = $level + 1;
$max = $min + $level / 4 + $hits / 10;
$gain = Shadowfunc::diceFloat($min, $max);
$oldhp = $target->getHP();
$maxhp = $target->getMaxHP();
$gain = $target->healHP($gain);
$append = Shadowfunc::displayHPGain($oldhp, $gain, $maxhp);
$this->announceADV($player, $target, $level, '10110', $append);
return true;
}
示例3: onConsume
public function onConsume(SR_Player $player)
{
$p = $player->getParty();
$oldhp = $player->getHP();
$maxhp = $player->getMaxHP();
$gain = $player->healHP(0.1);
$newhp = $player->getHP();
$gainmsg = Shadowfunc::displayHPGain($oldhp, $gain, $maxhp);
$last = $this->getAmount() === 0 ? 'the last' : 'a';
if ($p->isFighting()) {
$busy = $this->getItemUsetime();
$player->busy($busy);
$busytext = sprintf(' %s busy.', GWF_Time::humanDuration($busy));
$p->message($player, sprintf(' eats %s potatoe chip from his roll of Pringles: %s.%s', $last, $gainmsg, $busytext));
$p->getEnemyParty()->message($player, sprintf(' eats %s chip from his roll of Pringles.', $last));
} else {
$player->message(sprintf('You eat %s chip from your Pringles: %s', $last, $gainmsg));
}
}
示例4: onConsume
public function onConsume(SR_Player $player)
{
$oldhp = $player->getHP();
$gain = $player->healHP(0.4);
$player->getParty()->notice(sprintf('%s drank a half litre of milk %s.', $player->getName(), Shadowfunc::displayHPGain($oldhp, $gain, $player->getMaxHP())));
}
示例5: 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(),
// ));
// }
}
示例6: spellDamageSingleTarget
/**
* Do simple damage to a single target.
* Loot the stuff, send messages.
* @param SR_Player $player
* @param SR_Player $target
* @param int $level
* @param double $damage
*/
public function spellDamageSingleTarget(SR_Player $player, SR_Player $target, $level, $key = '10000', $damage, $arg4)
{
$maxhp = $target->getMaxHP();
$damage = round($damage, 1);
if ($damage <= 0) {
// $append = $append_ep = $player->lang('but no damge');
// $append = $append_ep = ' but caused no damage';
$hp = $target->getHP();
$this->announceADV($player, $target, $level, $key, $damage, $hp, $maxhp, $arg4);
return true;
}
$p = $player->getParty();
$mc = $p->getMemberCount();
$target->dealDamage($damage);
if ($target->isDead()) {
// $append = $append_ep = ' and kills them with '.$damage.' damage';
$this->announceADV($player, $target, $level, $key, $damage, '0', $maxhp, $arg4);
# Loot him!
$xp = $target->isHuman() ? 0 : $target->getLootXP();
// $xp = $target->getLootXP();
$ny = round($target->getLootNuyen() / $mc, 1);
$pxp = 0;
if ($player->isNPC()) {
$target->resetXP();
}
foreach ($p->getMembers() as $member) {
$lxp = $xp / $mc;
$leveldiff = ($target->getBase('level') + 1) / ($member->getBase('level') + 1);
$lxp *= $leveldiff;
$lxp = round(Common::clamp($lxp, 0.01), 2);
$pxp += $lxp;
$member->giveXP($lxp);
$member->giveNuyen($ny);
$member->msg('5105', array(Shadowfunc::displayNuyen($ny), $lxp));
// $member->message(sprintf('You loot %s Nuyen and %s XP.', $ny, $lxp));
}
$p->givePartyXP($pxp);
$target->gotKilledBy($player);
} else {
$hp = $target->getHP();
// $maxhp = $target->getMaxHP();
// $append = " and caused {$damage} damage";
// $append_ep = "{$append} ($hp/$maxhp)HP left.";
$this->announceADV($player, $target, $level, $key, $damage, $hp, $maxhp, $arg4);
}
return true;
}
示例7: calcDamage
private static function calcDamage(SR_Player $player, $perc, $dmgperc)
{
if ($perc < 0) {
$perc = 10000 + abs($perc);
}
$damage = $player->getMaxHP() * $dmgperc / 100;
$damage *= $perc / 10000;
return $damage;
}