@@ -8,8 +8,7 @@ |
||
8 | 8 | * |
9 | 9 | * @author Jakub Konečný |
10 | 10 | */ |
11 | -final class ActionSelector implements ICombatActionSelector |
|
12 | -{ |
|
11 | +final class ActionSelector implements ICombatActionSelector { |
|
13 | 12 | public function chooseAction(CombatBase $combat, Character $character): ?ICombatAction |
14 | 13 | { |
15 | 14 | return null; |
@@ -45,7 +45,7 @@ |
||
45 | 45 | "id" => "stunEffect", "type" => SkillSpecial::TYPE_STUN, "valueAbsolute" => false, |
46 | 46 | "duration" => CharacterEffect::DURATION_COMBAT, |
47 | 47 | ]); |
48 | - for ($i = 1; $i <= 10; $i++) { |
|
48 | + for($i = 1; $i <= 10; $i++) { |
|
49 | 49 | Assert::true($this->calculator->hasHit($character1, $character2)); |
50 | 50 | Assert::true($this->calculator->hasHit($character1, $character2, $characterSkill)); |
51 | 51 | } |
@@ -23,7 +23,7 @@ |
||
23 | 23 | private function generateCharacter(int $id): Character |
24 | 24 | { |
25 | 25 | $stats = [ |
26 | - "id" => $id, "name" => "Player $id", "level" => 1, "initiativeFormula" => "1d2+DEX/4", "strength" => 10, |
|
26 | + "id" => $id, "name" => "player $id", "level" => 1, "initiativeFormula" => "1d2+DEX/4", "strength" => 10, |
|
27 | 27 | "dexterity" => 10, "constitution" => 10, "intelligence" => 10, "charisma" => 10 |
28 | 28 | ]; |
29 | 29 | return new Character($stats); |
@@ -26,7 +26,7 @@ |
||
26 | 26 | { |
27 | 27 | $character = $this->generateCharacter(1); |
28 | 28 | $parser = new InitiativeFormulaParser(); |
29 | - for ($i = 1; $i <= 10; $i++) { |
|
29 | + for($i = 1; $i <= 10; $i++) { |
|
30 | 30 | $initiative = $parser->calculateInitiative($character); |
31 | 31 | Assert::true($initiative >= 4); |
32 | 32 | Assert::true($initiative <= 8); |
@@ -16,7 +16,7 @@ |
||
16 | 16 | private function generateCharacter(int $id): Character |
17 | 17 | { |
18 | 18 | $stats = [ |
19 | - "id" => $id, "name" => "Player $id", "level" => 1, "initiativeFormula" => "1d4+DEX/4", "strength" => 10, |
|
19 | + "id" => $id, "name" => "player $id", "level" => 1, "initiativeFormula" => "1d4+DEX/4", "strength" => 10, |
|
20 | 20 | "dexterity" => 12, "constitution" => 10, "intelligence" => 10, "charisma" => 10 |
21 | 21 | ]; |
22 | 22 | return new Character($stats); |
@@ -84,14 +84,14 @@ |
||
84 | 84 | $team->setCharacterPosition(1, 1, 1); |
85 | 85 | Assert::same(1, $team[0]->positionRow); |
86 | 86 | Assert::same(1, $team[0]->positionColumn); |
87 | - Assert::exception(function () use ($team) { |
|
87 | + Assert::exception(function() use ($team) { |
|
88 | 88 | $team->setCharacterPosition(2, 1, 1); |
89 | 89 | }, \OutOfBoundsException::class); |
90 | 90 | $team[] = $this->generateCharacter(2); |
91 | - Assert::exception(function () use ($team) { |
|
91 | + Assert::exception(function() use ($team) { |
|
92 | 92 | $team->setCharacterPosition(2, 1, 1); |
93 | 93 | }, InvalidCharacterPositionException::class, null, InvalidCharacterPositionException::POSITION_OCCUPIED); |
94 | - Assert::exception(function () use ($team) { |
|
94 | + Assert::exception(function() use ($team) { |
|
95 | 95 | $team->maxRowSize = 1; |
96 | 96 | $team->setCharacterPosition(2, 1, 2); |
97 | 97 | }, InvalidCharacterPositionException::class, null, InvalidCharacterPositionException::ROW_FULL); |
@@ -16,7 +16,7 @@ |
||
16 | 16 | private function generateCharacter(int $id): Character |
17 | 17 | { |
18 | 18 | $stats = [ |
19 | - "id" => $id, "name" => "Player $id", "level" => 1, "initiativeFormula" => "1d2+DEX/4", "strength" => 10, |
|
19 | + "id" => $id, "name" => "player $id", "level" => 1, "initiativeFormula" => "1d2+DEX/4", "strength" => 10, |
|
20 | 20 | "dexterity" => 10, "constitution" => 10, "intelligence" => 10, "charisma" => 10 |
21 | 21 | ]; |
22 | 22 | return new Character($stats); |
@@ -16,7 +16,7 @@ |
||
16 | 16 | private function generateCharacter(int $id): Character |
17 | 17 | { |
18 | 18 | $stats = [ |
19 | - "id" => $id, "name" => "Player $id", "level" => 1, "initiativeFormula" => "1d2+DEX/4", "strength" => 10, |
|
19 | + "id" => $id, "name" => "player $id", "level" => 1, "initiativeFormula" => "1d2+DEX/4", "strength" => 10, |
|
20 | 20 | "dexterity" => 10, "constitution" => 10, "intelligence" => 10, "charisma" => 10 |
21 | 21 | ]; |
22 | 22 | return new Character($stats); |
@@ -8,8 +8,7 @@ |
||
8 | 8 | * |
9 | 9 | * @author Jakub Konečný |
10 | 10 | */ |
11 | -final class EffectsProvider implements ICharacterEffectsProvider |
|
12 | -{ |
|
11 | +final class EffectsProvider implements ICharacterEffectsProvider { |
|
13 | 12 | public int $value = 10; |
14 | 13 | |
15 | 14 | public function getCombatEffects(): array |
@@ -54,11 +54,11 @@ discard block |
||
54 | 54 | public function testInvalidStates(): void |
55 | 55 | { |
56 | 56 | $combat = new CombatBase(clone $this->logger); |
57 | - Assert::exception(function () use ($combat) { |
|
57 | + Assert::exception(function() use ($combat) { |
|
58 | 58 | $combat->execute(); |
59 | 59 | }, InvalidStateException::class); |
60 | 60 | $combat->setTeams(new Team(""), new Team("")); |
61 | - Assert::exception(function () use ($combat) { |
|
61 | + Assert::exception(function() use ($combat) { |
|
62 | 62 | $combat->setTeams(new Team(""), new Team("")); |
63 | 63 | }, ImmutableException::class); |
64 | 64 | } |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | public function testPostCombat(): void |
187 | 187 | { |
188 | 188 | $combat = new CombatBase(clone $this->logger); |
189 | - $combat->healers = function (Team $team1, Team $team2): Team { |
|
189 | + $combat->healers = function(Team $team1, Team $team2): Team { |
|
190 | 190 | return Team::fromArray(array_merge($team1->toArray(), $team2->toArray()), "healers"); |
191 | 191 | }; |
192 | 192 | $character1 = $this->generateCharacter(1); |
@@ -25,7 +25,7 @@ |
||
25 | 25 | private function generateCharacter(int $id): Character |
26 | 26 | { |
27 | 27 | $stats = [ |
28 | - "id" => $id, "name" => "Player $id", "level" => 1, "initiativeFormula" => "1d2+DEX/4", "strength" => 10, |
|
28 | + "id" => $id, "name" => "player $id", "level" => 1, "initiativeFormula" => "1d2+DEX/4", "strength" => 10, |
|
29 | 29 | "dexterity" => 10, "constitution" => 10, "intelligence" => 10, "charisma" => 10 |
30 | 30 | ]; |
31 | 31 | $petStats = [ |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | $character2 = $this->generateCharacter(2); |
44 | 44 | $combat = new CombatBase(clone $this->logger, new StaticSuccessCalculator()); |
45 | 45 | $combat->setDuelParticipants($character1, $character2); |
46 | - $combat->healers = function (Team $team1, Team $team2) { |
|
46 | + $combat->healers = function(Team $team1, Team $team2) { |
|
47 | 47 | return Team::fromArray($team1->toArray(), "healers"); |
48 | 48 | }; |
49 | 49 | $action = new Heal(); |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | $character2 = $this->generateCharacter(2); |
61 | 61 | $combat = new CombatBase(clone $this->logger, new StaticSuccessCalculator()); |
62 | 62 | $combat->setDuelParticipants($character1, $character2); |
63 | - $combat->healers = function (Team $team1, Team $team2) { |
|
63 | + $combat->healers = function(Team $team1, Team $team2) { |
|
64 | 64 | return Team::fromArray($team1->toArray(), "healers"); |
65 | 65 | }; |
66 | 66 | $combat->onCombatStart($combat); |
@@ -31,7 +31,7 @@ |
||
31 | 31 | private function generateCharacter(int $id): Character |
32 | 32 | { |
33 | 33 | $stats = [ |
34 | - "id" => $id, "name" => "Player $id", "level" => 1, "initiativeFormula" => "1d2+DEX/4", "strength" => 10, |
|
34 | + "id" => $id, "name" => "player $id", "level" => 1, "initiativeFormula" => "1d2+DEX/4", "strength" => 10, |
|
35 | 35 | "dexterity" => 10, "constitution" => 10, "intelligence" => 10, "charisma" => 10 |
36 | 36 | ]; |
37 | 37 | return new Character($stats); |
@@ -65,7 +65,7 @@ |
||
65 | 65 | $combat->setDuelParticipants($character1, $character2); |
66 | 66 | $combat->onCombatStart($combat); |
67 | 67 | $combat->onRoundStart($combat); |
68 | - for ($i = 1; $i <= $character1->skills[0]->skill->cooldown; $i++) { |
|
68 | + for($i = 1; $i <= $character1->skills[0]->skill->cooldown; $i++) { |
|
69 | 69 | $character1->skills[0]->decreaseCooldown(); |
70 | 70 | } |
71 | 71 | $action = new SkillAttack(); |
@@ -32,7 +32,7 @@ |
||
32 | 32 | private function generateCharacter(int $id): Character |
33 | 33 | { |
34 | 34 | $stats = [ |
35 | - "id" => $id, "name" => "Player $id", "level" => 1, "initiativeFormula" => "1d2+DEX/4", "strength" => 10, |
|
35 | + "id" => $id, "name" => "player $id", "level" => 1, "initiativeFormula" => "1d2+DEX/4", "strength" => 10, |
|
36 | 36 | "dexterity" => 10, "constitution" => 10, "intelligence" => 10, "charisma" => 10 |
37 | 37 | ]; |
38 | 38 | $skillData = [ |