반계 아이템 발동 누락과 특기 중첩 처리 수정

This commit is contained in:
2026-09-19 08:02:36 +00:00
parent d89bdc439f
commit e542a9beea
6 changed files with 228 additions and 6 deletions
@@ -1,7 +1,9 @@
import { createStatItemModule } from './base.js';
import type { ItemModule } from './types.js';
import { BaseWarUnitTrigger, WarTriggerCaller } from '@sammo-ts/logic/war/triggers.js';
import { che_반계발동, che_반계시도 } from '@sammo-ts/logic/war/triggers/che_반계.js';
export const itemModule: ItemModule = createStatItemModule({
const baseModule = createStatItemModule({
key: 'che_서적_07_사마법',
rawName: '사마법',
slot: 'book',
@@ -13,3 +15,18 @@ export const itemModule: ItemModule = createStatItemModule({
unique: true,
extraInfo: '[전투] 상대의 계략을 10% 확률로 되돌림',
});
export const itemModule: ItemModule = {
...baseModule,
getBattlePhaseTriggerList: (context) =>
context.unit
? new WarTriggerCaller(
new che_반계시도(
context.unit,
BaseWarUnitTrigger.TYPE_ITEM + BaseWarUnitTrigger.TYPE_DEDUP_TYPE_BASE * 207,
0.1
),
new che_반계발동(context.unit)
)
: null,
};
@@ -1,6 +1,6 @@
import { createStatItemModule } from './base.js';
import type { ItemModule } from './types.js';
import { WarTriggerCaller } from '@sammo-ts/logic/war/triggers.js';
import { BaseWarUnitTrigger, WarTriggerCaller } from '@sammo-ts/logic/war/triggers.js';
import { che_반계발동, che_반계시도 } from '@sammo-ts/logic/war/triggers/che_반계.js';
const baseModule = createStatItemModule({
@@ -19,5 +19,10 @@ const baseModule = createStatItemModule({
export const itemModule: ItemModule = {
...baseModule,
getBattlePhaseTriggerList: (context) =>
context.unit ? new WarTriggerCaller(new che_반계시도(context.unit, 0.1), new che_반계발동(context.unit)) : null,
context.unit
? new WarTriggerCaller(
new che_반계시도(context.unit, BaseWarUnitTrigger.TYPE_ITEM, 0.1),
new che_반계발동(context.unit)
)
: null,
};
@@ -2,6 +2,7 @@ import type { TraitModule } from '@sammo-ts/logic/actionModules/traits/types.js'
import { BaseWarUnitTrigger, WarTriggerCaller } from '@sammo-ts/logic/war/triggers.js';
import { che_의술발동, che_의술시도 } from '@sammo-ts/logic/war/triggers/che_의술.js';
import { che_저격발동, che_저격시도 } from '@sammo-ts/logic/war/triggers/che_저격.js';
import { che_반계발동, che_반계시도 } from '@sammo-ts/logic/war/triggers/che_반계.js';
import type { ItemModule } from './types.js';
export const createEventBattleTraitItemModule = (
@@ -56,6 +57,14 @@ export const createEventBattleTraitItemModule = (
new che_저격발동(context.unit, BaseWarUnitTrigger.TYPE_ITEM)
)
: null;
} else if (traitModule.key === 'che_반계') {
itemModule.getBattlePhaseTriggerList = (context) =>
context.unit
? new WarTriggerCaller(
new che_반계시도(context.unit, BaseWarUnitTrigger.TYPE_ITEM),
new che_반계발동(context.unit)
)
: null;
} else if (traitModule.key === 'che_의술') {
itemModule.getBattlePhaseTriggerList = (context) =>
context.unit
@@ -7,8 +7,9 @@ import type { WarUnit } from '@sammo-ts/logic/war/units.js';
export class che_반계시도 extends BaseWarUnitTrigger {
private readonly prob: number;
constructor(unit: WarUnit, prob = 0.4) {
super(unit, TriggerPriority.Body + 300);
constructor(unit: WarUnit, raiseType = BaseWarUnitTrigger.TYPE_NONE, prob = 0.4) {
// Ref는 특기와 아이템의 시도를 raiseType으로 구분하고 발동은 한 번만 합친다.
super(unit, TriggerPriority.Body + 300, raiseType);
this.prob = prob;
}