refactor(fight/effect): 重构效果触发时机处理,统一命中前/后接口并移除冗余方法
This commit is contained in:
@@ -12,16 +12,6 @@ type Effect0 struct {
|
||||
node.EffectNode
|
||||
}
|
||||
|
||||
// 技能命中计算
|
||||
func (this *Effect0) IsHit(opp *input.Input, skill *info.SkillEntity) {
|
||||
skill.AttackTimeC(int(opp.GetProp(5, true))) //计算命中
|
||||
}
|
||||
|
||||
// 比如xx技能无效
|
||||
func (this *Effect0) UseSkill(opp *input.Input) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *Effect0) TurnEnd(opp *input.Input) {
|
||||
e.Input.AttackValue.RemainHp = int32(e.Input.CurrentPet.Info.Hp)
|
||||
|
||||
@@ -35,7 +25,6 @@ func (e *Effect0) OnSkill(opp *input.Input, skill *info.SkillEntity) {
|
||||
|
||||
e.Input.Exec(func(t input.Effect) bool { //计算暴击率加成
|
||||
|
||||
t.IsCrit(opp, skill)
|
||||
e.Input.AttackValue.IsCritical = skill.Crit
|
||||
return e.Input.AttackValue.IsCritical == 0
|
||||
})
|
||||
@@ -45,7 +34,8 @@ func (e *Effect0) OnSkill(opp *input.Input, skill *info.SkillEntity) {
|
||||
}
|
||||
|
||||
}
|
||||
func (this *Effect0) IsCrit(opp *input.Input, skill *info.SkillEntity) {
|
||||
func (this *Effect0) BeforHit(opp *input.Input, skill *info.SkillEntity) {
|
||||
skill.AttackTimeC(int(opp.GetProp(5, true))) //计算命中
|
||||
skill.Crit = 0
|
||||
CritRate := utils.Max(skill.CritRate, 1)
|
||||
CritRateR := this.Input.FightC.GetRand().Int31n(16)
|
||||
|
||||
Reference in New Issue
Block a user