Files
bl/logic/service/fight/boss/NewSeIdx_23.go
昔念 f15f08189f feat(effect): 实现多个新技能效果逻辑
新增了多个宠物战斗中的技能效果实现,包括伤害反弹、必杀技增强、先手权调整、
回复机制以及特殊条件触发逻辑。同时修复了部分技能判断条件与执行顺序问题,
优化了 AI 在 NPC 战斗中的行为表现,并完善了相关配置文件内容。
2025-11-26 18:39:23 +08:00

61 lines
1.4 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/action"
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"math"
"github.com/shopspring/decimal"
)
// 23. 自身体力降到N以下时, 每次(针对多宠)攻击必定秒杀对方, 且必定先手;a1: high 16, a2: low 16
// TODO: 实现自身体力降到N以下时, 每次(针对多宠)攻击必定秒杀对方, 且必定先手;a1: high 16, a2: low 16的核心逻辑
type NewSel23 struct {
NewSel0
}
func (e *NewSel23) Compare_Pre(fattack *action.SelectSkillAction, sattack *action.SelectSkillAction) bool {
if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime {
return true
}
if fattack == nil {
return true
}
//先手是自己
if fattack.PlayerID == e.Ctx().Our.UserID {
return true
}
if sattack == nil {
return true
}
if sattack.SkillEntity == nil {
return true
}
full32 := int(e.Args()[0])<<16 | int(e.Args()[1])
if int(e.Ctx().Our.CurrentPet.Info.Hp) <= full32 {
sattack.SkillEntity.Priority = math.MaxInt
}
return true
}
func (e *NewSel23) OnSkill() bool {
full32 := int(e.Args()[0])<<16 | int(e.Args()[1])
if int(e.Ctx().Our.CurrentPet.Info.Hp) <= full32 {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Red,
Damage: decimal.NewFromInt(int64(e.Ctx().Opp.GetPetInfo().Info.MaxHp)),
})
}
return true
}
func init() {
input.InitEffect(input.EffectType.NewSel, 23, &NewSel23{})
}