-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoregonTrail.js
1461 lines (1451 loc) · 36.8 KB
/
oregonTrail.js
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
/* global module */
/* MINNESOTA EDUCATIONAL COMPUTING CONSORTIUM STAFF */
/* PROGRAMMING REVISIONS BY DON RAWITSCH - 1975 */
/* CURRENT VERSION - 3/27/75 */
function* play() {
function createChoice(text, choices) {
return {
text,
choices,
type: play.PROMPT_TYPE.CHOICE,
};
}
function createNumericChoice(text) {
return {
text,
type: play.PROMPT_TYPE.NUMERIC,
};
}
function createStringChoice(text) {
return {
text,
type: play.PROMPT_TYPE.STRING,
};
}
function createInfo(text) {
return {
text,
type: play.PROMPT_TYPE.NONE,
};
}
let instructionPointer = 30;
let returnPointer;
let X1, K8, S4, F1, F2, M, M9, D3, info, E, T1, X, P, B1, L1, C1, S5, F9, B2;
let A, F, B, C, M1, T, M2, D1, DATA_INDEX, R1;
while (true) {
switch (instructionPointer) {
case 30: {
const C$ = yield createChoice('DO YOU NEED INSTRUCTIONS', [
{ id: 'YES', label: 'YES' },
{ id: 'NO', label: 'NO' },
]);
if (C$ === 'NO') {
instructionPointer = 400;
break;
}
yield createInfo(
`THIS PROGRAM SIMULATES A TRIP OVER THE OREGON TRAIL FROM
INDEPENDENCE, MISSOURI TO OREGON CITY, OREGON IN 1847.
YOUR FAMILY OF FIVE WILL COVER THE 2000 MILE OREGON TRAIL
IN 5-6 MONTHS --- IF YOU MAKE IT ALIVE.
YOU HAD SAVED $900 TO SPEND FOR THE TRIP, AND YOU'VE JUST
PAID $200 FOR A WAGON.
YOU WILL NEED TO SPEND THE REST OF YOUR MONEY ON THE
FOLLOWING ITEMS:
OXEN - YOU CAN SPEND $200-$300 ON YOUR TEAM
THE MORE YOU SPEND, THE FASTER YOU'LL GO
BECAUSE YOU'LL HAVE BETTER ANIMALS
FOOD - THE MORE YOU HAVE, THE LESS CHANCE THERE
IS OF GETTING SICK
AMMUNITION - $1 BUYS A BELT OF 50 BULLETS
YOU WILL NEED BULLETS FOR ATTACKS BY ANIMALS
AND BANDITS, AND FOR HUNTING FOOD
CLOTHING - THIS IS ESPECIALLY IMPORTANT FOR THE COLD
WEATHER YOU WILL ENCOUNTER WHEN CROSSING
THE MOUNTAINS
MISCELLANEOUS SUPPLIES - THIS INCLUDES MEDICINE AND
OTHER THINGS YOU WILL NEED FOR SICKNESS
AND EMERGENCY REPAIRS
YOU CAN SPEND ALL YOUR MONEY BEFORE YOU START YOUR TRIP -
OR YOU CAN SAVE SOME OF YOUR CASH TO SPEND AT FORTS ALONG
THE WAY WHEN YOU RUN LOW. HOWEVER, ITEMS COST MORE AT
THE FORTS. YOU CAN ALSO GO HUNTING ALONG THE WAY TO GET
MORE FOOD.
WHENEVER YOU HAVE TO USE YOUR TRUSTY RIFLE ALONG THE WAY,
YOU WILL SEE THE WORDS: TYPE BANG. THE FASTER YOU TYPE
IN THE WORD 'BANG' AND HIT THE 'RETURN' KEY, THE BETTER
LUCK YOU'LL HAVE WITH YOUR GUN.
WHEN ASKED TO ENTER MONEY AMOUNTS, DON'T USE A '$'.
GOOD LUCK!!!`
);
}
case 400: {
X1 = -1;
K8 = S4 = F1 = F2 = M = M9 = D3 = 0;
}
case 415: {
A = parseInt(
yield createNumericChoice(
'HOW MUCH DO YOU WANT TO SPEND ON YOUR OXEN TEAM'
),
10
);
if (A >= 200) {
instructionPointer = 440;
break;
}
yield createInfo('NOT ENOUGH');
instructionPointer = 415;
break;
}
case 440: {
if (A <= 300) {
instructionPointer = 455;
break;
}
yield createInfo('TOO MUCH');
instructionPointer = 415;
break;
}
case 455: {
F = parseInt(
yield createNumericChoice('HOW MUCH DO YOU WANT TO SPEND ON FOOD'),
10
);
if (F >= 0) {
instructionPointer = 485;
break;
}
yield createInfo('IMPOSSIBLE');
instructionPointer = 455;
break;
}
case 485: {
B = parseInt(
yield createNumericChoice(
'HOW MUCH DO YOU WANT TO SPEND ON AMMUNITION'
),
10
);
if (B >= 0) {
instructionPointer = 510;
break;
}
yield createInfo('IMPOSSIBLE');
instructionPointer = 485;
break;
}
case 510: {
C = parseInt(
yield createNumericChoice(
'HOW MUCH DO YOU WANT TO SPEND ON CLOTHING'
),
10
);
if (C >= 0) {
instructionPointer = 535;
break;
}
yield createInfo('IMPOSSIBLE');
instructionPointer = 510;
break;
}
case 535: {
M1 = parseInt(
yield createNumericChoice(
'HOW MUCH DO YOU WANT TO SPEND ON MISCELANEOUS SUPPLIES'
),
10
);
if (M1 >= 0) {
instructionPointer = 560;
break;
}
yield createInfo('IMPOSSIBLE');
instructionPointer = 535;
break;
}
case 560: {
T = 700 - A - F - B - C - M1;
if (T >= 0) {
instructionPointer = 580;
break;
}
yield createInfo(
'YOU OVERSPENT--YOU ONLY HAD $700 TO SPEND. BUY AGAIN'
);
instructionPointer = 415;
break;
}
case 580: {
B *= 50;
yield createInfo(
`AFTER ALL YOUR PURCHASES, YOU NOW HAVE ${T} DOLLARS LEFT`
);
yield createInfo('MONDAY MARCH 29 1847');
instructionPointer = 1000;
break;
}
case 700: {
if (M >= 2040 || D3 > 17) {
instructionPointer = 4000;
break;
}
// ***SETTING DATE***
D3 += 1;
info = 'MONDAY ';
if (D3 > 10) {
instructionPointer = 735;
break;
}
instructionPointer = [
740, 750, 760, 770, 780, 790, 800, 810, 820, 830,
][D3 - 1];
break;
}
case 735: {
instructionPointer = [840, 850, 860, 870, 880, 890, 900][D3 - 10 - 1];
break;
}
case 740: {
info = `${info}APRIL 12 `;
instructionPointer = 910;
break;
}
case 750: {
info = `${info}APRIL 26 `;
instructionPointer = 910;
break;
}
case 760: {
info = `${info}MAY 10 `;
instructionPointer = 910;
break;
}
case 770: {
info = `${info}MAY 24 `;
instructionPointer = 910;
break;
}
case 780: {
info = `${info}JUNE 7 `;
instructionPointer = 910;
break;
}
case 790: {
info = `${info}JUNE 21 `;
instructionPointer = 910;
break;
}
case 800: {
info = `${info}JULY 5 `;
instructionPointer = 910;
break;
}
case 810: {
info = `${info}JULY 19 `;
instructionPointer = 910;
break;
}
case 820: {
info = `${info}AUGUST 2 `;
instructionPointer = 910;
break;
}
case 830: {
info = `${info}AUGUST 16 `;
instructionPointer = 910;
break;
}
case 840: {
info = `${info}AUGUST 31 `;
instructionPointer = 910;
break;
}
case 850: {
info = `${info}SEPTEMBER 13 `;
instructionPointer = 910;
break;
}
case 860: {
info = `${info}SEPTEMBER 27 `;
instructionPointer = 910;
break;
}
case 870: {
info = `${info}OCTOBER 11 `;
instructionPointer = 910;
break;
}
case 880: {
info = `${info}OCTOBER 25 `;
instructionPointer = 910;
break;
}
case 890: {
info = `${info}NOVEMBER 8 `;
instructionPointer = 910;
break;
}
case 900: {
info = `${info}NOVEMBER 22 `;
instructionPointer = 910;
break;
}
case 910: {
yield createInfo(`${info} 1847`);
}
case 1000: {
// ***BEGINNING EACH TURN***
if (F >= 0) {
instructionPointer = 1015;
break;
}
F = 0;
}
case 1015: {
if (B >= 0) {
instructionPointer = 1025;
break;
}
B = 0;
}
case 1025: {
if (C >= 0) {
instructionPointer = 1035;
break;
}
C = 0;
}
case 1035: {
if (M1 >= 0) {
instructionPointer = 1045;
break;
}
M1 = 0;
}
case 1045: {
if (F >= 12) {
instructionPointer = 1055;
break;
}
yield createInfo(
"YOU'D BETTER DO SOME HUNTING OR BUY FOOD AND SOON!!!!"
);
}
case 1055: {
F = Math.floor(F);
B = Math.floor(B);
C = Math.floor(C);
M1 = Math.floor(M1);
T = Math.floor(T);
M = Math.floor(M);
M2 = M;
if (S4 === 1) {
instructionPointer = 1105;
break;
}
if (K8 === 1) {
instructionPointer = 1105;
break;
}
instructionPointer = 1130;
break;
}
case 1105: {
T -= 20;
if (T < 0) {
instructionPointer = 3520;
break;
}
yield createInfo("DOCTOR'S BILL IS $20");
K8 = S4 = 0;
}
case 1130: {
if (M9 === 1) {
instructionPointer = 1145;
break;
}
yield createInfo(`TOTAL MILEAGE IS ${M}`);
instructionPointer = 1160;
break;
}
case 1145: {
yield createInfo('TOTAL MILEAGE IS 950');
M9 = 0;
}
case 1160: {
yield createInfo('FOOD, BULLETS, CLOTHING, MISC. SUPP., CASH');
yield createInfo(`${F}, ${B}, ${C}, ${M1}, ${T}`);
if (X1 === -1) {
instructionPointer = 1350;
break;
}
X1 *= -1;
}
case 1310: {
X = parseInt(
yield createChoice(
'DO YOU WANT TO (1) STOP AT THE NEXT FORT, (2) HUNT, OR (3) CONTINUE',
[
{ id: '1', label: 'STOP AT THE NEXT FORT' },
{ id: '2', label: 'HUNT' },
{ id: '3', label: 'CONTINUE' },
]
),
10
);
if (X > 2) {
instructionPointer = 1340;
break;
}
if (X < 1) {
instructionPointer = 1340;
break;
}
X = Math.floor(X);
instructionPointer = 1400;
break;
}
case 1340: {
X = 3;
instructionPointer = 1400;
break;
}
case 1350: {
X = parseInt(
yield createChoice('DO YOU WANT TO (1) HUNT, OR (2) CONTINUE', [
{ id: '1', label: 'HUNT' },
{ id: '2', label: 'CONTINUE' },
]),
10
);
if (X === 1) {
instructionPointer = 1370;
break;
}
X = 2;
}
case 1370: {
X += 1;
if (X === 3) {
instructionPointer = 1395;
break;
}
if (B > 39) {
instructionPointer = 1395;
break;
}
yield createInfo('TOUGH---YOU NEED MORE BULLETS TO GO HUNTING');
instructionPointer = 1350;
break;
}
case 1395: {
X1 *= -1;
}
case 1400: {
instructionPointer = [1500, 1700, 1800][X - 1];
break;
}
case 1500: {
yield createInfo('ENTER WHAT YOU WISH TO SPEND ON THE FOLLOWING');
P = parseInt(yield createNumericChoice('FOOD'), 10);
returnPointer = 1515;
instructionPointer = 1520;
break;
}
case 1515: {
instructionPointer = 1555;
break;
}
case 1520: {
if (P < 0) {
instructionPointer = 1550;
break;
}
T -= P;
if (T >= 0) {
instructionPointer = 1550;
break;
}
yield createInfo("YOU DON'T HAVE THAT MUCH--KEEP YOUR SPENDING DOWN");
T += P;
P = 0;
}
case 1550: {
instructionPointer = returnPointer;
break;
}
case 1555: {
F += (2 / 3) * P;
P = parseInt(yield createNumericChoice('AMMUNITION'), 10);
returnPointer = 1570;
instructionPointer = 1520;
break;
}
case 1570: {
B = Math.floor(B + (2 / 3) * P * 50);
P = parseInt(yield createNumericChoice('CLOTHING'), 10);
returnPointer = 1585;
instructionPointer = 1520;
break;
}
case 1585: {
C += (2 / 3) * P;
P = parseInt(yield createNumericChoice('MISCELLANEOUS SUPPLIES'), 10);
returnPointer = 1600;
instructionPointer = 1520;
break;
}
case 1600: {
M1 += (2 / 3) * P;
M -= 45;
instructionPointer = 1800;
break;
}
case 1700: {
// ***HUNTING***
if (B > 39) {
instructionPointer = 1715;
break;
}
yield createInfo('TOUGH---YOU NEED MORE BULLETS TO GO HUNTING');
instructionPointer = 1310;
break;
}
case 1715: {
M -= 45;
returnPointer = 1725;
instructionPointer = 4500;
break;
}
case 1725: {
if (B1 <= 1) {
instructionPointer = 1755;
break;
}
if (100 * Math.random() < 13 * B1) {
instructionPointer = 1780;
break;
}
F = F + 48 - 2 * B1;
yield createInfo('NICE SHOT--RIGHT THROUGH THE NECK--FEAST TONIGHT!!');
B = B - 10 - 3 * B1;
instructionPointer = 1800;
break;
}
case 1755: {
// **BELLS IN LINE 1755**
yield createInfo('RIGHT BETWEEN THE EYES---YOU GOT A BIG ONE!!!!');
F = F + 52 + Math.random() * 6;
B = B - 10 - Math.random() * 4;
instructionPointer = 1800;
break;
}
case 1780: {
yield createInfo('SORRY---NO LUCK TODAY');
if (F >= 13) {
instructionPointer = 1900;
break;
}
instructionPointer = 3500;
break;
}
case 1800: {
if (F >= 13) {
instructionPointer = 1900;
break;
}
instructionPointer = 3500;
break;
}
case 1900: {
// ***EATING***
E = parseInt(
yield createChoice(
'DO YOU WANT TO EAT (1) POORLY (2) MODERATELY OR (3) WELL',
[
{ id: '1', label: 'POORLY' },
{ id: '2', label: 'MODERATELY' },
{ id: '3', label: 'WELL' },
]
),
10
);
if (E > 3) {
instructionPointer = 1900;
break;
}
if (E < 1) {
instructionPointer = 1900;
break;
}
E = Math.floor(E);
F = F - 8 - 5 * E;
if (F >= 0) {
instructionPointer = 2000;
break;
}
F = F + 8 + 5 * E;
yield createInfo("YOU CAN'T EAT THAT WELL");
instructionPointer = 1900;
break;
}
case 2000: {
M = M + 200 + (A - 220) / 5 + 10 * Math.random();
L1 = C1 = 0;
// ***RIDERS ATTACK***
if (
Math.random() * 10 >
((M / 100 - 4) ** 2 + 72) / ((M / 100 - 4) ** 2 + 12) - 1
) {
instructionPointer = 2500;
break;
}
info = 'RIDERS AHEAD. THEY ';
S5 = 0;
if (Math.random() < 0.8) {
instructionPointer = 2130;
break;
}
info = `${info} DON'T `;
S5 = 1;
}
case 2130: {
info = `${info}LOOK HOSTILE`;
info = '';
yield createInfo(info);
yield createInfo('TACTICS');
}
case 2140: {
T1 = parseInt(
yield createChoice(
`(1) RUN (2) ATTACK (3) CONTINUE (4) CIRCLE WAGONS
IF YOU RUN YOU'LL GAIN TIME BUT WEAR DOWN YOUR OXEN
IF YOU CIRCLE YOU'LL LOSE TIME`,
[
{ id: '1', label: 'RUN' },
{ id: '2', label: 'ATTACK' },
{ id: '3', label: 'CONTINUE' },
{ id: '4', label: 'CIRCLE WAGONS' },
]
),
10
);
if (T1 < 1) {
instructionPointer = 2140;
break;
}
if (T1 > 4) {
instructionPointer = 2140;
break;
}
T1 = Math.floor(T1);
if (S5 === 1) {
instructionPointer = 2330;
break;
}
if (T1 > 1) {
instructionPointer = 2220;
break;
}
M += 20;
M1 -= 15;
B -= 150;
A -= 40;
instructionPointer = 2395;
break;
}
case 2220: {
if (T1 > 2) {
instructionPointer = 2285;
break;
}
returnPointer = 2230;
instructionPointer = 4500;
break;
}
case 2230: {
B = B - B1 * 40 - 80;
}
case 2235: {
if (B1 > 1) {
instructionPointer = 2250;
break;
}
yield createInfo('NICE SHOOTING---YOU DROVE THEM OFF');
instructionPointer = 2395;
break;
}
case 2250: {
if (B1 <= 4) {
instructionPointer = 2275;
break;
}
yield createInfo('LOUSY SHOT---YOU GOT KNIFED');
K8 = 1;
yield createInfo("YOU HAVE TO SEE OL' DOC BLANCHARD");
instructionPointer = 2395;
break;
}
case 2275: {
yield createInfo('KINDA SLOW WITH YOUR COLT .45');
instructionPointer = 2395;
break;
}
case 2285: {
if (T1 > 3) {
instructionPointer = 2310;
break;
}
if (Math.random() > 0.8) {
instructionPointer = 2390;
break;
}
B -= 150;
M1 -= 15;
instructionPointer = 2395;
break;
}
case 2310: {
returnPointer = 2315;
instructionPointer = 4500;
break;
}
case 2315: {
B = B - B1 * 30 - 80;
M -= 25;
instructionPointer = 2235;
break;
}
case 2330: {
if (T1 > 1) {
instructionPointer = 2350;
break;
}
M += 15;
A -= 10;
instructionPointer = 2395;
break;
}
case 2350: {
if (T1 > 2) {
instructionPointer = 2370;
break;
}
M -= 5;
B -= 100;
instructionPointer = 2395;
break;
}
case 2370: {
if (T1 > 3) {
instructionPointer = 2380;
break;
}
instructionPointer = 2395;
break;
}
case 2380: {
M -= 20;
instructionPointer = 2395;
break;
}
case 2390: {
yield createInfo('THEY DID NOT ATTACK');
instructionPointer = 2500;
break;
}
case 2395: {
if (S5 === 0) {
instructionPointer = 2410;
break;
}
yield createInfo('RIDERS WERE FRIENDLY, BUT CHECK FOR POSSIBLE LOSSES');
instructionPointer = 2500;
break;
}
case 2410: {
yield createInfo('RIDERS WERE HOSTILE--CHECK FOR LOSSES');
if (B >= 0) {
instructionPointer = 2500;
break;
}
yield createInfo(
'YOU RAN OUT OF BULLETS AND GOT MASSACRED BY THE RIDERS'
);
instructionPointer = 3600;
break;
}
case 2500: {
// ***SELECTION OF EVENTS***
D1 = 0;
R1 = 100 * Math.random();
}
case 2515: {
D1 += 1;
if (D1 === 16) {
instructionPointer = 3020;
break;
}
const DATA = [
6, 11, 13, 15, 17, 22, 32, 35, 37, 42, 44, 54, 64, 69, 95,
];
const D = DATA[DATA_INDEX];
DATA_INDEX += 1;
if (R1 > D) {
instructionPointer = 2515;
break;
}
if (D1 > 10) {
instructionPointer = 2545;
break;
}
instructionPointer = [
2550, 2570, 2590, 2615, 2630, 2645, 2660, 2690, 2785, 2810,
][D1 - 1];
break;
}
case 2545: {
instructionPointer = [2825, 2860, 2885, 2970, 2990, 3020][D1 - 10 - 1];
break;
}
case 2550: {
yield createInfo('WAGON BREAKS DOWN--LOSE TIME AND SUPPLIES FIXING IT');
M = M - 15 - 5 * Math.random();
M1 -= 8;
instructionPointer = 3100;
break;
}
case 2570: {
yield createInfo('OX INJURES LEG---SLOWS YOU DOWN REST OF TRIP');
M -= 25;
A -= 20;
instructionPointer = 3100;
break;
}
case 2590: {
yield createInfo('BAD LUCK---YOUR DAUGHTER BROKE HER ARM');
yield createInfo('YOU HAD TO STOP AND USE SUPPLIES TO MAKE A SLING');
M = M - 5 - 4 * Math.random();
M1 = M1 - 2 - 3 * Math.random();
instructionPointer = 3100;
break;
}
case 2615: {
yield createInfo('OX WANDERS OFF---SPEND TIME LOOKING FOR IT');
M -= 17;
instructionPointer = 3100;
break;
}
case 2630: {
yield createInfo(
'YOUR SON GETS LOST---SPEND HALF THE DAY LOOKING FOR HIM'
);
M -= 10;
instructionPointer = 3100;
break;
}
case 2645: {
yield createInfo('UNSAFE WATER--LOSE TIME LOOKING FOR CLEAN SPRING');
M = M - 10 * Math.random() - 2;
instructionPointer = 3100;
break;
}
case 2660: {
if (M > 950) {
instructionPointer = 2935;
break;
}
yield createInfo('HEAVY RAINS---TIME AND SUPPLIES LOST');
F -= 10;
B -= 500;
M1 -= 15;
M = M - 10 * Math.random() - 5;
instructionPointer = 3100;
break;
}
case 2690: {
yield createInfo('BANDITS ATTACK');
instructionPointer = 4500;
returnPointer = 2705;
break;
}
case 2705: {
B -= 20 * B1;
if (B >= 0) {
instructionPointer = 2735;
break;
}
yield createInfo('YOU RAN OUT OF BULLETS---THEY GET LOTS OF CASH');
T /= 3;
instructionPointer = 2740;
break;
}
case 2735: {
if (B1 <= 1) {
instructionPointer = 2770;
break;
}
}
case 2740: {
yield createInfo(
'YOU GOT SHOT IN THE LEG AND THEY TOOK ONE OF YOUR OXEN'
);
K8 = 1;
yield createInfo('BETTER HAVE A DOC LOOK AT YOUR WOUND');
M1 -= 5;
A -= 20;
instructionPointer = 3100;
break;
}
case 2770: {
yield createInfo('QUICKEST DRAW OUTSIDE OF DODGE CITY!!!');
yield createInfo("YOU GOT 'EM!");
instructionPointer = 3100;
break;
}
case 2785: {
yield createInfo(
'THERE WAS A FIRE IN YOUR WAGON--FOOD AND SUPPLIES DAMAGED'
);
F -= 40;
B -= 400;
M1 = M1 - Math.random() * 8 - 3;
M -= 15;
instructionPointer = 3100;
break;
}
case 2810: {
yield createInfo('LOSE YOUR WAY IN HEAVY FOG---TIME IS LOST');
M = M - 10 - 5 * Math.random();
instructionPointer = 3100;
break;
}
case 2825: {
yield createInfo('YOU KILLED A POISONOUS SNAKE AFTER IT BIT YOU');
B -= 10;
M1 -= 5;
if (M1 >= 0) {
instructionPointer = 2855;
break;
}
yield createInfo('YOU DIE OF SNAKEBITE SINCE YOU HAVE NO MEDICINE');
instructionPointer = 3600;
break;
}
case 2855: {
instructionPointer = 3100;
break;
}
case 2860: {
yield createInfo(
'WAGON GETS SWAMPED FORDING RIVER--LOSE FOOD AND CLOTHES'
);
F -= 30;
C -= 20;
M = M - 20 - 20 * Math.random();
instructionPointer = 3100;
break;
}
case 2885: {
yield createInfo('WILD ANIMALS ATTACK!');
instructionPointer = 4500;
returnPointer = 2889;
break;
}
case 2889: {
if (B > 39) {
instructionPointer = 2895;
break;
}
yield createInfo('YOU WERE TOO LOW ON BULLETS--');
yield createInfo('THE WOLVES OVERPOWERED YOU');
K8 = 1;
instructionPointer = 3555;
break;
}
case 2895: {
if (B1 > 2) {
instructionPointer = 2910;
break;
}
yield createInfo("NICE SHOOTIN' PARDNER---THEY DIDN'T GET MUCH");
instructionPointer = 2915;
break;
}
case 2910: {
yield createInfo(
'SLOW ON THE DRAW---THEY GOT AT YOUR FOOD AND CLOTHES'
);
}
case 2915: {
B -= 20 * B1;
C -= B1 * 4;
F -= B1 * 8;
instructionPointer = 3100;
break;
}
case 2935: {
info = 'COLD WEATHER---BRRRRRRR!---YOU ';
if (C > 22 + 4 * Math.random()) {
instructionPointer = 2955;
break;