@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | foreach($team as $character) { |
| 233 | 233 | try { |
| 234 | 234 | $column++; |
| 235 | - if($character->positionRow > 0 AND $character->positionColumn > 0) { |
|
| 235 | + if($character->positionRow > 0 and $character->positionColumn > 0) { |
|
| 236 | 236 | continue; |
| 237 | 237 | } |
| 238 | 238 | setPosition: |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | $characters = array_merge($combat->team1->toArray(), $combat->team2->toArray()); |
| 288 | 288 | foreach($characters as $character) { |
| 289 | 289 | foreach($character->effects as $effect) { |
| 290 | - if($effect->duration === CharacterEffect::DURATION_COMBAT OR is_int($effect->duration)) { |
|
| 290 | + if($effect->duration === CharacterEffect::DURATION_COMBAT or is_int($effect->duration)) { |
|
| 291 | 291 | $character->removeEffect($effect->id); |
| 292 | 292 | } |
| 293 | 293 | } |
@@ -349,7 +349,7 @@ discard block |
||
| 349 | 349 | $enemyTeam = $this->getEnemyTeam($attacker); |
| 350 | 350 | $rangedWeapon = false; |
| 351 | 351 | foreach($attacker->equipment as $equipment) { |
| 352 | - if($equipment instanceof Weapon AND $equipment->isWorn() AND $equipment->ranged) { |
|
| 352 | + if($equipment instanceof Weapon and $equipment->isWorn() and $equipment->ranged) { |
|
| 353 | 353 | $rangedWeapon = true; |
| 354 | 354 | break; |
| 355 | 355 | } |
@@ -409,7 +409,7 @@ discard block |
||
| 409 | 409 | $targets = $this->getTeam($primaryTarget)->getItems(["positionColumn" => $primaryTarget->positionColumn]); |
| 410 | 410 | break; |
| 411 | 411 | default: |
| 412 | - throw new NotImplementedException("Target {$skill->skill->target} for attack skills is not implemented."); |
|
| 412 | + throw new NotImplementedException("target {$skill->skill->target} for attack skills is not implemented."); |
|
| 413 | 413 | } |
| 414 | 414 | foreach($targets as $target) { |
| 415 | 415 | for($i = 1; $i <= $skill->skill->strikes; $i++) { |
@@ -437,7 +437,7 @@ discard block |
||
| 437 | 437 | $targets = $this->getEnemyTeam($character)->toArray(); |
| 438 | 438 | break; |
| 439 | 439 | default: |
| 440 | - throw new NotImplementedException("Target {$skill->skill->target} for special skills is not implemented."); |
|
| 440 | + throw new NotImplementedException("target {$skill->skill->target} for special skills is not implemented."); |
|
| 441 | 441 | } |
| 442 | 442 | foreach($targets as $target) { |
| 443 | 443 | $this->onSkillSpecial($character, $target, $skill); |
@@ -475,7 +475,7 @@ discard block |
||
| 475 | 475 | $combat->onHeal($character, $combat->selectHealingTarget($character)); |
| 476 | 476 | break; |
| 477 | 477 | default: |
| 478 | - throw new NotImplementedException("Action $action is not implemented."); |
|
| 478 | + throw new NotImplementedException("action $action is not implemented."); |
|
| 479 | 479 | } |
| 480 | 480 | } |
| 481 | 481 | } |
@@ -586,7 +586,7 @@ discard block |
||
| 586 | 586 | "character1" => $character1, "character2" => $target, |
| 587 | 587 | ]; |
| 588 | 588 | $effect = new CharacterEffect([ |
| 589 | - "id" => "skill{$skill->skill->id}Effect", |
|
| 589 | + "id" => "skill{$skill->skill->id}effect", |
|
| 590 | 590 | "type" => $skill->skill->type, |
| 591 | 591 | "stat" => ((in_array($skill->skill->type, SkillSpecial::NO_STAT_TYPES, true)) ? null : $skill->skill->stat), |
| 592 | 592 | "value" => $skill->value, |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | $resolver->setAllowedTypes("stat", "string"); |
| 58 | 58 | $resolver->setDefault("stat", ""); |
| 59 | 59 | $resolver->setAllowedValues("stat", function(string $value) { |
| 60 | - return $value === "" OR in_array($value, $this->getAllowedStats(), true); |
|
| 60 | + return $value === "" or in_array($value, $this->getAllowedStats(), true); |
|
| 61 | 61 | }); |
| 62 | 62 | $resolver->setAllowedTypes("source", "string"); |
| 63 | 63 | $resolver->setAllowedValues("source", function(string $value) { |
@@ -67,10 +67,10 @@ discard block |
||
| 67 | 67 | $resolver->setDefault("value", 0); |
| 68 | 68 | $resolver->setAllowedTypes("duration", ["string", "integer"]); |
| 69 | 69 | $resolver->setAllowedValues("duration", function($value) { |
| 70 | - return (in_array($value, $this->getDurations(), true)) OR ($value > 0); |
|
| 70 | + return (in_array($value, $this->getDurations(), true)) or ($value > 0); |
|
| 71 | 71 | }); |
| 72 | 72 | $effect = $resolver->resolve($effect); |
| 73 | - if(!in_array($effect["type"], SkillSpecial::NO_STAT_TYPES, true) AND $effect["stat"] === "") { |
|
| 73 | + if(!in_array($effect["type"], SkillSpecial::NO_STAT_TYPES, true) and $effect["stat"] === "") { |
|
| 74 | 74 | throw new \InvalidArgumentException("The option stat with value '' is invalid."); |
| 75 | 75 | } |
| 76 | 76 | $this->id = $effect["id"]; |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | * @throws \InvalidArgumentException |
| 153 | 153 | */ |
| 154 | 154 | public function setDuration($value): void { |
| 155 | - if(!is_int($value) AND !in_array($value, $this->getDurations(), true)) { |
|
| 155 | + if(!is_int($value) and !in_array($value, $this->getDurations(), true)) { |
|
| 156 | 156 | throw new \InvalidArgumentException("Invalid value set to CharacterEffect::\$duration. Expected string or integer."); |
| 157 | 157 | } |
| 158 | 158 | $this->duration = $value; |