자가 발령 포상 몰수
This commit is contained in:
@@ -89,7 +89,7 @@ function do수뇌임명(General $general, int $targetOfficerLevel):?string{
|
||||
return '임명불가능한 관직입니다.';
|
||||
}
|
||||
|
||||
if(isOfficerSet($chiefSet, $lv)){
|
||||
if(isOfficerSet($chiefSet, $targetOfficerLevel)){
|
||||
return '지금은 임명할 수 없습니다.';
|
||||
}
|
||||
|
||||
|
||||
@@ -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']);
|
||||
|
||||
@@ -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']);
|
||||
|
||||
@@ -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']);
|
||||
|
||||
Reference in New Issue
Block a user