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

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

196 lines
4.5 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 1041: 造成的攻击伤害若低于{0}则令对手下{1}次使用的攻击技能无效
type Effect1041 struct {
node.EffectNode
}
func (e *Effect1041) Skill_Use() bool {
if len(e.Args()) < 2 || e.Ctx().SkillEntity == nil {
return true
}
if e.Ctx().SkillEntity.Category() == info.Category.STATUS || e.Ctx().SkillEntity.AttackTime == 0 {
return true
}
if e.Ctx().Our.SumDamage.Cmp(e.Args()[0]) >= 0 {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1041, int(e.Args()[1].IntPart()))
if sub != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect1041Sub struct {
node.EffectNode
remaining int
}
func (e *Effect1041Sub) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.CanStack(false)
e.Duration(-1)
if len(a) > 0 {
e.remaining = a[0]
}
}
func (e *Effect1041Sub) ActionStart(a, b *action.SelectSkillAction) bool {
if e.remaining <= 0 {
e.Alive(false)
return true
}
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
e.Ctx().SkillEntity.SetMiss()
e.remaining--
if e.remaining <= 0 {
e.Alive(false)
}
return true
}
// Effect 1042: {0}回合内每回合自身技能消除对手能力提升状态
type Effect1042 struct {
node.EffectNode
}
func (e *Effect1042) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1042, int(e.Args()[0].IntPart()))
if sub != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect1042Sub struct {
RoundEffectArg0Base
}
func (e *Effect1042Sub) Skill_Use_ex() bool {
clearPositivePropsTo(e.Ctx().Opp, e.Ctx().Our)
return true
}
// Effect 1043: 反转自身能力下降状态,反转成功则{0}回合受到的伤害转化为自身体力
type Effect1043 struct {
node.EffectNode
}
func (e *Effect1043) Skill_Use() 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), -2*v) {
reversed = true
}
}
if !reversed {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1043, int(e.Args()[0].IntPart()))
if sub != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect1043Sub struct {
RoundEffectArg0Base
}
func (e *Effect1043Sub) DamageLockEx(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red {
return true
}
if zone.Damage.Cmp(alpacadecimal.Zero) <= 0 {
return true
}
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, zone.Damage)
zone.Damage = alpacadecimal.Zero
return true
}
// Effect 1045: 未击败对手则附加自身最大体力/{0}的百分比伤害
type Effect1045 struct {
node.EffectNode
}
func (e *Effect1045) Skill_Use() bool {
if len(e.Args()) == 0 || e.Ctx().Opp.CurrentPet == nil || e.Ctx().Opp.CurrentPet.Info.Hp == 0 {
return true
}
if e.Args()[0].Cmp(alpacadecimal.Zero) <= 0 {
return true
}
damage := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[0])
if damage.Cmp(alpacadecimal.Zero) <= 0 {
return true
}
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Percent,
Damage: damage,
})
return true
}
// Effect 1046: 若对手不处于异常状态则附加对手最大体力/{0}的百分比伤害
type Effect1046 struct {
node.EffectNode
}
func (e *Effect1046) OnSkill() bool {
if len(e.Args()) == 0 || e.Ctx().Opp.StatEffect_Exist_all() {
return true
}
if e.Args()[0].Cmp(alpacadecimal.Zero) <= 0 {
return true
}
damage := e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[0])
if damage.Cmp(alpacadecimal.Zero) <= 0 {
return true
}
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Percent,
Damage: damage,
})
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 1041, &Effect1041{})
input.InitEffect(input.EffectType.Sub, 1041, &Effect1041Sub{})
input.InitEffect(input.EffectType.Skill, 1042, &Effect1042{})
input.InitEffect(input.EffectType.Sub, 1042, &Effect1042Sub{})
input.InitEffect(input.EffectType.Skill, 1043, &Effect1043{})
input.InitEffect(input.EffectType.Sub, 1043, &Effect1043Sub{})
input.InitEffect(input.EffectType.Skill, 1045, &Effect1045{})
input.InitEffect(input.EffectType.Skill, 1046, &Effect1046{})
}