docs(effect): 移除已完成的效果任务文档 移除effects 876-1061范围内的任务文档,这些effect已经实现或不再需要跟踪。 包括task-053至task-089的多个任务列表,涵盖各种战斗效果的实现说明。 ```
166 lines
3.9 KiB
Go
166 lines
3.9 KiB
Go
package effect
|
|
|
|
import (
|
|
"blazing/logic/service/fight/info"
|
|
"blazing/logic/service/fight/input"
|
|
"blazing/logic/service/fight/node"
|
|
|
|
"github.com/alpacahq/alpacadecimal"
|
|
)
|
|
|
|
// Effect 1006: 造成的伤害超过{0}则下{1}回合免疫异常状态
|
|
type Effect1006 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect1006) Skill_Use() bool {
|
|
if len(e.Args()) < 2 || e.Ctx().Our.SumDamage.Cmp(e.Args()[0]) <= 0 {
|
|
return true
|
|
}
|
|
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1006, int(e.Args()[1].IntPart()))
|
|
if sub != nil {
|
|
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
|
|
}
|
|
return true
|
|
}
|
|
|
|
type Effect1006Sub struct {
|
|
RoundEffectArg0Base
|
|
}
|
|
|
|
func (e *Effect1006Sub) EFFect_Befer(in *input.Input, effEffect input.Effect) bool {
|
|
if in != e.Ctx().Opp || !input.IS_Stat(effEffect) {
|
|
return true
|
|
}
|
|
return false
|
|
}
|
|
|
|
// Effect 1007: {0}回合内每次攻击都有{1}%概率令对手{2},未触发则对手全属性-{3}
|
|
type Effect1007 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect1007) Skill_Use() bool {
|
|
if len(e.Args()) < 4 {
|
|
return true
|
|
}
|
|
sub := e.Ctx().Our.InitEffect(
|
|
input.EffectType.Sub,
|
|
1007,
|
|
int(e.Args()[0].IntPart()),
|
|
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 Effect1007Sub struct {
|
|
RoundEffectArg0Base
|
|
}
|
|
|
|
func (e *Effect1007Sub) OnSkill() bool {
|
|
if len(e.Args()) < 4 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
|
return true
|
|
}
|
|
ok, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100)
|
|
if ok {
|
|
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[2].IntPart()))
|
|
return true
|
|
}
|
|
applyAllPropDown(e.Ctx().Our, e.Ctx().Opp, int8(e.Args()[3].IntPart()))
|
|
return true
|
|
}
|
|
|
|
// Effect 1008: 造成的伤害高于{0}则获得{1}点护盾
|
|
type Effect1008 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect1008) Skill_Use() bool {
|
|
if len(e.Args()) < 2 || e.Ctx().Our.SumDamage.Cmp(e.Args()[0]) <= 0 {
|
|
return true
|
|
}
|
|
e.Ctx().Our.AddShield(e.Args()[1])
|
|
return true
|
|
}
|
|
|
|
// Effect 1009: 消除对手能力提升状态,消除成功则对手全属性-{0}
|
|
type Effect1009 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect1009) 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) {
|
|
cleared = true
|
|
}
|
|
}
|
|
if !cleared {
|
|
return true
|
|
}
|
|
applyAllPropDown(e.Ctx().Our, e.Ctx().Opp, int8(e.Args()[0].IntPart()))
|
|
return true
|
|
}
|
|
|
|
// Effect 1010: 消除对手能力提升状态,消除成功则下{0}回合造成的伤害提高{1}%
|
|
type Effect1010 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect1010) Skill_Use() bool {
|
|
if len(e.Args()) < 2 {
|
|
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) {
|
|
cleared = true
|
|
}
|
|
}
|
|
if !cleared {
|
|
return true
|
|
}
|
|
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1010, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
|
|
if sub != nil {
|
|
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
|
|
}
|
|
return true
|
|
}
|
|
|
|
type Effect1010Sub struct {
|
|
RoundEffectArg0Base
|
|
}
|
|
|
|
func (e *Effect1010Sub) Damage_Mul(zone *info.DamageZone) bool {
|
|
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 2 {
|
|
return true
|
|
}
|
|
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(100).Add(e.Args()[1])).Div(alpacadecimal.NewFromInt(100))
|
|
return true
|
|
}
|
|
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 1006, &Effect1006{})
|
|
input.InitEffect(input.EffectType.Sub, 1006, &Effect1006Sub{})
|
|
input.InitEffect(input.EffectType.Skill, 1007, &Effect1007{})
|
|
input.InitEffect(input.EffectType.Sub, 1007, &Effect1007Sub{})
|
|
input.InitEffect(input.EffectType.Skill, 1008, &Effect1008{})
|
|
input.InitEffect(input.EffectType.Skill, 1009, &Effect1009{})
|
|
input.InitEffect(input.EffectType.Skill, 1010, &Effect1010{})
|
|
input.InitEffect(input.EffectType.Sub, 1010, &Effect1010Sub{})
|
|
}
|