feat: eslint 적용 및 관련 코드 일괄 수정
This commit is contained in:
@@ -54,15 +54,8 @@ class ActivateTrigger extends BaseWarUnitTrigger {
|
||||
}
|
||||
selfEnv['치료발동'] = true;
|
||||
|
||||
oppose
|
||||
.getLogger()
|
||||
.pushGeneralBattleDetailLog(
|
||||
'상대가 <R>치료</>했다!',
|
||||
LogFormat.PLAIN
|
||||
);
|
||||
self
|
||||
.getLogger()
|
||||
.pushGeneralBattleDetailLog('<C>치료</>했다!', LogFormat.PLAIN);
|
||||
oppose.getLogger().pushGeneralBattleDetailLog('상대가 <R>치료</>했다!', LogFormat.PLAIN);
|
||||
self.getLogger().pushGeneralBattleDetailLog('<C>치료</>했다!', LogFormat.PLAIN);
|
||||
|
||||
oppose.multiplyWarPowerMultiply(0.7);
|
||||
if (self instanceof WarUnitGeneral) {
|
||||
@@ -79,9 +72,5 @@ export const triggerModule: WarTriggerModule = {
|
||||
key: 'che_의술',
|
||||
name: '의술',
|
||||
info: '[전투] 페이즈마다 치료 발동(아군 피해 30% 감소, 부상 회복)',
|
||||
createTriggerList: (unit) =>
|
||||
new WarTriggerCaller(
|
||||
new AttemptTrigger(unit),
|
||||
new ActivateTrigger(unit)
|
||||
),
|
||||
createTriggerList: (unit) => new WarTriggerCaller(new AttemptTrigger(unit), new ActivateTrigger(unit)),
|
||||
};
|
||||
|
||||
@@ -11,14 +11,7 @@ export class CheSnipingAttemptTrigger extends BaseWarUnitTrigger {
|
||||
private readonly woundMax: number;
|
||||
private readonly addAtmos: number;
|
||||
|
||||
constructor(
|
||||
unit: WarUnit,
|
||||
raiseType: number,
|
||||
ratio: number,
|
||||
woundMin: number,
|
||||
woundMax: number,
|
||||
addAtmos = 20
|
||||
) {
|
||||
constructor(unit: WarUnit, raiseType: number, ratio: number, woundMin: number, woundMax: number, addAtmos = 20) {
|
||||
super(unit, TriggerPriority.Pre + 100, raiseType);
|
||||
this.ratio = ratio;
|
||||
this.woundMin = woundMin;
|
||||
@@ -85,27 +78,12 @@ export class CheSnipingActivateTrigger extends BaseWarUnitTrigger {
|
||||
|
||||
if (oppose instanceof WarUnitGeneral) {
|
||||
self.getLogger().pushGeneralActionLog('상대를 <C>저격</>했다!', LogFormat.PLAIN);
|
||||
self.getLogger().pushGeneralBattleDetailLog(
|
||||
'상대를 <C>저격</>했다!',
|
||||
LogFormat.PLAIN
|
||||
);
|
||||
oppose.getLogger().pushGeneralActionLog(
|
||||
'상대에게 <R>저격</>당했다!',
|
||||
LogFormat.PLAIN
|
||||
);
|
||||
oppose.getLogger().pushGeneralBattleDetailLog(
|
||||
'상대에게 <R>저격</>당했다!',
|
||||
LogFormat.PLAIN
|
||||
);
|
||||
self.getLogger().pushGeneralBattleDetailLog('상대를 <C>저격</>했다!', LogFormat.PLAIN);
|
||||
oppose.getLogger().pushGeneralActionLog('상대에게 <R>저격</>당했다!', LogFormat.PLAIN);
|
||||
oppose.getLogger().pushGeneralBattleDetailLog('상대에게 <R>저격</>당했다!', LogFormat.PLAIN);
|
||||
} else {
|
||||
self.getLogger().pushGeneralActionLog(
|
||||
'성벽 수비대장을 <C>저격</>했다!',
|
||||
LogFormat.PLAIN
|
||||
);
|
||||
self.getLogger().pushGeneralBattleDetailLog(
|
||||
'성벽 수비대장을 <C>저격</>했다!',
|
||||
LogFormat.PLAIN
|
||||
);
|
||||
self.getLogger().pushGeneralActionLog('성벽 수비대장을 <C>저격</>했다!', LogFormat.PLAIN);
|
||||
self.getLogger().pushGeneralBattleDetailLog('성벽 수비대장을 <C>저격</>했다!', LogFormat.PLAIN);
|
||||
}
|
||||
|
||||
const addAtmos = Number(selfEnv['addAtmos'] ?? 0);
|
||||
@@ -115,8 +93,7 @@ export class CheSnipingActivateTrigger extends BaseWarUnitTrigger {
|
||||
const woundMin = Number(selfEnv['woundMin'] ?? 10);
|
||||
const woundMax = Number(selfEnv['woundMax'] ?? 80);
|
||||
oppose.getGeneral().injury = clamp(
|
||||
oppose.getGeneral().injury +
|
||||
self.rng.nextRangeInt(woundMin, woundMax),
|
||||
oppose.getGeneral().injury + self.rng.nextRangeInt(woundMin, woundMax),
|
||||
0,
|
||||
80
|
||||
);
|
||||
|
||||
@@ -53,12 +53,8 @@ class ActivateTrigger extends BaseWarUnitTrigger {
|
||||
}
|
||||
selfEnv['필살발동'] = true;
|
||||
|
||||
oppose
|
||||
.getLogger()
|
||||
.pushGeneralBattleDetailLog('상대의 <R>필살</>공격!</>', LogFormat.PLAIN);
|
||||
self
|
||||
.getLogger()
|
||||
.pushGeneralBattleDetailLog('<C>필살</>공격!</>', LogFormat.PLAIN);
|
||||
oppose.getLogger().pushGeneralBattleDetailLog('상대의 <R>필살</>공격!</>', LogFormat.PLAIN);
|
||||
self.getLogger().pushGeneralBattleDetailLog('<C>필살</>공격!</>', LogFormat.PLAIN);
|
||||
|
||||
self.multiplyWarPowerMultiply(self.criticalDamage());
|
||||
return true;
|
||||
@@ -69,9 +65,5 @@ export const triggerModule: WarTriggerModule = {
|
||||
key: 'che_필살',
|
||||
name: '필살',
|
||||
info: '[전투] 페이즈마다 확률로 필살 발동',
|
||||
createTriggerList: (unit) =>
|
||||
new WarTriggerCaller(
|
||||
new AttemptTrigger(unit),
|
||||
new ActivateTrigger(unit)
|
||||
),
|
||||
createTriggerList: (unit) => new WarTriggerCaller(new AttemptTrigger(unit), new ActivateTrigger(unit)),
|
||||
};
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
import type { WarTriggerModule, WarTriggerModuleExport } from './types.js';
|
||||
import type { WarTriggerRegistry } from '@sammo-ts/logic/war/triggers.js';
|
||||
|
||||
export const WAR_TRIGGER_KEYS = [
|
||||
'che_필살',
|
||||
'che_의술',
|
||||
] as const;
|
||||
export const WAR_TRIGGER_KEYS = ['che_필살', 'che_의술'] as const;
|
||||
|
||||
export type WarTriggerKey =
|
||||
(typeof WAR_TRIGGER_KEYS)[number];
|
||||
export type WarTriggerKey = (typeof WAR_TRIGGER_KEYS)[number];
|
||||
|
||||
export type WarTriggerImporter = () => Promise<WarTriggerModuleExport>;
|
||||
|
||||
@@ -22,9 +18,7 @@ export const isWarTriggerKey = (value: string): value is WarTriggerKey =>
|
||||
export class WarTriggerLoader {
|
||||
private readonly cache = new Map<WarTriggerKey, Promise<WarTriggerModule>>();
|
||||
|
||||
constructor(
|
||||
private readonly importers: Record<WarTriggerKey, WarTriggerImporter> = defaultImporters
|
||||
) {}
|
||||
constructor(private readonly importers: Record<WarTriggerKey, WarTriggerImporter> = defaultImporters) {}
|
||||
|
||||
async load(key: WarTriggerKey): Promise<WarTriggerModule> {
|
||||
const cached = this.cache.get(key);
|
||||
@@ -41,9 +35,7 @@ export class WarTriggerLoader {
|
||||
}
|
||||
const resolved = module.triggerModule;
|
||||
if (resolved.key !== key) {
|
||||
throw new Error(
|
||||
`War trigger key mismatch: expected ${key}, got ${resolved.key}`
|
||||
);
|
||||
throw new Error(`War trigger key mismatch: expected ${key}, got ${resolved.key}`);
|
||||
}
|
||||
return resolved;
|
||||
});
|
||||
@@ -68,9 +60,7 @@ export const loadWarTriggerModules = async (
|
||||
return modules;
|
||||
};
|
||||
|
||||
export const createWarTriggerRegistry = (
|
||||
modules: WarTriggerModule[]
|
||||
): WarTriggerRegistry => {
|
||||
export const createWarTriggerRegistry = (modules: WarTriggerModule[]): WarTriggerRegistry => {
|
||||
const registry: WarTriggerRegistry = {};
|
||||
for (const module of modules) {
|
||||
registry[module.key] = (unit) => module.createTriggerList(unit);
|
||||
|
||||
Reference in New Issue
Block a user