feat(xmlres): 添加任务数据加载与初始化逻辑 在 xmlres 包中新增 TaskMap 用于存储任务数据,并在 initfile 函数中 加载 task.xml 文件内容。同时调整 login 控制器中的任务重置逻辑,根据 任务类型每日重置任务状态。修复 pet 控制器释放宠物时的数据更新问题。 战斗系统中增加 Effect 的 OnMiss 回调处理,并修正状态效果映射关系。 修复 PVP 邀
62 lines
1.3 KiB
Go
62 lines
1.3 KiB
Go
package node
|
|
|
|
import (
|
|
"blazing/logic/service/fight/info"
|
|
"blazing/logic/service/fight/input"
|
|
)
|
|
|
|
func (e *EffectNode) Skill_Pre(ctx input.Ctx) bool {
|
|
return true
|
|
}
|
|
func (e *EffectNode) Calculate_Pre(ctx input.Ctx) bool {
|
|
return true
|
|
}
|
|
|
|
func (e *EffectNode) Skill_Hit_Pre(ctx input.Ctx) bool {
|
|
return true
|
|
}
|
|
func (e *EffectNode) Skill_Hit(ctx input.Ctx) bool {
|
|
return true
|
|
}
|
|
func (e *EffectNode) Skill_Hit_to(ctx input.Ctx) bool {
|
|
return true
|
|
}
|
|
func (e *EffectNode) OnSkill(ctx input.Ctx) bool {
|
|
if e.Effect != nil {
|
|
if e.Hit() { //没命中
|
|
e.Effect.OnHit(ctx.Input, ctx.SkillEntity)
|
|
} else {
|
|
e.Effect.OnMiss(ctx.Input, ctx.SkillEntity)
|
|
}
|
|
}
|
|
return true
|
|
}
|
|
|
|
func (e *EffectNode) Skill_Can(ctx input.Ctx) bool {
|
|
|
|
return e.Input.CurrentPet.HP != 0
|
|
}
|
|
|
|
func (e *EffectNode) Skill_Use(ctx input.Ctx) bool {
|
|
return true
|
|
}
|
|
func (e *EffectNode) Skill_Useed(ctx input.Ctx) bool {
|
|
if e.Effect != nil {
|
|
if e.Input.CurrentPet.Info.Hp == 0 {
|
|
e.OnDefeat(ctx.Input, ctx.SkillEntity) //死亡
|
|
|
|
} else {
|
|
e.OnAlive(ctx.Input, ctx.SkillEntity) //存活
|
|
}
|
|
|
|
}
|
|
return true
|
|
}
|
|
|
|
type Effect interface {
|
|
OnMiss(opp *input.Input, skill *info.SkillEntity)
|
|
OnHit(opp *input.Input, skill *info.SkillEntity)
|
|
OnDefeat(opp *input.Input, skill *info.SkillEntity) bool //如果需要死亡
|
|
OnAlive(opp *input.Input, skill *info.SkillEntity) bool //如果需要存活
|
|
}
|