docs(effect): 移除已完成的效果任务文档 移除effects 876-1061范围内的任务文档,这些effect已经实现或不再需要跟踪。 包括task-053至task-089的多个任务列表,涵盖各种战斗效果的实现说明。 ```
205 lines
5.0 KiB
Go
205 lines
5.0 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 891: 吸收对手能力提升状态,吸收成功则下{0}回合造成的伤害翻倍
|
|
type Effect891 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect891) Skill_Use() 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, 891, int(e.Args()[0].IntPart()))
|
|
if sub != nil {
|
|
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
|
|
}
|
|
return true
|
|
}
|
|
|
|
type Effect891Sub struct {
|
|
RoundEffectArg0Base
|
|
}
|
|
|
|
func (e *Effect891Sub) Damage_Mul(zone *info.DamageZone) bool {
|
|
if zone == nil || zone.Type != info.DamageType.Red {
|
|
return true
|
|
}
|
|
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
|
return true
|
|
}
|
|
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(2))
|
|
return true
|
|
}
|
|
|
|
// Effect 892: 每使用此技能击败一只精灵则减少对手下只出场精灵{0}%最大体力
|
|
type Effect892 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect892) Skill_Use() bool {
|
|
if len(e.Args()) == 0 || e.Ctx().Opp == nil || e.Ctx().Opp.CurrentPet == nil || e.Ctx().Opp.CurrentPet.Info.Hp > 0 {
|
|
return true
|
|
}
|
|
|
|
sub := e.Ctx().Opp.InitEffect(input.EffectType.Sub, 892, int(e.Args()[0].IntPart()))
|
|
if sub != nil {
|
|
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
|
|
}
|
|
return true
|
|
}
|
|
|
|
type Effect892Sub struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect892Sub) SetArgs(t *input.Input, a ...int) {
|
|
e.EffectNode.SetArgs(t, a...)
|
|
e.CanStack(false)
|
|
e.Duration(1)
|
|
}
|
|
|
|
func (e *Effect892Sub) SwitchIn(in *input.Input) bool {
|
|
if in != e.Ctx().Our || len(e.Args()) == 0 || e.Ctx().Our == nil || e.Ctx().Our.CurrentPet == nil {
|
|
return true
|
|
}
|
|
|
|
percent := e.Args()[0]
|
|
if percent.Cmp(alpacadecimal.Zero) <= 0 {
|
|
e.Alive(false)
|
|
return true
|
|
}
|
|
|
|
if percent.Cmp(alpacadecimal.NewFromInt(100)) > 0 {
|
|
percent = alpacadecimal.NewFromInt(100)
|
|
}
|
|
|
|
currentMax := e.Ctx().Our.CurrentPet.GetMaxHP()
|
|
newMax := currentMax.Mul(alpacadecimal.NewFromInt(100).Sub(percent)).Div(alpacadecimal.NewFromInt(100))
|
|
if newMax.Cmp(alpacadecimal.NewFromInt(1)) < 0 {
|
|
newMax = alpacadecimal.NewFromInt(1)
|
|
}
|
|
e.Ctx().Our.CurrentPet.Info.MaxHp = uint32(newMax.IntPart())
|
|
if e.Ctx().Our.CurrentPet.Info.Hp > e.Ctx().Our.CurrentPet.Info.MaxHp {
|
|
e.Ctx().Our.CurrentPet.Info.Hp = e.Ctx().Our.CurrentPet.Info.MaxHp
|
|
}
|
|
e.Alive(false)
|
|
return true
|
|
}
|
|
|
|
// Effect 893: 全属性+{0},自身满体力时强化效果翻倍
|
|
type Effect893 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect893) OnSkill() bool {
|
|
if len(e.Args()) == 0 {
|
|
return true
|
|
}
|
|
|
|
boost := int8(e.Args()[0].IntPart())
|
|
if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Our.CurrentPet.GetMaxHP()) == 0 {
|
|
boost *= 2
|
|
}
|
|
applyAllPropUp(e.Ctx().Our, boost)
|
|
return true
|
|
}
|
|
|
|
// Effect 894: 吸取对手{0}点体力,体力低于对手时吸取效果翻倍
|
|
type Effect894 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect894) OnSkill() bool {
|
|
if len(e.Args()) == 0 {
|
|
return true
|
|
}
|
|
|
|
drain := e.Args()[0]
|
|
if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Opp.CurrentPet.GetHP()) < 0 {
|
|
drain = drain.Mul(alpacadecimal.NewFromInt(2))
|
|
}
|
|
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 895: {0}回合内受到的所有类型伤害的1/{1}转化为自身体力
|
|
type Effect895 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect895) Skill_Use() bool {
|
|
if len(e.Args()) < 2 {
|
|
return true
|
|
}
|
|
|
|
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 895, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
|
|
if sub != nil {
|
|
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
|
|
}
|
|
return true
|
|
}
|
|
|
|
type Effect895Sub struct {
|
|
RoundEffectArg0Base
|
|
}
|
|
|
|
func (e *Effect895Sub) DamageLockEx(zone *info.DamageZone) bool {
|
|
if zone == nil || len(e.Args()) < 2 || zone.Damage.Cmp(alpacadecimal.Zero) <= 0 {
|
|
return true
|
|
}
|
|
if e.Args()[1].Cmp(alpacadecimal.Zero) <= 0 {
|
|
return true
|
|
}
|
|
|
|
convert := zone.Damage.Div(e.Args()[1])
|
|
if convert.Cmp(alpacadecimal.Zero) <= 0 {
|
|
return true
|
|
}
|
|
if convert.Cmp(zone.Damage) > 0 {
|
|
convert = zone.Damage
|
|
}
|
|
|
|
zone.Damage = zone.Damage.Sub(convert)
|
|
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, convert)
|
|
return true
|
|
}
|
|
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 891, &Effect891{})
|
|
input.InitEffect(input.EffectType.Sub, 891, &Effect891Sub{})
|
|
input.InitEffect(input.EffectType.Skill, 892, &Effect892{})
|
|
input.InitEffect(input.EffectType.Sub, 892, &Effect892Sub{})
|
|
input.InitEffect(input.EffectType.Skill, 893, &Effect893{})
|
|
input.InitEffect(input.EffectType.Skill, 894, &Effect894{})
|
|
input.InitEffect(input.EffectType.Skill, 895, &Effect895{})
|
|
input.InitEffect(input.EffectType.Sub, 895, &Effect895Sub{})
|
|
}
|