fix: 랜덤임관 적용이 거꾸로된 것 수정

This commit is contained in:
2021-08-11 16:29:06 +09:00
parent be423d8a08
commit a5145636ad
3 changed files with 45 additions and 32 deletions
@@ -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;
+14 -8
View File
@@ -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("<D><b>{$nationName}</b></>{$josaRoSrc}부터 금<C>{$goldAmountText}</> 쌀<C>{$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);
@@ -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',
[