-
Notifications
You must be signed in to change notification settings - Fork 0
/
gameDriver.cpp
710 lines (691 loc) · 30.7 KB
/
gameDriver.cpp
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
//This is the main game file that contains all of the functions and brings together all of the classes
#include <iomanip>
#include <fstream>
#include <string>
#include <cstdlib>
#include <cmath>
#include <random>
#include "store.h"
#include "Person.h"
#include "calendar.h"
#include "inventory.h"
#include "distance.h"
void storeDriver (int campNumber){
Store store(campNumber);
Inventory items;
int input = 0;
cout << "Welcome to the shop." << endl;
cout << "Make your selection using the numbers then press enter" << endl;
while(input != 5){
cout << "You have $" << fixed << setprecision(2) << items.getMoney() << " to spend" << endl;
cout << "1. Oxen - You should have between 3 and 5 yokes of oxen. A yoke costs $40." << endl << "There are 2 oxen per yoke and you will gain an increase in travel speed if you have more oxen." << endl;
cout << "2. Food - You should have at least 200 lbs. of food. Food costs $0.5/lb" << endl;
cout << "3. Bullets - You can use bullets to hunt along the way for food. A box costs $2 and has 20 bullets" << endl;
cout << "4. Miscellaneous Supplies" << endl;
cout << "5. Exit" << endl;
cin >> input;
cin.ignore();
if (input < 1 && input > 5){
cout << "Invalid Input." << endl;
}
switch(input){
case 1:{
cout << "How many yokes do you want to buy?" << endl;
int amount;
cin >> amount;
if (amount == 0){
cout << "You have not purchased anything." << endl;
break;
}
if (amount < 0){
cout << "Invalid Input." << endl;
break;
}
if (amount * 2 + items.getOxen() > 10 && amount < 6){
cout << "You can't buy anymore oxen" << endl;
break;
}
if (amount > 5){
cout << "You can own a maximum of 5 yokes of oxen (10 oxen)" << endl;
cout << "You currently have " << items.getOxen() << endl;
int i = 0;
for (int j = items.getOxen(); j < 10; j++){
i++;
}
i = i / 2;
cout << "Do you want to purchase " << i << " yokes of oxen for $" << store.getOxen() * i << " ?" << endl;
cout << "Y/N" << endl;
char select;
cin >> select;
cin.ignore();
if(select == 'y' || select == 'Y'){
if(store.getOxen() > items.getMoney()){
cout << "You do not have emough money." << endl;
break;
}
cout << "You have purchased " << i << " yokes of oxen" << endl;
items.buyOxen(i);
items.spendMoney(store.getOxen() * i);
break;
}
if(select == 'n' || select == 'N'){
cout << "You have not purchased anything." << endl;
break;
}
}
else{
if(store.getOxen() > items.getMoney()){
cout << "You do not have emough money." << endl;
break;
}
cout << "Do you want to purchase " << amount << " yokes of oxen for $" << store.getOxen() * amount << " ?" << endl;
cout << "Y/N" << endl;
char select;
cin >> select;
cin.ignore();
if(select == 'y' || select == 'Y'){
if(store.getOxen() > items.getMoney()){
cout << "You do not have emough money." << endl;
break;
}
cout << "You have purchased " << amount << " yokes of oxen" << endl;
items.buyOxen(amount);
items.spendMoney(store.getOxen() * amount);
break;
}
if (select == 'n' || select == 'N'){
cout << "You have not purchased anything." << endl;
break;
}
}
break;
}
case 2:{
cout << "How many lbs. of food do you want to purchase?" << endl;
int amount;
cin >> amount;
cin.ignore();
if (amount < 0){
cout << "Invalid input" << endl;
break;
}
if(amount == 0){
cout << "You have not purchased anything." << endl;
break;
}
if(store.getFood()*amount > items.getMoney()){
cout << "You do not have enough money" << endl;
break;
}
if(items.getFood() + amount > 1000){
cout << "You cannot have more than 1000 lbs. of food" << endl;
break;
}
cout << "Do you want to purchase " << amount << " lbs. of food for $" << store.getFood()*amount << " ?" << endl;
cout << "Y/N" << endl;
char select;
cin >> select;
cin.ignore();
if(select == 'y' || select == 'Y'){
items.buyFood(amount);
items.spendMoney(store.getFood()*amount);
break;
}
if(select == 'n' || select == 'N'){
break;
}
break;
}
case 3:{
cout << "How many boxes of bullets would you like to buy? (20 bullets in a box with each box costing $2)" << endl;
int amount;
cin >> amount;
cin.ignore();
if (amount < 0){
cout << "Invalid input" << endl;
break;
}
if(amount == 0){
cout << "You have not purchased anything." << endl;
break;
}
if(store.getBullet()*amount > items.getMoney()){
cout << "You do not have enough money" << endl;
break;
}
cout << "Do you want to purchase " << amount << " boxes of bullets for $" << store.getBullet()*amount << " ?" << endl;
cout << "Y/N" << endl;
char select;
cin >> select;
cin.ignore();
if(select == 'y' || select == 'Y'){
items.buyBullets(amount);
items.spendMoney(store.getBullet()*amount);
break;
}
if(select == 'n' || select == 'N'){
cout << "You have not purchased anything." << endl;
break;
}
break;
}
case 4:{
int input2 = 0;
while (input2 != 3){
cout << "1. Wagon parts at $20 per part. If your wagon breaks and you have no parts you will be stranded." << endl;
cout << "2. Medical kit at $25 per part. If someone gets sick, you can use a medical kit to reduce the chance of death." << endl;
cout << "3. Back" << endl;
cin >> input2;
cin.ignore();
switch(input2){
case 1:{
cout << "How many wagon part(s) would you like to buy?" << endl;
int amount;
cin >> amount;
cin.ignore();
if (amount < 0){
cout << "Invalid input" << endl;
break;
}
if(amount == 0){
cout << "You have not purchased anything." << endl;
break;
}
cout << "Do you want to buy " << amount << " wagon part(s) for $" << store.getWagon()*amount << "?" << endl;
cout << "Y/N" << endl;
char select;
cin >> select;
cin.ignore();
if(select == 'y' || select == 'Y'){
items.buyParts(amount);
items.spendMoney(store.getWagon()*amount);
break;
}
if(select == 'n' || select == 'N'){
cout << "You have not purchased anything." << endl;
break;
}
break;
}
case 2:{
cout << "How many medical kits(s) would you like to buy?" << endl;
int amount;
cin >> amount;
cin.ignore();
if (amount < 0){
cout << "Invalid input" << endl;
break;
}
if(amount == 0){
cout << "You have not purchased anything." << endl;
break;
}
cout << "Do you want to buy " << amount << " medical kits(s) for $" << store.getMedkit()*amount << "?" << endl;
cout << "Y/N" << endl;
char select;
cin >> select;
cin.ignore();
if(select == 'y' || select == 'Y'){
items.buyMedicine(amount);
items.spendMoney(store.getMedkit()*amount);
break;
}
if(select == 'n' || select == 'N'){
cout << "You have not purchased anything." << endl;
break;
}
break;
}
case 3:{break;}
}
}
}
}
}
}
void printStats(string date, Person *traveler){
Inventory items;
Distance game;
cout << "===================================================================" << endl;
cout << "The current date is " << date << endl;
cout << "Money: $" << fixed << setprecision(2) << items.getMoney() << setprecision(0) << " Food: " << items.getFood() << " lbs. Oxen: " << items.getOxen() << endl;
cout << "Bullets: " << items.getBullets() << " Wagon Parts: " << items.getParts() << " Medicine: " << items.getMedicine() << endl;
cout << "You have traveled " << game.distanceTraveled() << " miles." << endl;
game.printNextMilestone();
cout << "===================================================================" << endl;
cout << traveler[0].getName(); if(traveler[0].sick()){cout << " is sick" << endl;}if(traveler[0].dead()){cout << " is dead" << endl;}if(!traveler[0].sick()&&!traveler[0].dead()){cout << " is healthy" << endl;}
cout << traveler[1].getName(); if(traveler[1].sick()){cout << " is sick" << endl;}if(traveler[1].dead()){cout << " is dead" << endl;}if(!traveler[1].sick()&&!traveler[1].dead()){cout << " is healthy" << endl;}
cout << traveler[2].getName(); if(traveler[2].sick()){cout << " is sick" << endl;}if(traveler[2].dead()){cout << " is dead" << endl;}if(!traveler[2].sick()&&!traveler[2].dead()){cout << " is healthy" << endl;}
cout << traveler[3].getName(); if(traveler[3].sick()){cout << " is sick" << endl;}if(traveler[3].dead()){cout << " is dead" << endl;}if(!traveler[3].sick()&&!traveler[3].dead()){cout << " is healthy" << endl;}
cout << traveler[4].getName(); if(traveler[4].sick()){cout << " is sick" << endl;}if(traveler[4].dead()){cout << " is dead" << endl;}if(!traveler[4].sick()&&!traveler[4].dead()){cout << " is healthy" << endl;}
cout << "===================================================================" << endl;
}
void welcomeBanner(){
cout << " ____ _______ _ _ " << endl;
cout << " / __ \\ |__ __| (_| |" << endl;
cout << " | | | |_ __ ___ __ _ ___ _ __ | |_ __ __ _ _| |" << endl;
cout << " | | | | '__/ _ \\/ _` |/ _ \\| '_ \\ | | '__/ _` | | |" << endl;
cout << " | |__| | | | __| (_| | (_) | | | | | | | | (_| | | |" << endl;
cout << " \\____/|_| \\___|\\__, |\\___/|_| |_| |_|_| \\__,_|_|_|" << endl;
cout << " __/ | " << endl;
cout << " |___/ " << endl;
}
void raiderAttack(){
Inventory items;
Distance game;
double probability;
double distance = game.distanceTraveled();
random_device gen;
probability = ((pow(distance/100-4,2)+72)/(pow(distance/100-4,2)+12));
probability = probability - 1;
probability = probability / 0.10;
bool attack = (gen() % 45) < probability;
if (attack){
int input = 0;
while(input != 1 && input != 2 && input != 3){
cout << "Raiders ahead. They look Hostile" << endl;
cout << "1. Run" << endl;
cout << "2. Attack" << endl;
cout << "3. Surrender" << endl;
cin >> input;
cin.ignore();
switch(input){
case 1:{
items.loseOxen(1);
items.loseFood(10);
items.loseParts(1);
cout << "You were able to get away from the raiders, but in the process you lost 1 oxen, 10 lbs of food, 1 wagon part." << endl;
break;
}
case 2:{
int num = gen() % 10 + 1;
//cout << num;
int input;
cout << "To win the battle, try to guess the number from 1 to 10. You have three attemps and the number does not change between attempts." << endl;
for (int i = 0; i < 3; i++){
cout << "Enter a number" << endl;
cin >> input;
cin.ignore();
if(input == num){
cout << "You guessed correct. You gained 50 lbs. of food and 50 bullets." << endl;
items.buyFood(50);
items.increaseBullets(50);
break;
}
}
if(input != num){
cout << "The raiders took a quarter of your money and 50 bullets" << endl;
items.loseBullets(50);
items.spendMoney(items.getMoney()*0.25);
}
break;
}
case 3:{
cout << "The raiders took a quarter of your money" << endl;
items.spendMoney(items.getMoney()*0.25);
break;
}
}
}
}
}
void hunt(){
cout << "You will go on a hunting trip today." << endl;
Inventory items;
random_device gen;
bool rabbit = (gen() % 100) < 50;
bool fox = (gen() % 100) < 25;
bool deer = (gen() % 100) < 15;
bool bear = (gen() % 100) < 7;
bool moose = (gen() % 100) < 5;
if(rabbit){
int select = 0;
cout << "You got lucky! You encountered a rabbit! Do you want to hunt?" << endl;
while (select != 1 && select != 2){
cout << "1. Yes, 2. No" << endl;
cin >> select;
cin.ignore();
if(select == 1 && items.getBullets()< 10){
cout << "You do not have enough bullets for this hunt" << endl;
}
if(select == 1 && items.getBullets() >= 10){
int num = gen() % 10 + 1;
int input;
cout << "To successfully hunt, guess the number from 1 to 10. You have 3 guesses and the number remains the same between guesses." << endl;
for (int i = 0; i < 3; i++){
cout << "Enter a number" << endl;
cin >> input;
cin.ignore();
if(input == num){
cout << "You guessed correct. You gained 5 lbs of food and used 10 bullets" << endl;
items.buyFood(5);
items.loseBullets(10);
}
}
if(input != num){
cout << "The rabbit got away" << endl;
}
}
}
}
if(fox){
int select = 0;
cout << "You got lucky! You encountered a fox! Do you want to hunt?" << endl;
while (select != 1 && select != 2){
cout << "1. Yes, 2. No" << endl;
cin >> select;
cin.ignore();
if(select == 1 && items.getBullets()< 8){
cout << "You do not have enough bullets for this hunt" << endl;
}
if(select == 1 && items.getBullets() >= 8){
int num = gen() % 10 + 1;
int input;
cout << "To successfully hunt, guess the number from 1 to 10. You have 3 guesses and the number remains the same between guesses." << endl;
for (int i = 0; i < 3; i++){
cout << "Enter a number" << endl;
cin >> input;
cin.ignore();
if(input == num){
cout << "You guessed correct. You gained 10 lbs of food and used 8 bullets" << endl;
items.buyFood(10);
items.loseBullets(8);
}
}
if(input != num){
cout << "The fox got away" << endl;
}
}
}
}
if(deer){
int select = 0;
cout << "You got lucky! You encountered a deer! Do you want to hunt?" << endl;
while (select != 1 && select != 2){
cout << "1. Yes, 2. No" << endl;
cin >> select;
cin.ignore();
if(select == 1 && items.getBullets()< 10){
cout << "You do not have enough bullets for this hunt" << endl;
}
if(select == 1 && items.getBullets() >= 10){
int num = gen() % 10 + 1;
int input;
cout << "To successfully hunt, guess the number from 1 to 10. You have 3 guesses and the number remains the same between guesses." << endl;
for (int i = 0; i < 3; i++){
cout << "Enter a number" << endl;
cin >> input;
cin.ignore();
if(input == num){
cout << "You guessed correct. You gained 5 lbs of food and used 10 bullets" << endl;
items.buyFood(5);
items.loseBullets(10);
}
}
if(input != num){
cout << "The deer got away" << endl;
}
}
}
}
if(bear){
int select = 0;
cout << "You got lucky! You encountered a bear! Do you want to hunt?" << endl;
while (select != 1 && select != 2){
cout << "1. Yes, 2. No" << endl;
cin >> select;
cin.ignore();
if(select == 1 && items.getBullets()< 10){
cout << "You do not have enough bullets for this hunt" << endl;
}
if(select == 1 && items.getBullets() >= 10){
int num = gen() % 10 + 1;
int input;
cout << "To successfully hunt, guess the number from 1 to 10. You have 3 guesses and the number remains the same between guesses." << endl;
for (int i = 0; i < 3; i++){
cout << "Enter a number" << endl;
cin >> input;
cin.ignore();
if(input == num){
cout << "You guessed correct. You gained 200 lbs of food and used 10 bullets" << endl;
items.buyFood(200);
items.loseBullets(10);
}
}
if(input != num){
cout << "The bear got away" << endl;
}
}
}
}
if(moose){
int select = 0;
cout << "You got lucky! You encountered a mosose! Do you want to hunt?" << endl;
while (select != 1 && select != 2){
cout << "1. Yes, 2. No" << endl;
cin >> select;
cin.ignore();
if(select == 1 && items.getBullets()< 12){
cout << "You do not have enough bullets for this hunt" << endl;
}
if(select == 1 && items.getBullets() >= 12){
int num = gen() % 10 + 1;
int input;
cout << "To successfully hunt, guess the number from 1 to 10. You have 3 guesses and the number remains the same between guesses." << endl;
for (int i = 0; i < 3; i++){
cout << "Enter a number" << endl;
cin >> input;
cin.ignore();
if(input == num){
cout << "You guessed correct. You gained 500 lbs of food and used 12 bullets" << endl;
items.buyFood(500);
items.loseBullets(12);
}
}
if(input != num){
cout << "The moose got away" << endl;
}
}
}
}
cout << "You have returned from your hunting trip." << endl;
if(rabbit == 0 && fox == 0 && deer == 0 && bear == 0 && moose == 0){
cout << "You have not encountered any animals on today's trip." << endl;
}
}
bool misfortune(Person *traveler, Calendar game){
Inventory items;
random_device gen;
bool misfortune = (gen() % 100) < 40;
if(misfortune){
int type = (gen() % 3);
switch(type){
case 0:{
int person = (gen() % 5);
if(!traveler[person].sick()&&!traveler[person].dead()){
traveler[person].setSick();
cout << traveler[person].getName() << " ate a pangolin and got coronavirus! :P" << endl;
bool death = (gen() % 2);
if(items.getMedicine() > 0){
bool death = (gen() % 2);
if(death){
cout << traveler[person].getName() << " wasn't in a great shape and died with corona" << endl;
traveler[person].setDeath();
}
if(!death){
cout << traveler[person].getName() << " managed to get better" << endl;
traveler[person].setHealed();
}
}
if(items.getMedicine() == 0){
cout << "You do not have any medicine. Do you want to rest or keep going?" << endl;
cout << "1. Rest" << endl;
cout << "2. Keep going" << endl;
string input;
while(input != "1" && input != "2"){
cin >> input;
if (input == "1"){
game.increaseDays(3);
bool death = (gen() % 100) < 30;
if(death){
cout << traveler[person].getName() << " wasn't in a great shape and died with corona" << endl;
traveler[person].setDeath();
}
if(!death){
cout << traveler[person].getName() << " managed to get better" << endl;
traveler[person].setHealed();
}
}
if (input == "2"){
break;
}
}
}
}
break;
}
case 1:{
cout << "Your wagon broke" << endl;
if(items.getParts() > 0){
cout << "You used one of your parts to fix the wagon." << endl;
items.loseParts(1);
break;
}
if(items.getParts() == 0){
cout << "You are out of parts and cannot continue on your journey" << endl;
return 1;
}
break;
}
case 2:{
items.loseOxen(1);
cout << "One of your oxen died. You have " << items.getOxen() << " oxen left." << endl;
if(items.getOxen() == 0){
cout << "You don't have anymore oxen left and you can't continue on your journey." << endl;
return 1;
}
break;
}
}
}
return 0;
}
int main(){
bool gameOver = 0;
bool deadlinePass = 0;
string temp;
welcomeBanner();
Person traveler[5];
Calendar calendar;
Distance game;
Inventory items;
int select = 0;
int input= 0;
int input2= 0;
random_device gen;
cout << "Enter the team leader's name" << endl;
cin >> temp;
traveler[0].setName(temp);
cout << "Enter the name of traveling partner 1" << endl;
cin >> temp;
traveler[1].setName(temp);
cout << "Enter the name of traveling partner 2" << endl;
cin >> temp;
traveler[2].setName(temp);
cout << "Enter the name of traveling partner 3" << endl;
cin >> temp;
traveler[3].setName(temp);
cout << "Enter the name of traveling partner 4" << endl;
cin >> temp;
traveler[4].setName(temp);
cout << "You need to visit the store to get ready for the journey." << endl;
storeDriver(0);
cout << "The default departure date is 3/28/1847. Would you like to select a different date? (between 3/1/1847 and 5/1/1847)" << endl;
while(select != 1 && select != 2){
cout << "1. yes 2. no" << endl;
cin >> select;
cin.ignore();
if(select == 1){
int month;
int day;
cout << "Input the date as month/day/year" << endl;
cin >> temp;
calendar.setDate(temp);
}
}
input = 0;
while(input != 5 && !gameOver){
printStats(calendar.getDate(), traveler);
cout << "1. Rest" << endl;
cout << "2. Continue on the trail" << endl;
cout << "3. Hunt" << endl;
for(int i = 0; i < 5; i++){
if(traveler[i].sick() && !traveler[i].dead()){
bool death = (gen() % 100) < 70;
if(death){
cout << traveler[i].getName() << " wasn't in a great shape and died with corona" << endl;
traveler[i].setDeath();
}
if(!death){
cout << traveler[i].getName() << " managed to get better" << endl;
traveler[i].setHealed();
}
}
}
if(game.isatCamp()){
cout << "4. Store" << endl;
}
cout << "5. Quit the game" << endl;
cin >> input;
if(input == 1){
cout << "You will rest for 2 days" << endl;;
calendar.increaseDays(2);
items.loseFood(6*(!traveler[0].dead()+!traveler[1].dead()+!traveler[2].dead()+!traveler[3].dead()+!traveler[4].dead()));
}
if(input == 2){
calendar.increaseDays(14);
items.loseFood(14*3*(!traveler[0].dead()+!traveler[1].dead()+!traveler[2].dead()+!traveler[3].dead()+!traveler[4].dead()));
game.travel(75+(items.getOxen()*7));
}
if(input == 3){
hunt();
}
if(input == 4 && game.isatCamp()){
storeDriver(game.getCampNumber());
}
if(input == 5){
gameOver = 1;
break;
}
if (items.getFood() == 0){
cout << "You are out of food" << endl;
gameOver = 1;
break;
}
misfortune(traveler, calendar);
if (traveler[0].dead()){
gameOver = 1;
break;
}
gameOver = game.travel(0);
raiderAttack();
}
ofstream file;
file.open("results.txt");
if(file.is_open()){
file << traveler[0].getName() << endl;
file << "===================================================================" << endl;
file << "The current date is " << calendar.getDate() << endl;
file << "Money: $" << fixed << setprecision(2) << items.getMoney() << setprecision(0) << " Food: " << items.getFood() << " lbs. Oxen: " << items.getOxen() << endl;
file << "Bullets: " << items.getBullets() << " Wagon Parts: " << items.getParts() << " Medicine: " << items.getMedicine() << endl;
file << "You have traveled " << game.distanceTraveled() << " miles." << endl;
file << game.returnNextMilestone() << endl;
file << "===================================================================" << endl;
file << traveler[0].getName(); if(traveler[0].sick()){file << " is sick" << endl;}if(traveler[0].dead()){file << " is dead" << endl;}if(!traveler[0].sick()&&!traveler[0].dead()){file << " is healthy" << endl;}
file << traveler[1].getName(); if(traveler[1].sick()){file << " is sick" << endl;}if(traveler[1].dead()){file << " is dead" << endl;}if(!traveler[1].sick()&&!traveler[1].dead()){file << " is healthy" << endl;}
file << traveler[2].getName(); if(traveler[2].sick()){file << " is sick" << endl;}if(traveler[2].dead()){file << " is dead" << endl;}if(!traveler[2].sick()&&!traveler[2].dead()){file << " is healthy" << endl;}
file << traveler[3].getName(); if(traveler[3].sick()){file << " is sick" << endl;}if(traveler[3].dead()){file << " is dead" << endl;}if(!traveler[3].sick()&&!traveler[3].dead()){file << " is healthy" << endl;}
file << traveler[4].getName(); if(traveler[4].sick()){file << " is sick" << endl;}if(traveler[4].dead()){file << " is dead" << endl;}if(!traveler[4].sick()&&!traveler[4].dead()){file << " is healthy" << endl;}
file << "===================================================================" << endl;
}
}