자가 발령 포상 몰수
This commit is contained in:
@@ -89,7 +89,7 @@ function do수뇌임명(General $general, int $targetOfficerLevel):?string{
|
|||||||
return '임명불가능한 관직입니다.';
|
return '임명불가능한 관직입니다.';
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isOfficerSet($chiefSet, $lv)){
|
if(isOfficerSet($chiefSet, $targetOfficerLevel)){
|
||||||
return '지금은 임명할 수 없습니다.';
|
return '지금은 임명할 수 없습니다.';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -67,9 +67,6 @@ class che_몰수 extends Command\NationCommand
|
|||||||
if ($destGeneralID <= 0) {
|
if ($destGeneralID <= 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if ($destGeneralID == $this->generalObj->getID()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
$this->arg = [
|
$this->arg = [
|
||||||
'isGold' => $isGold,
|
'isGold' => $isGold,
|
||||||
'amount' => $amount,
|
'amount' => $amount,
|
||||||
@@ -106,6 +103,13 @@ class che_몰수 extends Command\NationCommand
|
|||||||
$env = $this->env;
|
$env = $this->env;
|
||||||
$relYear = $env['year'] - $env['startyear'];
|
$relYear = $env['year'] - $env['startyear'];
|
||||||
|
|
||||||
|
if($this->arg['destGeneralID'] == $this->getGeneral()->getID()){
|
||||||
|
$this->fullConditionConstraints=[
|
||||||
|
ConstraintHelper::AlwaysFail('본인입니다')
|
||||||
|
];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$this->fullConditionConstraints = [
|
$this->fullConditionConstraints = [
|
||||||
ConstraintHelper::NotBeNeutral(),
|
ConstraintHelper::NotBeNeutral(),
|
||||||
ConstraintHelper::OccupiedCity(),
|
ConstraintHelper::OccupiedCity(),
|
||||||
@@ -222,7 +226,7 @@ class che_몰수 extends Command\NationCommand
|
|||||||
//TODO: 암행부처럼 보여야...
|
//TODO: 암행부처럼 보여야...
|
||||||
$db = DB::db();
|
$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 = [];
|
$destGeneralList = [];
|
||||||
foreach ($destRawGenerals as $destGeneral) {
|
foreach ($destRawGenerals as $destGeneral) {
|
||||||
$nameColor = \sammo\getNameColor($destGeneral['npc']);
|
$nameColor = \sammo\getNameColor($destGeneral['npc']);
|
||||||
|
|||||||
@@ -44,9 +44,6 @@ class che_발령 extends Command\NationCommand{
|
|||||||
$destGeneralID = $this->arg['destGeneralID'];
|
$destGeneralID = $this->arg['destGeneralID'];
|
||||||
$destCityID = $this->arg['destCityID'];
|
$destCityID = $this->arg['destCityID'];
|
||||||
|
|
||||||
if($destGeneralID == $this->generalObj->getID()){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
$this->arg = [
|
$this->arg = [
|
||||||
'destGeneralID'=>$destGeneralID,
|
'destGeneralID'=>$destGeneralID,
|
||||||
'destCityID'=>$destCityID,
|
'destCityID'=>$destCityID,
|
||||||
@@ -75,6 +72,13 @@ class che_발령 extends Command\NationCommand{
|
|||||||
$destGeneral = General::createGeneralObjFromDB($this->arg['destGeneralID'], null, 1);
|
$destGeneral = General::createGeneralObjFromDB($this->arg['destGeneralID'], null, 1);
|
||||||
$this->setDestGeneral($destGeneral);
|
$this->setDestGeneral($destGeneral);
|
||||||
|
|
||||||
|
if($this->arg['destGeneralID'] == $this->getGeneral()->getID()){
|
||||||
|
$this->fullConditionConstraints=[
|
||||||
|
ConstraintHelper::AlwaysFail('본인입니다')
|
||||||
|
];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$this->fullConditionConstraints=[
|
$this->fullConditionConstraints=[
|
||||||
ConstraintHelper::BeChief(),
|
ConstraintHelper::BeChief(),
|
||||||
ConstraintHelper::NotBeNeutral(),
|
ConstraintHelper::NotBeNeutral(),
|
||||||
@@ -169,7 +173,7 @@ class che_발령 extends Command\NationCommand{
|
|||||||
{
|
{
|
||||||
$db = DB::db();
|
$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 = [];
|
$destGeneralList = [];
|
||||||
foreach($destRawGenerals as $destGeneral){
|
foreach($destRawGenerals as $destGeneral){
|
||||||
$nameColor = \sammo\getNameColor($destGeneral['npc']);
|
$nameColor = \sammo\getNameColor($destGeneral['npc']);
|
||||||
|
|||||||
@@ -64,9 +64,6 @@ class che_포상 extends Command\NationCommand
|
|||||||
if ($destGeneralID <= 0) {
|
if ($destGeneralID <= 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if ($destGeneralID == $this->generalObj->getID()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
$this->arg = [
|
$this->arg = [
|
||||||
'isGold' => $isGold,
|
'isGold' => $isGold,
|
||||||
'amount' => $amount,
|
'amount' => $amount,
|
||||||
@@ -95,6 +92,13 @@ class che_포상 extends Command\NationCommand
|
|||||||
$destGeneral = General::createGeneralObjFromDB($this->arg['destGeneralID'], ['gold', 'rice', 'nation'], 1);
|
$destGeneral = General::createGeneralObjFromDB($this->arg['destGeneralID'], ['gold', 'rice', 'nation'], 1);
|
||||||
$this->setDestGeneral($destGeneral);
|
$this->setDestGeneral($destGeneral);
|
||||||
|
|
||||||
|
if($this->arg['destGeneralID'] == $this->getGeneral()->getID()){
|
||||||
|
$this->fullConditionConstraints=[
|
||||||
|
ConstraintHelper::AlwaysFail('본인입니다')
|
||||||
|
];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$this->fullConditionConstraints = [
|
$this->fullConditionConstraints = [
|
||||||
ConstraintHelper::NotBeNeutral(),
|
ConstraintHelper::NotBeNeutral(),
|
||||||
ConstraintHelper::OccupiedCity(),
|
ConstraintHelper::OccupiedCity(),
|
||||||
@@ -187,7 +191,7 @@ class che_포상 extends Command\NationCommand
|
|||||||
//TODO: 암행부처럼 보여야...
|
//TODO: 암행부처럼 보여야...
|
||||||
$db = DB::db();
|
$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 = [];
|
$destGeneralList = [];
|
||||||
foreach ($destRawGenerals as $destGeneral) {
|
foreach ($destRawGenerals as $destGeneral) {
|
||||||
$nameColor = \sammo\getNameColor($destGeneral['npc']);
|
$nameColor = \sammo\getNameColor($destGeneral['npc']);
|
||||||
|
|||||||
Reference in New Issue
Block a user