From a5145636ad564311ab614f0820ad78ec16583ca4 Mon Sep 17 00:00:00 2001 From: hide_d Date: Wed, 11 Aug 2021 16:29:06 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EB=9E=9C=EB=8D=A4=EC=9E=84=EA=B4=80=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9=EC=9D=B4=20=EA=B1=B0=EA=BE=B8=EB=A1=9C?= =?UTF-8?q?=EB=90=9C=20=EA=B2=83=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/Command/General/che_랜덤임관.php | 2 +- hwe/sammo/Command/Nation/che_물자원조.php | 22 +++++---- hwe/sammo/Command/Nation/che_불가침수락.php | 53 ++++++++++++--------- 3 files changed, 45 insertions(+), 32 deletions(-) diff --git a/hwe/sammo/Command/General/che_랜덤임관.php b/hwe/sammo/Command/General/che_랜덤임관.php index 44bb9c0e..eac97fac 100644 --- a/hwe/sammo/Command/General/che_랜덤임관.php +++ b/hwe/sammo/Command/General/che_랜덤임관.php @@ -215,7 +215,7 @@ class che_랜덤임관 extends Command\GeneralCommand } if ($general->getNPCType() < 2 && Util::starts_with($nation['name'], 'ⓤ')) { - $calcCnt *= 0.01; + $calcCnt *= 100; } $generalsCnt[$nationID]['cnt'] += $calcCnt; diff --git a/hwe/sammo/Command/Nation/che_물자원조.php b/hwe/sammo/Command/Nation/che_물자원조.php index 9bae2441..93b1aaa2 100644 --- a/hwe/sammo/Command/Nation/che_물자원조.php +++ b/hwe/sammo/Command/Nation/che_물자원조.php @@ -9,16 +9,16 @@ use \sammo\{ LastTurn, GameUnitConst, Command, + Json, StringUtil }; -use function \sammo\{ - getDomesticExpLevelBonus, - CriticalRatioDomestic, - CriticalScoreEx, - getAllNationStaticInfo, - getNationStaticInfo -}; +use function \sammo\getDomesticExpLevelBonus; +use function \sammo\CriticalRatioDomestic; +use function \sammo\CriticalScoreEx; +use function \sammo\getAllNationStaticInfo; +use function \sammo\getNationStaticInfo; + use \sammo\Constraint\Constraint; use \sammo\Constraint\ConstraintHelper; @@ -91,7 +91,7 @@ class che_물자원조 extends Command\NationCommand{ protected function initWithArg() { $destNationID = $this->arg['destNationID']; - $this->setDestNation($destNationID, ['gold', 'rice', 'surlimit']); + $this->setDestNation($destNationID, ['gold', 'rice', 'surlimit', 'aux']); [$goldAmount, $riceAmount] = $this->arg['amountList']; $limit = $this->nation['level'] * GameConst::$coefAidAmount; @@ -224,6 +224,11 @@ class che_물자원조 extends Command\NationCommand{ $destNationLogger->pushNationalHistoryLog("{$nationName}{$josaRoSrc}부터 금{$goldAmountText} 쌀{$riceAmountText}을 지원 받음"); + $destAux = Json::decode($this->destNation['aux']); + if(!key_exists('recv_assist', $destAux)){ + $destAux['recv_assist'] = []; + } + $destAux['recv_assist'][$nationID] = $destAux['recv_assist'][$nationID]??0 + $goldAmount + $riceAmount; $db->update('nation', [ 'gold'=>$db->sqleval('gold - %i', $goldAmount), @@ -234,6 +239,7 @@ class che_물자원조 extends Command\NationCommand{ $db->update('nation', [ 'gold'=>$db->sqleval('gold + %i', $goldAmount), 'rice'=>$db->sqleval('rice + %i', $riceAmount), + 'aux'=>Json::encode($destAux) ], 'nation = %i', $destNationID); $general->addExperience(5); diff --git a/hwe/sammo/Command/Nation/che_불가침수락.php b/hwe/sammo/Command/Nation/che_불가침수락.php index a739f77b..b31c1ba8 100644 --- a/hwe/sammo/Command/Nation/che_불가침수락.php +++ b/hwe/sammo/Command/Nation/che_불가침수락.php @@ -2,33 +2,30 @@ namespace sammo\Command\Nation; -use\sammo\{ - DB, - Util, - JosaUtil, - General, - DummyGeneral, - ActionLogger, - GameConst, - LastTurn, - GameUnitConst, - Command, - MessageTarget, - DiplomaticMessage, - Message, -}; +use \sammo\DB; +use \sammo\Util; +use \sammo\JosaUtil; +use \sammo\General; +use \sammo\DummyGeneral; +use \sammo\ActionLogger; +use \sammo\GameConst; +use \sammo\LastTurn; +use \sammo\GameUnitConst; +use \sammo\Command; +use \sammo\MessageTarget; +use \sammo\DiplomaticMessage; +use \sammo\Message; -use function\sammo\{ - getDomesticExpLevelBonus, - CriticalRatioDomestic, - CriticalScoreEx, - getAllNationStaticInfo, - getNationStaticInfo, - GetImageURL -}; +use function \sammo\getDomesticExpLevelBonus; +use function \sammo\CriticalRatioDomestic; +use function \sammo\CriticalScoreEx; +use function \sammo\getAllNationStaticInfo; +use function \sammo\getNationStaticInfo; +use function \sammo\GetImageUR; use \sammo\Constraint\Constraint; use \sammo\Constraint\ConstraintHelper; +use sammo\Json; class che_불가침수락 extends Command\NationCommand { @@ -191,6 +188,12 @@ class che_불가침수락 extends Command\NationCommand $destNationID = $destNation['nation']; $destNationName = $destNation['name']; + $destNationAux = Json::decode($db->queryFirstField('SELECT aux FROM nation WHERE nation = %i', $destNationID)); + if(!key_exists('resp_assist', $destNationAux)){ + $destNationAux['resp_assist'] = []; + } + $destNationAux['resp_assist'][$nationID] = $destNationAux['recv_assist'][$nationID]??0; + $year = $this->arg['year']; $month = $this->arg['month']; @@ -200,6 +203,10 @@ class che_불가침수락 extends Command\NationCommand $currentMonth = $env['year'] * 12 + $env['month'] - 1; $reqMonth = $year * 12 + $month - 1; + $db->update('nation', [ + 'aux'=>Json::encode($destNationAux) + ], 'nation=%i', $destNationID); + $db->update( 'diplomacy', [