refactor(fight/effect): 封装Effect2的BeforeSkill逻辑到Prop回调中,确保正确获取敌方防御属性

This commit is contained in:
1
2025-09-24 23:14:27 +00:00
parent e7ac3991c3
commit d9d47b8d21

View File

@@ -22,9 +22,12 @@ type Effect2 struct {
}
func (e *Effect2) BeforeSkill(opp *input.Input, skill *info.SkillEntity) {
if opp.CurrentPet.Info.Hp < (opp.CurrentPet.Info.MaxHp / 2) {
skill.Power *= 2
opp.Prop(e.Input, func() { //我方取敌方防御
if opp.CurrentPet.Info.Hp < (opp.CurrentPet.Info.MaxHp / 2) {
skill.Power *= 2
}
}
})
}