Files
bl/logic/service/fight/effect/475.go
xinian 875ad668aa
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed
feat: 实现战斗效果逻辑和接口重构
2026-03-28 21:57:22 +08:00

52 lines
1.1 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"
)
// Effect 475: 若造成的伤害不足{0},则下{1}回合的攻击必定致命一击
type Effect475 struct {
node.EffectNode
damageThreshold int
critDuration int
}
func (e *Effect475) Skill_Use() bool {
damageThreshold := int(e.Args()[0].IntPart())
damageDone := e.Ctx().Our.SumDamage
if damageDone.IntPart() < int64(damageThreshold) {
critDuration := int(e.Args()[1].IntPart())
addSubEffect(e.Ctx().Our, e.Ctx().Our, &e.EffectNode, &Effect475_sub{}, critDuration)
}
return true
}
type Effect475_sub struct {
node.EffectNode
}
func (e *Effect475_sub) ActionStart(a, b *action.SelectSkillAction) bool {
//fmt.Println(e.Ctx().SkillEntity)
if e.Ctx().SkillEntity == nil {
return true
}
if e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
e.Ctx().SkillEntity.XML.CritRate = 16
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 475, &Effect475{})
}