Total Complexity | 9 |
Total Lines | 35 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
14 | 1 | final class CharacterAttackSkill extends BaseCharacterSkill { |
|
15 | /** @var SkillAttack */ |
||
16 | protected $skill; |
||
17 | |||
18 | public function __construct(SkillAttack $skill, int $level) { |
||
20 | 1 | } |
|
21 | |||
22 | public function getSkillType(): string { |
||
23 | 1 | return "attack"; |
|
24 | } |
||
25 | |||
26 | /** |
||
27 | * @return SkillAttack |
||
28 | */ |
||
29 | public function getSkill(): SkillAttack { |
||
30 | 1 | return $this->skill; |
|
31 | } |
||
32 | |||
33 | public function getDamage(): int { |
||
34 | 1 | $damage = 0; |
|
35 | 1 | if(substr($this->skill->baseDamage, -1) === "%") { |
|
36 | 1 | $damage += (int) $this->skill->baseDamage; |
|
37 | } |
||
38 | 1 | if(substr($this->skill->damageGrowth, -1) === "%") { |
|
39 | 1 | $damage += (int) $this->skill->damageGrowth * ($this->level - 1); |
|
40 | } |
||
41 | 1 | return $damage; |
|
42 | } |
||
43 | |||
44 | public function getHitRate(): int { |
||
49 | } |
||
50 | } |
||
51 | ?> |