From 6e66fefcf0540d1b2586479957c1d34fa501ce6f Mon Sep 17 00:00:00 2001 From: humingxing <930621236@qq.com> Date: Mon, 19 Oct 2026 17:25:35 +0800 Subject: [PATCH] =?UTF-8?q?AI=E5=BC=80=E6=8C=96=E7=AD=96=E7=95=A5=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/script/battle/ai/decision/AiShovelPlanner.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/assets/script/battle/ai/decision/AiShovelPlanner.ts b/assets/script/battle/ai/decision/AiShovelPlanner.ts index 9617677..787d149 100644 --- a/assets/script/battle/ai/decision/AiShovelPlanner.ts +++ b/assets/script/battle/ai/decision/AiShovelPlanner.ts @@ -44,7 +44,13 @@ export class AiShovelPlanner { private _pickDig(ctx: AiPlannerContext, digs: MapGrid[]): MapGrid | null { const policy = ctx.personality.shovelPolicy; if (policy === AiShovelPolicyType.Type1) { + // 用「剩余可铲集合」作盐,避免整局死盯 digs[固定下标] let x = (Math.floor(Number(ctx.profile.seed) || 0) >>> 0) || 1; + let salt = digs.length >>> 0; + for (let i = 0; i < digs.length; i++) { + salt = (salt * 131 + ((digs[i].Index | 0) + 1)) >>> 0; + } + x ^= salt; x ^= x << 13; x ^= x >>> 17; x ^= x << 5;