feat: add atmos property to General entity and update related logic

- Added `atmos` property to the `General` interface in `entities.ts`.
- Initialized `atmos` to 0 in the `buildGeneralSeeds` function in `bootstrap.ts`.
- Updated exports in `index.ts` to include `unitSet.js`.
- Introduced new types for crew types and their requirements in `types.ts`.
- Implemented `unitSetLoader.ts` for loading unit set definitions from JSON files.
- Created `che_징병.ts` action for recruiting crew types with cost and training calculations.
- Developed `unitSet.ts` for handling crew type availability and requirements.
- Added tests for crew type availability and unit set parsing in `crewType.test.ts`.
This commit is contained in:
2025-12-30 09:45:51 +00:00
parent e3bbbd3718
commit d599d94a7b
18 changed files with 1665 additions and 31 deletions
+5
View File
@@ -44,6 +44,7 @@ export interface GeneralRow {
crew: number;
crewTypeId: number;
train: number;
atmos: number;
age: number;
npcState: number;
meta: unknown;
@@ -79,12 +80,15 @@ export interface CityRow {
commerceMax: number;
security: number;
securityMax: number;
trust: number;
trade: number;
supplyState: number;
frontState: number;
defence: number;
defenceMax: number;
wall: number;
wallMax: number;
region: number;
meta: unknown;
}
@@ -95,6 +99,7 @@ export interface NationRow {
capitalCityId: number | null;
gold: number;
rice: number;
tech: number;
level: number;
typeCode: string;
meta: unknown;
+18 -2
View File
@@ -16,6 +16,7 @@ import {
evaluateConstraints,
FireAttackActionDefinition,
NationRestActionDefinition,
RecruitActionDefinition,
RestActionDefinition,
TalentScoutActionDefinition,
VolunteerRecruitActionDefinition,
@@ -324,6 +325,7 @@ const mapGeneralRow = (row: GeneralRow): General => ({
crew: row.crew,
crewTypeId: row.crewTypeId,
train: row.train,
atmos: row.atmos,
age: row.age,
npcState: row.npcState,
triggerState: {
@@ -354,7 +356,12 @@ const mapCityRow = (row: CityRow): City => ({
defenceMax: row.defenceMax,
wall: row.wall,
wallMax: row.wallMax,
meta: asTriggerRecord(row.meta),
meta: {
...asTriggerRecord(row.meta),
trust: row.trust,
trade: row.trade,
region: row.region,
},
});
const mapNationRow = (row: NationRow): Nation => ({
@@ -368,7 +375,10 @@ const mapNationRow = (row: NationRow): Nation => ({
power: 0,
level: row.level,
typeCode: row.typeCode,
meta: asTriggerRecord(row.meta),
meta: {
...asTriggerRecord(row.meta),
tech: row.tech,
},
});
const buildStateView = (
@@ -465,6 +475,12 @@ const buildEntries = (env: CommandEnv): {
reqArg: false,
args: {},
},
{
category: '내정',
definition: new RecruitActionDefinition(emptyModules, {}),
reqArg: true,
args: {},
},
{
category: '계략',
definition: new FireAttackActionDefinition(emptyModules, {