diff --git a/hwe/sammo/Command/Nation/che_급습.php b/hwe/sammo/Command/Nation/che_급습.php index 92534432..f7daf847 100644 --- a/hwe/sammo/Command/Nation/che_급습.php +++ b/hwe/sammo/Command/Nation/che_급습.php @@ -228,7 +228,8 @@ class che_급습 extends Command\NationCommand return [ 'mapTheme' => \sammo\getMapTheme(), 'procRes' => [ - 'nations' => $nationList + 'nations' => $nationList, + 'startYear' => $this->env['startyear'], ], ]; } diff --git a/hwe/sammo/Command/Nation/che_선전포고.php b/hwe/sammo/Command/Nation/che_선전포고.php index 38a55d1f..2c127767 100644 --- a/hwe/sammo/Command/Nation/che_선전포고.php +++ b/hwe/sammo/Command/Nation/che_선전포고.php @@ -192,6 +192,45 @@ class che_선전포고 extends Command\NationCommand return true; } + + public function exportJSVars(): array + { + $generalObj = $this->generalObj; + $nationID = $generalObj->getNationID(); + $nationList = []; + $testTurn = new LastTurn($this->getName(), null, $this->getPreReqTurn()); + foreach (getAllNationStaticInfo() as $destNation) { + /*if ($destNation['nation'] == $nationID) { + continue; + }*/ + + $testTurn->setArg(['destNationID' => $destNation['nation']]); + $testCommand = new static($generalObj, $this->env, $testTurn, ['destNationID' => $destNation['nation']]); + + $nationTarget = [ + 'id' => $destNation['nation'], + 'name' => $destNation['name'], + 'color' => $destNation['color'], + 'power' => $destNation['power'], + ]; + if (!$testCommand->hasFullConditionMet()) { + $nationTarget['notAvailable'] = true; + } + if ($destNation['nation'] == $nationID) { + $nationTarget['notAvailable'] = true; + } + + $nationList[] = $nationTarget; + } + return [ + 'mapTheme' => \sammo\getMapTheme(), + 'procRes' => [ + 'nations' => $nationList, + 'startYear' => $this->env['startyear'], + ], + ]; + } + public function getJSPlugins(): array { return [ diff --git a/hwe/ts/processing/Nation/che_급습.vue b/hwe/ts/processing/Nation/che_선전포고.vue similarity index 72% rename from hwe/ts/processing/Nation/che_급습.vue rename to hwe/ts/processing/Nation/che_선전포고.vue index dea8f58c..794075e4 100644 --- a/hwe/ts/processing/Nation/che_급습.vue +++ b/hwe/ts/processing/Nation/che_선전포고.vue @@ -10,12 +10,21 @@ v-model="selectedCityObj" /> -
+
+ 타국에게 선전 포고합니다.
+ 선전 포고할 국가를 목록에서 선택하세요.
+ 고립되지 않은 아국 도시에서 인접한 국가에 선포 가능합니다.
+ 초반제한 해제 2년전부터 선포가 가능합니다. ({{ startYear + 1 }}년 + 1월부터 가능)
+ 현재 선포가 불가능한 국가는 배경색이 붉은색으로 + 표시됩니다.
+
+
선택된 국가에 급습을 발동합니다.
선포, 전쟁중인 상대국에만 가능합니다.
상대 국가를 목록에서 선택하세요.
- 배경색은 현재 급습 불가능 국가는 붉은색으로 - 표시됩니다.
+ 배경색은 현재 급습 불가능 국가는 + 붉은색으로 표시됩니다.
@@ -40,16 +49,14 @@ import { unwrap } from "@/util/unwrap"; import { Args } from "@/processing/args"; import TopBackBar from "@/components/TopBackBar.vue"; import BottomBar from "@/components/BottomBar.vue"; -import { - procNationItem, - procNationList -} from "../processingRes"; +import { procNationItem, procNationList } from "../processingRes"; declare const mapTheme: string; declare const currentNation: number; declare const commandName: string; declare const procRes: { - nations: procNationList, + nations: procNationList; + startYear: number, }; export default defineComponent({ @@ -61,7 +68,7 @@ export default defineComponent({ }, watch: { selectedCityObj(city: MapCityParsed) { - if(!city.nationID){ + if (!city.nationID) { return; } this.selectedNationID = city.nationID; @@ -73,7 +80,7 @@ export default defineComponent({ nations.set(nationItem.id, nationItem); } - const selectedNationID = ref(currentNation); + const selectedNationID = ref(procRes.nations[0].id); function selectedNation(nationID: number) { selectedNationID.value = nationID; diff --git a/hwe/ts/processing/Nation/index.ts b/hwe/ts/processing/Nation/index.ts index 147f60e6..73bee302 100644 --- a/hwe/ts/processing/Nation/index.ts +++ b/hwe/ts/processing/Nation/index.ts @@ -1,6 +1,6 @@ import { default as che_국기변경 } from "./che_국기변경.vue"; import { default as che_국호변경 } from "./che_국호변경.vue"; -import { default as NationProcess } from "./che_급습.vue"; +import { default as NationProcess } from "./che_선전포고.vue"; import { default as GeneralAmountProcess } from "./che_몰수.vue"; import { default as GeneralCityProcess } from "./che_발령.vue"; @@ -9,6 +9,7 @@ export const commandMap: Record = { che_국호변경, che_급습: NationProcess, che_몰수: GeneralAmountProcess, + che_선전포고: NationProcess, che_포상: GeneralAmountProcess, che_발령: GeneralCityProcess, }