From fe4d095f216c9b633aaf2ccbef41294e6f2faa75 Mon Sep 17 00:00:00 2001 From: Hide_D Date: Wed, 13 Apr 2022 01:53:14 +0900 Subject: [PATCH] =?UTF-8?q?game:=20=EC=88=98=EB=87=8C/=EA=B4=80=EC=A7=81?= =?UTF-8?q?=20=EC=A0=84=ED=88=AC=EB=A0=A5=20=EB=B3=B4=EC=A0=95=EC=9D=84=20?= =?UTF-8?q?=EC=A1=B0=EC=A0=95=20-=20=EC=88=98=EB=B9=84=EC=8B=9C,=20?= =?UTF-8?q?=EA=B3=B5=EA=B2=A9=EC=8B=9C=EA=B0=80=20=EC=95=84=EB=8B=88?= =?UTF-8?q?=EB=9D=BC=20=ED=95=AD=EC=8B=9C=20=EC=9E=91=EB=8F=99=20-=20?= =?UTF-8?q?=EA=B5=B0=EC=A3=BC:=20=EA=B3=B5=EA=B2=A9=205%,=20=ED=94=BC?= =?UTF-8?q?=ED=95=B4=20-5%=20-=20=EC=B0=B8=EB=AA=A8:=20=EA=B3=B5=EA=B2=A9?= =?UTF-8?q?=203%,=20=ED=94=BC=ED=95=B4=20-3%=20-=20=EB=AC=B4=EC=9E=A5=20?= =?UTF-8?q?=EC=88=98=EB=87=8C:=20=EA=B3=B5=EA=B2=A9=203%=20-=20=EC=A7=80?= =?UTF-8?q?=EC=9E=A5=20=EC=88=98=EB=87=8C:=20=ED=94=BC=ED=95=B4=20-3%=20-?= =?UTF-8?q?=20=EB=8F=84=EC=8B=9C=20=EA=B4=80=EC=A7=81:=20=EA=B3=B5?= =?UTF-8?q?=EA=B2=A9=201.5%,=20=ED=94=BC=ED=95=B4=20-1.5%?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/TriggerOfficerLevel.php | 30 ++++++++++++++++++++++++++++-- hwe/sammo/WarUnitGeneral.php | 20 -------------------- 2 files changed, 28 insertions(+), 22 deletions(-) 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;