feat: Add universal victory celebration modal, chamber item requirements, and fix broom & cauldron displays
This commit is contained in:
+23
-8
@@ -165,11 +165,7 @@
|
||||
activeTargets.clear();
|
||||
|
||||
if (won) {
|
||||
if (window.soundFX) window.soundFX.playMagicSuccess();
|
||||
if (window.navigator && window.navigator.vibrate) {
|
||||
window.navigator.vibrate([50, 100, 150]);
|
||||
}
|
||||
|
||||
let newItem = null;
|
||||
try {
|
||||
const res = await fetch('/api/pixies/complete', {
|
||||
method: 'POST',
|
||||
@@ -177,15 +173,34 @@
|
||||
body: JSON.stringify({ caught: score })
|
||||
});
|
||||
const data = await res.json();
|
||||
if (data.new_item && window.notifyNewItem) {
|
||||
window.notifyNewItem(data.new_item);
|
||||
}
|
||||
if (data.new_item) newItem = data.new_item;
|
||||
} catch (e) {
|
||||
console.error("Pixies complete error:", e);
|
||||
}
|
||||
|
||||
if (!newItem) {
|
||||
newItem = {
|
||||
id: "pixie_jar",
|
||||
name: "Wichtelglas",
|
||||
icon: "🧚",
|
||||
desc: "Ein dickbauchiges Glas mit einem gebannten Wichtel."
|
||||
};
|
||||
}
|
||||
|
||||
if (successPanel) successPanel.style.display = 'block';
|
||||
|
||||
if (window.showChamberVictory) {
|
||||
window.showChamberVictory({
|
||||
chamberBadge: "Kammer V: Wichtel-Panik",
|
||||
title: "🧚 Wichtel Gebannt!",
|
||||
statsHtml: `<span>❄️ Gebannt: <strong>${score} Wichtel</strong></span><span>👦 Neville: <strong>Gerettet</strong></span>`,
|
||||
item: newItem,
|
||||
storyText: "Mit blitzschnellen <em>Immobilus!</em>-Zaubern hast du alle 10 Wichtel eingefroren! Ein zappelnder Wichtel landet sicher im <strong>Wichtelglas</strong>. Neville bedankt sich erleichtert. Der Weg zur berüchtigten <strong>Flammenkammer von Severus Snape</strong> liegt nun offen!",
|
||||
nextUrl: "/bottles",
|
||||
nextBtnText: "➔ Weiter zu Kammer VI: Snapes Flaschen 🧪"
|
||||
});
|
||||
}
|
||||
|
||||
} else {
|
||||
if (window.soundFX) window.soundFX.playWhoosh();
|
||||
if (startOverlay) {
|
||||
|
||||
Reference in New Issue
Block a user