docs(effect): 移除已完成的效果任务文档 移除effects 876-1061范围内的任务文档,这些effect已经实现或不再需要跟踪。 包括task-053至task-089的多个任务列表,涵盖各种战斗效果的实现说明。 ```
265 lines
6.3 KiB
Go
265 lines
6.3 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 926: 反转自身能力下降状态,反转成功则下{0}回合先制+{1}
|
||
type Effect926 struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect926) Skill_Use() bool {
|
||
if len(e.Args()) < 2 {
|
||
return true
|
||
}
|
||
|
||
reversed := false
|
||
for i, v := range e.Ctx().Our.Prop[:] {
|
||
if v >= 0 {
|
||
continue
|
||
}
|
||
if e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), -v) {
|
||
reversed = true
|
||
}
|
||
}
|
||
if !reversed {
|
||
return true
|
||
}
|
||
|
||
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 926, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
|
||
if sub != nil {
|
||
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
|
||
}
|
||
return true
|
||
}
|
||
|
||
type Effect926Sub struct {
|
||
RoundEffectArg0Base
|
||
}
|
||
|
||
func (e *Effect926Sub) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
|
||
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
|
||
if current == nil || current.SkillEntity == nil || current.SkillEntity.Category() == info.Category.STATUS {
|
||
return true
|
||
}
|
||
current.SkillEntity.XML.Priority += int(e.Args()[1].IntPart())
|
||
return true
|
||
}
|
||
|
||
// Effect 927: {0}回合内每回合使用技能后恢复1/{1}最大体力,低于1/{2}时附加等量百分比伤害
|
||
type Effect927 struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect927) Skill_Use() bool {
|
||
if len(e.Args()) < 3 {
|
||
return true
|
||
}
|
||
|
||
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 927, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()), int(e.Args()[2].IntPart()))
|
||
if sub != nil {
|
||
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
|
||
}
|
||
return true
|
||
}
|
||
|
||
type Effect927Sub struct {
|
||
RoundEffectArg0Base
|
||
}
|
||
|
||
func (e *Effect927Sub) OnSkill() bool {
|
||
if len(e.Args()) < 3 || e.Ctx().Our == nil || e.Ctx().Our.CurrentPet == nil || e.Ctx().Opp == nil || e.Ctx().Opp.CurrentPet == nil {
|
||
return true
|
||
}
|
||
if e.Args()[1].Cmp(alpacadecimal.Zero) <= 0 || e.Args()[2].Cmp(alpacadecimal.Zero) <= 0 {
|
||
return true
|
||
}
|
||
|
||
heal := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[1])
|
||
if heal.Cmp(alpacadecimal.Zero) <= 0 {
|
||
return true
|
||
}
|
||
|
||
lowHP := e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[2])) < 0
|
||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal)
|
||
if lowHP {
|
||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||
Type: info.DamageType.Percent,
|
||
Damage: heal,
|
||
})
|
||
}
|
||
return true
|
||
}
|
||
|
||
// Effect 928: 消除对手回合类效果,消除成功则免疫下{0}次受到的异常状态
|
||
type Effect928 struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect928) 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, 928, int(e.Args()[0].IntPart()))
|
||
if sub != nil {
|
||
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
|
||
}
|
||
return true
|
||
}
|
||
|
||
type Effect928Sub struct {
|
||
node.EffectNode
|
||
remaining int
|
||
}
|
||
|
||
func (e *Effect928Sub) SetArgs(t *input.Input, a ...int) {
|
||
e.EffectNode.SetArgs(t, a...)
|
||
e.Duration(-1)
|
||
if len(a) > 0 {
|
||
e.remaining = a[0]
|
||
}
|
||
}
|
||
|
||
func (e *Effect928Sub) EFFect_Befer(in *input.Input, effEffect input.Effect) bool {
|
||
if e.remaining <= 0 {
|
||
e.Alive(false)
|
||
return true
|
||
}
|
||
if in != e.Ctx().Opp || !input.IS_Stat(effEffect) {
|
||
return true
|
||
}
|
||
|
||
e.remaining--
|
||
if e.remaining <= 0 {
|
||
e.Alive(false)
|
||
}
|
||
return false
|
||
}
|
||
|
||
// Effect 929: 反弹{0}倍的伤害给对手并使自身恢复等量体力
|
||
type Effect929 struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect929) Skill_Use() bool {
|
||
if len(e.Args()) == 0 {
|
||
return true
|
||
}
|
||
|
||
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 929, int(e.Args()[0].IntPart()))
|
||
if sub != nil {
|
||
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
|
||
}
|
||
return true
|
||
}
|
||
|
||
type Effect929Sub struct {
|
||
FixedDuration1Base
|
||
}
|
||
|
||
func (e *Effect929Sub) DamageLockEx(zone *info.DamageZone) bool {
|
||
if zone == nil || zone.Damage.Cmp(alpacadecimal.Zero) <= 0 {
|
||
return true
|
||
}
|
||
switch zone.Type {
|
||
case info.DamageType.Red, info.DamageType.Fixed, info.DamageType.Percent, info.DamageType.True:
|
||
default:
|
||
return true
|
||
}
|
||
if len(e.Args()) == 0 {
|
||
return true
|
||
}
|
||
|
||
rebound := zone.Damage.Mul(e.Args()[0])
|
||
if rebound.Cmp(alpacadecimal.Zero) <= 0 {
|
||
return true
|
||
}
|
||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||
Type: info.DamageType.Fixed,
|
||
Damage: rebound,
|
||
})
|
||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, rebound)
|
||
return true
|
||
}
|
||
|
||
// Effect 930: 获得{0}点护盾,护盾消失时对对手造成{1}点固定伤害且有{2}%概率使对手{3}
|
||
type Effect930 struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect930) Skill_Use() bool {
|
||
if len(e.Args()) < 4 {
|
||
return true
|
||
}
|
||
|
||
shield := e.Args()[0]
|
||
if shield.Cmp(alpacadecimal.Zero) <= 0 {
|
||
return true
|
||
}
|
||
|
||
e.Ctx().Our.AddShield(shield)
|
||
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 930, int(e.Args()[1].IntPart()), int(e.Args()[2].IntPart()), int(e.Args()[3].IntPart()))
|
||
if sub != nil {
|
||
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
|
||
}
|
||
return true
|
||
}
|
||
|
||
type Effect930Sub struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect930Sub) SetArgs(t *input.Input, a ...int) {
|
||
e.EffectNode.SetArgs(t, a...)
|
||
e.CanStack(false)
|
||
e.Duration(-1)
|
||
}
|
||
|
||
func (e *Effect930Sub) ShieldChange(before, after alpacadecimal.Decimal) bool {
|
||
if len(e.Args()) < 3 {
|
||
return true
|
||
}
|
||
if before.Cmp(alpacadecimal.Zero) <= 0 || after.Cmp(alpacadecimal.Zero) > 0 {
|
||
return true
|
||
}
|
||
|
||
damage := e.Args()[0]
|
||
if damage.Cmp(alpacadecimal.Zero) > 0 {
|
||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||
Type: info.DamageType.Fixed,
|
||
Damage: damage,
|
||
})
|
||
}
|
||
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100); ok {
|
||
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[2].IntPart()))
|
||
}
|
||
e.Alive(false)
|
||
return true
|
||
}
|
||
|
||
func init() {
|
||
input.InitEffect(input.EffectType.Skill, 926, &Effect926{})
|
||
input.InitEffect(input.EffectType.Sub, 926, &Effect926Sub{})
|
||
input.InitEffect(input.EffectType.Skill, 927, &Effect927{})
|
||
input.InitEffect(input.EffectType.Sub, 927, &Effect927Sub{})
|
||
input.InitEffect(input.EffectType.Skill, 928, &Effect928{})
|
||
input.InitEffect(input.EffectType.Sub, 928, &Effect928Sub{})
|
||
input.InitEffect(input.EffectType.Skill, 929, &Effect929{})
|
||
input.InitEffect(input.EffectType.Sub, 929, &Effect929Sub{})
|
||
input.InitEffect(input.EffectType.Skill, 930, &Effect930{})
|
||
input.InitEffect(input.EffectType.Sub, 930, &Effect930Sub{})
|
||
}
|