2025-09-29 02:40:35 +08:00
|
|
|
package node
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"blazing/logic/service/fight/info"
|
|
|
|
|
"blazing/logic/service/fight/input"
|
|
|
|
|
)
|
|
|
|
|
|
2025-09-30 18:32:15 +08:00
|
|
|
func (e *EffectNode) Skill_Pre(ctx input.Ctx) bool {
|
|
|
|
|
return true
|
2025-09-29 02:40:35 +08:00
|
|
|
}
|
2025-10-05 00:29:22 +08:00
|
|
|
func (e *EffectNode) Calculate_Pre(ctx input.Ctx) bool {
|
2025-09-30 18:32:15 +08:00
|
|
|
return true
|
2025-09-29 02:40:35 +08:00
|
|
|
}
|
|
|
|
|
|
2025-10-05 00:29:22 +08:00
|
|
|
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
|
|
|
|
|
}
|
2025-09-30 18:32:15 +08:00
|
|
|
func (e *EffectNode) OnSkill(ctx input.Ctx) bool {
|
2025-09-29 02:40:35 +08:00
|
|
|
if e.Effect != nil {
|
|
|
|
|
if e.Hit() { //没命中
|
|
|
|
|
e.OnHit(ctx.Input, ctx.SkillEntity)
|
|
|
|
|
} else {
|
|
|
|
|
e.OnMiss(ctx.Input, ctx.SkillEntity)
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-09-30 18:32:15 +08:00
|
|
|
return true
|
2025-09-29 02:40:35 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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 //如果需要存活
|
|
|
|
|
}
|