docs(effect): 移除已完成的效果任务文档 移除effects 876-1061范围内的任务文档,这些effect已经实现或不再需要跟踪。 包括task-053至task-089的多个任务列表,涵盖各种战斗效果的实现说明。 ```
204 lines
4.9 KiB
Go
204 lines
4.9 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 1031: 出手时本回合若未受到伤害则对手下{0}回合属性技能无效
|
|
type Effect1031 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect1031) Skill_Use() bool {
|
|
if len(e.Args()) == 0 || e.Ctx().Opp.SumDamage.Cmp(alpacadecimal.Zero) > 0 {
|
|
return true
|
|
}
|
|
|
|
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1031, int(e.Args()[0].IntPart()))
|
|
if sub != nil {
|
|
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
|
|
}
|
|
return true
|
|
}
|
|
|
|
type Effect1031Sub struct {
|
|
RoundEffectArg0Base
|
|
}
|
|
|
|
func (e *Effect1031Sub) 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
|
|
}
|
|
|
|
// Effect 1032: 消除对手回合类效果,消除成功则下{0}回合令对手使用的攻击技能无效
|
|
type Effect1032 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect1032) 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, 1032, int(e.Args()[0].IntPart()))
|
|
if sub != nil {
|
|
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
|
|
}
|
|
return true
|
|
}
|
|
|
|
type Effect1032Sub struct {
|
|
RoundEffectArg0Base
|
|
}
|
|
|
|
func (e *Effect1032Sub) 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
|
|
}
|
|
|
|
// Effect 1033: {0}%使对手{1},未触发则自身下{2}回合攻击必定致命一击
|
|
type Effect1033 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect1033) Skill_Use() bool {
|
|
if len(e.Args()) < 3 {
|
|
return true
|
|
}
|
|
|
|
success, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100)
|
|
if success {
|
|
applyStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
|
|
return true
|
|
}
|
|
|
|
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1033, int(e.Args()[2].IntPart()))
|
|
if sub != nil {
|
|
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
|
|
}
|
|
return true
|
|
}
|
|
|
|
type Effect1033Sub struct {
|
|
RoundEffectArg0Base
|
|
}
|
|
|
|
func (e *Effect1033Sub) ActionStart(a, b *action.SelectSkillAction) bool {
|
|
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
|
return true
|
|
}
|
|
e.Ctx().SkillEntity.XML.CritRate = 16
|
|
return true
|
|
}
|
|
|
|
// Effect 1034: 消除对手回合类效果,消除成功则免疫下{0}回合受到的攻击伤害
|
|
type Effect1034 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect1034) 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, 1034, int(e.Args()[0].IntPart()))
|
|
if sub != nil {
|
|
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
|
|
}
|
|
return true
|
|
}
|
|
|
|
type Effect1034Sub struct {
|
|
RoundEffectArg0Base
|
|
}
|
|
|
|
func (e *Effect1034Sub) DamageLockEx(zone *info.DamageZone) bool {
|
|
if zone == nil || zone.Type != info.DamageType.Red {
|
|
return true
|
|
}
|
|
zone.Damage = alpacadecimal.Zero
|
|
return true
|
|
}
|
|
|
|
// Effect 1035: 命中后{0}%使对手{1},未触发则下{2}回合攻击有{3}%概率使对手{4}
|
|
type Effect1035 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect1035) SkillHit() bool {
|
|
if len(e.Args()) < 5 {
|
|
return true
|
|
}
|
|
|
|
success, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100)
|
|
if success {
|
|
applyStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
|
|
return true
|
|
}
|
|
|
|
sub := e.Ctx().Our.InitEffect(
|
|
input.EffectType.Sub,
|
|
1035,
|
|
int(e.Args()[2].IntPart()),
|
|
int(e.Args()[3].IntPart()),
|
|
int(e.Args()[4].IntPart()),
|
|
)
|
|
if sub != nil {
|
|
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
|
|
}
|
|
return true
|
|
}
|
|
|
|
type Effect1035Sub struct {
|
|
RoundEffectArg0Base
|
|
}
|
|
|
|
func (e *Effect1035Sub) OnSkill() bool {
|
|
if len(e.Args()) < 3 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
|
return true
|
|
}
|
|
|
|
success, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100)
|
|
if !success {
|
|
return true
|
|
}
|
|
applyStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[2].IntPart()))
|
|
return true
|
|
}
|
|
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 1031, &Effect1031{})
|
|
input.InitEffect(input.EffectType.Sub, 1031, &Effect1031Sub{})
|
|
input.InitEffect(input.EffectType.Skill, 1032, &Effect1032{})
|
|
input.InitEffect(input.EffectType.Sub, 1032, &Effect1032Sub{})
|
|
input.InitEffect(input.EffectType.Skill, 1033, &Effect1033{})
|
|
input.InitEffect(input.EffectType.Sub, 1033, &Effect1033Sub{})
|
|
input.InitEffect(input.EffectType.Skill, 1034, &Effect1034{})
|
|
input.InitEffect(input.EffectType.Sub, 1034, &Effect1034Sub{})
|
|
input.InitEffect(input.EffectType.Skill, 1035, &Effect1035{})
|
|
input.InitEffect(input.EffectType.Sub, 1035, &Effect1035Sub{})
|
|
}
|