Files
bl/logic/service/fight/effect/951_955.go
昔念 5675fff48c ```
docs(effect): 移除已完成的效果任务文档

移除effects 876-1061范围内的任务文档,这些effect已经实现或不再需要跟踪。
包括task-053至task-089的多个任务列表,涵盖各种战斗效果的实现说明。
```
2026-03-31 20:02:25 +08:00

164 lines
4.0 KiB
Go

package effect
import (
"blazing/logic/service/fight/action"
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/alpacahq/alpacadecimal"
)
// Effect 951: 反转对手能力提升状态,反转成功则己方免疫下{0}次受到的异常状态
type Effect951 struct{ node.EffectNode }
func (e *Effect951) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
reversed := false
for i, v := range e.Ctx().Opp.Prop[:] {
if v <= 0 {
continue
}
if e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), -2*v) {
reversed = true
}
}
if !reversed {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 951, int(e.Args()[0].IntPart()))
if sub != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect951Sub struct {
node.EffectNode
remaining int
}
func (e *Effect951Sub) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.Duration(-1)
if len(a) > 0 {
e.remaining = a[0]
}
}
func (e *Effect951Sub) EFFect_Befer(in *input.Input, effEffect input.Effect) bool {
if e.remaining <= 0 {
e.Alive(false)
return true
}
if in != e.Ctx().Opp || !input.IS_Stat(effEffect) {
return true
}
e.remaining--
if e.remaining <= 0 {
e.Alive(false)
}
return false
}
// Effect 952: 全属性+{0},若对手处于能力下降状态则效果翻倍
type Effect952 struct{ node.EffectNode }
func (e *Effect952) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
boost := int8(e.Args()[0].IntPart())
if e.Ctx().Opp.HasPropSub() {
boost *= 2
}
applyAllPropUp(e.Ctx().Our, boost)
return true
}
// Effect 953: {0}回合恢复最大体力的1/{1},体力低于{2}%时先制+{3}
type Effect953 struct{ RoundEffectArg0Base }
func (e *Effect953) TurnEnd() {
if len(e.Args()) < 2 || e.Args()[1].Cmp(alpacadecimal.Zero) <= 0 {
e.EffectNode.TurnEnd()
return
}
heal := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[1])
if heal.Cmp(alpacadecimal.Zero) > 0 {
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal)
}
e.EffectNode.TurnEnd()
}
func (e *Effect953) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
if len(e.Args()) < 4 {
return true
}
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
if current == nil || current.SkillEntity == nil {
return true
}
currentPercent := e.Ctx().Our.CurrentPet.GetHP().Mul(hundred)
thresholdPercent := e.Ctx().Our.CurrentPet.GetMaxHP().Mul(e.Args()[2])
if currentPercent.Cmp(thresholdPercent) >= 0 {
return true
}
current.SkillEntity.XML.Priority += int(e.Args()[3].IntPart())
return true
}
// Effect 954: 若当前体力低于对手则先制+1
type Effect954 struct{ node.EffectNode }
func (e *Effect954) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Opp.CurrentPet.GetHP()) >= 0 {
return true
}
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
if current == nil || current.SkillEntity == nil {
return true
}
current.SkillEntity.XML.Priority += 1
return true
}
// Effect 955: 反转自身能力下降状态,反转成功则吸取对手{0}点体力
type Effect955 struct{ node.EffectNode }
func (e *Effect955) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
reversed := false
for i, v := range e.Ctx().Our.Prop[:] {
if v >= 0 {
continue
}
if e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), -v) {
reversed = true
}
}
if !reversed {
return true
}
drain := e.Args()[0]
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: drain,
})
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, drain)
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 951, &Effect951{})
input.InitEffect(input.EffectType.Sub, 951, &Effect951Sub{})
input.InitEffect(input.EffectType.Skill, 952, &Effect952{})
input.InitEffect(input.EffectType.Skill, 953, &Effect953{})
input.InitEffect(input.EffectType.Skill, 954, &Effect954{})
input.InitEffect(input.EffectType.Skill, 955, &Effect955{})
}