game/_incl_data/class/magic/Elemental/Fire.php

45 lines
1.1 KiB
PHP
Raw Normal View History

<?php
namespace Magic\Elemental;
use Battle;
use Insallah\Math;
class Fire
{
private $btl;
private $color = '#a00';
private $colorCrit = '#f00';
private $colorMiss = '#909090';
public function __construct(Battle $btl)
{
$this->btl = $btl;
}
2023-01-10 16:29:32 +00:00
/** Вспышка. Приёмы: 34(8), 67(9), 68 (10), 69(11)
* @param $level
* @param $fireTargetMultiplier
* @return array
*/
public function Flash($level, $fireTargetMultiplier = 0)
{
$baseDamage = [
8 => [40, 40],
9 => [45, 45],
10 => [50, 50],
11 => [60, 60],
];
if (!is_numeric($fireTargetMultiplier)) {
$fireTargetMultiplier = 0;
}
$rawDamage = mt_rand($baseDamage[$level][0], $baseDamage[$level][1]);
$rawDamage = Math::addPercent($rawDamage, $fireTargetMultiplier);
return [
2023-01-10 16:29:32 +00:00
'name' => "Вспышка [$level]",
'damage' => $rawDamage,
'color' => $this->color,
'colorCrit' => $this->colorCrit,
'colorMiss' => $this->colorMiss,
];
}
}