fix: 랜덤임관 적용이 거꾸로된 것 수정
This commit is contained in:
@@ -215,7 +215,7 @@ class che_랜덤임관 extends Command\GeneralCommand
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($general->getNPCType() < 2 && Util::starts_with($nation['name'], 'ⓤ')) {
|
if ($general->getNPCType() < 2 && Util::starts_with($nation['name'], 'ⓤ')) {
|
||||||
$calcCnt *= 0.01;
|
$calcCnt *= 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
$generalsCnt[$nationID]['cnt'] += $calcCnt;
|
$generalsCnt[$nationID]['cnt'] += $calcCnt;
|
||||||
|
|||||||
@@ -9,16 +9,16 @@ use \sammo\{
|
|||||||
LastTurn,
|
LastTurn,
|
||||||
GameUnitConst,
|
GameUnitConst,
|
||||||
Command,
|
Command,
|
||||||
|
Json,
|
||||||
StringUtil
|
StringUtil
|
||||||
};
|
};
|
||||||
|
|
||||||
use function \sammo\{
|
use function \sammo\getDomesticExpLevelBonus;
|
||||||
getDomesticExpLevelBonus,
|
use function \sammo\CriticalRatioDomestic;
|
||||||
CriticalRatioDomestic,
|
use function \sammo\CriticalScoreEx;
|
||||||
CriticalScoreEx,
|
use function \sammo\getAllNationStaticInfo;
|
||||||
getAllNationStaticInfo,
|
use function \sammo\getNationStaticInfo;
|
||||||
getNationStaticInfo
|
|
||||||
};
|
|
||||||
|
|
||||||
use \sammo\Constraint\Constraint;
|
use \sammo\Constraint\Constraint;
|
||||||
use \sammo\Constraint\ConstraintHelper;
|
use \sammo\Constraint\ConstraintHelper;
|
||||||
@@ -91,7 +91,7 @@ class che_물자원조 extends Command\NationCommand{
|
|||||||
protected function initWithArg()
|
protected function initWithArg()
|
||||||
{
|
{
|
||||||
$destNationID = $this->arg['destNationID'];
|
$destNationID = $this->arg['destNationID'];
|
||||||
$this->setDestNation($destNationID, ['gold', 'rice', 'surlimit']);
|
$this->setDestNation($destNationID, ['gold', 'rice', 'surlimit', 'aux']);
|
||||||
|
|
||||||
[$goldAmount, $riceAmount] = $this->arg['amountList'];
|
[$goldAmount, $riceAmount] = $this->arg['amountList'];
|
||||||
$limit = $this->nation['level'] * GameConst::$coefAidAmount;
|
$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}</>을 지원 받음");
|
$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', [
|
$db->update('nation', [
|
||||||
'gold'=>$db->sqleval('gold - %i', $goldAmount),
|
'gold'=>$db->sqleval('gold - %i', $goldAmount),
|
||||||
@@ -234,6 +239,7 @@ class che_물자원조 extends Command\NationCommand{
|
|||||||
$db->update('nation', [
|
$db->update('nation', [
|
||||||
'gold'=>$db->sqleval('gold + %i', $goldAmount),
|
'gold'=>$db->sqleval('gold + %i', $goldAmount),
|
||||||
'rice'=>$db->sqleval('rice + %i', $riceAmount),
|
'rice'=>$db->sqleval('rice + %i', $riceAmount),
|
||||||
|
'aux'=>Json::encode($destAux)
|
||||||
], 'nation = %i', $destNationID);
|
], 'nation = %i', $destNationID);
|
||||||
|
|
||||||
$general->addExperience(5);
|
$general->addExperience(5);
|
||||||
|
|||||||
@@ -2,33 +2,30 @@
|
|||||||
|
|
||||||
namespace sammo\Command\Nation;
|
namespace sammo\Command\Nation;
|
||||||
|
|
||||||
use\sammo\{
|
use \sammo\DB;
|
||||||
DB,
|
use \sammo\Util;
|
||||||
Util,
|
use \sammo\JosaUtil;
|
||||||
JosaUtil,
|
use \sammo\General;
|
||||||
General,
|
use \sammo\DummyGeneral;
|
||||||
DummyGeneral,
|
use \sammo\ActionLogger;
|
||||||
ActionLogger,
|
use \sammo\GameConst;
|
||||||
GameConst,
|
use \sammo\LastTurn;
|
||||||
LastTurn,
|
use \sammo\GameUnitConst;
|
||||||
GameUnitConst,
|
use \sammo\Command;
|
||||||
Command,
|
use \sammo\MessageTarget;
|
||||||
MessageTarget,
|
use \sammo\DiplomaticMessage;
|
||||||
DiplomaticMessage,
|
use \sammo\Message;
|
||||||
Message,
|
|
||||||
};
|
|
||||||
|
|
||||||
use function\sammo\{
|
use function \sammo\getDomesticExpLevelBonus;
|
||||||
getDomesticExpLevelBonus,
|
use function \sammo\CriticalRatioDomestic;
|
||||||
CriticalRatioDomestic,
|
use function \sammo\CriticalScoreEx;
|
||||||
CriticalScoreEx,
|
use function \sammo\getAllNationStaticInfo;
|
||||||
getAllNationStaticInfo,
|
use function \sammo\getNationStaticInfo;
|
||||||
getNationStaticInfo,
|
use function \sammo\GetImageUR;
|
||||||
GetImageURL
|
|
||||||
};
|
|
||||||
|
|
||||||
use \sammo\Constraint\Constraint;
|
use \sammo\Constraint\Constraint;
|
||||||
use \sammo\Constraint\ConstraintHelper;
|
use \sammo\Constraint\ConstraintHelper;
|
||||||
|
use sammo\Json;
|
||||||
|
|
||||||
class che_불가침수락 extends Command\NationCommand
|
class che_불가침수락 extends Command\NationCommand
|
||||||
{
|
{
|
||||||
@@ -191,6 +188,12 @@ class che_불가침수락 extends Command\NationCommand
|
|||||||
$destNationID = $destNation['nation'];
|
$destNationID = $destNation['nation'];
|
||||||
$destNationName = $destNation['name'];
|
$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'];
|
$year = $this->arg['year'];
|
||||||
$month = $this->arg['month'];
|
$month = $this->arg['month'];
|
||||||
|
|
||||||
@@ -200,6 +203,10 @@ class che_불가침수락 extends Command\NationCommand
|
|||||||
$currentMonth = $env['year'] * 12 + $env['month'] - 1;
|
$currentMonth = $env['year'] * 12 + $env['month'] - 1;
|
||||||
$reqMonth = $year * 12 + $month - 1;
|
$reqMonth = $year * 12 + $month - 1;
|
||||||
|
|
||||||
|
$db->update('nation', [
|
||||||
|
'aux'=>Json::encode($destNationAux)
|
||||||
|
], 'nation=%i', $destNationID);
|
||||||
|
|
||||||
$db->update(
|
$db->update(
|
||||||
'diplomacy',
|
'diplomacy',
|
||||||
[
|
[
|
||||||
|
|||||||
Reference in New Issue
Block a user