docs(effect): 移除已完成的效果任务文档 移除effects 876-1061范围内的任务文档,这些effect已经实现或不再需要跟踪。 包括task-053至task-089的多个任务列表,涵盖各种战斗效果的实现说明。 ```
149 lines
3.5 KiB
Go
149 lines
3.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 876: 附加自身防御、特防和速度总和{0}%的百分比伤害
|
|
type Effect876 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect876) OnSkill() bool {
|
|
if len(e.Args()) == 0 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
|
return true
|
|
}
|
|
|
|
base := e.Ctx().Our.GetProp(1).Add(e.Ctx().Our.GetProp(3)).Add(e.Ctx().Our.GetProp(4))
|
|
damage := base.Mul(e.Args()[0]).Div(alpacadecimal.NewFromInt(100))
|
|
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 877: 先手时自身全属性+{0}
|
|
type Effect877 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect877) OnSkill() bool {
|
|
if len(e.Args()) == 0 || !e.IsFirst() {
|
|
return true
|
|
}
|
|
|
|
applyAllPropUp(e.Ctx().Our, int8(e.Args()[0].IntPart()))
|
|
return true
|
|
}
|
|
|
|
// Effect 878: 接下来{0}回合,若先手则使对手进入{1}状态
|
|
type Effect878 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect878) Skill_Use() bool {
|
|
if len(e.Args()) < 2 {
|
|
return true
|
|
}
|
|
|
|
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 878, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
|
|
if sub != nil {
|
|
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
|
|
}
|
|
return true
|
|
}
|
|
|
|
type Effect878Sub struct {
|
|
RoundEffectArg0Base
|
|
}
|
|
|
|
func (e *Effect878Sub) OnSkill() bool {
|
|
if len(e.Args()) < 2 || !e.IsFirst() {
|
|
return true
|
|
}
|
|
|
|
applyStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
|
|
return true
|
|
}
|
|
|
|
// Effect 879: 消除对手回合类效果,消除成功则自身回复满体力
|
|
type Effect879 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect879) Skill_Use() bool {
|
|
before := activeTurnEffectCount(e.Ctx().Opp)
|
|
e.Ctx().Opp.CancelTurn(e.Ctx().Our)
|
|
if before <= 0 {
|
|
return true
|
|
}
|
|
|
|
heal := e.Ctx().Our.CurrentPet.GetMaxHP().Sub(e.Ctx().Our.CurrentPet.GetHP())
|
|
if heal.Cmp(alpacadecimal.Zero) <= 0 {
|
|
return true
|
|
}
|
|
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal)
|
|
return true
|
|
}
|
|
|
|
// Effect 880: 消除对手回合类效果,消除成功则下回合所有技能先制+{0}
|
|
type Effect880 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect880) Skill_Use() bool {
|
|
if len(e.Args()) == 0 {
|
|
return true
|
|
}
|
|
|
|
before := activeTurnEffectCount(e.Ctx().Opp)
|
|
e.Ctx().Opp.CancelTurn(e.Ctx().Our)
|
|
if before <= 0 {
|
|
return true
|
|
}
|
|
|
|
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 880, 1, int(e.Args()[0].IntPart()))
|
|
if sub != nil {
|
|
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
|
|
}
|
|
return true
|
|
}
|
|
|
|
type Effect880Sub struct {
|
|
RoundEffectArg0Base
|
|
}
|
|
|
|
func (e *Effect880Sub) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
|
|
if len(e.Args()) < 2 {
|
|
return true
|
|
}
|
|
|
|
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
|
|
if current == nil || current.SkillEntity == nil {
|
|
return true
|
|
}
|
|
|
|
current.SkillEntity.XML.Priority += int(e.Args()[1].IntPart())
|
|
return true
|
|
}
|
|
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 876, &Effect876{})
|
|
input.InitEffect(input.EffectType.Skill, 877, &Effect877{})
|
|
input.InitEffect(input.EffectType.Skill, 878, &Effect878{})
|
|
input.InitEffect(input.EffectType.Sub, 878, &Effect878Sub{})
|
|
input.InitEffect(input.EffectType.Skill, 879, &Effect879{})
|
|
input.InitEffect(input.EffectType.Skill, 880, &Effect880{})
|
|
input.InitEffect(input.EffectType.Sub, 880, &Effect880Sub{})
|
|
}
|