merge: 최신 main 변경을 NPC 삭턴 사망 복구에 통합

This commit is contained in:
2026-08-21 04:52:41 +00:00
18 changed files with 456 additions and 32 deletions
@@ -55,6 +55,18 @@ describe('Ref event domestic traits', () => {
expect(eventMusang!.getWarPowerMultiplier?.(context, unit, unit)).toEqual([1, 1]);
});
it('applies the persisted victory count to the ordinary 무쌍 battle multiplier', async () => {
const musang = await new WarTraitLoader().load('che_무쌍');
const unit = {
getGeneral: () => ({ meta: { rank_killnum: 40 } }),
} as unknown as WarUnit;
const context = { unit } as unknown as WarActionContext;
const multiplier = musang.getWarPowerMultiplier?.(context, unit, unit);
expect(multiplier?.[0]).toBeCloseTo(1.2, 12);
expect(multiplier?.[1]).toBeCloseTo(0.92, 12);
});
it('keeps event and ordinary 견고 injury-prevention triggers distinct by raise type', async () => {
const [eventGyeongo] = await loadEventDomesticTraitModules(['che_event_견고']);
const canonical = await new WarTraitLoader().load('che_견고');
+57
View File
@@ -224,6 +224,63 @@ describe('war triggers', () => {
expect(general.atmos).toBeCloseTo(115.5, 12);
});
it('accumulates battle, victory, loss, and casualty records on the persisted rank meta keys', () => {
const attacker = buildGeneral(80);
attacker.meta = { ...attacker.meta, rank_warnum: 2, rank_killnum: 3, rank_killcrew: 400 };
const defender = {
...buildGeneral(70),
id: 2,
name: 'Defender',
nationId: 2,
meta: { ...buildGeneral(70).meta, rank_warnum: 4, rank_deathnum: 1, rank_deathcrew: 500 },
};
const crewType = new WarCrewType(buildUnitSet().crewTypes![0]!);
const attackerUnit = new WarUnitGeneral(
new RandUtil(new ConstantRNG(0)),
buildConfig(),
attacker,
buildCity(),
buildNation(),
true,
crewType,
new ActionLogger({ generalId: attacker.id, nationId: attacker.nationId }),
new WarActionPipeline([])
);
const defenderUnit = new WarUnitGeneral(
new RandUtil(new ConstantRNG(0)),
buildConfig(),
defender,
{ ...buildCity(), nationId: 2 },
{ ...buildNation(), id: 2 },
false,
crewType,
new ActionLogger({ generalId: defender.id, nationId: defender.nationId }),
new WarActionPipeline([])
);
attackerUnit.setOppose(defenderUnit);
defenderUnit.setOppose(attackerUnit);
attackerUnit.increaseKilled(120);
defenderUnit.decreaseHP(120);
attackerUnit.addWin();
defenderUnit.addLose();
attackerUnit.finishBattle();
defenderUnit.finishBattle();
expect(attacker.meta).toMatchObject({
rank_warnum: 3,
rank_killnum: 4,
rank_killcrew: 520,
rank_killcrew_person: 120,
});
expect(defender.meta).toMatchObject({
rank_warnum: 5,
rank_deathnum: 2,
rank_deathcrew: 620,
rank_deathcrew_person: 120,
});
});
it('updates the legacy experience level and applies item experience modifiers immediately', () => {
const general = buildGeneral(80);
general.experience = 90;