本文整理汇总了PHP中Shadowfunc::multiDamage方法的典型用法代码示例。如果您正苦于以下问题:PHP Shadowfunc::multiDamage方法的具体用法?PHP Shadowfunc::multiDamage怎么用?PHP Shadowfunc::multiDamage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shadowfunc
的用法示例。
在下文中一共展示了Shadowfunc::multiDamage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cast
public function cast(SR_Player $player, SR_Player $target, $level, $hits, SR_Player $potion_player)
{
// echo "Casting Firewall with level $level and $hits hits.\n";
# Firebolt ads 0.20 per level
$firebolt = $potion_player->getSpell('firebolt');
$firebolt = $firebolt === false ? 0 : $firebolt->getLevel($potion_player);
$firebolt = round($firebolt / 5, 1);
$level += $firebolt;
# Fireball ads 0.25 per level
$fireball = $potion_player->getSpell('fireball');
$fireball = $fireball === false ? 0 : $fireball->getLevel($potion_player);
$fireball = round($fireball / 4, 1);
$level += $fireball;
$line = $target->getY();
$damage = array();
$ep = $target->getParty();
foreach ($ep->getMembers() as $t) {
$t instanceof SR_Player;
$d = abs($line - $t->getY());
// echo "Distance to target is $d\n";
$l = $level - $d;
if ($l >= 0) {
$hits = $this->dice($potion_player, $t, $l);
$damage[$t->getID()] = $this->calcFirewallDamage($player, $t, $level, $hits);
}
}
$this->announceADV($player, $target, $level);
Shadowfunc::multiDamage($player, $damage);
return true;
}
示例2: onThrow
public function onThrow(SR_Player $player, SR_Player $target)
{
$party = $player->getParty();
$ep = $party->getEnemyParty();
$mc = $party->getMemberCount();
$firearms = $player->get('firearms');
$atk = 15;
$mindmg = 1;
$maxdmg = 4;
$damage = array();
$inaccuracy = rand(2, 4) - ($firearms ? 1 : 0);
$targets = self::computeDistances($target, $inaccuracy);
foreach ($targets as $data) {
list($pid, $d) = $data;
$target = $ep->getMemberByPID($pid);
$target instanceof SR_Player;
$a = $atk - $d * $d + rand(-1, 2);
$a = Common::clamp($a, 0, $atk);
$def = $target->get('defense');
$arm = $target->get('marm');
$hits = Shadowfunc::diceHits($mindmg, $arm, $a, $def, $player, $target);
$hits = Common::clamp($hits, 0);
echo "Dicing... DIST: {$d}, ATK: {$a}, DEF: {$def}. Hits: {$hits}\n";
// $hits -= $arm;
if ($hits <= 0) {
continue;
}
$dmg = round($mindmg + $hits * 0.1, 2);
$dmg = Common::clamp($dmg, $mindmg, $maxdmg);
$dmg -= $arm;
if ($dmg <= 0) {
continue;
}
echo "Blinding the target with {$hits} hits ...\n";
for ($i = 0; $i < $hits; $i += 3) {
$target->addEffects(new SR_Effect($i * 10, array('attack' => -0.15), SR_Effect::MODE_ONCE));
}
$damage[$pid] = $dmg;
}
Shadowfunc::multiDamage($player, $damage, 'The Flashbang totally missed all targets.');
}
示例3: spellDamageMultiTargets
/**
* Cause damage to multiple targets.
* @param SR_Player $player
* @param array $damage
* @param int $level
*/
public function spellDamageMultiTargets(SR_Player $player, array $damage, $level)
{
Shadowfunc::multiDamage($player, $damage, $this->getName());
}