Files
bl/logic/service/fight/effect/1920_1944.go
昔念 e037539123 ```
docs(effects): 移除已完成的技能效果任务文档

移除 effects 956-1005、1263-1312、1695-1734 等范围内的未实现技能效果任务文档,
这些任务已经完成实现,相关文档不再需要维护。
```
2026-03-31 00:38:50 +08:00

554 lines
16 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"
"blazing/logic/service/fight/node"
"github.com/alpacahq/alpacadecimal"
"github.com/gogf/gf/v2/util/grand"
)
// Effect 1920: 对手当前体力低于60时先制+1
type Effect1920 struct{ node.EffectNode }
func (e *Effect1920) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
if current == nil || current.SkillEntity == nil {
return true
}
if e.Ctx().Opp.CurrentPet.GetHP().Cmp(e.Ctx().Opp.CurrentPet.GetMaxHP().Mul(alpacadecimal.NewFromInt(60)).Div(hundred)) >= 0 {
return true
}
current.SkillEntity.XML.Priority += 1
return true
}
// Effect 1921: 对手当前体力低于30时先制+1
type Effect1921 struct{ node.EffectNode }
func (e *Effect1921) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
if current == nil || current.SkillEntity == nil {
return true
}
if e.Ctx().Opp.CurrentPet.GetHP().Cmp(e.Ctx().Opp.CurrentPet.GetMaxHP().Mul(alpacadecimal.NewFromInt(30)).Div(hundred)) >= 0 {
return true
}
current.SkillEntity.XML.Priority += 1
return true
}
// Effect 1922: 消除对手回合类效果,消除成功则{0}回合内对手属性技能命中失效
type Effect1922 struct{ node.EffectNode }
func (e *Effect1922) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
removed := false
for _, eff := range e.Ctx().Opp.Effects {
if eff == nil || !eff.Alive() {
continue
}
if eff.ID().GetEffectType() != input.EffectType.Sub {
continue
}
eff.Alive(false)
removed = true
}
if !removed {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1922, int(e.Args()[0].IntPart()))
if sub != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect1922Sub struct{ RoundEffectArg0Base }
func (e *Effect1922Sub) SkillHit_ex() bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
e.Ctx().SkillEntity.SetMiss()
return true
}
// Effect 1923: {0}回合内令对手使用的攻击技能无效
type Effect1923 struct{ node.EffectNode }
func (e *Effect1923) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1923, int(e.Args()[0].IntPart()))
if sub != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect1923Sub struct{ RoundEffectArg0Base }
func (e *Effect1923Sub) SkillHit_ex() bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
e.Ctx().SkillEntity.SetMiss()
return true
}
// Effect 1924: {0}回合内每回合使用技能恢复自身1点体力并造成等量固定伤害
type Effect1924 struct{ node.EffectNode }
func (e *Effect1924) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1924, int(e.Args()[0].IntPart()))
if sub != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect1924Sub struct{ RoundEffectArg0Base }
func (e *Effect1924Sub) OnSkill() bool {
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, alpacadecimal.NewFromInt(1))
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: alpacadecimal.NewFromInt(1)})
return true
}
// Effect 1925: 吸取对手最大体力的1/{0}
type Effect1925 struct{ node.EffectNode }
func (e *Effect1925) OnSkill() bool {
if len(e.Args()) == 0 || 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().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, damage)
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
return true
}
// Effect 1926: {0}次攻击技能无视攻击免疫效果
type Effect1926 struct{ node.EffectNode }
func (e *Effect1926) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1926, int(e.Args()[0].IntPart()))
if sub != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect1926Sub struct {
RoundEffectArg0Base
remaining int
}
func (e *Effect1926Sub) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.Duration(-1)
if len(a) > 0 {
e.remaining = a[0]
}
}
func (e *Effect1926Sub) SkillHit_ex() bool {
if e.remaining <= 0 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
e.remaining--
if e.remaining <= 0 {
e.Alive(false)
}
return true
}
// Effect 1928: 吸取对手能力提升状态若对手不处于能力提升状态则吸取对手最大体力的1/{0}
type Effect1928 struct{ node.EffectNode }
func (e *Effect1928) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
if !e.Ctx().Opp.HasPropADD() {
damage := e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[0])
if damage.Cmp(alpacadecimal.Zero) > 0 {
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, damage)
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
}
return true
}
absorbed := false
for i, v := range e.Ctx().Opp.Prop[:] {
if v <= 0 {
continue
}
if e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), 0) {
absorbed = true
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), v)
}
}
if absorbed {
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[0]))
}
return true
}
// Effect 1929: {0}%令对手随机进入{1}种异常状态
type Effect1929 struct{ node.EffectNode }
func (e *Effect1929) Skill_Use() bool {
if len(e.Args()) < 3 {
return true
}
success, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100)
if !success {
return true
}
statuses := []int{
int(info.PetStatus.Paralysis),
int(info.PetStatus.Fear),
int(info.PetStatus.Tired),
int(info.PetStatus.Petrified),
}
count := int(e.Args()[2].IntPart())
if count > len(statuses) {
count = len(statuses)
}
indexes := grand.Perm(len(statuses))
for _, idx := range indexes[:count] {
st := e.Ctx().Our.InitEffect(input.EffectType.Status, statuses[idx])
if st != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, st)
}
}
return true
}
// Effect 1927: 每回合使用技能吸血,并在低血时翻倍
type Effect1927 struct{ node.EffectNode }
func (e *Effect1927) Skill_Use() bool {
if len(e.Args()) < 3 || e.Ctx().Our.CurrentPet == nil || e.Ctx().Opp.CurrentPet == nil {
return true
}
heal := e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[1])
if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[2])) < 0 {
heal = heal.Mul(alpacadecimal.NewFromInt(2))
}
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal)
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: heal})
return true
}
// Effect 1930: 自身每有先制条件则连击次数提升
type Effect1930 struct{ node.EffectNode }
func (e *Effect1930) SkillHit() bool {
if len(e.Args()) < 3 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
if e.Ctx().Our.HasPropADD() {
e.Ctx().SkillEntity.AttackTime += uint32(e.Args()[1].IntPart())
}
return true
}
// Effect 1931: 回合内按条件附加效果
type Effect1931 struct{ node.EffectNode }
func (e *Effect1931) OnSkill() bool {
if len(e.Args()) < 3 {
return true
}
if e.Ctx().Opp.CurrentPet != nil && e.Ctx().Opp.CurrentPet.GetHP().Cmp(e.Ctx().Our.CurrentPet.GetHP()) < 0 {
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[2].IntPart()))
}
return true
}
// Effect 1932: 回合内免疫并反弹异常
type Effect1932 struct{ node.EffectNode }
func (e *Effect1932) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1932, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
if eff != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect1932Sub struct{ node.EffectNode }
func (e *Effect1932Sub) SkillHit_ex() bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
e.Ctx().SkillEntity.SetMiss()
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(info.PetStatus.Confused))
return true
}
// Effect 1933: 击败后进入指定状态
type Effect1933 struct{ node.EffectNode }
func (e *Effect1933) OnSkill() bool {
if len(e.Args()) < 2 {
return true
}
if e.Ctx().Opp.CurrentPet != nil && e.Ctx().Opp.CurrentPet.GetHP().Cmp(alpacadecimal.Zero) <= 0 {
addStatusByID(e.Ctx().Our, e.Ctx().Our, int(e.Args()[1].IntPart()))
}
return true
}
// Effect 1934: 每死亡一只精灵提升伤害
type Effect1934 struct{ node.EffectNode }
func (e *Effect1934) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) == 0 {
return true
}
dead := 0
for _, pet := range e.Ctx().Our.AllPet {
if pet != nil && !pet.Alive() {
dead++
}
}
if dead > 0 {
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(100 + int64(dead)*int64(e.Args()[0].IntPart()))).Div(alpacadecimal.NewFromInt(100))
}
return true
}
// Effect 1935: 免疫并反弹若干次自身异常
type Effect1935 struct{ node.EffectNode }
func (e *Effect1935) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1935, int(e.Args()[0].IntPart()))
if eff != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect1935Sub struct {
node.EffectNode
remaining int
}
func (e *Effect1935Sub) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.Duration(-1)
if len(a) > 0 {
e.remaining = a[0]
}
}
func (e *Effect1935Sub) EFFect_Befer(in *input.Input, effEffect input.Effect) bool {
if e.remaining <= 0 {
e.Alive(false)
return true
}
if in != e.Ctx().Our || !input.IS_Stat(effEffect) {
return true
}
e.remaining--
if e.remaining <= 0 {
e.Alive(false)
}
return false
}
// Effect 1936: 对手未满体力时吸血
type Effect1936 struct{ node.EffectNode }
func (e *Effect1936) OnSkill() bool {
if len(e.Args()) == 0 || e.Ctx().Opp.CurrentPet == nil {
return true
}
if e.Ctx().Opp.CurrentPet.GetHP().Cmp(e.Ctx().Opp.CurrentPet.GetMaxHP()) < 0 {
damage := e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[0])
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, damage)
}
return true
}
// Effect 1937: 自身主动切换后获得护盾
type Effect1937 struct{ node.EffectNode }
func (e *Effect1937) SwitchOut(in *input.Input) bool {
if in != e.Ctx().Our || len(e.Args()) == 0 {
return true
}
e.Ctx().Our.AddShield(alpacadecimal.NewFromInt(int64(e.Args()[0].IntPart())))
return true
}
// Effect 1938: 为对手附加护盾
type Effect1938 struct{ node.EffectNode }
func (e *Effect1938) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
e.Ctx().Opp.AddShield(alpacadecimal.NewFromInt(int64(e.Args()[0].IntPart())))
return true
}
// Effect 1939: 为对手附加护盾
type Effect1939 struct{ node.EffectNode }
func (e *Effect1939) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
e.Ctx().Opp.AddShield(alpacadecimal.NewFromInt(int64(e.Args()[0].IntPart())))
return true
}
// Effect 1940: 自身持有回能标记时先制+2
type Effect1940 struct{ node.EffectNode }
func (e *Effect1940) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
if current != nil && current.SkillEntity != nil && e.Ctx().Our.HasPropADD() {
current.SkillEntity.XML.Priority += 2
}
return true
}
// Effect 1941: 对手持有失能标记时先制+2
type Effect1941 struct{ node.EffectNode }
func (e *Effect1941) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
if current != nil && current.SkillEntity != nil && e.Ctx().Opp.HasPropSub() {
current.SkillEntity.XML.Priority += 2
}
return true
}
// Effect 1942: 解除自身回能并随机附加异常
type Effect1942 struct{ node.EffectNode }
func (e *Effect1942) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
clearTargetEffects(e.Ctx().Our, e.Ctx().Our)
statuses := []int{int(info.PetStatus.Paralysis), int(info.PetStatus.Fear), int(info.PetStatus.Tired)}
addStatusByID(e.Ctx().Our, e.Ctx().Opp, statuses[grand.Intn(len(statuses))])
return true
}
// Effect 1943: 解除对手失能并随机附加异常
type Effect1943 struct{ node.EffectNode }
func (e *Effect1943) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
clearTargetEffects(e.Ctx().Our, e.Ctx().Opp)
statuses := []int{int(info.PetStatus.Frozen), int(info.PetStatus.Burned), int(info.PetStatus.Poisoned)}
addStatusByID(e.Ctx().Our, e.Ctx().Opp, statuses[grand.Intn(len(statuses))])
return true
}
// Effect 1944: 未持有回能则附加持续回能,否则刷新回能回合数
type Effect1944 struct{ node.EffectNode }
func (e *Effect1944) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1944, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
if sub != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect1944Sub struct {
node.EffectNode
remaining int
}
func (e *Effect1944Sub) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.Duration(-1)
if len(a) > 0 {
e.remaining = a[0]
}
}
func (e *Effect1944Sub) TurnEnd() {
if e.remaining <= 0 {
e.Alive(false)
return
}
e.remaining--
if e.remaining <= 0 {
e.Alive(false)
}
}
func init() {
input.InitEffect(input.EffectType.Skill, 1920, &Effect1920{})
input.InitEffect(input.EffectType.Skill, 1921, &Effect1921{})
input.InitEffect(input.EffectType.Skill, 1922, &Effect1922{})
input.InitEffect(input.EffectType.Sub, 1922, &Effect1922Sub{})
input.InitEffect(input.EffectType.Skill, 1923, &Effect1923{})
input.InitEffect(input.EffectType.Sub, 1923, &Effect1923Sub{})
input.InitEffect(input.EffectType.Skill, 1924, &Effect1924{})
input.InitEffect(input.EffectType.Sub, 1924, &Effect1924Sub{})
input.InitEffect(input.EffectType.Skill, 1925, &Effect1925{})
input.InitEffect(input.EffectType.Skill, 1926, &Effect1926{})
input.InitEffect(input.EffectType.Sub, 1926, &Effect1926Sub{})
input.InitEffect(input.EffectType.Skill, 1928, &Effect1928{})
input.InitEffect(input.EffectType.Skill, 1929, &Effect1929{})
input.InitEffect(input.EffectType.Skill, 1927, &Effect1927{})
input.InitEffect(input.EffectType.Skill, 1930, &Effect1930{})
input.InitEffect(input.EffectType.Skill, 1931, &Effect1931{})
input.InitEffect(input.EffectType.Skill, 1932, &Effect1932{})
input.InitEffect(input.EffectType.Sub, 1932, &Effect1932Sub{})
input.InitEffect(input.EffectType.Skill, 1933, &Effect1933{})
input.InitEffect(input.EffectType.Skill, 1934, &Effect1934{})
input.InitEffect(input.EffectType.Skill, 1935, &Effect1935{})
input.InitEffect(input.EffectType.Sub, 1935, &Effect1935Sub{})
input.InitEffect(input.EffectType.Skill, 1936, &Effect1936{})
input.InitEffect(input.EffectType.Skill, 1937, &Effect1937{})
input.InitEffect(input.EffectType.Skill, 1938, &Effect1938{})
input.InitEffect(input.EffectType.Skill, 1939, &Effect1939{})
input.InitEffect(input.EffectType.Skill, 1940, &Effect1940{})
input.InitEffect(input.EffectType.Skill, 1941, &Effect1941{})
input.InitEffect(input.EffectType.Skill, 1942, &Effect1942{})
input.InitEffect(input.EffectType.Skill, 1943, &Effect1943{})
input.InitEffect(input.EffectType.Skill, 1944, &Effect1944{})
input.InitEffect(input.EffectType.Sub, 1944, &Effect1944Sub{})
}