Files
bl/logic/service/fight/effect/497.go
xinian 069d961585
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
refactor: 重构效果 150、196、437 实现
2026-03-08 16:22:54 +08:00

46 lines
1.2 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/common/utils"
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/alpacahq/alpacadecimal"
)
// 497 - 附加m点固定伤害每次使用额外附加n点最高k点遇到天敌时效果翻倍
type Effect497 struct {
node.EffectNode
Skillid int //记录使用的技能 如果技能变了就删除effect
UseSkillCount int //技能使用了多少次切换后置0
}
func (e *Effect497) OnSkill() bool {
if e.Skillid != 0 && e.Ctx().SkillEntity.ID != e.Skillid {
e.Alive(false)
e.UseSkillCount = 0
return true
}
e.Skillid = e.Ctx().SkillEntity.ID
add := e.EffectNode.SideEffectArgs[0] + e.EffectNode.SideEffectArgs[1]*e.UseSkillCount
add = utils.Min(add, e.EffectNode.SideEffectArgs[2])
// 附加固定伤害
damageZone := &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: alpacadecimal.NewFromInt(int64(add)),
}
e.Ctx().Opp.Damage(e.Ctx().Our, damageZone)
return true
}
func init() {
t := &Effect497{}
t.Duration(-1) //次数类无限回合
t.CanStack(true) //后续的不会顶掉这个效果
input.InitEffect(input.EffectType.Skill, 497, t)
}