diff --git a/logic/service/fight/boss/NewSeIdx_403.go b/logic/service/fight/boss/NewSeIdx_403.go index a03abeb2..c43b4f9b 100644 --- a/logic/service/fight/boss/NewSeIdx_403.go +++ b/logic/service/fight/boss/NewSeIdx_403.go @@ -1,6 +1,7 @@ package effect import ( + "blazing/logic/service/fight/info" "blazing/logic/service/fight/input" ) @@ -8,6 +9,8 @@ import ( // TODO: 需要实现一个持续伤害的状态效果 type NewSel403 struct { NewSel0 + // 记录剩余减伤回合数 + remainingTurns int } func (e *NewSel403) ActionEndEx() bool { @@ -15,31 +18,28 @@ func (e *NewSel403) ActionEndEx() bool { if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime { return true } + if e.remainingTurns > 0 { + e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{ + Type: info.DamageType.Fixed, + Damage: e.Args()[2], + }) + } // n%几率触发 success, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100) if !success { return true } + e.remainingTurns = int(e.Args()[1].IntPart()) - // 创建持续伤害的状态效果 - // 这里使用ID 0来创建自定义持续效果,m回合 - statusEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, 0) - if statusEffect == nil { - return true - } - - // 设置参数:回合数=a2,每回合扣血=a3 - statusEffect.SetArgs(e.Ctx().Opp, - int(e.Args()[1].IntPart()), // 持续回合数 - int(e.Args()[2].IntPart()), // 每回合减少的体力 - ) - - // 给对手添加状态 - e.Ctx().Opp.AddEffect(e.Ctx().Opp, statusEffect) return true } - +func (e *NewSel403) TurnEnd() { + // 每回合减少减伤效果剩余回合数 + if e.remainingTurns > 0 { + e.remainingTurns-- + } +} func init() { input.InitEffect(input.EffectType.NewSel, 403, &NewSel403{}) }