3d8566bc-063f-41e8-8934-68c9ac5b8211

This commit is contained in:
2026-06-23 13:38:23 +00:00
parent 674775be0e
commit da18f32df2
36 changed files with 849 additions and 34 deletions
+5
View File
@@ -5,6 +5,7 @@
import { useState } from "react";
import { useGameStore } from "@/store/gameStore";
import { useToast } from "@/hooks/use-toast";
import { sfx } from "@/hooks/useAudio";
import { COLOR_VISUAL } from "@/lib/game/config";
import { isSolvable, canStartFrom } from "@/lib/game/decode";
import type { DecodeNode, ResonanceColor } from "@/lib/game/types";
@@ -35,9 +36,11 @@ export function DecodeArray() {
const res = clickNode(node.id);
if (res.ok && res.finished) {
setWarned(false);
sfx("decodeSuccess");
if (res.failReason) {
const ids = res.failReason.split(",").filter(Boolean);
if (ids.length) {
sfx("fragmentUnlock");
toast({
title: "✦ 记忆碎片浮现",
description: "新的回响被拼入图谱,前往「记忆图谱」查看。",
@@ -51,9 +54,11 @@ export function DecodeArray() {
return;
}
if (!res.ok) {
sfx("decodeFail");
setFlash({ id: node.id, ok: false });
setTimeout(() => setFlash(null), 280);
} else {
sfx("decodeClick", { color: node.color });
setFlash({ id: node.id, ok: true });
setTimeout(() => setFlash(null), 280);
// 点击后若不可解,提示玩家撤销