From 4a1bccdf75c0f415bffcf51f1e1a7a31f4c38ece Mon Sep 17 00:00:00 2001 From: hide_d Date: Thu, 14 Oct 2021 00:16:44 +0900 Subject: [PATCH] =?UTF-8?q?balance:=20=ED=83=88=EC=B7=A8=EB=9F=89=EC=9D=84?= =?UTF-8?q?=20=EB=8F=84=EC=8B=9C=20=EB=82=B4=EC=A0=95=EC=B9=98=EC=97=90=20?= =?UTF-8?q?=EA=B8=B0=EB=B0=98=ED=95=98=EB=8F=84=EB=A1=9D=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/Command/General/che_탈취.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/hwe/sammo/Command/General/che_탈취.php b/hwe/sammo/Command/General/che_탈취.php index d5ec1885..57440220 100644 --- a/hwe/sammo/Command/General/che_탈취.php +++ b/hwe/sammo/Command/General/che_탈취.php @@ -3,7 +3,7 @@ namespace sammo\Command\General; use \sammo\{ DB, Util, JosaUtil, - General, + General, ActionLogger, GameConst, GameUnitConst, Command @@ -31,18 +31,20 @@ class che_탈취 extends che_화계{ $commandName = $this->getName(); $db = DB::db(); - // 탈취 최대 800 * 8 * sqrt(1 + (year - startyear) / 5) / 2 - $yearCoef = sqrt(1 + ($this->env['year'] - $this->env['startyear']) / 5) / 2; - $gold = Util::randRangeInt(GameConst::$sabotageDamageMin, GameConst::$sabotageDamageMax) * $destCity['level'] * $yearCoef; - $rice = Util::randRangeInt(GameConst::$sabotageDamageMin, GameConst::$sabotageDamageMax) * $destCity['level'] * $yearCoef; + // 탈취 최대 800 * 8 * sqrt(1 + (year - startyear) / 4) / 2 + $yearCoef = sqrt(1 + ($this->env['year'] - $this->env['startyear']) / 4) / 2; + $commRatio = $destCity['comm'] / $destCity['comm_max']; + $agriRatio = $destCity['agri'] / $destCity['agri_max']; + $gold = Util::randRangeInt(GameConst::$sabotageDamageMin, GameConst::$sabotageDamageMax) * $destCity['level'] * $yearCoef * (0.25 + $commRatio / 4); + $rice = Util::randRangeInt(GameConst::$sabotageDamageMin, GameConst::$sabotageDamageMax) * $destCity['level'] * $yearCoef * (0.25 + $agriRatio / 4); if($destCity['supply']){ [$destNationGold, $destNationRice] = $db->queryFirstList('SELECT gold,rice FROM nation WHERE nation=%i', $destNationID); - + $destNationGold -= $gold; $destNationRice -= $rice; - - if($destNationGold < GameConst::$minNationalGold) { + + if($destNationGold < GameConst::$minNationalGold) { $gold += $destNationGold - GameConst::$minNationalGold; $destNationGold = GameConst::$minNationalGold; } @@ -50,7 +52,7 @@ class che_탈취 extends che_화계{ $rice += $destNationRice - GameConst::$minNationalRice; $destNationRice = GameConst::$minNationalRice; } - + $db->update('nation', [ 'gold'=>$destNationGold, 'rice'=>$destNationRice @@ -96,5 +98,5 @@ class che_탈취 extends che_화계{ $logger->pushGeneralActionLog("금{$goldText} 쌀{$riceText}을 획득했습니다.", ActionLogger::PLAIN); } - + } \ No newline at end of file