docs(effect): 移除已完成的效果任务文档 移除effects 876-1061范围内的任务文档,这些effect已经实现或不再需要跟踪。 包括task-053至task-089的多个任务列表,涵盖各种战斗效果的实现说明。 ```
118 lines
3.1 KiB
Go
118 lines
3.1 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 946: 全属性+{0},若自身当前体力低于对手则强化效果翻倍
|
|
type Effect946 struct{ node.EffectNode }
|
|
|
|
func (e *Effect946) OnSkill() bool {
|
|
if len(e.Args()) == 0 {
|
|
return true
|
|
}
|
|
boost := int8(e.Args()[0].IntPart())
|
|
if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Opp.CurrentPet.GetHP()) < 0 {
|
|
boost *= 2
|
|
}
|
|
applyAllPropUp(e.Ctx().Our, boost)
|
|
return true
|
|
}
|
|
|
|
// Effect 947: 造成的伤害不足{0}则吸取对手最大体力的1/{1}
|
|
type Effect947 struct{ node.EffectNode }
|
|
|
|
func (e *Effect947) Skill_Use() bool {
|
|
if len(e.Args()) < 2 || e.Args()[1].Cmp(alpacadecimal.Zero) <= 0 {
|
|
return true
|
|
}
|
|
if e.Ctx().Our.SumDamage.Cmp(e.Args()[0]) >= 0 {
|
|
return true
|
|
}
|
|
damage := e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[1])
|
|
if damage.Cmp(alpacadecimal.Zero) <= 0 {
|
|
return true
|
|
}
|
|
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 948: 吸取对手能力提升状态,吸取成功则对手{0}
|
|
type Effect948 struct{ node.EffectNode }
|
|
|
|
func (e *Effect948) OnSkill() bool {
|
|
if len(e.Args()) == 0 {
|
|
return true
|
|
}
|
|
if !clearPositivePropsTo(e.Ctx().Opp, e.Ctx().Our) {
|
|
return true
|
|
}
|
|
applyStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[0].IntPart()))
|
|
return true
|
|
}
|
|
|
|
// Effect 949: 造成伤害不足{0}则恢复自身全部体力
|
|
type Effect949 struct{ node.EffectNode }
|
|
|
|
func (e *Effect949) Skill_Use() bool {
|
|
if len(e.Args()) == 0 {
|
|
return true
|
|
}
|
|
if e.Ctx().Our.SumDamage.Cmp(e.Args()[0]) >= 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 950: 消除对手回合类效果,消除成功则对手{0}回合内攻击技能MISS
|
|
type Effect950 struct{ node.EffectNode }
|
|
|
|
func (e *Effect950) 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, 950, int(e.Args()[0].IntPart()))
|
|
if sub != nil {
|
|
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
|
|
}
|
|
return true
|
|
}
|
|
|
|
type Effect950Sub struct{ RoundEffectArg0Base }
|
|
|
|
func (e *Effect950Sub) 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, 946, &Effect946{})
|
|
input.InitEffect(input.EffectType.Skill, 947, &Effect947{})
|
|
input.InitEffect(input.EffectType.Skill, 948, &Effect948{})
|
|
input.InitEffect(input.EffectType.Skill, 949, &Effect949{})
|
|
input.InitEffect(input.EffectType.Skill, 950, &Effect950{})
|
|
input.InitEffect(input.EffectType.Sub, 950, &Effect950Sub{})
|
|
}
|