``` feat(fight): 新增多种技能效果实现(110/125/128/131/145/151),优化状态判断逻辑并重构随机数生成方式

This commit is contained in:
1
2025-12-11 20:05:00 +00:00
parent 5ca43fe21f
commit 4c69e578dd
13 changed files with 328 additions and 33 deletions

View File

@@ -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
}