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