docs(effect): 移除已完成的效果任务文档 移除effects 876-1061范围内的任务文档,这些effect已经实现或不再需要跟踪。 包括task-053至task-089的多个任务列表,涵盖各种战斗效果的实现说明。 ```
196 lines
4.5 KiB
Go
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 931: 吸取对手能力提升状态,吸取成功则对手{0}个技能PP值归零
|
|
type Effect931 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect931) OnSkill() bool {
|
|
if len(e.Args()) == 0 {
|
|
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 {
|
|
return true
|
|
}
|
|
|
|
zeroRandomSkillPP(e.Ctx().Opp, int(e.Args()[0].IntPart()))
|
|
return true
|
|
}
|
|
|
|
// Effect 932: 先出手时附加自身攻击{0}%的百分比伤害
|
|
type Effect932 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect932) OnSkill() bool {
|
|
if len(e.Args()) == 0 || !e.IsFirst() {
|
|
return true
|
|
}
|
|
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
|
return true
|
|
}
|
|
|
|
damage := e.Ctx().Our.GetProp(0).Mul(e.Args()[0]).Div(hundred)
|
|
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 933: 未击败对手则己方下{0}次攻击技能必定打出致命一击
|
|
type Effect933 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect933) Skill_Use() bool {
|
|
if len(e.Args()) == 0 || e.Ctx().Opp.CurrentPet == nil || e.Ctx().Opp.CurrentPet.Info.Hp == 0 {
|
|
return true
|
|
}
|
|
|
|
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 933, int(e.Args()[0].IntPart()))
|
|
if sub != nil {
|
|
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
|
|
}
|
|
return true
|
|
}
|
|
|
|
type Effect933Sub struct {
|
|
node.EffectNode
|
|
remaining int
|
|
}
|
|
|
|
func (e *Effect933Sub) 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 *Effect933Sub) 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.XML.CritRate = 16
|
|
e.remaining--
|
|
if e.remaining <= 0 {
|
|
e.Alive(false)
|
|
}
|
|
return true
|
|
}
|
|
|
|
// Effect 934: 击败对手则对手下只出场精灵{0}回合内先制-{1}
|
|
type Effect934 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect934) Skill_Use() bool {
|
|
if len(e.Args()) < 2 || e.Ctx().Opp.CurrentPet == nil || e.Ctx().Opp.CurrentPet.Info.Hp > 0 {
|
|
return true
|
|
}
|
|
|
|
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 934, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
|
|
if sub != nil {
|
|
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
|
|
}
|
|
return true
|
|
}
|
|
|
|
type Effect934Sub struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect934Sub) SetArgs(t *input.Input, a ...int) {
|
|
e.EffectNode.SetArgs(t, a...)
|
|
e.CanStack(false)
|
|
e.Duration(1)
|
|
}
|
|
|
|
func (e *Effect934Sub) SwitchIn(in *input.Input) bool {
|
|
if in != e.Ctx().Our || len(e.Args()) < 2 {
|
|
return true
|
|
}
|
|
|
|
prioritySub := e.Ctx().Opp.InitEffect(input.EffectType.Sub, 9341, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
|
|
if prioritySub != nil {
|
|
e.Ctx().Our.AddEffect(e.Ctx().Opp, prioritySub)
|
|
}
|
|
e.Alive(false)
|
|
return true
|
|
}
|
|
|
|
type Effect934PrioritySub struct {
|
|
RoundEffectArg0Base
|
|
}
|
|
|
|
func (e *Effect934PrioritySub) 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
|
|
}
|
|
|
|
// Effect 935: 若自身体力高于对手则使对手{0}
|
|
type Effect935 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect935) OnSkill() bool {
|
|
if len(e.Args()) == 0 {
|
|
return true
|
|
}
|
|
if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Opp.CurrentPet.GetHP()) <= 0 {
|
|
return true
|
|
}
|
|
|
|
applyStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[0].IntPart()))
|
|
return true
|
|
}
|
|
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 931, &Effect931{})
|
|
input.InitEffect(input.EffectType.Skill, 932, &Effect932{})
|
|
input.InitEffect(input.EffectType.Skill, 933, &Effect933{})
|
|
input.InitEffect(input.EffectType.Sub, 933, &Effect933Sub{})
|
|
input.InitEffect(input.EffectType.Skill, 934, &Effect934{})
|
|
input.InitEffect(input.EffectType.Sub, 934, &Effect934Sub{})
|
|
input.InitEffect(input.EffectType.Sub, 9341, &Effect934PrioritySub{})
|
|
input.InitEffect(input.EffectType.Skill, 935, &Effect935{})
|
|
}
|