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

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

134 lines
3.8 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 921: {0}%概率造成的攻击伤害为{1}倍,未触发则{2}回合内令对手使用的属性技能无效
type Effect921 struct {
node.EffectNode
}
func (e *Effect921) SkillHit() bool {
if len(e.Args()) < 3 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
success, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100)
if success {
e.Ctx().SkillEntity.XML.Power *= int(e.Args()[1].IntPart())
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 921, int(e.Args()[2].IntPart()))
if sub != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect921Sub struct {
RoundEffectArg0Base
}
func (e *Effect921Sub) ActionStart(a, b *action.SelectSkillAction) bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() != info.Category.STATUS {
return true
}
e.Ctx().SkillEntity.SetMiss()
return true
}
// Effect 922: {0}回合内每回合结束后解除并反馈自身能力下降状态
type Effect922 struct {
RoundEffectArg0Base
}
func (e *Effect922) TurnEnd() {
for i, v := range e.Ctx().Our.Prop[:] {
if v >= 0 {
continue
}
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), -v)
e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), v)
}
e.EffectNode.TurnEnd()
}
// Effect 923: {0}回合内每回合若先出手则吸取对手{1}点体力
type Effect923 struct {
RoundEffectArg0Base
}
func (e *Effect923) OnSkill() bool {
if len(e.Args()) < 2 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
if e.Ctx().Our.Prop[5] < e.Ctx().Opp.Prop[5] {
return true
}
drain := e.Args()[1]
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
}
// Effect 924: 下{0}回合攻击技能吸取对手1/{1}最大体力值
type Effect924 struct {
node.EffectNode
}
func (e *Effect924) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 924, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
if sub != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect924Sub struct {
RoundEffectArg0Base
}
func (e *Effect924Sub) OnSkill() bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS || len(e.Args()) < 2 || e.Args()[1].Cmp(alpacadecimal.Zero) <= 0 {
return true
}
damage := e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[1])
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, damage)
return true
}
// Effect 925: 若自身为满体力则技能威力提升{0}%
type Effect925 struct {
node.EffectNode
}
func (e *Effect925) SkillHit() bool {
if len(e.Args()) == 0 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Our.CurrentPet.GetMaxHP()) < 0 {
return true
}
addSkillPowerPercent(e.Ctx().SkillEntity, e.Args()[0])
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 921, &Effect921{})
input.InitEffect(input.EffectType.Sub, 921, &Effect921Sub{})
input.InitEffect(input.EffectType.Skill, 922, &Effect922{})
input.InitEffect(input.EffectType.Skill, 923, &Effect923{})
input.InitEffect(input.EffectType.Skill, 924, &Effect924{})
input.InitEffect(input.EffectType.Sub, 924, &Effect924Sub{})
input.InitEffect(input.EffectType.Skill, 925, &Effect925{})
}