Skip to content

Commit 9277a81

Browse files
Fix power-up panel visibility for conditional power-ups
- Expand valid phases to include track-type, mutation-result, and compose - Disable Room Lock when no tracks exist - Disable One Last Breath when no curses to reverse
1 parent 148d91e commit 9277a81

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/ui/render.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,11 @@ function renderPowerUpPanel(): void {
9494
const panel = $('powerup-panel');
9595
if (!panel) return;
9696

97+
const validPhases = ['track-type', 'curse-check', 'mutation', 'mutation-result', 'curse-result', 'compose'];
9798
const canUse =
9899
state.powerUps > 0 &&
99100
!state.usedPowerUpThisRoom &&
100-
['curse-check', 'mutation', 'curse-result'].includes(state.phase);
101+
validPhases.includes(state.phase);
101102

102103
panel.classList.toggle('hidden', !canUse);
103104

@@ -106,9 +107,9 @@ function renderPowerUpPanel(): void {
106107
const type = btn.dataset.type;
107108
let disabled = false;
108109

109-
if (type === 'lock' && state.usedRoomLock) disabled = true;
110+
if (type === 'lock' && (state.usedRoomLock || state.tracks.length === 0)) disabled = true;
110111
if (type === 'painshift' && (state.room <= 3 || state.phase !== 'curse-check')) disabled = true;
111-
if (type === 'breath' && state.usedOneLastBreath) disabled = true;
112+
if (type === 'breath' && (state.usedOneLastBreath || state.curses.length === 0)) disabled = true;
112113
if (type === 'redirect' && state.phase !== 'curse-result') disabled = true;
113114
if (type === 'split' && state.phase !== 'curse-result') disabled = true;
114115

0 commit comments

Comments
 (0)