diff --git a/hwe/sammo/TriggerOfficerLevel.php b/hwe/sammo/TriggerOfficerLevel.php index e8a0f2e8..f17289e8 100644 --- a/hwe/sammo/TriggerOfficerLevel.php +++ b/hwe/sammo/TriggerOfficerLevel.php @@ -47,8 +47,8 @@ class TriggerOfficerLevel implements iAction{ } } } - - + + return $value; } @@ -58,4 +58,30 @@ class TriggerOfficerLevel implements iAction{ } return $value; } + + public function getWarPowerMultiplier(WarUnit $unit): array + { + $officerLevel = $this->officerLevel; + $warPowerMultiply = 1; + $opposeWarPowerMultiply = 1; + if ($officerLevel == 12) { + $warPowerMultiply = 1.05; + $opposeWarPowerMultiply = 0.95; + } + else if($officerLevel == 11){ + $warPowerMultiply = 1.03; + $opposeWarPowerMultiply = 0.97; + } + else if(in_array($officerLevel, [10, 8, 6])){ + $warPowerMultiply = 1.03; + } + else if(in_array($officerLevel, [9, 7, 5])){ + $opposeWarPowerMultiply = 0.97; + } + else if(in_array($officerLevel, [4, 3, 2])){ + $warPowerMultiply = 1.015; + $opposeWarPowerMultiply = 0.985; + } + return [$warPowerMultiply, $opposeWarPowerMultiply]; + } } \ No newline at end of file diff --git a/hwe/sammo/WarUnitGeneral.php b/hwe/sammo/WarUnitGeneral.php index 4c79cd39..11235021 100644 --- a/hwe/sammo/WarUnitGeneral.php +++ b/hwe/sammo/WarUnitGeneral.php @@ -209,25 +209,6 @@ class WarUnitGeneral extends WarUnit [$warPower, $opposeWarPowerMultiply] = parent::computeWarPower(); $general = $this->general; - $cityID = $general->getCityID(); - $officerLevel = $general->getVar('officer_level'); - $officerCity = $general->getVar('officer_city'); - - if ($this->isAttacker) { - if ($officerLevel == 12) { - $warPower *= 1.10; - } else if ($officerLevel == 11 || $officerLevel == 10 || $officerLevel == 8 || $officerLevel == 6) { - $warPower *= 1.05; - } - } else { - if ($officerLevel == 12) { - $opposeWarPowerMultiply *= 0.90; - } else if ($officerLevel == 11 || $officerLevel == 9 || $officerLevel == 7 || $officerLevel == 5) { - $opposeWarPowerMultiply *= 0.95; - } else if (2 <= $officerLevel && $officerLevel <= 4 && $officerCity == $cityID) { - $opposeWarPowerMultiply *= 0.95; - } - } $expLevel = $general->getVar('explevel'); @@ -238,7 +219,6 @@ class WarUnitGeneral extends WarUnit $opposeWarPowerMultiply *= max(0.01, 1 - $expLevel / 300); } - [$specialMyWarPowerMultiply, $specialOpposeWarPowerMultiply] = $this->general->getWarPowerMultiplier($this); $warPower *= $specialMyWarPowerMultiply; $opposeWarPowerMultiply *= $specialOpposeWarPowerMultiply;