feat: 实现药水卡限时强化功能,支持自定义数值覆写
1. 新增Buff数值覆写机制,支持药水卡自定义buff效果数值 2. 重构属性计算逻辑,支持读取药水卡传递的覆写值 3. 新增多组限时强化Buff与药水卡配置 4. 优化UI数值显示,实时展示最终属性值 5. 新增多维度调试日志方便排查问题
This commit is contained in:
@@ -166,10 +166,10 @@ export class SkillBoxComp extends CCComp {
|
||||
* @param uuid 卡牌 UUID
|
||||
* @param card_lv 技能卡等级
|
||||
*/
|
||||
init(uuid: number, card_lv: number) {
|
||||
init(uuid: number, card_lv: number, overrides?: SkillOverrides) {
|
||||
this.card_lv = card_lv;
|
||||
|
||||
// 查询触发配置
|
||||
// 查询触发配置(药水卡不在 SkillCardList,会走 else 分支)
|
||||
const config = SkillCardList.find(c => c.uuid === uuid);
|
||||
if (config) {
|
||||
this.s_uuid = config.skill ?? uuid; // 获取实际的技能 UUID
|
||||
@@ -177,14 +177,18 @@ export class SkillBoxComp extends CCComp {
|
||||
this.trigger_times = config.t_times ?? 1;
|
||||
this.trigger_interval = config.t_inv ?? 0;
|
||||
this.keep_waves = config.keep_waves ?? 0;
|
||||
this.overrides = config.overrides;
|
||||
this.overrides = overrides ?? config.overrides; // 外部透传(药水卡)优先
|
||||
this.field = config.field || [];
|
||||
this.card_icon = config.icon; // 保存卡牌自定义图标(优先级最高)
|
||||
// 读取触发类型与上限(兜底默认值,避免 undefined)
|
||||
this.trigger_type = config.trigger_type ?? CardTriggerType.Instant;
|
||||
this.trigger_limit = config.trigger_limit ?? Infinity;
|
||||
} else {
|
||||
// 药水卡等:uuid 即技能 id,触发类型默认 Instant(即时生效一次)
|
||||
this.s_uuid = uuid;
|
||||
this.overrides = overrides;
|
||||
this.trigger_type = CardTriggerType.Instant;
|
||||
this.trigger_times = 1;
|
||||
}
|
||||
|
||||
this.current_trigger_times = 0;
|
||||
|
||||
Reference in New Issue
Block a user