当前位置: 首页>>代码示例>>PHP>>正文


PHP Shadowfunc::multiDamage方法代码示例

本文整理汇总了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;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:30,代码来源:firewall.php

示例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.');
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:41,代码来源:Flashbang.php

示例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());
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:10,代码来源:SR_Spell.php


注:本文中的Shadowfunc::multiDamage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。