feat: add special action modules for domestic and war triggers
- Implemented '발명' and '인덕' domestic special action modules with modifiers for technology research and population management. - Added '의술' and '징병' war special action modules to enhance healing and recruitment capabilities during battles. - Created a general trigger for city healing in '의술' and integrated it with the war action pipeline. - Developed a comprehensive registry and loader for special action modules to streamline their usage in the game logic. - Enhanced test coverage for special action modules, ensuring correct application of modifiers and trigger functionalities.
This commit is contained in:
@@ -14,10 +14,6 @@ import { LogFormat } from '../logging/types.js';
|
||||
import { buildCrewTypeIndex as buildCrewTypeDefinitionIndex } from '../world/unitSet.js';
|
||||
import { WarActionPipeline } from './actions.js';
|
||||
import { WarCrewType } from './crewType.js';
|
||||
import {
|
||||
ChePilsalActivateTrigger,
|
||||
ChePilsalAttemptTrigger,
|
||||
} from './triggersChePilsal.js';
|
||||
import {
|
||||
WarTriggerCaller,
|
||||
createWarTriggerEnv,
|
||||
@@ -84,7 +80,12 @@ const appendCrewTypeTriggers = (
|
||||
continue;
|
||||
}
|
||||
const trigger = factory(unit);
|
||||
if (trigger) {
|
||||
if (!trigger) {
|
||||
continue;
|
||||
}
|
||||
if (trigger instanceof WarTriggerCaller) {
|
||||
caller.merge(trigger);
|
||||
} else {
|
||||
caller.append(trigger);
|
||||
}
|
||||
}
|
||||
@@ -109,8 +110,7 @@ const buildBattlePhaseTriggers = (
|
||||
): WarTriggerCaller => {
|
||||
const caller = new WarTriggerCaller();
|
||||
if (unit instanceof WarUnitGeneral) {
|
||||
caller.append(new ChePilsalAttemptTrigger(unit));
|
||||
caller.append(new ChePilsalActivateTrigger(unit));
|
||||
appendCrewTypeTriggers(caller, unit, ['che_필살'], registry);
|
||||
const context = unit.getActionContext();
|
||||
caller.merge(unit.getActionPipeline().getBattlePhaseTriggerList(context));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user