refactor(fight/effect): 封装Effect2的BeforeSkill逻辑到Prop回调中,确保正确获取敌方防御属性
This commit is contained in:
@@ -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
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user