Files
bl/logic/service/fight/effect/749_753.go
昔念 ec9f592e44
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
```
refactor(effect): 移除未使用的action包导入

移除了effect/749_753.go文件中未被使用的blazing/logic/service/fight/action包导入,
保持代码整洁性。
```
2026-03-30 21:09:39 +08:00

169 lines
3.8 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 749: {0}%令对手全属性-{1}
type Effect749 struct {
node.EffectNode
}
func (e *Effect749) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
success, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100)
if !success {
return true
}
applyAllPropDown(e.Ctx().Our, e.Ctx().Opp, int8(e.Args()[1].IntPart()))
return true
}
// Effect 750: 先出手时无视伤害限制效果
type Effect750 struct {
node.EffectNode
disabled []input.Effect
}
func (e *Effect750) SkillHit() bool {
if !e.IsFirst() || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
e.disabled = e.disabled[:0]
for _, effect := range e.Ctx().Opp.Effects {
if effect == nil || !effect.Alive() {
continue
}
if _, ok := effect697IgnoredLimitIDs[int(effect.ID().Suffix())]; !ok {
continue
}
effect.Alive(false)
e.disabled = append(e.disabled, effect)
}
return true
}
func (e *Effect750) Skill_Use() bool {
restoreTemporarilyDisabledEffects(e.disabled)
e.disabled = e.disabled[:0]
return true
}
func (e *Effect750) Action_end() bool {
restoreTemporarilyDisabledEffects(e.disabled)
e.disabled = e.disabled[:0]
return true
}
// Effect 751: 附加对手当前体力{0}%的伤害
type Effect751 struct {
node.EffectNode
}
func (e *Effect751) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
damage := e.Ctx().Opp.CurrentPet.GetHP().Mul(e.Args()[0]).Div(hundred)
if damage.Cmp(alpacadecimal.Zero) <= 0 {
return true
}
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Percent,
Damage: damage,
})
return true
}
// Effect 752: 若对手处于异常状态则回合结束时减少对手1/{0}最大体力
type Effect752 struct {
node.EffectNode
}
func (e *Effect752) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 752, int(e.Args()[0].IntPart()))
if effect != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, effect)
}
return true
}
type Effect752Sub struct {
FixedDuration1Base
}
func (e *Effect752Sub) TurnEnd() {
if len(e.Args()) == 0 || !e.Ctx().Opp.StatEffect_Exist_all() {
e.Alive(false)
return
}
damage := e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[0])
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Percent,
Damage: damage,
})
e.Alive(false)
}
// Effect 753: 消耗自身全部体力,使对手{0}回合内使用属性技能失效(延续到对手所有精灵)
type Effect753 struct {
node.EffectNode
}
func (e *Effect753) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 753, int(e.Args()[0].IntPart()))
if effect != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, effect)
}
e.Ctx().Our.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: alpacadecimal.NewFromInt(int64(e.Ctx().Our.CurrentPet.Info.MaxHp)),
})
return true
}
type Effect753Sub struct {
RoundEffectArg0Base
}
func (e *Effect753Sub) SkillHit_ex() bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() != info.Category.STATUS {
return true
}
e.Ctx().SkillEntity.SetNoSide()
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 749, &Effect749{})
input.InitEffect(input.EffectType.Skill, 750, &Effect750{})
input.InitEffect(input.EffectType.Skill, 751, &Effect751{})
input.InitEffect(input.EffectType.Skill, 752, &Effect752{})
input.InitEffect(input.EffectType.Sub, 752, &Effect752Sub{})
input.InitEffect(input.EffectType.Skill, 753, &Effect753{})
input.InitEffect(input.EffectType.Sub, 753, &Effect753Sub{})
}