diff --git a/hwe/sammo/Command/BaseCommand.php b/hwe/sammo/Command/BaseCommand.php index 007c2f8a..df37be42 100644 --- a/hwe/sammo/Command/BaseCommand.php +++ b/hwe/sammo/Command/BaseCommand.php @@ -278,7 +278,11 @@ abstract class BaseCommand{ return $this->reasonNoPermissionToReserve; } - if($this->permissionConstraints === null){ + if($this->cachedPermissionToReserve){ + return $this->reasonNoPermissionToReserve; + } + + if(!$this->permissionConstraints){ return null; } @@ -304,7 +308,7 @@ abstract class BaseCommand{ } public function canDisplay():bool{ - return $this->hasPermissionToReserve(); + return true; } public function testMinConditionMet():?string{ diff --git a/hwe/sammo/Command/General/che_NPC능동.php b/hwe/sammo/Command/General/che_NPC능동.php index 3a2db37a..a2518a79 100644 --- a/hwe/sammo/Command/General/che_NPC능동.php +++ b/hwe/sammo/Command/General/che_NPC능동.php @@ -58,6 +58,10 @@ class che_NPC능동 extends Command\GeneralCommand{ } + public function canDisplay():bool{ + return false; + } + public function getCost():array{ return [0, 0]; } diff --git a/hwe/sammo/Command/General/che_등용.php b/hwe/sammo/Command/General/che_등용.php index 9df12314..8b50731c 100644 --- a/hwe/sammo/Command/General/che_등용.php +++ b/hwe/sammo/Command/General/che_등용.php @@ -95,12 +95,16 @@ class che_등용 extends Command\GeneralCommand{ ConstraintHelper::ReqGeneralGold($reqGold), ConstraintHelper::ReqGeneralRice($reqRice), ]; - + if($this->destGeneralObj->getVar('officer_level') == 12){ $this->fullConditionConstraints[] = ConstraintHelper::AlwaysFail('군주에게는 등용장을 보낼 수 없습니다.'); } } + public function canDisplay():bool{ + return $this->env['join_mode'] !== 'onlyRandom'; + } + public function getCost():array{ $env = $this->env; if(!$this->isArgValid){ diff --git a/hwe/sammo/Command/General/che_등용수락.php b/hwe/sammo/Command/General/che_등용수락.php index 7e7c668f..a456fd66 100644 --- a/hwe/sammo/Command/General/che_등용수락.php +++ b/hwe/sammo/Command/General/che_등용수락.php @@ -100,6 +100,10 @@ class che_등용수락 extends Command\GeneralCommand{ ]; } + public function canDisplay():bool{ + return false; + } + public function getCost():array{ return [0, 0]; } diff --git a/hwe/sammo/Command/General/che_임관.php b/hwe/sammo/Command/General/che_임관.php index 04edccad..c8b1ca3a 100644 --- a/hwe/sammo/Command/General/che_임관.php +++ b/hwe/sammo/Command/General/che_임관.php @@ -96,6 +96,10 @@ class che_임관 extends Command\GeneralCommand{ } + public function canDisplay():bool{ + return $this->env['join_mode'] !== 'onlyRandom'; + } + protected function initWithArg() { $destGeneralID = $this->arg['destGeneralID']??null; diff --git a/hwe/sammo/Command/General/che_첩보.php b/hwe/sammo/Command/General/che_첩보.php index f9feaa8d..17d94273 100644 --- a/hwe/sammo/Command/General/che_첩보.php +++ b/hwe/sammo/Command/General/che_첩보.php @@ -60,7 +60,6 @@ class che_첩보 extends Command\GeneralCommand [$reqGold, $reqRice] = $this->getCost(); $this->minConditionConstraints = [ - ConstraintHelper::NotOccupiedDestCity(), ConstraintHelper::ReqGeneralGold($reqGold), ConstraintHelper::ReqGeneralRice($reqRice), ]; diff --git a/hwe/sammo/Command/Nation/che_감축.php b/hwe/sammo/Command/Nation/che_감축.php index 41e03a59..ece1392c 100644 --- a/hwe/sammo/Command/Nation/che_감축.php +++ b/hwe/sammo/Command/Nation/che_감축.php @@ -42,7 +42,7 @@ class che_감축 extends Command\NationCommand{ $env = $this->env; if($general->getNationID()===0){ - $this->permissionConstraints=[ + $this->minConditionConstraints=[ ConstraintHelper::NotBeNeutral(), ]; $this->fullConditionConstraints=[ diff --git a/hwe/sammo/Command/Nation/che_불가침수락.php b/hwe/sammo/Command/Nation/che_불가침수락.php index 85500836..de039dda 100644 --- a/hwe/sammo/Command/Nation/che_불가침수락.php +++ b/hwe/sammo/Command/Nation/che_불가침수락.php @@ -148,6 +148,10 @@ class che_불가침수락 extends Command\NationCommand ]; } + public function canDisplay():bool{ + return false; + } + public function getCost(): array { return [0, 0]; diff --git a/hwe/sammo/Command/Nation/che_불가침파기수락.php b/hwe/sammo/Command/Nation/che_불가침파기수락.php index 5ced9902..87d7e5de 100644 --- a/hwe/sammo/Command/Nation/che_불가침파기수락.php +++ b/hwe/sammo/Command/Nation/che_불가침파기수락.php @@ -103,6 +103,10 @@ class che_불가침파기수락 extends Command\NationCommand ]; } + public function canDisplay():bool{ + return false; + } + public function getCost(): array { return [0, 0]; diff --git a/hwe/sammo/Command/Nation/che_종전수락.php b/hwe/sammo/Command/Nation/che_종전수락.php index 466bcced..a11aab44 100644 --- a/hwe/sammo/Command/Nation/che_종전수락.php +++ b/hwe/sammo/Command/Nation/che_종전수락.php @@ -110,6 +110,10 @@ class che_종전수락 extends Command\NationCommand ]; } + public function canDisplay():bool{ + return false; + } + public function getCost(): array { return [0, 0]; diff --git a/hwe/sammo/Command/Nation/che_증축.php b/hwe/sammo/Command/Nation/che_증축.php index 0a1d226a..7d75e4e9 100644 --- a/hwe/sammo/Command/Nation/che_증축.php +++ b/hwe/sammo/Command/Nation/che_증축.php @@ -41,7 +41,7 @@ class che_증축 extends Command\NationCommand{ $env = $this->env; if($general->getNationID()===0){ - $this->permissionConstraints=[ + $this->minConditionConstraints=[ ConstraintHelper::NotBeNeutral(), ]; $this->fullConditionConstraints=[ diff --git a/hwe/sammo/TurnExecutionHelper.php b/hwe/sammo/TurnExecutionHelper.php index fba82254..86c5eb20 100644 --- a/hwe/sammo/TurnExecutionHelper.php +++ b/hwe/sammo/TurnExecutionHelper.php @@ -67,7 +67,7 @@ class TurnExecutionHelper $general = $this->getGeneral(); while(true){ - if($commandObj->hasFullConditionMet()){ + if(!$commandObj->hasFullConditionMet()){ $date = $general->getTurnTime($general::TURNTIME_HM); $failString = $commandObj->getFailString(); $text = "{$failString} <1>{$date}"; @@ -109,7 +109,7 @@ class TurnExecutionHelper $commandClassName = $commandObj->getName(); while(true){ - if($commandObj->hasFullConditionMet()){ + if(!$commandObj->hasFullConditionMet()){ $date = $general->getTurnTime($general::TURNTIME_HM); $failString = $commandObj->getFailString(); $text = "{$failString} <1>{$date}";