-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
1446 lines (1269 loc) · 62.1 KB
/
main.py
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
#Shop Manager
import time, sys, os.path, fileinput
from random import randint
class GameInit():
#handles inital startup
@staticmethod
def check_dlc():
global yes_list, no_list
#check for DLC/map packs
ask_dlc = input("Game: Would you like to play with DLC loaded? ")
if ask_dlc.lower() in ["yes", "y"]:
#checking for DCL1
file_present = os.path.isfile("DLC_PIE.dlc")
if file_present == True:
time.sleep(1)
ask_dlc1 = input("Game: Would you like to load the Packa Pie DLC? ")
if ask_dlc1.lower() in yes_list:
with fileinput.FileInput("DLC_PIE.dlc", inplace=True, backup='.bak') as file:
DLC1 = file.readline()
print("Game: Packa Pie DLC loaded.")
time.sleep(1)
else:
print("Game: Packa Pie DLC not loaded.")
time.sleep(1)
else:
print("Game: Packa Pie DLC not installed!")
#checking for DCL2
file_present2 = os.path.isfile("DLC_FISH.dlc")
if file_present2 == True:
time.sleep(1)
ask_dlc2 = input("Game: Would you like to load the More Fish DLC? ")
if ask_dlc2.lower() in yes_list:
with fileinput.FileInput("DLC_FISH.dlc", inplace=True, backup='.bak') as file:
DLC2 = file.readline()
print("Game: More Fish DLC loaded.")
time.sleep(1)
else:
print("Game: More Fish DLC not loaded.")
time.sleep(1)
else:
print("Game: More Fish DLC not installed!")
if ask_dlc.lower() in ["no", "n"]:
return
else:
return
@staticmethod
def variables():
#sets the variables to default values and creates them on startup or reset
#general
global username, day, rand_day, cash, level, exp, req_exp, shop, game_version, currency, supported_versions, rent, wages, day_name
username = "John"
shop = "Fish n' Chips"
day = 1
rand_day = 0
cash = 25
level = 1
exp = 0
req_exp = 10
game_version = "v1.3-beta"
supported_versions = ["v1.2-beta", "v1.3-beta"]
currency = "£"
rent = 10
wages = 10
day_name = 0
#stock
global fish, potato, sausage, fishcake, cooked_fish, cooked_potato, cooked_sausage, cooked_fishcake, fish_sellable, potato_sellable, sausage_sellable, fishcake_sellable
fish = 20
cooked_fish = 0
fish_sellable = True
potato = 0
cooked_potato = 0
potato_sellable = False
sausage = 0
cooked_sausage = 0
sausage_sellable = False
fishcake = 0
cooked_fishcake = 0
fishcake_sellable = False
#prices
global fish_cost, cooked_fish_cost, potato_cost, cooked_potato_cost, sausage_cost, cooked_sausage_cost, fishcake_cost, cooked_fishcake_cost
fish_cost = 1
cooked_fish_cost = 1.5
potato_cost = 2
cooked_potato_cost = 2.5
sausage_cost = 3
cooked_sausage_cost = 3.5
fishcake_cost = 3
cooked_fishcake_cost = 3.5
#exp values
global fish_exp, potato_exp, sausage_exp, fishcake_exp
fish_exp = 1
potato_exp = 2
sausage_exp = 3
fishcake_exp = 3
#fail/rand states
global rand1, rand2, fail1, fail2
rand1 = False
rand2 = False
fail1 = False
fail2 = False
#DLC1
if DLC1 == True:
global pukkapie, cooked_pukkapie, pukkapie_sellable, pukkapie_cost, cooked_pukkapie_cost, pukkapie_exp
#pukka pie
pukkapie = 0
cooked_pukkapie = 0
pukkapie_sellable = False
pukkapie_cost = 1.5
cooked_pukkapie_cost = 2.5
pukkapie_exp = 2
#DLC2
if DLC2 == True:
global plaice, cooked_plaice, plaice_sellable, plaice_cost, cooked_plaice_cost, plaice_exp
#plaice
plaice = 0
cooked_plaice = 0
plaice_sellable = False
plaice_cost = 2.5
cooked_plaice_cost = 3.5
plaice_exp = 3
global haddock, cooked_haddock, haddock_sellable, haddock_cost, cooked_haddock_cost, haddock_exp
#haddock
haddock = 0
cooked_haddock = 0
haddock_sellable = False
haddock_cost = 3
cooked_haddock_cost = 4.5
haddock_exp = 4
@staticmethod
def manager_name():
#handles the username
global username, yes_list, no_list
username = input("Uncle Bob: Hello, I 've forgotton your name. What was it again? ")
#sets default if the input is blank
if username == "":
username = "John"
username_ch = input("Uncle Bob: So you're "+username+" right? ")
time.sleep(1)
#asks the user if the if they are sure about their username
if username_ch.lower() in yes_list:
print("Uncle Bob: Ah, yes! My brother's kid who's taking the shop from me. I forgot who you were for a minute!")
return
if username_ch.lower() in no_list:
GameInit.manager_name()
return
else:
print("Uncle Bob: What's that? I didn't quite catch that.")
GameInit.manager_name()
@staticmethod
def shop_name():
#handles the shop
global shop, yes_list, no_list, username
time.sleep(1)
print("Uncle Bob: You might as well re-name the shop as 'Fish n' Chips' might not be as good as what you come up with.")
time.sleep(1)
shop = input("Uncle Bob: So "+username+", what would you like the shop to be called? ")
#sets default if the input is blank
if shop == "":
shop = "Fish n' Chips"
shop_ch = input("Uncle Bob: You want it called "+shop+"? ")
#asks the user if the if they are sure about the shop name
if shop_ch.lower() in yes_list:
if shop.lower() == "fish n' chips":
print("Uncle Bob: So it was a good name...")
return
if shop_ch.lower() in no_list:
GameInit.shop_name()
return
else:
print("Uncle Bob: What's that "+username+"? I didn't quite catch that.")
GameInit.shop_name()
@staticmethod
def currency_name():
#handles the shop
global currency,yes_list, no_list
currency = input("Uncle Bob: What is the currency you use again? ")
#sets default if the input is blank
if currency == "":
currency = "£"
currency_ch = input("Uncle Bob: Ah so it's "+currency+"? ")
#makes sure the user has a value less than or equal to 4
if len(currency) > 4:
print("Uncle Bob: That seems to be a bit too long from memory?")
GameInit.currency_name()
return
if currency_ch.lower() in yes_list:
return
if currency_ch.lower() in no_list:
GameInit.currency_name()
return
else:
print("Uncle Bob: What was that kiddo? Say that again for me.")
GameInit.currency_name()
return
@staticmethod
def startup():
#sets up global varaibles used before GameInit.varibles()
global DLC1, DLC2, yes_list, no_list
DLC1 = False
DLC2 = False
yes_list = ["yes", "y", "yes.", "y.", "yeah", "yh", "yeah.", "yh.", "hells yeah boi", "yeaah","yep", "yep."]
no_list = ["no", "n", "no.", "n.", "nah", "noo", "nah.", "noo.", "hells nah boi", "naah", "nope", "nope."]
x_loop = 1
#runs all the startup stuff
pre_init = input("Game: Hello, would you like to start a new game? ")
pre_init = pre_init.lower()
#runs the variable delcrations
if pre_init in yes_list:
GameInit.check_dlc()
GameInit.variables()
#launches user-friendly text details
launching = "Game: Launching"
for x in range(3):
launching = launching + "."
print(launching)
time.sleep(0.5)
print("")
GameInit.manager_name()
GameInit.shop_name()
GameInit.currency_name()
GameMain.main()
return
#asking about loading the game if pre_init input equals no
if pre_init in no_list:
ask_load = input("Game: Would you like to load a previous game? ")
if ask_load in yes_list:
DataManage.load()
return
if ask_load in no_list:
DataManage.game_quit()
return
else:
print("Game: Please enter a valid reply.")
GameInit.startup()
#skips the startup questions if the user is a tester
if pre_init.lower() in ["default", "bug"]:
GameInit.variables()
GameMain.main()
else:
print("Game: Please enter a valid reply.")
GameInit.startup()
@staticmethod
def day_costs():
global cash, rent, wages, currency
#manages the rent and taxes for the day
rent_and_wages = rent + wages
print("Fred: You should pay the rent and the wages for today.")
print("Fred: That comes to "+currency+str(rent_and_wages)+" "+username+"!")
time.sleep(1.5)
if rent_and_wages > cash:
print("Fred: You don't have enough money boss! I'm sorry but we're going to have to close down!")
GameInit.game_over()
else:
cash = cash - rent_and_wages
print("Fred: You now have "+currency+str(cash)+" left.")
@staticmethod
def end():
#manages all of the end of day prints
global level, cash, exp, req_exp, currency, day, yes_list, no_list
print("Fred: Congratulations Boss, you finished the day with "+currency+str(cash)+" overall!")
print("Fred: You are level "+str(level)+" and have "+str(exp)+"/"+str(req_exp)+" EXP for the next level.")
#rusn the rent and wages func.
GameInit.day_costs()
#changes the day and resets the daytime var.
daytime = 0
day = day + 1
#ask the user to save the game and runs the save function if yes
ask_sav = input("Game: Would you like to save your game? ")
ask_sav = ask_sav.lower()
if ask_sav in yes_list:
DataManage.save()
elif ask_sav in no_list:
print("")
else:
print("Game: Please enter a valid response!")
#ask the user about quitting the game and runs the quit function is yes
ask_qui = input("Game: Would you like to quit your game? ")
ask_qui = ask_qui.lower()
if ask_qui in yes_list:
DataManage.game_quit()
return
elif ask_qui in no_list:
return
else:
print("Game: Please enter a valid response!")
@staticmethod
def buy_stock():
global yes_list, no_list, DLC1, DLC2, fish, fish_cost, potato, potato_cost, sausage, sausage_cost, fishcake, fishcake_cost, cash, level, currency
if DLC1 == True:
global pukkapie, pukkapie_cost
if DLC2 == True:
global plaice, plaice_cost, haddock, haddock_cost
#asks the user if they want to buy stock to sell later on
ask_stock = input("Fred: Hey boss, would you like to buy some stock this morning (You have "+currency+ str(cash)+")? ")
if ask_stock.lower() in yes_list:
#shows how much stock they have and asks them what they want to buy
print("Fred: Cod Stock: "+str(fish)+", Potato Stock: "+str(potato)+", Sasuage Stock: "+str(sausage)+" and Fishcake Stock: "+str(fishcake)+" ")
dlc_str = ""
if DLC1 == True:
dlc_str = dlc_str + "Pie Stock "+str(pukkapie)+", "
if DLC2 == True:
dlc_str = dlc_str + "Plaice Stock: "+str(plaice)+" and Haddock Stock: "+str(haddock)+" "
print(dlc_str)
ask_buy = input("Fred: What do you want to buy? ")
#asks them how many fish they want to buy
if ask_buy.lower() in ["cod", "cods", "c"]:
ask_amount = int(input("Fred: How much Cod would you like to order? ("+currency + str(fish_cost) + " a cod) "))
#checks if the cash is there to buy the stock
if ask_amount > cash:
print("Fred: Sorry, we don't have the money to order that much!")
GameInit.buy_stock()
return
else:
#adds the stock to the global var. and subtarcts the cost
cash = cash - (ask_amount * fish_cost)
fish = fish + ask_amount
time.sleep(1.5)
return
#asks them how many potatoes they want to buy
if ask_buy.lower() in ["potato", "potatoes", "p"]:
#checks if the user is a high enough level to buy the stock to sell
if level < 3:
print("Fred: Sorry! You need to be level 3 to unlock this!")
GameInit.buy_stock()
elif level >= 3:
ask_amount = int(input("Fred: How many potatoes would you like to order? ("+currency + str(potato_cost) + " a potato) "))
#checks if the cash is there to buy the stock
if ask_amount > cash:
print("Fred: Sorry, we don't have the money to order that many!")
buy_stock()
return
else:
#adds the stock to the global var. and subtarcts the cost
cash = cash - (ask_amount * potato_cost)
potato = potato + ask_amount
time.sleep(1.5)
return
else:
print("Game: Please enter a valid reply.")
GameInit.buy_stock()
return
#asks them how many sausage they want to buy
if ask_buy.lower() in ["sausage", "sausages", "s"]:
#checks if the user is a high enough level to buy the stock to sell
if level < 5:
print("Fred: Sorry! You need to be level 5 to unlock this!")
GameInit.buy_stock()
elif level >= 5:
ask_amount = int(input("Fred: How many sausages would you like to order? (" + currency + str(sausage_cost) + " a sausage) "))
#checks if the cash is there to buy the stock
if ask_amount > cash:
print("Fred: Sorry, we don't have the money to order that much!")
GameInit.buy_stock()
return
else:
#adds the stock to the global var. and subtarcts the cost
cash = cash - (ask_amount * sausage_cost)
sausage = sausage + ask_amount
time.sleep(1.5)
return
else:
print("Game: Please enter a valid reply.")
GameInit.buy_stock()
return
#asks them how many fishcake they want to buy
if ask_buy.lower() in ["fishcake", "fishcakes", "fc"]:
#checks if the user is a high enough level to buy the stock to sell
if level < 7:
print("Fred: Sorry! You need to be level 7 to unlock this!")
GameInit.buy_stock()
elif level >= 7:
ask_amount = int(input("Fred: How many fishcakes would you like to order? (" + currency + str(fishcake_cost) + " a fishcake) "))
#checks if the cash is there to buy the stock
if ask_amount > cash:
print("Fred: Sorry, we don't have the money to order that many!")
GameInit.buy_stock()
return
else:
#adds the stock to the global var. and subtarcts the cost
cash = cash - (ask_amount * fishcake_cost)
fishcake = fishcake + ask_amount
time.sleep(1.5)
return
if ask_buy.lower() in ["pukkapie", "pukka pie", "pie", "pies", "dlc1"]:
if DLC1 == True:
if level < 4:
print("Fred: Sorry! You need to be level 4 to unlock this!")
GameInit.buy_stock()
elif level >= 4:
ask_amount = int(input("Fred: How many pies would you like to order? (" + currency + str(pukkapie_cost) + " a pie) "))
#checks if the cash is there to buy the stock
if ask_amount > cash:
print("Fred: Sorry, we don't have the money to order that many!")
GameInit.buy_stock()
return
else:
#adds the stock to the global var. and subtarcts the cost
cash = cash - (ask_amount * pukkapie_cost)
pukkapie = pukkapie + ask_amount
time.sleep(1.5)
return
if ask_buy.lower() in ["plaice", "plaices", "p", "fish2"]:
if DLC1 == True:
if level < 6:
print("Fred: Sorry! You need to be level 6 to unlock this!")
GameInit.buy_stock()
elif level >= 6:
ask_amount = int(input("Fred: How much plaice would you like to order? (" + currency + str(plaice_cost) + " a plaice) "))
#checks if the cash is there to buy the stock
if ask_amount > cash:
print("Fred: Sorry, we don't have the money to order that many!")
GameInit.buy_stock()
return
else:
#adds the stock to the global var. and subtarcts the cost
cash = cash - (ask_amount * plaice_cost)
plaice = plaice + ask_amount
time.sleep(1.5)
return
else:
print("Game: Error, DLC not found.")
if ask_buy.lower() in ["haddock", "haddocks", "h", "fish3"]:
if DLC1 == True:
if level < 8:
print("Fred: Sorry! You need to be level 8 to unlock this!")
GameInit.buy_stock()
elif level >= 8:
ask_amount = int(input("Fred: How much haddock would you like to order? (" + currency + str(haddock_cost) + " a haddock) "))
#checks if the cash is there to buy the stock
if ask_amount > cash:
print("Fred: Sorry, we don't have the money to order that many!")
GameInit.buy_stock()
return
else:
#adds the stock to the global var. and subtarcts the cost
cash = cash - (ask_amount * haddock_cost)
haddock = haddock + ask_amount
time.sleep(1.5)
return
else:
print("Game: Error, DLC not found.")
ask_reorder = input("Fred: Would you like to place another order? ")
if ask_reorder in yes_list:
GameInit.buy_stock()
if ask_reorder in no_list:
print("Fred: The order has arrived thanks to Congo Prime and the almost instant delivery!")
else:
print("Game: Please enter a valid reply.")
GameInit.buy_stock()
return
if ask_stock.lower() in no_list:
print("Fred: We can always order more tomorrow if we need.")
return
else:
return
@staticmethod
def cook_fish():
#variables
global username, fish, cooked_fish, level, cooked_fish_cost, currency, yes_list, no_list
#asks the user how mucbh fo the stock they want to cook
print("Fred: Perfect! How many cod would you like to cook this morning? ")
ask_fish = int(input("Fred: Lastly "+username+", you only have "+str(fish)+": "))
#checking they have the stock to cook
if ask_fish > fish:
print("Fred: Boss, you can't cook more than you have!")
GameInit.cook_fish()
else:
print("Fred: I'll cook the cod now Boss!")
time.sleep(1.5)
#subtracts the fish and adds them to the cooked stock
fish = fish - ask_fish
cooked_fish = ask_fish
print("Fred: Al'ight Boss, "+str(cooked_fish)+" cod were cooked!")
ask_chg = input("Fred: Would you like to change the price today? ")
if ask_chg in ["yes", "y"]:
cooked_fish_cost = float(input("Fred: What would you like it to be? (Current: "+currency+str(cooked_fish_cost)+") "))
return
if ask_chg in ["no", "n"]:
return
@staticmethod
def cook_potato():
#variables
global potato, cooked_potato, level, potato_sellable, username, cooked_potato_cost, currency, yes_list, no_list
#asks the user how mucbh fo the stock they want to cook
ask_pots = input("Fred: Would you like to cook chips today? ")
if ask_pots.lower() in yes_list:
print("Fred: Sounds great! How many potatoes do you want to cook this morning? ")
ask_potato = int(input("Fred: By the way, you currently have "+str(potato)+": "))
#checking they have the stock to cook
if ask_potato > potato:
print("Fred: Boss, you can't cook more than you have!")
GameInit.cook_potato()
else:
print("Fred: I'll cook the potatoes now Boss!")
time.sleep(1.5)
#subtracts the fish and adds them to the cooked stock
potato = potato - ask_potato
cooked_potato = ask_potato
print("Fred: Al'ight Boss, "+str(cooked_potato)+" portions of chips were cooked!")
if ask_pots.lower() in no_list:
potato_sellable = False
print("Fred: That sounds like a plan boss!")
ask_chg = input("Fred: Would you like to change the price today? ")
#changes the price to what the user selects and stores it as a float
if ask_chg in yes_list:
cooked_potato_cost = float(input("Fred: What would you like it to be? (Current: "+currency+str(cooked_potato_cost)+") "))
return
if ask_chg in no_list:
return
@staticmethod
def cook_sausage():
#variables
global sausage, cooked_sausage, level, sausage_sellable, username, cooked_sausage_cost, currency, yes_list, no_list
#asks the user how mucbh fo the stock they want to cook
ask_pots = input("Fred: Would you like to cook sauages today? ")
if ask_pots.lower() in yes_list:
print("Fred: Sounds great! How many sausages do you want to cook this morning? ")
ask_sausage = int(input("Fred: You have "+str(sausages)+": "))
#checking they have the stock to cook
if ask_sausage > sausage:
print("Fred: Boss, you can't cook more than you have!")
GameInit.cook_sausage()
else:
print("Fred: I'll cook the sausages now Boss!")
time.sleep(1.5)
#subtracts the fish and adds them to the cooked stock
sausage = sausage - ask_sausages
cooked_sausage = ask_sausages
print("Fred: Al'ight Boss, "+str(cooked_sausage)+" sausages were cooked!")
if ask_pots.lower() in no_list:
sausage_sellable = False
print("Fred: Sounds like a plan "+username+"!")
ask_chg = input("Fred: Would you like to change the price today? ")
#changes the price to what the user selects and stores it as a float
if ask_chg in yes_list:
cooked_sausage_cost = float(input("Fred: What would you like it to be? (Current: "+currency+str(cooked_sausage_cost)+") "))
return
if ask_chg in no_list:
return
@staticmethod
def cook_fishcake():
#variables
global fishcake, cooked_fishcake, level, fishcake_sellable, username, cooked_fishcake_cost, currency, yes_list, no_list
#asks the user how mucbh fo the stock they want to cook
ask_pots = input("Fred: Would you like to cook fishcakes today? ")
if ask_pots.lower() in yes_list:
print("Fred: Sounds great! How many fishcakes do you want to cook this morning? ")
ask_fishcake = int(input("Fred: You have "+str(fishcake)+": "))
#checking they have the stock to cook
if ask_fishcake > fishcake:
print("Fred: Boss, you can't cook more than you have!")
GameInit.cook_fishcake()
else:
print("Fred: I'll cook the fishcakes now Boss!")
time.sleep(1.5)
#subtracts the fish and adds them to the cooked stock
fishcake = fishcake - ask_fishcake
cooked_fishcake = ask_fishcake
print("Fred: Okay Boss, "+str(cooked_fishcake)+" fishcakes were cooked!")
if ask_pots.lower() in no_list:
sausage_sellable = False
print("Fred: Sounds like a plan "+username+"!")
ask_chg = input("Fred: Would you like to change the price today? ")
#changes the price to what the user selects and stores it as a float
if ask_chg in yes_list:
cooked_fishcake_cost = float(input("Fred: What would you like it to be? (Current: "+currency+str(cooked_fishcake_cost)+") "))
return
if ask_chg in no_list:
return
@staticmethod
def cook_pukkapie():
#variables
global pukkapie, cooked_pukkapie, pukkapie_sellable, cooked_pukkapie_cost, level, username, currency, yes_list, no_list
#asks the user how mucbh fo the stock they want to cook
ask_pots = input("Fred: Would you like to cook pies today? ")
if ask_pots.lower() in yes_list:
print("Fred: Sounds great! How many pies do you want to cook this morning? ")
ask_pukkapie = int(input("Fred: You have "+str(pies)+": "))
#checking they have the stock to cook
if ask_pukkapie > pukkapie:
print("Fred: Boss, you can't cook more than you have!")
GameInit.cook_pukkapie()
else:
print("Fred: I'll cook the pies now Boss!")
time.sleep(1.5)
#subtracts the fish and adds them to the cooked stock
pukkapie = pukkapie - ask_pukkapie
cooked_pukkapie = ask_pukkapie
print("Fred: Okay Boss, "+str(cooked_pukkapie)+" pies were cooked!")
if ask_pots.lower() in no_list:
sausage_sellable = False
print("Fred: Sounds like a plan "+username+"!")
ask_chg = input("Fred: Would you like to change the price today? ")
#changes the price to what the user selects and stores it as a float
if ask_chg in yes_list:
cooked_fishcake_cost = float(input("Fred: What would you like it to be? (Current: "+currency+str(cooked_pukkapie_cost)+") "))
return
if ask_chg in no_list:
return
@staticmethod
def cook_plaice():
#variables
global plaice, cooked_plaice, plaice_sellable, cooked_plaice_cost, level, username, currency, yes_list, no_list
#asks the user how mucbh fo the stock they want to cook
ask_pots = input("Fred: Would you like to cook plaice today? ")
if ask_pots.lower() in yes_list:
print("Fred: Sounds great! How much plaice do you want to cook this morning? ")
ask_plaice = int(input("Fred: You have "+str(plaice)+": "))
#checking they have the stock to cook
if ask_plaice > plaice:
print("Fred: Boss, you can't cook more than you have!")
GameInit.cook_plaice()
else:
print("Fred: I'll cook the plaice now Boss!")
time.sleep(1.5)
#subtracts the fish and adds them to the cooked stock
plaice = plaice - ask_plaice
cooked_plaice = ask_plaice
print("Fred: Okay Boss, "+str(cooked_plaice)+" plaice were cooked!")
if ask_pots.lower() in no_list:
sausage_sellable = False
print("Fred: Sounds like a plan "+username+"!")
ask_chg = input("Fred: Would you like to change the price today? ")
#changes the price to what the user selects and stores it as a float
if ask_chg in yes_list:
cooked_plaice_cost = float(input("Fred: What would you like it to be? (Current: "+currency+str(cooked_plaice_cost)+") "))
return
if ask_chg in no_list:
return
@staticmethod
def cook_haddock():
#variables
global haddock, cooked_haddock, haddock_sellable, cooked_haddock_cost, level, username, currency, yes_list, no_list
#asks the user how mucbh fo the stock they want to cook
ask_pots = input("Fred: Would you like to cook haddock today? ")
if ask_pots.lower() in yes_list:
print("Fred: Sounds great! How much haddock do you want to cook this morning? ")
ask_plaice = int(input("Fred: You have "+str(haddock)+": "))
#checking they have the stock to cook
if ask_plaice > plaice:
print("Fred: Boss, you can't cook more than you have!")
GameInit.cook_plaice()
else:
print("Fred: I'll cook the haddock now Boss!")
time.sleep(1.5)
#subtracts the fish and adds them to the cooked stock
plaice = plaice - ask_plaice
cooked_plaice = ask_plaice
print("Fred: Okay Boss, "+str(cooked_haddock)+" haddock were cooked!")
if ask_pots.lower() in no_list:
sausage_sellable = False
print("Fred: Sounds like a plan "+username+"!")
ask_chg = input("Fred: Would you like to change the price today? ")
#changes the price to what the user selects and stores it as a float
if ask_chg in yes_list:
cooked_plaice_cost = float(input("Fred: What would you like it to be? (Current: "+currency+str(cooked_haddock_cost)+") "))
return
if ask_chg in no_list:
return
@staticmethod
def special_days():
#special days
global cash, day, shop, currency, rent, wages, day_name
#runs the special day code for the first day, the beginning
if day == 1:
rw = rent + wages
print("-= Day 1: The Beginning =-")
print("Uncle Bob: Welcome to ShopManager "+username+"! You must run "+shop+" inherited from me, your Uncle Bob!")
print("Uncle Bob: Always remember you have to pay "+currency+str(rw)+" a day in wages and rent!")
time.sleep(1.5)
#runs the special day code for the 7th day, the end of week 1
if day == 7:
bonus = level * 10
print("-= Day 7: The First Week =-")
print("Uncle Bob: Congratulations "+username+", you made it through the week. Here's an extra "+currency+bonus+" to get you on your way!")
cash += bonus
print("Game: You now have "+currency+str(cash)+"!")
time.sleep(1.5)
#runs the special day code for the 14th day, the end of week 2
if day == 14:
bonus = level * 20
print("-= Day 14: The Second Week =-")
print("Uncle Bob: Congratulations "+username+", you made it through a second week. Impressive! Here's an extra "+currency+bonus+" to get you on your way!")
cash += bonus
print("Game: You now have "+currency+str(cash)+"!")
time.sleep(1.5)
#checks if it isn't a speical day and prints the default day header
elif day not in [1, 7, 14, rand_day]:
print("-= Day "+str(day)+" =-")
time.sleep(1.5)
if day_name == 0:
print("-= Monday =-")
day_name += 1
if day_name == 1:
print("-= Tuesday =-")
day_name += 1
if day_name == 2:
print("-= Wednesday =-")
day_name += 1
if day_name == 3:
print("-= Thursday =-")
day_name += 1
if day_name == 4:
print("-= Friday =-")
day_name += 1
if day_name == 5:
print("-= Saturday =-")
day_name += 1
if day_name == 6:
print("-= Sunday =-")
day_name = 0
else:
return
@staticmethod
def random_days():
#picks a random day and runs a special feature
global day, rand_day, rand1, cash
#creates a random day number and runs the code if it is equal to the day and runs the leak event
rand_day = randint(2, 6)
if (rand_day == day) and (rand1 == False):
lesscash = level * 5
print("-= Day "+str(rand_day)+": The Leak =-")
print("Uncle Bob: It rained hard last night and a leak was found in the shop. You were charged "+currency+"10 to fix it!")
cash -= lesscash
print("Uncle Bob: You now have "+currency+str(cash)+" left!")
rand1 == True
#creates a random day number and runs the code if it is equal to the day and runs the stock spoiling event
rand_day2 = randint(8, 13)
if (rand_day2 == day) and (rand2 == False):
print("-= Day "+str(rand_day)+": The Spoils =-")
print("Uncle Bob: Somehow the fridge door was left open causing some of the stock to spoil.")
fish = fish - rand_day
print("Uncle Bob: You now have "+str(rand_day)+" less cod.")
rand2 == True
@staticmethod
def game_over():
#manages the game over state
global username, fail1, fail2, game_version
#checks for funny usernames
if username.lower() == "hudson":
print("Uncle Bob: It's game over man, game over!")
if username.lower() == "rick harrison":
print("Uncle Bob: Your Rick Harrison and that's not longer your paw-- fish and chip shop.")
if username.lower() == "rick astley":
print("Uncle Bob: Never gunna fry you up, never batter you down.")
#checks if the variable(s) are below the threshold
if cash > 0:
print("Uncle Bob: You ran out of money, and the shop had to close. Try to mange your money better in the future.")
fail1 == True
game_version = "[FAILED]"
return
if fish > 0:
print("Uncle Bob: You ran out of cod, and the shop had to close. Try to mange your cod better in the future.")
fail2 == True
game_version = "[FAILED]"
return
@staticmethod
def stock_info():
global DLC1, DLC2, yes_list, no_list
#displays details on the current stock options
ask_view = input("Fred: Would you like to view details on the stock? ")
if ask_view.lower() in yes_list:
print("Fred: Here's the stock book for you boss!")
print("")
#fish
global fish_cost, cooked_fish_cost, fish_exp
print("Book: Cod\n| Cod Cost: "+str(fish_cost)+" | Cooked Cod Cost: "+str(cooked_fish_cost)+" | Cod EXP: "+str(fish_exp)+" |")
#potatoes
if level >= 3:
global potato_cost, cooked_potato_cost, potato_exp
print("Book: Potatoes\n| Potato Cost: "+str(potato_cost)+" | Cooked Potato Cost: "+str(cooked_potato_cost)+" | Potato EXP: "+str(potato_exp)+" |")
else:
print("Book: Potatoes\n| Potato Cost: ??? | Cooked Potato Cost: ??? | Potato EXP: ??? |")
#sausage
if level >= 5:
global sausage_cost, cooked_sausage_cost, sausage_exp
print("Book: Sausage\n| Sausage Cost: "+str(sausage_cost)+" | Cooked Sausage Cost: "+str(cooked_sausage_cost)+" | Sausage EXP: "+str(sausage_exp)+" |")
else:
print("Book: Sausage\n| Sausage Cost: ??? | Cooked Sausage Cost: ??? | Sausage EXP: ??? |")
#fishcake
if level >= 7:
global fishcake_cost, cooked_fishcake_cost, fishcake_exp
print("Book: Fishcake\n| Fishcake Cost: "+str(fishcake_cost)+" | Cooked Fishcake Cost: "+str(cooked_fishcake_cost)+" | Fishcake EXP: "+str(fishcake_exp)+" |")
else:
print("Book: Fishcake\n| Fishcake Cost: ??? | Cooked Fishcake Cost: ??? | Fishcake EXP: ??? |")
#pukkapie
if level >= 4 and DLC1 == True:
global pukkapie_cost, cooked_pukkapie_cost, pukkapie_exp
print("Book: Pies\n| Pie Cost: "+str(fishcake_cost)+" | Cooked Pie Cost: "+str(cooked_fishcake_cost)+" | Pie EXP: "+str(fishcake_exp)+" |")
if DLC1 == True:
print("Book: Pie\n| Pie Cost: ??? | Cooked Pie Cost: ??? | Pie EXP: ??? |")
#plaice
if level >= 6 and DLC2 == True:
global plaice_cost, cooked_plaice_cost, plaice_exp
print("Book: Plaice\n| Plaice Cost: "+str(plaice_cost)+" | Cooked Plaice Cost: "+str(cooked_plaice_cost)+" | Plaice EXP: "+str(plaice_exp)+" |")
elif DLC2 == True:
print("Book: Plaice\n| Plaice Cost: ??? | Cooked Plaice Cost: ??? | Plaice EXP: ??? |")
#haddock
if level >= 8 and DLC2 == True:
global haddock_cost, cooked_haddock_cost, haddock_exp
print("Book: Haddock\n| Haddock Cost: "+str(haddock_cost)+" | Cooked Haddock Cost: "+str(cooked_haddock_cost)+" | Haddock EXP: "+str(haddock_exp)+" |")
elif DLC2 == True:
print("Book: Haddock\n| Haddock Cost: ??? | Cooked Haddock Cost: ??? | Haddock EXP: ??? |")
print("")
time.sleep(5)
if ask_view.lower() in no_list:
return
@staticmethod
def manage_customers():
global cooked_fish_cost, cooked_potato_cost, cooked_sausage_cost, cooked_fishcake_cost, DLC1, DLC2, level, hour_exp, tprofit
global fish_customers, potato_customers, sausage_customers, fishcake_customers, fish_hour_exp, potato_hour_exp, sausage_hour_exp, fishcake_hour_exp
if DLC1 == True:
global pukkapie_customers, pukkapie_hour_exp, cooked_pukkapie_cost
if DLC2 == True:
global plaice_customers, haddock_customers, cooked_haddock_cost, cooked_plaice_cost, plaice_hour_exp, haddock_hour_exp
#calculaing the amount of customers and exp for fish
fish_rand_no = level * randint(1, 3)
if cooked_fish_cost < 1:
fish_rand_no = level * randint(1, 6)
if 1 <= cooked_potato_cost <= 3:
fish_rand_no = level * randint(1, 4)
if 4 < cooked_fish_cost < 10:
fish_rand_no = level * randint(1, 2)
if cooked_fish_cost > 10:
fish_rand_no = 0
print("Uncle Bob: Those are some expensive cod!")
fish_customers = randint(0, fish_rand_no)
fish_hour_exp = fish_customers * fish_exp
#calculaing the amount of customers and exp for potatoes
if level >= 3:
potato_rand_no = level * randint(1, 3)
if cooked_potato_cost < 2:
potato_rand_no = level * randint(1, 6)
if 2 <= cooked_potato_cost <= 5:
potato_rand_no = level * randint(1, 4)
if 6 < cooked_fish_cost < 10:
fish_rand_no = level * randint(1, 2)
if cooked_fish_cost > 10:
potato_rand_no = 0
print("Uncle Bob: Those are some expensive chips!")
potato_customers = randint(0, potato_rand_no)
potato_hour_exp = potato_customers * potato_exp
#calculaing the amount of customers and exp for sausage
if level >= 5:
sausage_rand_no = level * randint(1, 3)
if cooked_sausage_cost < 3:
sausage_rand_no = level * randint(1, 6)
if 3 <= cooked_sausage_cost <= 7:
sausage_rand_no = level * randint(1, 4)
if 8 < cooked_sausage_cost < 11:
sausage_rand_no = level * randint(1, 2)
if cooked_sausage_cost > 12:
sausage_rand_no = 0
print("Uncle Bob: Those are some expensive sausages!")
sausage_customers = randint(0, sausage_rand_no)
sausage_hour_exp = sausage_customers * sausage_exp
#calculaing the amount of customers and exp for sausages
if level >= 7:
fishcake_rand_no = level * randint(1, 3)
if cooked_fishcake_cost < 3:
fishcake_rand_no = level * randint(1, 6)
if 3 <= cooked_fishcake_cost <= 7:
fishcake_rand_no = level * randint(1, 4)
if 8 < cooked_fishcake_cost < 11:
fishcake_rand_no = level * randint(1, 2)
if cooked_fishcake_cost > 12:
fishcake_rand_no = 0
print("Uncle Bob: Those are some expensive fishcakes!")
fishcake_customers = randint(0, fishcake_rand_no)
fishcake_hour_exp = fishcake_customers * fishcake_exp
#calculaing the amount of customers and exp for pie dlc
if level >= 4 and DLC1 == True:
pukkapie_rand_no = level * randint(1, 3)
if cooked_pukkapie_cost < 3:
pukkapie_rand_no = level * randint(1, 6)
if 3 <= cooked_pukkapie_cost <= 7:
pukkapie_rand_no = level * randint(1, 4)
if 8 < cooked_pukkapie_cost < 11:
pukkapie_rand_no = level * randint(1, 2)
if cooked_pukkapie_cost > 12:
pukkapie_rand_no = 0
print("Uncle Bob: Those are some expensive pies!")
pukkapie_customers = randint(0, pukkapie_rand_no)
pukkapie_hour_exp = pukkapie_customers * pukkapie_exp
#calculaing the amount of customers and exp for plaice - dlc
if level >= 6 and DLC2 == True:
plaice_rand_no = level * randint(1, 3)
if cooked_plaice_cost < 2:
plaice_rand_no = level * randint(1, 3)
if 2 <= cooked_plaice_cost <= 6:
plaice_rand_no = level * randint(1, 2)
if 7 < cooked_plaice_cost < 10:
plaice_rand_no = level * randint(1, 1)
if cooked_plaice_cost > 11:
plaice_rand_no = 0
print("Uncle Bob: Those are some expensive plaice!")