@@ -74,7 +74,7 @@ |
||
| 74 | 74 | }); |
| 75 | 75 | $resolver->setAllowedTypes("stat", ["string", "null"]); |
| 76 | 76 | $resolver->setAllowedValues("stat", function(?string $value) { |
| 77 | - return is_null($value) OR in_array($value, $this->getAllowedStats(), true); |
|
| 77 | + return is_null($value) or in_array($value, $this->getAllowedStats(), true); |
|
| 78 | 78 | }); |
| 79 | 79 | $resolver->setAllowedTypes("value", "integer"); |
| 80 | 80 | $resolver->setAllowedValues("value", function(int $value) { |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | }); |
| 62 | 62 | $resolver->setAllowedTypes("type", ["string", "null"]); |
| 63 | 63 | $resolver->setAllowedValues("type", function(?string $value) { |
| 64 | - return is_null($value) OR in_array($value, $this->getAllowedTypes(), true); |
|
| 64 | + return is_null($value) or in_array($value, $this->getAllowedTypes(), true); |
|
| 65 | 65 | }); |
| 66 | 66 | $resolver->setAllowedTypes("strength", "integer"); |
| 67 | 67 | $resolver->setAllowedValues("strength", function(int $value) { |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | $resolver->setAllowedTypes("stat", "string"); |
| 53 | 53 | $resolver->setDefault("stat", ""); |
| 54 | 54 | $resolver->setAllowedValues("stat", function(string $value) { |
| 55 | - return $value === "" OR in_array($value, $this->getAllowedStats(), true); |
|
| 55 | + return $value === "" or in_array($value, $this->getAllowedStats(), true); |
|
| 56 | 56 | }); |
| 57 | 57 | $resolver->setAllowedTypes("source", "string"); |
| 58 | 58 | $resolver->setAllowedValues("source", function(string $value) { |
@@ -62,10 +62,10 @@ discard block |
||
| 62 | 62 | $resolver->setDefault("value", 0); |
| 63 | 63 | $resolver->setAllowedTypes("duration", ["string", "integer"]); |
| 64 | 64 | $resolver->setAllowedValues("duration", function($value) { |
| 65 | - return (in_array($value, $this->getDurations(), true)) OR ($value > 0); |
|
| 65 | + return (in_array($value, $this->getDurations(), true)) or ($value > 0); |
|
| 66 | 66 | }); |
| 67 | 67 | $effect = $resolver->resolve($effect); |
| 68 | - if(!in_array($effect["type"], SkillSpecial::NO_STAT_TYPES, true) AND $effect["stat"] === "") { |
|
| 68 | + if(!in_array($effect["type"], SkillSpecial::NO_STAT_TYPES, true) and $effect["stat"] === "") { |
|
| 69 | 69 | throw new \InvalidArgumentException("The option stat with value '' is invalid."); |
| 70 | 70 | } |
| 71 | 71 | $this->id = $effect["id"]; |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | * @throws \InvalidArgumentException |
| 136 | 136 | */ |
| 137 | 137 | public function setDuration($value) { |
| 138 | - if(!is_int($value) AND !in_array($value, $this->getDurations(), true)) { |
|
| 138 | + if(!is_int($value) and !in_array($value, $this->getDurations(), true)) { |
|
| 139 | 139 | throw new \InvalidArgumentException("Invalid value set to CharacterEffect::\$duration. Expected string or integer."); |
| 140 | 140 | } |
| 141 | 141 | $this->duration = $value; |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | $characters = array_merge($combat->team1->items, $combat->team2->items); |
| 299 | 299 | foreach($characters as $character) { |
| 300 | 300 | foreach($character->effects as $effect) { |
| 301 | - if($effect->duration === CharacterEffect::DURATION_COMBAT OR is_int($effect->duration)) { |
|
| 301 | + if($effect->duration === CharacterEffect::DURATION_COMBAT or is_int($effect->duration)) { |
|
| 302 | 302 | $character->removeEffect($effect->id); |
| 303 | 303 | } |
| 304 | 304 | } |
@@ -389,7 +389,7 @@ discard block |
||
| 389 | 389 | $threshold = static::LOWEST_HP_THRESHOLD; |
| 390 | 390 | } |
| 391 | 391 | foreach($team->aliveMembers as $index => $member) { |
| 392 | - if($member->hitpoints <= $member->maxHitpoints * $threshold AND $member->hitpoints < $lowestHp) { |
|
| 392 | + if($member->hitpoints <= $member->maxHitpoints * $threshold and $member->hitpoints < $lowestHp) { |
|
| 393 | 393 | $lowestHp = $member->hitpoints; |
| 394 | 394 | $lowestIndex = $index; |
| 395 | 395 | } |
@@ -441,7 +441,7 @@ discard block |
||
| 441 | 441 | protected function chooseAction(CombatBase $combat, Character $character): ?string { |
| 442 | 442 | if($character->hitpoints < 1) { |
| 443 | 443 | return NULL; |
| 444 | - } elseif(in_array($character, $combat->findHealers()->items, true) AND !is_null($combat->selectHealingTarget($character))) { |
|
| 444 | + } elseif(in_array($character, $combat->findHealers()->items, true) and !is_null($combat->selectHealingTarget($character))) { |
|
| 445 | 445 | return CombatAction::ACTION_HEALING; |
| 446 | 446 | } |
| 447 | 447 | $attackTarget = $combat->selectAttackTarget($character); |
@@ -628,7 +628,7 @@ discard block |
||
| 628 | 628 | ]; |
| 629 | 629 | $this->results = $result; |
| 630 | 630 | $effect = new CharacterEffect([ |
| 631 | - "id" => "skill{$skill->skill->id}Effect", |
|
| 631 | + "id" => "skill{$skill->skill->id}effect", |
|
| 632 | 632 | "type" => $skill->skill->type, |
| 633 | 633 | "stat" => ((in_array($skill->skill->type, SkillSpecial::NO_STAT_TYPES, true)) ? NULL : $skill->skill->stat), |
| 634 | 634 | "value" => $skill->value, |
@@ -103,7 +103,7 @@ |
||
| 103 | 103 | */ |
| 104 | 104 | public function getUsableMembers(): array { |
| 105 | 105 | return array_values(array_filter($this->items, function(Character $value) { |
| 106 | - return (!$value->stunned AND $value->hitpoints > 0); |
|
| 106 | + return (!$value->stunned and $value->hitpoints > 0); |
|
| 107 | 107 | })); |
| 108 | 108 | } |
| 109 | 109 | |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | public function getHitRate(): int { |
| 41 | - if(is_string($this->skill->hitRate) AND substr($this->skill->hitRate, -1) === "%") { |
|
| 41 | + if(is_string($this->skill->hitRate) and substr($this->skill->hitRate, -1) === "%") { |
|
| 42 | 42 | return (int) $this->skill->hitRate; |
| 43 | 43 | } |
| 44 | 44 | return 100; |
@@ -476,7 +476,7 @@ discard block |
||
| 476 | 476 | public function damageStat(): string { |
| 477 | 477 | $stat = "strength"; |
| 478 | 478 | foreach($this->equipment as $item) { |
| 479 | - if(!$item->worn OR $item->slot != Equipment::SLOT_WEAPON) { |
|
| 479 | + if(!$item->worn or $item->slot != Equipment::SLOT_WEAPON) { |
|
| 480 | 480 | continue; |
| 481 | 481 | } |
| 482 | 482 | switch($item->type) { |
@@ -534,7 +534,7 @@ discard block |
||
| 534 | 534 | $stat = $effect->stat; |
| 535 | 535 | $type = $effect->type; |
| 536 | 536 | $duration = $effect->duration; |
| 537 | - if(is_int($duration) AND $duration < 0) { |
|
| 537 | + if(is_int($duration) and $duration < 0) { |
|
| 538 | 538 | unset($this->effects[$i]); |
| 539 | 539 | continue; |
| 540 | 540 | } |