증축,감축,천도 버그

This commit is contained in:
2020-04-30 04:03:43 +09:00
parent e2ec3ef532
commit efffb46281
6 changed files with 21 additions and 14 deletions
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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,
+4 -4
View File
@@ -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("<G><b>{$destCityName}</b></>{$josaUl} 감축했습니다. <1>$date</");
$logger->pushGeneralActionLog("<G><b>{$destCityName}</b></>{$josaUl} 감축했습니다. <1>$date</>");
$logger->pushGeneralHistoryLog("<G><b>{$destCityName}</b></>{$josaUl} <M>감축</>");
$logger->pushNationalHistoryLog("<Y>{$generalName}</>{$josaYi} <G><b>{$destCityName}</b></>{$josaUl} <M>감축</>");
$logger->pushGlobalActionLog("<Y>{$generalName}</>{$josaYi} <G><b>{$destCityName}</b></>{$josaUl} <M>감축</>하였습니다.");
+7 -4
View File
@@ -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("<G><b>{$destCityName}</b></>{$josaUl} 증축했습니다. <1>$date</");
$logger->pushGeneralActionLog("<G><b>{$destCityName}</b></>{$josaUl} 증축했습니다. <1>$date</>");
$logger->pushGeneralHistoryLog("<G><b>{$destCityName}</b></>{$josaUl} <M>증축</>");
$logger->pushNationalHistoryLog("<Y>{$generalName}</>{$josaYi} <G><b>{$destCityName}</b></>{$josaUl} <M>증축</>");
$logger->pushGlobalActionLog("<Y>{$generalName}</>{$josaYi} <G><b>{$destCityName}</b></>{$josaUl} <M>증축</>하였습니다.");
+2 -2
View File
@@ -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,
+6 -2
View File
@@ -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);
}