From efffb462814646589f05002e5073be247341f43a Mon Sep 17 00:00:00 2001 From: hide_d Date: Thu, 30 Apr 2020 04:03:43 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A6=9D=EC=B6=95,=EA=B0=90=EC=B6=95,=EC=B2=9C?= =?UTF-8?q?=EB=8F=84=20=EB=B2=84=EA=B7=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/AutorunGeneralPolicy.php | 2 +- hwe/sammo/Command/BaseCommand.php | 2 +- hwe/sammo/Command/Nation/che_감축.php | 8 ++++---- hwe/sammo/Command/Nation/che_증축.php | 11 +++++++---- hwe/sammo/Command/Nation/che_천도.php | 4 ++-- hwe/sammo/LastTurn.php | 8 ++++++-- 6 files changed, 21 insertions(+), 14 deletions(-) diff --git a/hwe/sammo/AutorunGeneralPolicy.php b/hwe/sammo/AutorunGeneralPolicy.php index 9b787c90..74c57b92 100644 --- a/hwe/sammo/AutorunGeneralPolicy.php +++ b/hwe/sammo/AutorunGeneralPolicy.php @@ -69,7 +69,7 @@ class AutorunGeneralPolicy{ public $can징병 = true; public $can모병 = false; public $can한계징병 = true; - public $can고급병종 = true;//TODO: false로 전환 + public $can고급병종 = false; public $can전투준비 = true; public $can소집해제 = true; diff --git a/hwe/sammo/Command/BaseCommand.php b/hwe/sammo/Command/BaseCommand.php index 1eab7808..c8b0778f 100644 --- a/hwe/sammo/Command/BaseCommand.php +++ b/hwe/sammo/Command/BaseCommand.php @@ -333,7 +333,7 @@ abstract class BaseCommand{ $lastTurn = $this->getLastTurn(); $commandName = $this->getName(); - if($lastTurn->getCommand() != $commandName && $lastTurn->getArg() !== $this->arg){ + if($lastTurn->getCommand() != $commandName || $lastTurn->getArg() !== $this->arg){ $this->setResultTurn(new LastTurn( $commandName, $this->arg, diff --git a/hwe/sammo/Command/Nation/che_감축.php b/hwe/sammo/Command/Nation/che_감축.php index b1a49727..73f991b7 100644 --- a/hwe/sammo/Command/Nation/che_감축.php +++ b/hwe/sammo/Command/Nation/che_감축.php @@ -64,8 +64,8 @@ class che_감축 extends Command\NationCommand{ ConstraintHelper::OccupiedCity(), ConstraintHelper::BeChief(), ConstraintHelper::SuppliedCity(), - ConstraintHelper::ReqDestCityValue('level', '>', 4, '더이상 감축할 수 없습니다.'), - ConstraintHelper::ReqDestCityValue('level', '>', $origCityLevel, '더이상 감축할 수 없습니다.') + ConstraintHelper::ReqDestCityValue('level', '규모', '>', 4, '더이상 감축할 수 없습니다.'), + ConstraintHelper::ReqDestCityValue('level', '규모', '>', $origCityLevel, '더이상 감축할 수 없습니다.') ]; } @@ -96,7 +96,7 @@ class che_감축 extends Command\NationCommand{ public function addTermStack():bool{ $lastTurn = $this->getLastTurn(); $commandName = $this->getName(); - if($lastTurn->getCommand() != $commandName && $lastTurn->getArg() !== $this->arg){ + if($lastTurn->getCommand() != $commandName || $lastTurn->getArg() !== $this->arg){ $this->setResultTurn(new LastTurn( $commandName, $this->arg, @@ -193,7 +193,7 @@ class che_감축 extends Command\NationCommand{ 'rice' => $db->sqleval('rice + %i', $reqRice), ], 'nation=%i', $nationID); - $logger->pushGeneralActionLog("{$destCityName}{$josaUl} 감축했습니다. <1>$datepushGeneralActionLog("{$destCityName}{$josaUl} 감축했습니다. <1>$date"); $logger->pushGeneralHistoryLog("{$destCityName}{$josaUl} 감축"); $logger->pushNationalHistoryLog("{$generalName}{$josaYi} {$destCityName}{$josaUl} 감축"); $logger->pushGlobalActionLog("{$generalName}{$josaYi} {$destCityName}{$josaUl} 감축하였습니다."); diff --git a/hwe/sammo/Command/Nation/che_증축.php b/hwe/sammo/Command/Nation/che_증축.php index 82973e9e..684ee547 100644 --- a/hwe/sammo/Command/Nation/che_증축.php +++ b/hwe/sammo/Command/Nation/che_증축.php @@ -61,8 +61,8 @@ class che_증축 extends Command\NationCommand{ ConstraintHelper::OccupiedCity(), ConstraintHelper::BeChief(), ConstraintHelper::SuppliedCity(), - ConstraintHelper::ReqDestCityValue('level', '>', 3, '수진, 진, 관문에서는 불가능합니다.'), - ConstraintHelper::ReqDestCityValue('level', '<', 7, '더이상 증축할 수 없습니다.'), + ConstraintHelper::ReqDestCityValue('level', '규모', '>', 3, '수진, 진, 관문에서는 불가능합니다.'), + ConstraintHelper::ReqDestCityValue('level', '규모', '<', 7, '더이상 증축할 수 없습니다.'), ConstraintHelper::ReqNationGold(GameConst::$basegold+$reqGold), ConstraintHelper::ReqNationRice(GameConst::$baserice+$reqRice), ]; @@ -95,7 +95,8 @@ class che_증축 extends Command\NationCommand{ public function addTermStack():bool{ $lastTurn = $this->getLastTurn(); $commandName = $this->getName(); - if($lastTurn->getCommand() != $commandName && $lastTurn->getArg() !== $this->arg){ + if($lastTurn->getCommand() != $commandName || $lastTurn->getArg() !== $this->arg){ + \sammo\LogText('증축', '여기서 걸려?'); $this->setResultTurn(new LastTurn( $commandName, $this->arg, @@ -107,6 +108,7 @@ class che_증축 extends Command\NationCommand{ if($lastTurn->getSeq() < $this->nation['capset']){ //NOTE: 최근에 천도, 증축이 일어났으면 리셋됨 + \sammo\LogText('증축', '으으음?'.$this->nation['capset'].','.$lastTurn->getSeq()); $this->setResultTurn(new LastTurn( $commandName, $this->arg, @@ -117,6 +119,7 @@ class che_증축 extends Command\NationCommand{ } if($lastTurn->getTerm() < $this->getPreReqTurn()){ + \sammo\LogText('증축', '잘된다는데?'); $this->setResultTurn(new LastTurn( $commandName, $this->arg, @@ -185,7 +188,7 @@ class che_증축 extends Command\NationCommand{ 'rice' => $db->sqleval('rice - %i', $reqRice), ], 'nation=%i', $nationID); - $logger->pushGeneralActionLog("{$destCityName}{$josaUl} 증축했습니다. <1>$datepushGeneralActionLog("{$destCityName}{$josaUl} 증축했습니다. <1>$date"); $logger->pushGeneralHistoryLog("{$destCityName}{$josaUl} 증축"); $logger->pushNationalHistoryLog("{$generalName}{$josaYi} {$destCityName}{$josaUl} 증축"); $logger->pushGlobalActionLog("{$generalName}{$josaYi} {$destCityName}{$josaUl} 증축하였습니다."); diff --git a/hwe/sammo/Command/Nation/che_천도.php b/hwe/sammo/Command/Nation/che_천도.php index 94dd23a9..14abde98 100644 --- a/hwe/sammo/Command/Nation/che_천도.php +++ b/hwe/sammo/Command/Nation/che_천도.php @@ -57,7 +57,7 @@ class che_천도 extends Command\NationCommand{ $env = $this->env; $this->setCity(); - $this->setNation(['capset', 'gold', 'rice']); + $this->setNation(['capset', 'gold', 'rice', 'capital']); $this->setDestCity($this->arg['destCityID'], null); [$reqGold, $reqRice] = $this->getCost(); @@ -126,7 +126,7 @@ class che_천도 extends Command\NationCommand{ $nationID = $general->getNationID(); $nationStor->setValue("last천도Trial_{$nationID}", [$general->getVar('officer_level'), $general->getTurnTime()]); - if($lastTurn->getCommand() != $commandName && $lastTurn->getArg() !== $this->arg){ + if($lastTurn->getCommand() != $commandName || $lastTurn->getArg() !== $this->arg){ $this->setResultTurn(new LastTurn( $commandName, $this->arg, diff --git a/hwe/sammo/LastTurn.php b/hwe/sammo/LastTurn.php index a17c49e0..7e19916d 100644 --- a/hwe/sammo/LastTurn.php +++ b/hwe/sammo/LastTurn.php @@ -12,7 +12,7 @@ class LastTurn{ $this->setCommand($command); $this->setArg($arg); $this->setTerm($term); - $this->setSeq($term); + $this->setSeq($seq); } static function fromJson(?string $json):self{ @@ -23,7 +23,8 @@ class LastTurn{ $obj = new static( $values['command']??null, $values['arg']??null, - $values['term']??null + $values['term']??null, + $values['seq']??null ); return $obj; } @@ -73,6 +74,9 @@ class LastTurn{ if($this->term !== null){ $result['term'] = $this->term; } + if($this->seq !== null){ + $result['seq'] = $this->seq; + } return Json::encode($result); }