feat(field-skill): 新增驻场技能卡牌支持与属性计算逻辑

为CardConfig接口新增field字段用于配置驻场技能UUID数组
新增两个示例驻场光环卡牌
优化FieldSkillHelper统计场上技能卡牌的属性加成
调整SkillBoxComp逻辑:驻场技能隐藏剩余次数、跳过定期触发
This commit is contained in:
panFD
2026-06-04 21:21:34 +08:00
parent 998300f721
commit c1f1aea387
3 changed files with 46 additions and 5 deletions

View File

@@ -75,6 +75,8 @@ export class SkillBoxComp extends CCComp {
private keep_waves: number = 0;
/** 技能覆写参数自定义伤害、Buff等 */
private overrides?: SkillOverrides;
/** 驻场技能 UUID 列表 */
public field: number[] = [];
// ======================== 运行时状态 ========================
@@ -131,6 +133,7 @@ export class SkillBoxComp extends CCComp {
this.trigger_interval = config.t_inv ?? 0;
this.keep_waves = config.keep_waves ?? 0;
this.overrides = config.overrides;
this.field = config.field || [];
}
this.current_trigger_times = 0;
@@ -177,8 +180,12 @@ export class SkillBoxComp extends CCComp {
// 更新剩余次数标签
if (this.info_label) {
if (!this.is_instant) {
const remain = Math.max(0, this.trigger_times - this.current_trigger_times);
this.info_label.string = `${remain}`;
if (this.trigger_interval <= 0 && this.field && this.field.length > 0) {
this.info_label.string = ""; // 纯驻场技能不显示剩余次数
} else {
const remain = Math.max(0, this.trigger_times - this.current_trigger_times);
this.info_label.string = `${remain}`;
}
} else {
this.info_label.string = "";
}
@@ -189,7 +196,7 @@ export class SkillBoxComp extends CCComp {
let sprite = this.cd_mask.getComponent(Sprite);
if (sprite) {
if (this.is_instant || this.trigger_interval <= 0) {
sprite.fillRange = 0; // 无需冷却,直接归 0
sprite.fillRange = 0; // 无需冷却(包括驻场光环卡),直接归 0
} else {
sprite.fillRange = Math.max(0, 1 - (this.timer / this.trigger_interval));
}
@@ -284,6 +291,11 @@ export class SkillBoxComp extends CCComp {
if (!this.initialized || !this.in_combat || this.is_instant) return;
if (!smc.mission.play || smc.mission.pause) return;
// 如果是纯驻场光环技能且无触发间隔,则不执行定期触发逻辑
if (this.trigger_interval <= 0 && this.field && this.field.length > 0) {
return;
}
if (this.current_trigger_times < this.trigger_times) {
this.timer += dt;