refactor: add team effect

This commit is contained in:
hypercross 2026-04-15 15:21:44 +08:00
parent e5da41c1cb
commit 7472095822
3 changed files with 3 additions and 3 deletions

View File

@ -7,7 +7,7 @@
# brokenIntent: 防御被打空后改变的意图id多个意图则从中随机
# effects技能效果目标+buff/debuff/攻击/防御+数值/层数
enemy,id,nextIntents,brokenIntent,effects
@enemyDesert,string,@enemyIntentDesert[],@enemyIntentDesert[],['self' | 'player';@effectDesert;number][]
@enemyDesert,string,@enemyIntentDesert[],@enemyIntentDesert[],['self' | 'player' | 'team';@effectDesert;number][]
仙人掌怪,boost,boost;defend;defend,,[self;spike;1];[self;defend;4]
仙人掌怪,defend,attack,,[self;defend;8]

1 # 敌人行动状态机,敌人行动时会执行当前的意图,然后将意图变为下一个意图
7 # effects:技能效果,目标+buff/debuff/攻击/防御+数值/层数
8 enemy,id,nextIntents,brokenIntent,effects
9 @enemyDesert,string,@enemyIntentDesert[],@enemyIntentDesert[],['self' | 'player';@effectDesert;number][] @enemyDesert,string,@enemyIntentDesert[],@enemyIntentDesert[],['self' | 'player' | 'team';@effectDesert;number][]
10 仙人掌怪,boost,boost;defend;defend,,[self;spike;1];[self;defend;4]
11 仙人掌怪,defend,attack,,[self;defend;8]
12 仙人掌怪,attack,boost,,[player;attack;5]
13 蛇,poison,attack;attack,,[player;venom;1];[player;attack;4]

View File

@ -6,7 +6,7 @@ type EnemyIntentDesertTable = readonly {
readonly id: string;
readonly nextIntents: readonly EnemyIntentDesert[];
readonly brokenIntent: readonly EnemyIntentDesert[];
readonly effects: readonly ["self" | "player", EffectDesert, number];
readonly effects: readonly ["self" | "player" | "team", EffectDesert, number];
}[];
export type EnemyIntentDesert = EnemyIntentDesertTable[number];

View File

@ -231,7 +231,7 @@ describe('enemyIntentDesert.csv import', () => {
it('should have effects with target, effect ref, and value', () => {
for (const intent of enemyIntentDesertData) {
for (const [target, effect, value] of intent.effects) {
expect(target === 'self' || target === 'player').toBe(true);
expect(target === 'self' || target === 'player' || target === 'team').toBe(true);
expect(typeof effect === 'string' || typeof effect === 'object').toBe(true);
expect(typeof value).toBe('number');
}