fix: reduce active celebration workload and restore node and navigation feedback

This commit is contained in:
toshiocn
2026-10-23 16:41:53 +08:00
parent 0cefce44ef
commit 6abbc37399
22 changed files with 277 additions and 80 deletions
@@ -7,7 +7,7 @@ export function applyLayeredFeedback(source){
replace("record.backtracks++;path.pop();sound.play('undo');","record.backtracks++;const removed=path.pop();feedback.emit('undo',level,removed,path.length,{from:path.at(-1)});");
replace("path.pop();sound.play('undo');record.backtracks++;","const removed=path.pop();feedback.emit('undo',level,removed,path.length,{from:path.at(-1)});record.backtracks++;");
const audio="if(path.length<level.cells.length)sound.play(cell.clue!==undefined&&cell.clue===path.length?(cell.clue>1?'checkpoint':'correct'):'move',0,path.length)";
replace(audio,"if(path.length<level.cells.length)feedback.emit((cell.clue>1&&cell.clue===path.length)||cell.parity||cell.direction?'checkpoint':'move',level,id,path.length,{from:path.at(-2),ribbon:cell.clue>1&&cell.clue===path.length})");
replace(audio,"if(path.length<level.cells.length)feedback.emit((cell.clue>1&&cell.clue===path.length)||cell.parity||cell.direction?'checkpoint':'move',level,id,path.length,{from:path.at(-2),ribbon:Boolean(cell.parity)||(cell.clue>1&&cell.clue===path.length)})");
replace("sound.play('complete',0)","feedback.emit('complete',level,id,path.length,{from:path.at(-2)})");
replace("sound.unlock();sound.play('restart');","feedback.reset();sound.unlock();sound.play('restart');");
replace('advance(hit(a[0]+(p[0]-a[0])*i/steps,a[1]+(p[1]-a[1])*i/steps))','advanceAt(a[0]+(p[0]-a[0])*i/steps,a[1]+(p[1]-a[1])*i/steps)');