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
+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);