3d8566bc-063f-41e8-8934-68c9ac5b8211
This commit is contained in:
@@ -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);
|
||||
// 点击后若不可解,提示玩家撤销
|
||||
|
||||
Reference in New Issue
Block a user