Files
bl/logic/service/fight/boss/NewSeIdx_1.go
昔念 6455455992 feat(fight): 增加Boss精灵特效索引解析与空列表校验
在挑战Boss逻辑中,新增对Boss怪物NewSeIdxs字段的解析,将其分割并转换为EffectInfo添加到宠物信息中。同时增加对PetList为空时的错误处理,返回精灵不存在错误码。

refactor(effect): 调整技能属性判断方式及方法命名

将部分战斗效果和技能实体中的Type()方法重命名为GetType(),统一接口调用方式,并修改属性类型比较逻辑,直接通过整型值进行判断,提升代码一致性与可维护性。

fix(xml): 补充地图Boss配置项Id字段

更新地图配置文件中Boss节点缺失的Id属性,确保Boss数据结构完整性和唯一标识正确加载。

chore(input): 增加技能实体非空检查防止panic

在输入处理模块中加入对SelectSkillAction.SkillEntity的空指针检查,避免因未初始化技能导致运行时异常。
2025-11-25 18:25:52 +08:00

50 lines
1.2 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
// 基类特性
// 特性的ID=PET cacthtime+eid 这样保证不重复
type NewSel0 struct {
node.EffectNode
//Catchtime int //保存精灵的唯一指令,保证在上场时候正确注入
//Hide bool //是否隐藏 ,所属精灵下场后特性就应该消失
//如果2只精灵一个特性怎么办每次切精灵注入特性
}
// 重写回合结束效果,特性都是无线回合类的
// 次数类本质上也是这种
// 特性,无法被切精灵消除
func (e *NewSel0) Switch(in *input.Input, at info.AttackValue, outpet *info.BattlePetEntity) bool {
return true
}
// 免疫"能力(battle_lv)下降"
type NewSel1 struct {
NewSel0
}
func (e *NewSel1) BeferProp(in *input.Ctx, prop, level int8, ptype info.EnumAbilityOpType) bool {
//魂印特性有不在场的情况,绑定时候将精灵和特性绑定
if e.EffectIDCombiner.CatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime {
return true
}
//能力下降类
if level > 0 && ptype == info.AbilityOpType.SUB {
return false
}
return true
}
func init() {
input.InitEffect(input.EffectType.NewSel, 1, &NewSel1{})
}