refactor(fight): 重构伤害效果初始化逻辑,分离状态效果与伤害效果注册

This commit is contained in:
1
2025-09-22 04:47:12 +00:00
parent 9ffe6abe31
commit be1816be8d
3 changed files with 55 additions and 40 deletions

View File

@@ -110,17 +110,25 @@ func (c *Input) GetProp(id int, istue bool) int {
return 0
}
func InitDamageEffect(id int, t Effect) {
NodeM[id+4000000] = t
}
func (c *Input) GetDamageEffect(id int) (Effect, bool) {
//todo 获取前GetEffect
ret, ok := NodeM[id+4000000]
return ret, ok
//todo 获取后GetEffect
}
func InitStatusEffect(id int, t Effect) {
NodeM[id+3000000] = t
}
func (c *Input) GetCurrAttr(id int) *model.PetInfo {
//todo 获取前GetEffect
return c.CurrentPet.Info
//todo 获取后GetEffect
}
func (c *Input) GetStatusEffect(id int) (Effect, bool) {
//todo 获取前GetEffect
@@ -129,6 +137,13 @@ func (c *Input) GetStatusEffect(id int) (Effect, bool) {
return ret, ok
//todo 获取后GetEffect
}
func (c *Input) GetCurrAttr(id int) *model.PetInfo {
//todo 获取前GetEffect
return c.CurrentPet.Info
//todo 获取后GetEffect
}
func getTypeName(v interface{}) string {
// 获取类型信息
t := reflect.TypeOf(v)