Files
bl/logic/service/fight/effect/861_865.go
xinian 9c6f3988de
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
refactor: 重构 CurrentPet 为 CurPet
2026-04-04 04:34:43 +08:00

131 lines
3.0 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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 861: {0}回合内若对手使用属性技能则令对手所有技能降低{1}点PP值
type Effect861 struct {
RoundEffectArg0Base
}
func (e *Effect861) Skill_Use_ex() bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() != info.Category.STATUS {
return true
}
e.Ctx().Opp.DelPP(int(e.Args()[1].IntPart()))
return true
}
// Effect 862: 消耗自身所有神耀能量每消耗1层此技能威力提升{0}
type Effect862 struct {
node.EffectNode
}
func (e *Effect862) SkillHit() bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS || len(e.Args()) == 0 {
return true
}
energy := e.Ctx().Our.ConsumeDivineEnergy()
if energy <= 0 {
return true
}
e.Ctx().SkillEntity.XML.Power += energy * int(e.Args()[0].IntPart())
return true
}
// Effect 863: 后出手则下{0}回合令对手使用的攻击技能无效
type Effect863 struct {
node.EffectNode
}
func (e *Effect863) Skill_Use() bool {
if e.IsFirst() {
return true
}
addSubEffect(e.Ctx().Our, e.Ctx().Opp, &e.EffectNode, &Effect863Sub{}, -1)
return true
}
type Effect863Sub struct {
RoundEffectArg0Base
}
func (e *Effect863Sub) 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 864: 本回合未击败对手则下{0}回合反弹受到伤害的1/{1}
type Effect864 struct {
node.EffectNode
}
func (e *Effect864) Skill_Use() bool {
if e.Ctx().Opp.CurPet[0].Info.Hp == 0 {
return true
}
addSubEffect(e.Ctx().Our, e.Ctx().Our, &e.EffectNode, &Effect864Sub{}, -1)
return true
}
type Effect864Sub struct {
RoundEffectArg0Base
}
func (e *Effect864Sub) DamageSubEx(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 2 {
return true
}
if zone.Damage.Cmp(alpacadecimal.Zero) <= 0 || e.Args()[1].Cmp(alpacadecimal.Zero) <= 0 {
return true
}
reflectDamage := zone.Damage.Div(e.Args()[1])
if reflectDamage.Cmp(alpacadecimal.Zero) <= 0 {
return true
}
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: reflectDamage,
})
return true
}
// Effect 865: 击败对手则获得{0}层神耀能量
type Effect865 struct {
node.EffectNode
}
func (e *Effect865) Skill_Use() bool {
if len(e.Args()) == 0 || e.Ctx().Opp.CurPet[0].Info.Hp > 0 {
return true
}
e.Ctx().Our.AddDivineEnergy(int(e.Args()[0].IntPart()))
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 861, &Effect861{})
input.InitEffect(input.EffectType.Skill, 862, &Effect862{})
input.InitEffect(input.EffectType.Skill, 863, &Effect863{})
input.InitEffect(input.EffectType.Skill, 864, &Effect864{})
input.InitEffect(input.EffectType.Skill, 865, &Effect865{})
}