버그 수정
This commit is contained in:
@@ -174,7 +174,7 @@ function checkCommandArg(?array $arg):?string{
|
||||
],*/
|
||||
'integer'=>[
|
||||
'crewType', 'destGeneralID', 'destCityID', 'destNationID',
|
||||
'amount', 'colorType', 'itemCode'
|
||||
'amount', 'colorType',
|
||||
],
|
||||
'boolean'=>[
|
||||
'isGold', 'buyRice',
|
||||
@@ -184,7 +184,6 @@ function checkCommandArg(?array $arg):?string{
|
||||
],
|
||||
'min'=>[
|
||||
['year', 0],
|
||||
['itemCode', 0],
|
||||
['destGeneralID', 1],
|
||||
['destCityID', 1],
|
||||
['destNationID', 1],
|
||||
|
||||
@@ -30,13 +30,13 @@ $('#commonSubmit').click(function(){
|
||||
//checkCommandArg 참고
|
||||
var availableArgumentList = {
|
||||
'string':[
|
||||
'nationName', 'optionText', 'itemType', 'nationType',
|
||||
'nationName', 'optionText', 'itemType', 'nationType', 'itemCode',
|
||||
],
|
||||
'int':[
|
||||
'crewType', 'destGeneralID', 'destCityID', 'destNationID',
|
||||
'amount', 'colorType', 'itemCode',
|
||||
'amount', 'colorType',
|
||||
'month',
|
||||
'year', 'itemCode', 'destGeneralID', 'destCityID', 'destNationID', 'amount', 'crewType',
|
||||
'year', 'destGeneralID', 'destCityID', 'destNationID', 'amount', 'crewType',
|
||||
],
|
||||
'boolean':[
|
||||
'isGold', 'buyRice',
|
||||
|
||||
@@ -88,6 +88,13 @@ class che_강행 extends Command\GeneralCommand{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public function getBrief():string{
|
||||
$commandName = $this->getName();
|
||||
$destCityName = CityConst::byID($this->arg['destCityID'])->name;
|
||||
$josaRo = JosaUtil::pick($destCityName, '로');
|
||||
return "【{$destCityName}】{$josaRo} {$commandName}";
|
||||
}
|
||||
|
||||
public function getFailString():string{
|
||||
$commandName = $this->getName();
|
||||
$failReason = $this->testRunnable();
|
||||
@@ -160,21 +167,24 @@ class che_강행 extends Command\GeneralCommand{
|
||||
|
||||
public function getForm(): string
|
||||
{
|
||||
$currentCityID = $this->generalObj->getCityID();
|
||||
|
||||
$form = [];
|
||||
$form[] = \sammo\getMapHtml();
|
||||
$currentCityName = CityConst::byID($currentCityID)->name;
|
||||
|
||||
$form[] = <<<EOT
|
||||
선택된 도시로 강행합니다.<br>
|
||||
최대 3칸내 도시로만 강행이 가능합니다.<br>
|
||||
목록을 선택하거나 도시를 클릭하세요.<br>
|
||||
<select class='formInput' name="destCityID" id="destCityID" size='1' style='color:white;background-color:black;'>
|
||||
{$currentCityName} => <select class='formInput' name="destCityID" id="destCityID" size='1' style='color:white;background-color:black;'>
|
||||
EOT;
|
||||
$form[] = \sammo\optionsForCities();
|
||||
$form[] = '</select>';
|
||||
$form[] = '<input type=submit value="강행">';
|
||||
$form[] = printCitiesBasedOnDistance($this->generalObj->getCityID(), 3);
|
||||
$form[] = '</select> <input type=button id="commonSubmit" value="강행">';
|
||||
$form[] = '';
|
||||
$form[] = printCitiesBasedOnDistance($currentCityID, 3);
|
||||
|
||||
return join("\n",$form);
|
||||
return join("<br>\n",$form);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -35,13 +35,13 @@ class che_건국 extends Command\GeneralCommand{
|
||||
}
|
||||
$nationName = $this->arg['nationName']??null;
|
||||
$nationType = $this->arg['nationType']??null;
|
||||
$nationColor = $this->arg['nationColor']??null;
|
||||
$colorType = $this->arg['colorType']??null;
|
||||
|
||||
if($nationName === null || $nationType === null || $nationColor === null){
|
||||
if($nationName === null || $nationType === null || $colorType === null){
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!is_string($nationName) || !is_string($nationType) || !is_int($nationColor)){
|
||||
if(!is_string($nationName) || !is_string($nationType) || !is_int($colorType)){
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ class che_건국 extends Command\GeneralCommand{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!key_exists($nationColor, GetNationColors())){
|
||||
if(!key_exists($colorType, GetNationColors())){
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ class che_건국 extends Command\GeneralCommand{
|
||||
$this->arg = [
|
||||
'nationName'=>$nationName,
|
||||
'nationType'=>$nationType,
|
||||
'nationColor'=>$nationColor
|
||||
'colorType'=>$colorType
|
||||
];
|
||||
|
||||
return true;
|
||||
@@ -76,7 +76,7 @@ class che_건국 extends Command\GeneralCommand{
|
||||
|
||||
$nationName = $this->arg['nationName'];
|
||||
$nationType = $this->arg['nationType'];
|
||||
$nationColor = $this->arg['nationColor'];
|
||||
$colorType = $this->arg['colorType'];
|
||||
|
||||
$this->setCity();
|
||||
$this->setNation(['gennum']);
|
||||
@@ -84,11 +84,11 @@ class che_건국 extends Command\GeneralCommand{
|
||||
$relYear = $env['year'] - $env['startyear'];
|
||||
|
||||
$this->runnableConstraints=[
|
||||
ConstraintHelper::BeLord(),
|
||||
ConstraintHelper::WanderingNation(),
|
||||
ConstraintHelper::ReqNationValue('gennum', '수하 장수', '>=', 2),
|
||||
ConstraintHelper::BeOpeningPart($relYear),
|
||||
ConstraintHelper::WanderingNation(),
|
||||
ConstraintHelper::CheckNationNameDuplicate($nationName),
|
||||
ConstraintHelper::BeLord(),
|
||||
ConstraintHelper::AllowJoinAction(),
|
||||
ConstraintHelper::ConstructableCity(),
|
||||
];
|
||||
@@ -121,7 +121,7 @@ class che_건국 extends Command\GeneralCommand{
|
||||
|
||||
$nationName = $this->arg['nationName'];
|
||||
$nationType = $this->arg['nationType'];
|
||||
$nationColor = GetNationColors()[$this->arg['nationColor']];
|
||||
$colorType = GetNationColors()[$this->arg['colorType']];
|
||||
|
||||
$cityName = $this->city['name'];
|
||||
|
||||
@@ -157,7 +157,7 @@ class che_건국 extends Command\GeneralCommand{
|
||||
|
||||
$db->update('nation', [
|
||||
'name'=>$nationName,
|
||||
'color'=>$nationColor,
|
||||
'color'=>$colorType,
|
||||
'level'=>1,
|
||||
'type'=>$nationType,
|
||||
'capital'=>$general->getCityID()
|
||||
@@ -225,7 +225,7 @@ class che_건국 extends Command\GeneralCommand{
|
||||
$form[] = <<<EOT
|
||||
<br>
|
||||
국명 : <input type='text' class='formInput' name="nationName" id="nationName" size='18' maxlength='18' style='color:white;background-color:black;'>
|
||||
색깔 : <select class='formInput' name='nationColor' id='nationColor' size='1'>
|
||||
색깔 : <select class='formInput' name='colorType' id='colorType' size='1'>
|
||||
EOT;
|
||||
foreach(GetNationColors() as $idx=>$color) {
|
||||
/*
|
||||
@@ -247,7 +247,7 @@ EOT;
|
||||
|
||||
}
|
||||
$form[] = '</select>';
|
||||
$form[] = '<input type="submit" value="건국">';
|
||||
$form[] = '<input type=button id="commonSubmit" value="'.$this->getName().'">';
|
||||
|
||||
return join("\n",$form);
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ class GameUnitConst extends GameUnitConstBase
|
||||
[self::T_ARCHER=>1.2, self::T_CAVALRY=>0.8, self::T_SIEGE=>1.2],
|
||||
[self::T_ARCHER=>0.8, self::T_CAVALRY=>1.2, self::T_SIEGE=>0.8],
|
||||
["공격을 포기하고 오직 방어에만 집중합니다."],
|
||||
null
|
||||
null, null
|
||||
],
|
||||
[
|
||||
217008, self::T_FOOTMAN, '메이드병',
|
||||
|
||||
Reference in New Issue
Block a user