Files
bl/logic/service/fight/effect/effect_34.go
昔念 6ba9c3549c feat(fight): 优化精灵切换逻辑与技能效果处理
- 修改 `ChangePet` 方法,记录初始攻击值并在切换时正确传递
- 简化多个 effect 的初始化方式,移除冗余的 `EffectNode` 字段
- 增强 Effect58 和 Effect67 的逻辑判断,增加空指针检查和类型判断
- 引入 decimal 包用于精确血量计算
- 统一 `Switch` 接口参数,增强状态类和节点类的兼容性
- 修正部分技能效果的触发条件和持续时间设置
- 调整回合结束逻辑,注释掉原有后手增益机制
2025-11-13 23:06:55 +08:00

57 lines
994 B
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"
)
/**
* 将所受的伤害n倍反馈给对手
*/
func init() {
input.InitEffect(input.EffectType.Skill, 34, &Effect34{})
}
type Effect34 struct {
node.EffectNode
can bool
}
// 使用技能时不可被继承继承Miss和Hit就行
func (e *Effect34) OnSkill() bool {
if !e.Hit() {
return true
}
e.can = true
return true
}
// 被攻击时候反弹
func (e *Effect34) Skill_Use_ex() bool {
if !e.can {
return true
}
//不是技能
if e.Ctx().SkillEntity == nil {
return true
}
// //0血不触发
// if e.Input.CurrentPet.Info.Hp <= 0 {
// return true
// }
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: decimal.NewFromInt(int64(e.Ctx().Opp.DamageZone.Damage.IntPart())).Sub(decimal.NewFromInt(int64(e.SideEffectArgs[0]))),
})
return true
}