-
Notifications
You must be signed in to change notification settings - Fork 21
/
writers_input.compiled.dart
3724 lines (3443 loc) · 158 KB
/
writers_input.compiled.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// GENERATED CODE - DO NOT MODIFY BY HAND
// **************************************************************************
// WritersInputGenerator
// **************************************************************************
// ignore_for_file: constant_identifier_names
// ignore_for_file: unused_local_variable
// ignore_for_file: unnecessary_parenthesis
// ignore_for_file: lines_longer_than_80_chars
// ignore_for_file: type_annotate_public_apis
import 'package:edgehead/fractal_stories/context.dart' show ActionContext;
import 'package:edgehead/fractal_stories/writer_action.dart' show RoamingAction;
import 'package:edgehead/fractal_stories/actor.dart' show Actor;
import 'package:edgehead/fractal_stories/time/actor_turn.dart' show ActorTurn;
import 'package:edgehead/fractal_stories/room_approach.dart' show Approach;
import 'package:edgehead/fractal_stories/context.dart'
show ApplicabilityContext;
import 'package:edgehead/fractal_stories/action.dart' show Nothing;
import 'package:edgehead/ruleset/ruleset.dart' show Prerequisite;
import 'package:edgehead/fractal_stories/action.dart'
show ReasonedSuccessChance;
import 'package:edgehead/fractal_stories/action.dart' show Resource;
import 'package:edgehead/src/room_roaming/room_roaming_situation.dart'
show RoomRoamingSituation;
import 'package:edgehead/fractal_stories/room.dart' show Room;
import 'package:edgehead/ruleset/ruleset.dart' show Rule;
import 'package:edgehead/ruleset/ruleset.dart' show Ruleset;
import 'package:edgehead/fractal_stories/writer_action.dart' show SimpleAction;
import 'package:edgehead/fractal_stories/simulation.dart' show Simulation;
import 'package:edgehead/fractal_stories/situation.dart'
show SituationBaseBehavior;
import 'package:edgehead/fractal_stories/situation.dart' show Situation;
import 'package:edgehead/fractal_stories/storyline/storyline.dart'
show Storyline;
import 'package:edgehead/fractal_stories/items/weapon_type.dart'
show WeaponType;
import 'package:edgehead/fractal_stories/world_state.dart'
show WorldStateBuilder;
import 'package:edgehead/fractal_stories/world_state.dart' show WorldState;
import 'package:built_value/built_value.dart';
import 'package:built_value/serializer.dart';
import 'package:edgehead/writers_helpers.dart';
import 'package:edgehead/edgehead_ids.dart';
part 'writers_input.compiled.g.dart';
const bool DEV_MODE = false;
final Room undergroundChurch = Room('underground_church', (ActionContext c) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
s.add(
'You enter a room that at first looks like a large, twisting cave. But then it opens into a high-ceilinged space with many columns. This must be what the orcs call the Underground Church. Dim light shines from the far end of the room, where you’d expect the altar to be, but you can\'t quite see it. There are no torches here. And it’s eerily quiet. \n\n\nYour bare footsteps reverberate in the room, so you slow down to quiet them. \n\n',
wholeSentence: true);
Ruleset(
Rule(744937563, 1, false, (ApplicabilityContext c) {
final WorldState w = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
return $(c).justCameFrom("cave_with_agruth");
}, (ActionContext c) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
s.add(
'After a bit of searching, you also notice a twisting passage going from the right side of the Church and sloping upward. That must be the way out.\n\n',
wholeSentence: true);
}),
Rule(436107182, 1, false, (ApplicabilityContext c) {
final WorldState w = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
return $(c).justCameFrom("guardpost_above_church");
}, (ActionContext c) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
s.add(
'Not far from here, a tunnel leads slightly downward, back to where you killed Agruth.\n\n',
wholeSentence: true);
})).apply(c);
}, (ActionContext c) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
s.add('The temple is silent, as if it were holding its breath.\n\n',
wholeSentence: true);
rollBrianaQuote(c);
}, null, null);
final Approach undergroundChurchFromCaveWithAgruth = Approach(
'cave_with_agruth', 'underground_church', 'Go to the Unholy Church',
(ActionContext c) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
s.add('You make it to the Church undetected.\n', wholeSentence: true);
});
final Approach undergroundChurchFromGuardpostAboveChurch = Approach(
'guardpost_above_church',
'underground_church',
'Descend toward the Underground Church', (ActionContext c) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
s.add('You take the passage leading down toward the temple.\n',
wholeSentence: true);
});
final Approach undergroundChurchFromUndergroundChurchAltar =
Approach('underground_church_altar', 'underground_church', 'Sneak back',
(ActionContext c) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
s.add(
'You crouch low and, keeping an eye on the altar, move back to the Church\'s entrance.\n',
wholeSentence: true);
});
class ExamineUndergroundChurch extends RoamingAction {
@override
final String name = 'examine_underground_church';
static final ExamineUndergroundChurch singleton = ExamineUndergroundChurch();
@override
List<String> get commandPathTemplate => ['Look around'];
@override
bool isApplicable(
ApplicabilityContext c, Actor a, Simulation sim, WorldState w, void _) {
if ((w.currentSituation as RoomRoamingSituation).currentRoomName !=
'underground_church') {
return false;
}
if (!(!w.actionHasBeenPerformed(name))) {
return false;
}
return true;
}
@override
String applySuccess(ActionContext c, void _) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
s.add(
'This place wasn’t built by the orcs or their slaves. The walls are straight and smooth. The ceiling is high enough to make you feel small and insignificant. The columns are decorated with delicate carvings of skulls and tentacles.\n\n\n"What are these things?" Briana whispers, looking at the ornaments.\n\n\n_"This place was made for worshiping the Dead Prince."_\n\n\nSaying the name brings coldness and sweat to your brow. You hear the name every night in the Dead Prince\'s tongue — but it has been a long time since you said it yourself.\n\n\n"Worshiping?" Briana glances up at the high ceiling, and then around the temple. "I thought the Dead Prince was a warlord. Something like that."\n\n\n_"He is a god."_\n\n\n',
wholeSentence: true);
if (!w.actionHasBeenPerformed("wait_for_ritual")) {
s.add(
"""Briana smirks. "Look, no. The Dead Prince is no god. The orcs might think so, but you really shouldn't. He's a demented illusionist at best."
""",
wholeSentence: true);
}
s.add(
'\n\nThe glow coming from the altar dims for a moment, then lights up again.\n\n\n_"He is worse than a god. He is fear itself."_\n\n\nBriana looks at you, narrowing her eyes.\n\n\n_"I think you have felt it."_\n',
wholeSentence: true);
return '${a.name} successfully performs ExamineUndergroundChurch';
}
@override
String applyFailure(ActionContext c, void _) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
throw StateError("Success chance is 100%");
}
@override
ReasonedSuccessChance<Nothing> getSuccessChance(
Actor a, Simulation sim, WorldState w, void _) {
return ReasonedSuccessChance.sureSuccess;
}
@override
bool get rerollable => false;
@override
String getRollReason(Actor a, Simulation sim, WorldState w, void _) {
return 'Will you be successful?';
}
@override
Resource get rerollResource => null;
@override
String get helpMessage => null;
@override
bool get isAggressive => false;
}
final Room tunnel = Room('tunnel', (ActionContext c) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
s.add(
'Almost as soon as the circular room disappears from your line of sight, loud shouting rises from deep within the mountain. You hurry up, taking the high stairs by two. The voices from below quiet down a bit, and now you can hear dozens of orc and goblin feet stomping.\n\n\nThe air gets colder and fresher, but there\'s still no end in sight. The stairs get steeper and steeper until you feel like you’re climbing a ladder.\n\n\n"I have…" Briana gasps, catching her breath. "I have not fought my way through the depths of Mount Bloodrock just to die of exhaustion on its doorstep."\n\n\n_"That… that would be disappointing, yes."_\n\n\nThe sounds from behind grow louder. You can now pick out individual voices, although not what they are saying.\n\n\nThe stairway suddenly makes a sharp left turn and levels out. Tasting blood on the roof of your mouth, your whole body demands that you stop — but you start running anyway. Briana follows close behind.\n\n\nThe light in the tunnel gets brighter and the air gets colder. Suddenly, just when you can smell fresh air, an orc and a goblin jump out in front of you from a slimy crevice, swords in hands.\n\n\n![Picture of the Upper Door guard](https://egamebook.com/vermin/v/latest/img/orc_and_goblin_sketch.jpg)\n\n\nThey must be guarding the Upper Door. There is no way around them.\n',
wholeSentence: true);
}, null, generateEscapeTunnelFight, null);
final Approach tunnelFromTunnelCancelChance =
Approach('tunnel_cancel_chance', 'tunnel', 'Continue', (ActionContext c) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
s.add(
'You shake your head and continue through the passage. Soon, you find yourself climbing a steep, poorly lit stairway. Briana catches up with you quickly.\n',
wholeSentence: true);
});
final Room tunnelCancelChance = Room('tunnel_cancel_chance', (ActionContext c) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
s.add(
'After a few strides, you realize Briana is still standing in the circular room behind you.\n\n\n_"Are you not coming?"_\n\n\nBriana hesitates. "It feels like we could have done more." She motions toward the goblin, then extends her gesture to the rest of the mountain. "Wreak more havoc. I mean, we might be the first slaves in Mount Bloodrock to survive."\n',
wholeSentence: true);
}, null, null, null);
class TalkToBriana1 extends RoamingAction {
@override
final String name = 'talk_to_briana_1';
static final TalkToBriana1 singleton = TalkToBriana1();
@override
List<String> get commandPathTemplate => ['Talk to Briana'];
@override
bool isApplicable(
ApplicabilityContext c, Actor a, Simulation sim, WorldState w, void _) {
if (!(w.actionNeverUsed(name) && isRoamingInBloodrock(w))) {
return false;
}
return true;
}
@override
String applySuccess(ActionContext c, void _) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
s.add(
'_"You are new here, I think. What news can you tell me about the world outside?"_\n\n\nBriana shrugs. "How long have you been here?"\n\n\n_"Three years."_\n\n\n"Three years! Gods. A lot has happened. Just this winter, the orcs took over the upper valley. They are raiding way beyond Fort Ironcast now."\n',
wholeSentence: true);
return '${a.name} successfully performs TalkToBriana1';
}
@override
String applyFailure(ActionContext c, void _) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
throw StateError("Success chance is 100%");
}
@override
ReasonedSuccessChance<Nothing> getSuccessChance(
Actor a, Simulation sim, WorldState w, void _) {
return ReasonedSuccessChance.sureSuccess;
}
@override
bool get rerollable => false;
@override
String getRollReason(Actor a, Simulation sim, WorldState w, void _) {
return 'Will you be successful?';
}
@override
Resource get rerollResource => null;
@override
String get helpMessage => null;
@override
bool get isAggressive => false;
}
class TalkToBriana2 extends RoamingAction {
@override
final String name = 'talk_to_briana_2';
static final TalkToBriana2 singleton = TalkToBriana2();
@override
List<String> get commandPathTemplate => ['Ask Briana about her capture'];
@override
bool isApplicable(
ApplicabilityContext c, Actor a, Simulation sim, WorldState w, void _) {
if (!(w.actionHasBeenPerformed("talk_to_briana_1") &&
w.actionNeverUsed(name) &&
isRoamingInBloodrock(w))) {
return false;
}
return true;
}
@override
String applySuccess(ActionContext c, void _) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
s.add(
'_"Where were you captured?"_\n\n\n"At the Gate of Screams. I was trying to sneak in."\n\n\n_"You what?"_\n\n\n"I know. It seemed like a stupid idea even then. I wanted to get in, steal back the Orcthorn, get out, and help win the war."\n',
wholeSentence: true);
return '${a.name} successfully performs TalkToBriana2';
}
@override
String applyFailure(ActionContext c, void _) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
throw StateError("Success chance is 100%");
}
@override
ReasonedSuccessChance<Nothing> getSuccessChance(
Actor a, Simulation sim, WorldState w, void _) {
return ReasonedSuccessChance.sureSuccess;
}
@override
bool get rerollable => false;
@override
String getRollReason(Actor a, Simulation sim, WorldState w, void _) {
return 'Will you be successful?';
}
@override
Resource get rerollResource => null;
@override
String get helpMessage => null;
@override
bool get isAggressive => false;
}
class TalkToBriana3 extends RoamingAction {
@override
final String name = 'talk_to_briana_3';
static final TalkToBriana3 singleton = TalkToBriana3();
@override
List<String> get commandPathTemplate => ['Ask Briana about Orcthorn'];
@override
bool isApplicable(
ApplicabilityContext c, Actor a, Simulation sim, WorldState w, void _) {
if (!(w.actionHasBeenPerformed("talk_to_briana_2") &&
w.actionNeverUsed(name) &&
isRoamingInBloodrock(w))) {
return false;
}
return true;
}
@override
String applySuccess(ActionContext c, void _) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
s.add(
'_"What is Orcthorn?"_\n\n\n"A sword. It’s killed hundreds of orcs, wielded by a half dozen legendary knights. The orcs have been trying to get Orcthorn for decades, almost to no avail."\n\n\n_"Almost."_\n\n\n"Yes. Last full moon, an orcish captain and a company of warriors ambushed Lord Glencot. He wielded Orcthorn at the time, and they knew it. They slaughtered his company and brought the sword here, to Bloodrock. Since then, the orcs have been bolder."\n\n\n_"The Mad Guardian."_\n\n\n"The mad who?"\n\n\n_"That is what Agruth and the other slavers were talking about a couple of weeks back. One orc was supposed to guard a sword. That seemed weird enough to me. Guarding a sword? Stranger yet, that orc went mad after only a few days. Now they keep him in a cell, and call him_ grach kamkorr _– The Mad Guardian. That sword is still with him. Hidden there in the cell."_\n\n\n"Where is that cell?"\n\n\n',
wholeSentence: true);
Ruleset(
Rule(621956786, 2, false, (ApplicabilityContext c) {
final WorldState w = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
return a.currentRoomName == "slave_quarters_passage" &&
!$(c).playerHasVisited("orcthorn_room");
}, (ActionContext c) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
s.add(
'_"Somewhere here in the slave quarters."_\n\nBriana\'s eyes go wide and nods towards the door.\n\n\n',
wholeSentence: true);
}),
Rule(33780515, 2, false, (ApplicabilityContext c) {
final WorldState w = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
return $(c).playerHasVisited("orcthorn_room") &&
a.currentRoomName != "orcthorn_room";
}, (ActionContext c) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
s.add(
'_"Down the slave quarters."_\n\nBriana\'s eyes go wide. "The mad orc behind that door."\n\n\n',
wholeSentence: true);
}),
Rule(384668601, 2, false, (ApplicabilityContext c) {
final WorldState w = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
return $(c).playerHasVisited("slave_quarters_passage") &&
!$(c).playerHasVisited("orcthorn_room");
}, (ActionContext c) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
s.add(
'_"Down the slave quarters."_\n\nBriana\'s eyes go wide. "That door in the slave quarters."\n\n\n',
wholeSentence: true);
}),
Rule(361178650, 1, false, (ApplicabilityContext c) {
final WorldState w = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
return a.currentRoomName == "orcthorn_room";
}, (ActionContext c) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
s.add(
'_"Somewhere here in the slave quarters."_\n\nBriana\'s eyes go wide as she looks around the room.\n\n\n',
wholeSentence: true);
}),
Rule(974180978, 0, false, (ApplicabilityContext c) {
final WorldState w = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
return true;
}, (ActionContext c) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
s.add(
'_"Down the slave quarters."_\n\nBriana tenses. "Well then, at least we have that choice."\n\n\n',
wholeSentence: true);
})).apply(c);
return '${a.name} successfully performs TalkToBriana3';
}
@override
String applyFailure(ActionContext c, void _) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
throw StateError("Success chance is 100%");
}
@override
ReasonedSuccessChance<Nothing> getSuccessChance(
Actor a, Simulation sim, WorldState w, void _) {
return ReasonedSuccessChance.sureSuccess;
}
@override
bool get rerollable => false;
@override
String getRollReason(Actor a, Simulation sim, WorldState w, void _) {
return 'Will you be successful?';
}
@override
Resource get rerollResource => null;
@override
String get helpMessage => null;
@override
bool get isAggressive => false;
}
final Room testFightGoblin = Room('test_fight_goblin', (ActionContext c) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
s.add(
'This is a development-only test fight. If you still see this in a production\nbuild, it\'s a bug.\n\nA goblin stands in front of you, wielding a spear. Between the two of you,\na plain dagger lies on the ground. You also notice a nice, solid rock in the\nrubble.\n\nYou are barehanded.\n',
wholeSentence: true);
}, null, generateTestFightWithGoblin, null);
final Approach testFightGoblinFromPreStartBook = Approach(
'pre_start_book',
'test_fight_goblin',
'Playtest >> one-on-one test fight >> with a goblin', (ActionContext c) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
s.add('You get transported to the development testing arena.\n',
wholeSentence: true);
});
final Approach endOfRoamFromTestFightGoblin = Approach(
'test_fight_goblin', '__END_OF_ROAM__', 'End game', (ActionContext c) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
s.add('', wholeSentence: true);
});
final Room startAdventure = Room('start_adventure', (ActionContext c) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
s.add(
'The path from slavery to power begins with a single crack of a whip. Briana spins around, her face red with pain and anger. She is new here, but she knows what is coming.\n\n\nOnce Agruth starts whipping, the victim ends up dead. Agruth loves killing slaves.\n\n\n![Agruth whips Briana](https://egamebook.com/vermin/v/latest/img/agruth-attack.jpg)\n\n\nAnother crack and there is new blood pouring from a gash in Briana\'s face. Agruth grins.\n\n\nNobody else is in sight. It\'s just you, Agruth, and Briana. That\'s Agruth\'s first mistake.\n\n',
wholeSentence: true);
w.actors.removeWhere((actor) => !actor.isPlayer && actor.id != brianaId);
}, null, generateAgruthFight, null);
final Approach startAdventureFromPreStartBook = Approach(
'pre_start_book', 'start_adventure', 'DEBUG >> Smoke test \'Vermin\'',
(ActionContext c) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
s.add('', wholeSentence: true);
});
final Room undergroundChurchAltarAfterCeremony = Room(
'underground_church_altar_after_ceremony', null, (ActionContext c) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
s.add('The altar is covered with black blood.\n\n', wholeSentence: true);
rollBrianaQuote(c);
}, null, null,
parent: 'underground_church_altar',
prerequisite: Prerequisite(840572377, 1, true, (ApplicabilityContext c) {
final WorldState w = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
return w.actionHasBeenPerformedSuccessfully("wait_for_ritual");
}));
final Room slaveQuarters = Room('slave_quarters', (ActionContext c) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
s.add(
'"There is a difference between being brave and being stupid. You\'re crossing it right now," she says.\n',
wholeSentence: true);
}, (ActionContext c) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
s.add('"We _really_ shouldn\'t push our luck," she says.\n',
wholeSentence: true);
}, null, null);
final Approach slaveQuartersFromSlaveQuartersPassage = Approach(
'slave_quarters_passage',
'slave_quarters',
'Go further toward the Gate of Screams', (ActionContext c) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
s.add(
'You start down the slope of the passage, toward the heart of the slave’s quarters and the Gate of Screams beyond. Briana tugs at your hand.\n',
wholeSentence: true);
});
class SlaveQuartersContinue extends RoamingAction {
@override
final String name = 'slave_quarters_continue';
static final SlaveQuartersContinue singleton = SlaveQuartersContinue();
@override
List<String> get commandPathTemplate => ['Continue'];
@override
bool isApplicable(
ApplicabilityContext c, Actor a, Simulation sim, WorldState w, void _) {
if ((w.currentSituation as RoomRoamingSituation).currentRoomName !=
'slave_quarters') {
return false;
}
return true;
}
@override
String applySuccess(ActionContext c, void _) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
s.add(
'_"Do you not want to kill some more orcs?"_\n\n\n"I do, trust me. I just don\'t want to get killed first."\n\n\nYou shake your head and start walking. Briana reluctantly follows, her eyes darting around the familiar tunnel. You\'re close to where the orcs had kept you during sleeping hours.\n\n\nSoon, you see an orc patrol appear from behind a bend. Here, it\'s impossible to hide. The orcs spot you immediatelly. \n\n\nThere are three of them, one has a longsword, the second has a spear, and the third holds a large battle axe.\n\n\nThe orc with the spear hurls it, and it pierces Briana\'s shoulder. She screams in pain. \n\n\nThe orc with the sword makes three fast leaps toward you, and swings his weapon. You have no time to react, and the blade slits your throat. You gurgle and your arms flail in surprise.\n\n\nYou look at Briana. As the battle axe cleaves her stomach, the two of you hold eye contact.\n',
wholeSentence: true);
w.updateActorById(a.id, (b) => b..hitpoints = 0);
w.popSituation(sim);
return '${a.name} successfully performs SlaveQuartersContinue';
}
@override
String applyFailure(ActionContext c, void _) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
throw StateError("Success chance is 100%");
}
@override
ReasonedSuccessChance<Nothing> getSuccessChance(
Actor a, Simulation sim, WorldState w, void _) {
return ReasonedSuccessChance.sureSuccess;
}
@override
bool get rerollable => false;
@override
String getRollReason(Actor a, Simulation sim, WorldState w, void _) {
return 'Will you be successful?';
}
@override
Resource get rerollResource => null;
@override
String get helpMessage => null;
@override
bool get isAggressive => false;
}
final Room justAfterAgruthFight =
Room('just_after_agruth_fight', (ActionContext c) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
s.add(
'You are Aren, a slave. You have spent three painful years inside this mountain, surrounded by the foul-smelling cave walls, and under the whip of the orcs and the goblins that live here.\n\n\nBriana stands towering over Agruth\'s corpse. She smooths her hair back and looks down into the expanding pool of Agruth\'s blood, using it as a mirror.\n\n\n"What?" she says when she notices you\'re looking.\n\n\n_"We either go now, or die."_\n\n\nBriana spits down at the body. "He wasn\'t even the worst of them, you know."\n\n\n_"I know."_\n\n\n"They _all_ deserve to die, or worse. And I think it will be satisfying to kill them with their own swords." She kicks the dead slaver in the hip.\n\n\n_"That one is already dead."_\n\n\n"Just making sure," she says.\n\n\n![Agruth\'s sword](https://egamebook.com/vermin/v/latest/img/agruth-sword.jpg)\n\n\nShe turns her attention to the sword. "We should name it. Named weapons please the gods. And I refuse to have this thing around thinking of it as _Agruth\'s sword_." She makes a pained grimace when she says the orc\'s name.\n',
wholeSentence: true);
}, null, null, null);
final Approach justAfterAgruthFightFromStartAdventure =
Approach('start_adventure', 'just_after_agruth_fight', '<implicit>',
(ActionContext c) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
s.add('You look around. Fortunately, there’s no one in sight.\n',
wholeSentence: true);
});
class NameAgruthSwordOpportunity extends RoamingAction {
@override
final String name = 'name_agruth_sword_opportunity';
static final NameAgruthSwordOpportunity singleton =
NameAgruthSwordOpportunity();
@override
List<String> get commandPathTemplate => ['"Luck Bringer"'];
@override
bool isApplicable(
ApplicabilityContext c, Actor a, Simulation sim, WorldState w, void _) {
if ((w.currentSituation as RoomRoamingSituation).currentRoomName !=
'just_after_agruth_fight') {
return false;
}
return true;
}
@override
String applySuccess(ActionContext c, void _) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
s.add(
'_"We will call it Luck Bringer. We got lucky with Arguth, and luck is our only chance to get out of this place."_\n\n\nBriana nods. "Luck Bringer it is. Now, you\'re right, let\'s just get out of here as quickly as possible."\n',
wholeSentence: true);
nameAgruthSword(w, "Luck Bringer");
$(c).movePlayer("cave_with_agruth");
return '${a.name} successfully performs NameAgruthSwordOpportunity';
}
@override
String applyFailure(ActionContext c, void _) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
throw StateError("Success chance is 100%");
}
@override
ReasonedSuccessChance<Nothing> getSuccessChance(
Actor a, Simulation sim, WorldState w, void _) {
return ReasonedSuccessChance.sureSuccess;
}
@override
bool get rerollable => false;
@override
String getRollReason(Actor a, Simulation sim, WorldState w, void _) {
return 'Will you be successful?';
}
@override
Resource get rerollResource => null;
@override
String get helpMessage => null;
@override
bool get isAggressive => false;
}
class NameAgruthSwordRedemption extends RoamingAction {
@override
final String name = 'name_agruth_sword_redemption';
static final NameAgruthSwordRedemption singleton =
NameAgruthSwordRedemption();
@override
List<String> get commandPathTemplate => ['"Savior"'];
@override
bool isApplicable(
ApplicabilityContext c, Actor a, Simulation sim, WorldState w, void _) {
if ((w.currentSituation as RoomRoamingSituation).currentRoomName !=
'just_after_agruth_fight') {
return false;
}
return true;
}
@override
String applySuccess(ActionContext c, void _) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
s.add(
'_"We will call it Savior. Getting it was our first step toward freedom. The sword should have killed us, and instead it set us free."_\n\n\nBriana nods. "Savior it is. Now, you\'re right, let\'s just get out of here as quickly as possible."\n',
wholeSentence: true);
nameAgruthSword(w, "Savior");
$(c).movePlayer("cave_with_agruth");
return '${a.name} successfully performs NameAgruthSwordRedemption';
}
@override
String applyFailure(ActionContext c, void _) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
throw StateError("Success chance is 100%");
}
@override
ReasonedSuccessChance<Nothing> getSuccessChance(
Actor a, Simulation sim, WorldState w, void _) {
return ReasonedSuccessChance.sureSuccess;
}
@override
bool get rerollable => false;
@override
String getRollReason(Actor a, Simulation sim, WorldState w, void _) {
return 'Will you be successful?';
}
@override
Resource get rerollResource => null;
@override
String get helpMessage => null;
@override
bool get isAggressive => false;
}
class NameAgruthSwordNothing extends RoamingAction {
@override
final String name = 'name_agruth_sword_nothing';
static final NameAgruthSwordNothing singleton = NameAgruthSwordNothing();
@override
List<String> get commandPathTemplate => ['No name'];
@override
bool isApplicable(
ApplicabilityContext c, Actor a, Simulation sim, WorldState w, void _) {
if ((w.currentSituation as RoomRoamingSituation).currentRoomName !=
'just_after_agruth_fight') {
return false;
}
return true;
}
@override
String applySuccess(ActionContext c, void _) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
s.add(
'_"That is foolish. It is just a sword, after all."_\n\n\nBriana shrugs. "Whatever, just don\'t ever call it _Agruth\'s sword._ I already have more respect to this piece of iron than to that worthless animal. Now, you\'re right, let\'s just get out of here as quickly as possible."\n',
wholeSentence: true);
$(c).movePlayer("cave_with_agruth");
return '${a.name} successfully performs NameAgruthSwordNothing';
}
@override
String applyFailure(ActionContext c, void _) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
throw StateError("Success chance is 100%");
}
@override
ReasonedSuccessChance<Nothing> getSuccessChance(
Actor a, Simulation sim, WorldState w, void _) {
return ReasonedSuccessChance.sureSuccess;
}
@override
bool get rerollable => false;
@override
String getRollReason(Actor a, Simulation sim, WorldState w, void _) {
return 'Will you be successful?';
}
@override
Resource get rerollResource => null;
@override
String get helpMessage => null;
@override
bool get isAggressive => false;
}
final Room guardpostAboveChurch =
Room('guardpost_above_church', (ActionContext c) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
s.add(
'You enter a small circular room. You see three openings that lead to passages, each marked with crude writing.\n\n',
wholeSentence: true);
Ruleset(
Rule(1002529998, 1, false, (ApplicabilityContext c) {
final WorldState w = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
return $(c).justCameFrom("smelter");
}, (ActionContext c) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
s.add(
'The passage you came from is marked with the words "Hot iron", which must mean "smelter" in the orcs\' vocabulary. Another one has the words "Unholy Church" above it. Both of these passages slope downwards.\n\n',
wholeSentence: true);
}),
Rule(651703369, 1, false, (ApplicabilityContext c) {
final WorldState w = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
return $(c).justCameFrom("underground_church");
}, (ActionContext c) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
s.add(
'The passage you came from is marked with the words "Unholy Church". Another one has the words "Hot iron" above it, which must mean "smelter" in the orcs\' vocabulary. Both of these passages slope downward.\n\n',
wholeSentence: true);
})).apply(c);
s.add(
'\nA third passage is marked "Up Door". Beyond the opening, you see a steep stairway leading upward. This is it. Your final path to escape.\n\nFor the first time, you see a smile on Briana\'s face. Not a smirk or a battle snarl, but a genuine smile. "_Up Door?_" she whispers, shaking her head. "I can\'t believe we\'ve made it this far."\n\nJust inside the “Up Door” path sits a goblin guard. You’re in luck: He\'s sleeping. He loosely holds a scimitar in one hand, and has a shield laid on his lap.\n',
wholeSentence: true);
}, (ActionContext c) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
Ruleset(
Rule(453960981, 1, false, (ApplicabilityContext c) {
final WorldState w = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
return w.wasKilled(sleepingGoblinId);
}, (ActionContext c) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
s.add(
'The goblin\'s corpse is sprawled on the ground in the middle of the circular room.\n',
wholeSentence: true);
}),
Rule(948011826, 0, false, (ApplicabilityContext c) {
final WorldState w = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
return true;
}, (ActionContext c) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
s.add(
'The goblin is sleeping soundly next to the passage to the Upper Door.\n',
wholeSentence: true);
})).apply(c);
}, null, null);
final Approach guardpostAboveChurchFromUndergroundChurch = Approach(
'underground_church', 'guardpost_above_church', 'Enter the upwards passage',
(ActionContext c) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
s.add('You take the sloping passage and walk upward for a long time.\n',
wholeSentence: true);
});
final Approach guardpostAboveChurchFromTunnelCancelChance =
Approach('tunnel_cancel_chance', 'guardpost_above_church', 'Return',
(ActionContext c) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
s.add('You nod and step back into the circular room.\n', wholeSentence: true);
});
final Approach guardpostAboveChurchFromSmelter = Approach(
'smelter', 'guardpost_above_church', 'Go through the smooth passage',
(ActionContext c) {
final WorldState originalWorld = c.world;
final Simulation sim = c.simulation;
final Actor a = c.actor;
final WorldStateBuilder w = c.outputWorld;
final Storyline s = c.outputStoryline;
s.add('You take the smooth passage and it leads you slightly upwards.\n',
wholeSentence: true);