1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-06-15 16:12:30 +08:00

refactor(MathTool): 重命名随机数相关方法以提高可读性

将 randv2_range 重命名为 randomVector2In,randc_from 重命名为 randomChoiceFrom,randc_from_weights 重命名为 randChoiceWeightsFrom,并新增 randomRingPoint 方法
This commit is contained in:
2025-12-14 15:06:22 +08:00
parent 74d3e03fef
commit 2232c9148a
12 changed files with 30 additions and 28 deletions
+1 -1
View File
@@ -34,7 +34,7 @@ func attack(type):
await TickTool.millseconds(randi_range(10, 50))
elif type == 1 and health < fields[FieldStore.Entity.MAX_HEALTH] * 0.5 and canSummon:
for i in randi_range(1, 2):
var child = EntityBase.generate(ComponentManager.getCharacter("KukeChild"), position + MathTool.randv2_range(500))
var child = EntityBase.generate(ComponentManager.getCharacter("KukeChild"), position + MathTool.randomVector2In(500))
child.currentFocusedBoss = currentFocusedBoss
child.masterMine = self
elif type == 2: