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

36 lines
760 B
Go

package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
)
// Effect 502: {0}回合内所有直接攻击都将降低对手1/{1}的HP
type Effect502 struct {
RoundEffectArg0Base
}
func (e *Effect502) OnSkill() bool {
if e.Ctx().SkillEntity == nil {
return true
}
if e.Ctx().SkillEntity.Category() != info.Category.STATUS { // 非属性技能,即直接攻击
// 计算对手最大体力的1/m
maxHp := e.Ctx().Opp.CurrentPet.GetMaxHP()
damage := maxHp.Div(e.Args()[1])
damageZone := &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: damage,
}
e.Ctx().Opp.Damage(e.Ctx().Our, damageZone)
}
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 502, &Effect502{})
}