feat(skill): add summon_count config for skill summon count
1. 新增SkillConfig和SkillOverrides中的summon_count字段,用于配置单次施法召唤的技能实体个数 2. 重构SCastSystem的resolveSummonCount方法,优先使用配置中的summon_count,再回退到prefab配置 3. 调整注释说明,明确配置优先级和回退逻辑
This commit is contained in:
@@ -158,6 +158,7 @@ export interface SkillConfig {
|
||||
buff_value?: number, // 覆写计时 buff 的修饰数值(modifiers.value / tick.damage_or_heal),由药水卡自定义档位
|
||||
buff_duration?: number, // 覆写计时 buff 的持续时间(秒),不配置则用 BuffList 默认值
|
||||
call_hero?: number, // 召唤技能召唤英雄id(可选)
|
||||
summon_count?: number, // 单次施法召唤的技能实体个数(未配置时回退 prefab 上 SkillView.summon_count)
|
||||
is_accel?: boolean, // 是否逐渐加速飞行
|
||||
info: string, // 技能描述
|
||||
}
|
||||
@@ -178,6 +179,8 @@ export interface SkillOverrides {
|
||||
buff_value?: number;
|
||||
buff_duration?: number;
|
||||
call_hero?: number;
|
||||
/** 单次施法召唤的技能实体个数(覆盖 prefab 上 SkillView.summon_count;>1 视为召唤类,不再参与风怒等额外触发) */
|
||||
summon_count?: number;
|
||||
is_accel?: boolean;
|
||||
/** 单次施法额外释放次数(0=单次,1=双发,2=三发;弹道由 resolveRepeatCastTargetPos 分散上/中/下三路) */
|
||||
num?: number;
|
||||
|
||||
@@ -201,10 +201,14 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
|
||||
private summonCountCache: Map<string, number> = new Map();
|
||||
|
||||
/**
|
||||
* 解析技能 prefab 上 SkillView.summon_count 配置的单次施法召唤数量。
|
||||
* 仅使用已缓存的 prefab(oops.res.get 同步命中),未加载时回退 1(单体),不引入异步等待。
|
||||
* 解析单次施法的召唤数量。
|
||||
* 优先级:合并后配置上的 summon_count(heroSet overrides 可覆写) > prefab 上 SkillView.summon_count。
|
||||
* prefab 回退路径仅使用已缓存的资源(oops.res.get 同步命中),未加载时回退 1(单体),不引入异步等待。
|
||||
*/
|
||||
private resolveSummonCount(config: SkillConfig): number {
|
||||
if (typeof config.summon_count === "number") {
|
||||
return Math.max(1, Math.floor(config.summon_count));
|
||||
}
|
||||
const cached = this.summonCountCache.get(config.sp_name);
|
||||
if (cached !== undefined) return cached;
|
||||
const path = `game/skill/atk/${config.sp_name}`;
|
||||
|
||||
Reference in New Issue
Block a user