Files
bl/logic/service/fight/effect/effect_502.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

36 lines
759 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.CurPet[0].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{})
}