docs(effects): 移除已完成的技能效果任务文档 移除 effects 956-1005、1263-1312、1695-1734 等范围内的未实现技能效果任务文档, 这些任务已经完成实现,相关文档不再需要维护。 ```
229 lines
5.5 KiB
Go
229 lines
5.5 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 901: 消除对手回合类效果,消除成功则{0}
|
|
type Effect901 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect901) Skill_Use() bool {
|
|
if len(e.Args()) < 6 {
|
|
return true
|
|
}
|
|
before := activeTurnEffectCount(e.Ctx().Opp)
|
|
e.Ctx().Opp.CancelTurn(e.Ctx().Our)
|
|
if before <= 0 {
|
|
return true
|
|
}
|
|
for i := 0; i+2 < len(e.Args()) && i < 6; i += 3 {
|
|
statusID := int(e.Args()[i].IntPart())
|
|
chance := int(e.Args()[i+1].IntPart())
|
|
level := int8(e.Args()[i+2].IntPart())
|
|
if statusID <= 0 || chance <= 0 {
|
|
continue
|
|
}
|
|
success, _, _ := e.Input.Player.Roll(chance, 100)
|
|
if !success {
|
|
continue
|
|
}
|
|
statusEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, statusID)
|
|
if statusEffect == nil {
|
|
continue
|
|
}
|
|
if level > 0 {
|
|
statusEffect.Duration(int(level))
|
|
}
|
|
e.Ctx().Opp.AddEffect(e.Ctx().Our, statusEffect)
|
|
}
|
|
return true
|
|
}
|
|
|
|
// Effect 902: 消耗自身全部体力,消除对手能力提升状态和回合类效果并使对手{0}回合内所有技能失效
|
|
type Effect902 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect902) Skill_Use() bool {
|
|
if len(e.Args()) == 0 {
|
|
return true
|
|
}
|
|
e.Ctx().Our.Damage(e.Ctx().Our, &info.DamageZone{
|
|
Type: info.DamageType.Fixed,
|
|
Damage: e.Ctx().Our.CurrentPet.GetHP(),
|
|
})
|
|
for i, v := range e.Ctx().Opp.Prop[:] {
|
|
if v <= 0 {
|
|
continue
|
|
}
|
|
e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), 0)
|
|
}
|
|
e.Ctx().Opp.CancelTurn(e.Ctx().Our)
|
|
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 902, int(e.Args()[0].IntPart()))
|
|
if sub != nil {
|
|
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
|
|
}
|
|
return true
|
|
}
|
|
|
|
type Effect902Sub struct {
|
|
RoundEffectArg0Base
|
|
}
|
|
|
|
func (e *Effect902Sub) ActionStart(a, b *action.SelectSkillAction) bool {
|
|
if e.Ctx().SkillEntity == nil {
|
|
return true
|
|
}
|
|
e.Ctx().SkillEntity.SetMiss()
|
|
return true
|
|
}
|
|
|
|
// Effect 903: 自身体力高于对手时附加自身最大体力值{0}%的百分比伤害
|
|
type Effect903 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect903) OnSkill() bool {
|
|
if len(e.Args()) == 0 {
|
|
return true
|
|
}
|
|
if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Opp.CurrentPet.GetHP()) <= 0 {
|
|
return true
|
|
}
|
|
damage := e.Ctx().Our.CurrentPet.GetMaxHP().Mul(e.Args()[0]).Div(alpacadecimal.NewFromInt(100))
|
|
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
|
Type: info.DamageType.Percent,
|
|
Damage: damage,
|
|
})
|
|
return true
|
|
}
|
|
|
|
// Effect 904: 消耗自身全部体力,消除对手回合类效果且令己方免疫下{0}次受到的异常状态,同时己方下只精灵出战时获得{1}点护盾且{2}回合内令对手使用的属性技能无效
|
|
type Effect904 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect904) Skill_Use() bool {
|
|
if len(e.Args()) < 3 {
|
|
return true
|
|
}
|
|
e.Ctx().Our.Damage(e.Ctx().Our, &info.DamageZone{
|
|
Type: info.DamageType.Fixed,
|
|
Damage: e.Ctx().Our.CurrentPet.GetHP(),
|
|
})
|
|
e.Ctx().Opp.CancelTurn(e.Ctx().Our)
|
|
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 904, 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 Effect904Sub struct {
|
|
node.EffectNode
|
|
statusImmuneRemaining int
|
|
shieldGranted bool
|
|
}
|
|
|
|
func (e *Effect904Sub) SetArgs(t *input.Input, a ...int) {
|
|
e.EffectNode.SetArgs(t, a...)
|
|
if len(a) > 2 {
|
|
e.Duration(a[2])
|
|
} else {
|
|
e.Duration(-1)
|
|
}
|
|
if len(a) > 0 {
|
|
e.statusImmuneRemaining = a[0]
|
|
}
|
|
}
|
|
|
|
func (e *Effect904Sub) ActionStart(a, b *action.SelectSkillAction) bool {
|
|
skill := e.Ctx().SkillEntity
|
|
if skill == nil || skill.Category() != info.Category.STATUS {
|
|
return true
|
|
}
|
|
skill.SetMiss()
|
|
return true
|
|
}
|
|
|
|
func (e *Effect904Sub) SwitchIn(in *input.Input) bool {
|
|
if in != e.Ctx().Our || e.shieldGranted || len(e.Args()) < 2 {
|
|
return true
|
|
}
|
|
e.shieldGranted = true
|
|
e.Ctx().Our.AddShield(e.Args()[1])
|
|
return true
|
|
}
|
|
|
|
func (e *Effect904Sub) EFFect_Befer(in *input.Input, effEffect input.Effect) bool {
|
|
if e.statusImmuneRemaining <= 0 {
|
|
return true
|
|
}
|
|
if in != e.Ctx().Opp || !input.IS_Stat(effEffect) {
|
|
return true
|
|
}
|
|
e.statusImmuneRemaining--
|
|
if e.statusImmuneRemaining <= 0 && e.Duration() <= 0 {
|
|
e.Alive(false)
|
|
}
|
|
return false
|
|
}
|
|
|
|
// Effect 905: 消除对手能力提升,消除成功{0}回合内对手无法通过自身技能恢复体力
|
|
type Effect905 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect905) 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
|
|
}
|
|
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 905, int(e.Args()[0].IntPart()))
|
|
if sub != nil {
|
|
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
|
|
}
|
|
return true
|
|
}
|
|
|
|
type Effect905Sub struct {
|
|
RoundEffectArg0Base
|
|
}
|
|
|
|
func (e *Effect905Sub) Heal_Pre(ac action.BattleActionI, value *int) bool {
|
|
if value == nil || *value <= 0 {
|
|
return true
|
|
}
|
|
*value = 0
|
|
return true
|
|
}
|
|
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 901, &Effect901{})
|
|
input.InitEffect(input.EffectType.Skill, 902, &Effect902{})
|
|
input.InitEffect(input.EffectType.Sub, 902, &Effect902Sub{})
|
|
input.InitEffect(input.EffectType.Skill, 903, &Effect903{})
|
|
input.InitEffect(input.EffectType.Skill, 904, &Effect904{})
|
|
input.InitEffect(input.EffectType.Sub, 904, &Effect904Sub{})
|
|
input.InitEffect(input.EffectType.Skill, 905, &Effect905{})
|
|
input.InitEffect(input.EffectType.Sub, 905, &Effect905Sub{})
|
|
}
|