From 9f303966eb7395631f4bb3974f14a013f29b3054 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sat, 9 May 2020 15:14:24 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9E=90=EA=B0=80=20=EB=B0=9C=EB=A0=B9=20?= =?UTF-8?q?=ED=8F=AC=EC=83=81=20=EB=AA=B0=EC=88=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/j_myBossInfo.php | 2 +- hwe/sammo/Command/Nation/che_몰수.php | 12 ++++++++---- hwe/sammo/Command/Nation/che_발령.php | 14 +++++++++----- hwe/sammo/Command/Nation/che_포상.php | 12 ++++++++---- 4 files changed, 26 insertions(+), 14 deletions(-) diff --git a/hwe/j_myBossInfo.php b/hwe/j_myBossInfo.php index b7b92144..61c09783 100644 --- a/hwe/j_myBossInfo.php +++ b/hwe/j_myBossInfo.php @@ -89,7 +89,7 @@ function do수뇌임명(General $general, int $targetOfficerLevel):?string{ return '임명불가능한 관직입니다.'; } - if(isOfficerSet($chiefSet, $lv)){ + if(isOfficerSet($chiefSet, $targetOfficerLevel)){ return '지금은 임명할 수 없습니다.'; } diff --git a/hwe/sammo/Command/Nation/che_몰수.php b/hwe/sammo/Command/Nation/che_몰수.php index 77e09e16..dbf8bfd6 100644 --- a/hwe/sammo/Command/Nation/che_몰수.php +++ b/hwe/sammo/Command/Nation/che_몰수.php @@ -67,9 +67,6 @@ class che_몰수 extends Command\NationCommand if ($destGeneralID <= 0) { return false; } - if ($destGeneralID == $this->generalObj->getID()) { - return false; - } $this->arg = [ 'isGold' => $isGold, 'amount' => $amount, @@ -106,6 +103,13 @@ class che_몰수 extends Command\NationCommand $env = $this->env; $relYear = $env['year'] - $env['startyear']; + if($this->arg['destGeneralID'] == $this->getGeneral()->getID()){ + $this->fullConditionConstraints=[ + ConstraintHelper::AlwaysFail('본인입니다') + ]; + return; + } + $this->fullConditionConstraints = [ ConstraintHelper::NotBeNeutral(), ConstraintHelper::OccupiedCity(), @@ -222,7 +226,7 @@ class che_몰수 extends Command\NationCommand //TODO: 암행부처럼 보여야... $db = DB::db(); - $destRawGenerals = $db->query('SELECT no,name,officer_level,npc,gold,rice FROM general WHERE nation = %i AND no != %i ORDER BY npc,binary(name)', $this->generalObj->getNationID(), $this->generalObj->getID()); + $destRawGenerals = $db->query('SELECT no,name,officer_level,npc,gold,rice FROM general WHERE nation = %i ORDER BY npc,binary(name)', $this->generalObj->getNationID()); $destGeneralList = []; foreach ($destRawGenerals as $destGeneral) { $nameColor = \sammo\getNameColor($destGeneral['npc']); diff --git a/hwe/sammo/Command/Nation/che_발령.php b/hwe/sammo/Command/Nation/che_발령.php index c496c8be..480848b2 100644 --- a/hwe/sammo/Command/Nation/che_발령.php +++ b/hwe/sammo/Command/Nation/che_발령.php @@ -44,9 +44,6 @@ class che_발령 extends Command\NationCommand{ $destGeneralID = $this->arg['destGeneralID']; $destCityID = $this->arg['destCityID']; - if($destGeneralID == $this->generalObj->getID()){ - return false; - } $this->arg = [ 'destGeneralID'=>$destGeneralID, 'destCityID'=>$destCityID, @@ -71,10 +68,17 @@ class che_발령 extends Command\NationCommand{ protected function initWithArg() { $this->setDestCity($this->arg['destCityID']); - + $destGeneral = General::createGeneralObjFromDB($this->arg['destGeneralID'], null, 1); $this->setDestGeneral($destGeneral); + if($this->arg['destGeneralID'] == $this->getGeneral()->getID()){ + $this->fullConditionConstraints=[ + ConstraintHelper::AlwaysFail('본인입니다') + ]; + return; + } + $this->fullConditionConstraints=[ ConstraintHelper::BeChief(), ConstraintHelper::NotBeNeutral(), @@ -169,7 +173,7 @@ class che_발령 extends Command\NationCommand{ { $db = DB::db(); - $destRawGenerals = $db->query('SELECT no,name,officer_level,npc,gold,rice FROM general WHERE nation = %i AND no != %i ORDER BY npc,binary(name)',$this->generalObj->getNationID(), $this->generalObj->getID()); + $destRawGenerals = $db->query('SELECT no,name,officer_level,npc,gold,rice FROM general WHERE nation = %i ORDER BY npc,binary(name)',$this->generalObj->getNationID()); $destGeneralList = []; foreach($destRawGenerals as $destGeneral){ $nameColor = \sammo\getNameColor($destGeneral['npc']); diff --git a/hwe/sammo/Command/Nation/che_포상.php b/hwe/sammo/Command/Nation/che_포상.php index 9321553a..45090f5c 100644 --- a/hwe/sammo/Command/Nation/che_포상.php +++ b/hwe/sammo/Command/Nation/che_포상.php @@ -64,9 +64,6 @@ class che_포상 extends Command\NationCommand if ($destGeneralID <= 0) { return false; } - if ($destGeneralID == $this->generalObj->getID()) { - return false; - } $this->arg = [ 'isGold' => $isGold, 'amount' => $amount, @@ -95,6 +92,13 @@ class che_포상 extends Command\NationCommand $destGeneral = General::createGeneralObjFromDB($this->arg['destGeneralID'], ['gold', 'rice', 'nation'], 1); $this->setDestGeneral($destGeneral); + if($this->arg['destGeneralID'] == $this->getGeneral()->getID()){ + $this->fullConditionConstraints=[ + ConstraintHelper::AlwaysFail('본인입니다') + ]; + return; + } + $this->fullConditionConstraints = [ ConstraintHelper::NotBeNeutral(), ConstraintHelper::OccupiedCity(), @@ -187,7 +191,7 @@ class che_포상 extends Command\NationCommand //TODO: 암행부처럼 보여야... $db = DB::db(); - $destRawGenerals = $db->query('SELECT no,name,officer_level,npc,gold,rice FROM general WHERE nation = %i AND no != %i ORDER BY npc,binary(name)', $this->generalObj->getNationID(), $this->generalObj->getID()); + $destRawGenerals = $db->query('SELECT no,name,officer_level,npc,gold,rice FROM general WHERE nation = %i ORDER BY npc,binary(name)', $this->generalObj->getNationID()); $destGeneralList = []; foreach ($destRawGenerals as $destGeneral) { $nameColor = \sammo\getNameColor($destGeneral['npc']);