Files
bl/logic/service/fight/effect/effect_status.go
昔念 b90bceafd9 ```
feat(xmlres): 添加任务数据加载与初始化逻辑

在 xmlres 包中新增 TaskMap 用于存储任务数据,并在 initfile 函数中
加载 task.xml 文件内容。同时调整 login 控制器中的任务重置逻辑,根据
任务类型每日重置任务状态。修复 pet 控制器释放宠物时的数据更新问题。
战斗系统中增加 Effect 的 OnMiss 回调处理,并修正状态效果映射关系。
修复 PVP 邀
2025-10-20 23:59:49 +08:00

74 lines
1.6 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"
"github.com/shopspring/decimal"
)
// 施加一个基类effect
type EffectStatus struct {
node.EffectNode
Status info.EnumBattleStatus
}
type StatusNotSkill struct {
EffectStatus
}
// 不能出手
func (e *StatusNotSkill) Skill_Hit_Pre(input.Ctx) bool {
return false
}
// 扣血类
type DrainHP struct {
EffectStatus
}
func (e *DrainHP) Skill_Hit_Pre(input input.Ctx) bool {
input.DamageZone = &info.DamageZone{
Type: info.DamageType.True, //状态类扣除无法被减伤
Damage: decimal.NewFromUint64(uint64(e.Input.CurrentPet.Info.MaxHp)).
Div(decimal.NewFromInt(8)),
}
e.Input.Damage(input)
return true
}
// 被寄生种子 扣血类
type StatusDrainedHP struct {
DrainHP
}
func (e *StatusDrainedHP) Skill_Hit_Pre(input input.Ctx) bool {
e.DrainHP.Skill_Hit_Pre(input) //先调用父类扣血
//TODO 寄生种子 给对面回血待实现回血buff
// input.CurrentPet.Info.Hp = -e.Input.CurrentPet.Info.MaxHp / 8
return true
}
func init() {
//麻痹,疲惫,害怕,石化,都是无法行动
tt := func(t info.EnumBattleStatus, f *StatusNotSkill) {
f.Status = t
input.InitEffect(input.EffectType.Status, int(t), f)
}
input.InitEffect(input.EffectType.Status, int(info.PetStatus.DrainHP), &EffectStatus{}) //寄生种子
tt(info.PetStatus.Paralysis, &StatusNotSkill{})
tt(info.PetStatus.Tired, &StatusNotSkill{})
tt(info.PetStatus.Fear, &StatusNotSkill{})
tt(info.PetStatus.Petrified, &StatusNotSkill{})
}