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

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

163 lines
3.9 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 906: 附加对手最大体力值{0}%的百分比伤害,每次使用增加{1}%,最高{2}%
type Effect906 struct {
AddLvelEffect
}
func (e *Effect906) OnSkill() bool {
if len(e.Args()) < 3 {
return true
}
percent := e.GetADD(e.Args()[0], e.Args()[1], e.Args()[2])
damage := e.Ctx().Opp.CurrentPet.GetMaxHP().Mul(percent).Div(alpacadecimal.NewFromInt(100))
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Percent,
Damage: damage,
})
return true
}
// Effect 907: 反转自身能力下降状态,反转成功则使对手随机{0}个技能PP归零
type Effect907 struct {
node.EffectNode
}
func (e *Effect907) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
reversed := false
for i, v := range e.Ctx().Our.Prop[:] {
if v >= 0 {
continue
}
reversed = true
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), -v)
}
if !reversed {
return true
}
zeroRandomSkillPP(e.Ctx().Opp, int(e.Args()[0].IntPart()))
return true
}
// Effect 908: 吸收对手能力提升状态,吸收成功则对手下{0}回合所有技能失效
type Effect908 struct {
node.EffectNode
}
func (e *Effect908) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
cleared := false
for i, v := range e.Ctx().Opp.Prop[:] {
if v <= 0 {
continue
}
if e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), 0) {
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), v)
cleared = true
}
}
if !cleared {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 908, int(e.Args()[0].IntPart()))
if sub != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect908Sub struct {
RoundEffectArg0Base
}
func (e *Effect908Sub) ActionStart(a, b *action.SelectSkillAction) bool {
if e.Ctx().SkillEntity == nil {
return true
}
e.Ctx().SkillEntity.SetMiss()
return true
}
// Effect 909: 先出手时{0}%使对手{1},未触发则附加{2}点固定伤害
type Effect909 struct {
node.EffectNode
}
func (e *Effect909) Skill_Use() bool {
if len(e.Args()) < 3 {
return true
}
if !e.IsFirst() {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: e.Args()[2],
})
return true
}
success, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100)
if success {
statusEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, int(e.Args()[1].IntPart()))
if statusEffect != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, statusEffect)
}
return true
}
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: e.Args()[2],
})
return true
}
// Effect 910: 当回合击败对手则令对手{0}回合内属性技能无效
type Effect910 struct {
node.EffectNode
}
func (e *Effect910) Skill_Use() bool {
if len(e.Args()) == 0 || e.Ctx().Opp.CurrentPet.Info.Hp > 0 {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 910, int(e.Args()[0].IntPart()))
if sub != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect910Sub struct {
RoundEffectArg0Base
}
func (e *Effect910Sub) 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
}
func init() {
input.InitEffect(input.EffectType.Skill, 906, &Effect906{})
input.InitEffect(input.EffectType.Skill, 907, &Effect907{})
input.InitEffect(input.EffectType.Skill, 908, &Effect908{})
input.InitEffect(input.EffectType.Sub, 908, &Effect908Sub{})
input.InitEffect(input.EffectType.Skill, 909, &Effect909{})
input.InitEffect(input.EffectType.Skill, 910, &Effect910{})
input.InitEffect(input.EffectType.Sub, 910, &Effect910Sub{})
}