fix: prevent non-combat room repeated rewards during descent (Issue #382)
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m24s
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m24s
- Wrap library XP grant in progress < required guard so completed rooms don't grant XP every tick - Add early return in treasure room tick when progress >= required to skip loot processing - Initialize non-combat rooms (library, treasure, recovery) during descent in onEnterRoomDescend - Add regression test file: non-combat-room-reward-guards.test.ts (8 tests)
This commit is contained in:
@@ -214,6 +214,17 @@ export function onEnterRoomDescend(get: GetFn, set: SetFn): void {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize non-combat rooms during descent so they have proper progress tracking
|
||||
if (s.currentRoom.roomType === 'library') {
|
||||
onEnterLibraryRoom(get, set);
|
||||
} else if (s.currentRoom.roomType === 'recovery') {
|
||||
onEnterRecoveryRoom(get, set);
|
||||
} else if (s.currentRoom.roomType === 'treasure') {
|
||||
onEnterTreasureRoom(get, set);
|
||||
} else if (s.currentRoom.roomType === 'puzzle') {
|
||||
onEnterPuzzleRoom(get, set);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user