Expand narrated story, preserve solved patterns, and add ambience
Connect the island story with new character memories and narrative transitions. Blend each solved symbol into its artwork and retain a replayable pattern stamp. Allow completed grids to be inspected after navigation and app restarts. Reduce campaign difficulty spikes and keep explained story hints free. Append 24 narrated continuations while preserving original PCM takes. Add four offline environmental loops with saved mute/volume controls, scene fades, narration ducking and lifecycle handling. Validation: 31 unit/widget tests, Flutter analysis, narration and soundscape asset checks, tablet discovery layouts and extended-audio integration, including simultaneous active voice and ambience mixer tracks.
This commit is contained in:
@@ -10,6 +10,32 @@ import 'package:lumen/services/progress.dart';
|
||||
|
||||
void main() {
|
||||
TestWidgetsFlutterBinding.ensureInitialized();
|
||||
test(
|
||||
'every story passage and continuation has a complete recorded script',
|
||||
() async {
|
||||
final book = await Book.load();
|
||||
String joined(String base, String continuation) =>
|
||||
[base, continuation].where((s) => s.isNotEmpty).join('\n\n');
|
||||
for (final page in book.pages.where((p) => p.text.isNotEmpty)) {
|
||||
expect(
|
||||
book.tracks[page.id]?['text'],
|
||||
joined(page.text, page.continuation),
|
||||
reason: page.id,
|
||||
);
|
||||
}
|
||||
for (var i = 4; i < book.levels.length; i++) {
|
||||
final level = book.levels[i];
|
||||
expect(
|
||||
book.tracks['campaign.$i.before']['text'],
|
||||
joined(level.before, level.beforeContinuation),
|
||||
);
|
||||
expect(
|
||||
book.tracks['campaign.$i.after']['text'],
|
||||
joined(level.after, level.afterContinuation),
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
test(
|
||||
'cottage pages have stable identities and complete puzzle beats',
|
||||
() async {
|
||||
@@ -209,6 +235,65 @@ void main() {
|
||||
1,
|
||||
);
|
||||
});
|
||||
test('campaign has a foothold and bounded comparison chains', () async {
|
||||
final book = await Book.load();
|
||||
for (var i = 2; i < book.levels.length; i++) {
|
||||
final p = book.levels[i].puzzle();
|
||||
final solver = LogicSolver(49, p.constraints);
|
||||
final start = solver.analyze(p.initial, useAreas: false);
|
||||
expect(
|
||||
start.cells.where((v) => v >= 0).length -
|
||||
p.given.where((v) => v).length,
|
||||
greaterThanOrEqualTo(7),
|
||||
reason: 'A few clear deductions before comparing areas: $i',
|
||||
);
|
||||
expect(
|
||||
solver.analyze(p.initial).areaDeductions,
|
||||
lessThanOrEqualTo(
|
||||
i == 2
|
||||
? 3
|
||||
: i < 8
|
||||
? 5
|
||||
: 6,
|
||||
),
|
||||
reason: 'Avoid abrupt jumps in comparison work: $i',
|
||||
);
|
||||
}
|
||||
});
|
||||
test(
|
||||
'completed campaign grids can be inspected after restart without awards',
|
||||
() async {
|
||||
final book = await Book.load();
|
||||
final g = Game(
|
||||
book,
|
||||
Progress.memory({
|
||||
'story_access_level': 11,
|
||||
'solved': 12,
|
||||
for (var i = 0; i < 12; i++) 'done_story_v1_$i': true,
|
||||
}),
|
||||
);
|
||||
for (var i = 0; i < 12; i++) {
|
||||
g.startCampaign(i);
|
||||
expect(
|
||||
i < 4
|
||||
? g.storyPage.type == StoryPageType.puzzle
|
||||
: g.screen == Screen.game,
|
||||
true,
|
||||
);
|
||||
expect(g.puzzle!.solved(g.cells), true);
|
||||
final marks = List<int>.of(g.cells);
|
||||
g.mark(0);
|
||||
g.undo();
|
||||
g.check();
|
||||
expect(g.cells, marks);
|
||||
expect(g.solved, 12);
|
||||
final restored = Game(book, Progress.memory(g.progress.snapshot));
|
||||
await restored.restore();
|
||||
expect(restored.puzzle!.solved(restored.cells), true);
|
||||
expect(restored.solved, 12);
|
||||
}
|
||||
},
|
||||
);
|
||||
test(
|
||||
'fresh Flutter progress ignores old saves; reading never awards completion',
|
||||
() async {
|
||||
|
||||
Reference in New Issue
Block a user