feat: add killturn to general meta and update related tests

- Introduced a new meta property `killturn` to the GeneralMeta interface.
- Implemented a function `readMetaNumber` to handle the retrieval of numeric values from meta.
- Updated the `mapGeneralRow` function to ensure `killturn` is required and properly handled.
- Modified various tests to include the `killturn` property in the general's meta data.
- Adjusted related action files to utilize the new GeneralMeta type for better type safety.
- Ensured backward compatibility by updating existing test cases across multiple scenarios.
This commit is contained in:
2026-01-25 05:48:56 +00:00
parent 340cadb8ce
commit 5d5ed9ee2a
39 changed files with 164 additions and 99 deletions
+11 -2
View File
@@ -1,4 +1,11 @@
import type { City, General, GeneralTriggerState, Nation, TriggerValue } from '@sammo-ts/logic/domain/entities.js';
import type {
City,
General,
GeneralMeta,
GeneralTriggerState,
Nation,
TriggerValue,
} from '@sammo-ts/logic/domain/entities.js';
import type { ScenarioDefinition, ScenarioGeneral } from '@sammo-ts/logic/scenario/types.js';
import type {
CitySeed,
@@ -56,6 +63,7 @@ const DEFAULT_NEUTRAL_NATION_COLOR = '#000000';
const DEFAULT_GENERAL_GOLD = 1000;
const DEFAULT_GENERAL_RICE = 1000;
const DEFAULT_CREWTYPE_ID = 1100;
const DEFAULT_GENERAL_KILLTURN = 24;
const DEFAULT_CITY_TRUST = 50;
const DEFAULT_CITY_TRADE = 100;
const DEFAULT_CITY_SUPPLY_STATE = 1;
@@ -290,7 +298,8 @@ const buildGeneralSeeds = (
};
seeds.push(seed);
const generalMeta: Record<string, TriggerValue> = {
const generalMeta: GeneralMeta = {
killturn: DEFAULT_GENERAL_KILLTURN,
npcType,
crewTypeId: defaultCrewTypeId,
};