``` feat(fight): 新增多种技能效果实现(110/125/128/131/145/151),优化状态判断逻辑并重构随机数生成方式
This commit is contained in:
@@ -46,13 +46,13 @@ func (e *EffectRandomPower) Skill_Hit() bool {
|
||||
}
|
||||
|
||||
// 如果 FightC 没提供随机器,使用 math/rand 兜底
|
||||
var n int
|
||||
if e.Input != nil && e.Input.FightC != nil {
|
||||
n = int(e.Input.FightC.GetRand().Int31n(int32(e.Max-e.Min+1))) + e.Min
|
||||
} else {
|
||||
n = grand.Intn(e.Max-e.Min+1) + e.Min
|
||||
}
|
||||
|
||||
// var n int
|
||||
// if e.Input != nil && e.Input.FightC != nil {
|
||||
// n = int(e.Input.FightC.GetRand().Int31n(int32(e.Max-e.Min+1))) + e.Min
|
||||
// } else {
|
||||
// n = grand.Intn(e.Max-e.Min+1) + e.Min
|
||||
// }
|
||||
n := grand.N(e.Min, e.Max)
|
||||
e.Ctx().SkillEntity.Power = n
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user