-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAI.py
1011 lines (765 loc) · 29 KB
/
AI.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
#!/usr/bin/env python3
import time
import random
import Inventory as inv
import UserMoves as moves
# This is where the AI's logic is stored.
def EatFood(aiplayer):
percent = random.randint(5,15)/100
if aiplayer == 2:
eatamount = inv.Player2Soldiers * percent
eaten = round(eatamount)
inv.Player2Food -= eaten
if aiplayer == 3:
eatamount = inv.Player3Soldiers * percent
eaten = round(eatamount)
inv.Player3Food -= eaten
if aiplayer == 4:
eatamount = inv.Player4Soldiers * percent
eaten = round(eatamount)
inv.Player4Food -= eaten
if aiplayer == 5:
eatamount = inv.Player5Soldiers * percent
eaten = round(eatamount)
inv.Player5Food -= eaten
print("The AI's soldiers ate " + str(eaten) + " food this turn")
def FoodCheck(aiplayer):
if aiplayer == 2:
soldierleaves = inv.Player2Soldiers - inv.Player2Food
if inv.Player2Soldiers > inv.Player2Food:
inv.Player2Soldiers -=soldierleaves
print(str(soldierleaves) + " left their army because they didn't have enough food!")
if aiplayer == 3:
soldierleaves = inv.Player3Soldiers - inv.Player3Food
if inv.Player3Soldiers > inv.Player3Food:
inv.Player3Soldiers -=soldierleaves
print(str(soldierleaves) + " left their army because they didn't have enough food!")
if aiplayer == 4:
soldierleaves = inv.Player4Soldiers - inv.Player4Food
if inv.Player4Soldiers > inv.Player4Food:
inv.Player4Soldiers -=soldierleaves
print(str(soldierleaves) + " left their army because they didn't have enough food!")
if aiplayer == 5:
soldierleaves = inv.Player5Soldiers - inv.Player5Food
if inv.Player5Soldiers > inv.Player5Food:
inv.Player5Soldiers -=soldierleaves
print(str(soldierleaves) + " left their army because they didn't have enough food!")
def StartWar(player):
# This is when the AI chooses to invade to start a war
battlelist = []
if inv.Player1Lost == False:
battlelist.append(1)
if inv.Player2Lost == False:
battlelist.append(2)
if inv.Player3Lost == False:
battlelist.append(3)
if inv.Player4Lost == False:
battlelist.append(4)
if inv.Player5Lost == False:
battlelist.append(5)
if player == 1:
battlelist.remove(1)
if player == 2:
battlelist.remove(2)
if player == 3:
battlelist.remove(3)
if player == 4:
battlelist.remove(4)
if player == 5:
battlelist.remove(5)
invade = random.choice(battlelist)
if invade == 1:
print("Initiating War with you!")
moves.Attacked(ai=player)
if invade == 2:
print("Initiating War with the Frugalis Republic!")
AIWar(invadeplayer = 2, invader=player)
if invade == 3:
print("Initiating War with the Dutchy of Alea!")
AIWar(invadeplayer = 3, invader=player)
if invade == 4:
print("Initiating War with Imperium Malum!")
AIWar(invadeplayer = 4, invader=player)
if invade == 5:
print("Initiating War with Imbecile Kingdom!")
AIWar(invadeplayer = 5, invader=player)
def AIWar(invadeplayer, invader):
# This is when the AI has chosen an AI to invade
# If they chose to invade Player 1, they'll call "Attacked()" in UserMoves.py
if invader == 2:
invadersoldiers = inv.Player2Soldiers
invaderheroes = inv.Player2Heroes
invaderspies = inv.Player2Spies
invaderland = inv.Player2Land
invaderloss = inv.Player2Lost
if invader == 3:
invadersoldiers = inv.Player3Soldiers
invaderheroes = inv.Player3Heroes
invaderspies = inv.Player3Spies
invaderland = inv.Player3Land
invaderloss = inv.Player3Lost
if invader == 4:
invadersoldiers = inv.Player4Soldiers
invaderheroes = inv.Player4Heroes
invaderspies = inv.Player4Spies
invaderland = inv.Player4Land
invaderloss = inv.Player4Lost
if invader == 5:
invadersoldiers = inv.Player5Soldiers
invaderheroes = inv.Player5Heroes
invaderspies = inv.Player5Spies
invaderland = inv.Player5Land
invaderloss = inv.Player5Lost
if invadeplayer == 1:
moves.Attacked()
if invadeplayer == 2:
enemysoldiers = inv.Player2Soldiers
enemyheroes = inv.Player2Heroes
enemyspies = inv.Player2Spies
enemyland = inv.Player2Land
enemyloss = inv.Player2Lost
if invadeplayer == 3:
enemysoldiers = inv.Player3Soldiers
enemyheroes = inv.Player3Heroes
enemyspies = inv.Player3Spies
enemyland = inv.Player3Land
enemyloss = inv.Player3Lost
if invadeplayer == 4:
enemysoldiers = inv.Player4Soldiers
enemyheroes = inv.Player4Heroes
enemyspies = inv.Player4Spies
enemyland = inv.Player4Land
enemyloss = inv.Player4Lost
if invadeplayer == 5:
enemysoldiers = inv.Player5Soldiers
enemyheroes = inv.Player5Heroes
enemyspies = inv.Player5Spies
enemyland = inv.Player5Land
enemyloss = inv.Player5Lost
#Calculate invader power level!
#Soliders + (Soliders * (Number of heroes * .10)) == p1power
#p1power - (Soldiers * (Number of ai spies * .10)) == totalp1power
print()
print("Now calculating army power...")
print()
heropercent = invaderheroes * .10
heromult = invadersoldiers * heropercent
p1power = invadersoldiers + heromult
spypercent = enemyspies * .10
spymult = invadersoldiers * spypercent
totalinvaderpower = p1power - spymult
totalinvaderpower = round(totalinvaderpower)
invaderlandbonus = invaderland * 10
print("Since they reside on " + str(invaderland) + " land(s), they are entitled to a +"+ str(invaderlandbonus) + " soldier bonus!")
totalinvaderpower = totalinvaderpower + invaderlandbonus
print("Their total power: " + str(totalinvaderpower))
print()
#Calculate enemy power level
enemyhpercent = enemyheroes * .10
enemyhmult = enemysoldiers * enemyhpercent
enemypower = enemysoldiers + enemyhmult
enemyspypercent = invaderspies * .10
enemyspymult = enemysoldiers * enemyspypercent
totalenemypower = enemypower - enemyspymult
totalenemypower = round(totalenemypower)
enemylandbonus = enemyland * 10
print("Since the enemy resides on " + str(enemyland) + " land(s), they are entitled to a +"+ str(enemylandbonus) + " soldier bonus!" )
totalenemypower = totalenemypower + enemylandbonus
print("Their enemy's total power: " + str(totalenemypower))
print()
input("Press [Enter] to start their war!")
###########START AI WAR
print()
invaderroll = random.randint(1,12) * 2
enemyroll = random.randint(1,12) * 2
invaderluck = invaderroll/100
enemyluck = enemyroll/100
print("They rolled a " + str(invaderroll) + " out of 24.")
print("Their luck for the war: +" + str(invaderluck) + "%")
print("Their enemy rolled a " + str(enemyroll) + " out of 24.")
print("Their enemy's luck for the war: +" + str(enemyluck) + "%")
print()
time.sleep(2)
totalinvaderluck = totalinvaderpower * invaderluck
totalinvaderpower = totalinvaderpower + totalinvaderluck
totalinvaderpower = round(totalinvaderpower)
totalenemyluck = totalenemypower * enemyluck
totalenemypower = totalenemypower + totalenemyluck
totalenemypower = round(totalenemypower)
############ END OF WAR
if totalinvaderpower > totalenemypower:
print("They win!")
print("Their army had: " + str(totalinvaderpower) + ". While their enemy had: " + str(totalenemypower))
if invadeplayer == 2:
inv.Player2Lost = True
if invadeplayer == 3:
inv.Player3Lost = True
if invadeplayer == 4:
inv.Player4Lost = True
if invadeplayer == 5:
inv.Player5Lost = True
if invader == 2:
inv.Player2Land +=1
if invader == 3:
inv.Player3Land +=1
if invader == 4:
inv.Player4Land +=1
if invader == 5:
inv.Player5Land =+1
if totalinvaderpower < totalenemypower:
print("They lost!")
print("Their army had: " + str(totalinvaderpower) + ". While their enemy had: " + str(totalenemypower))
if invader == 2:
inv.Player2Lost = True
if invader == 3:
inv.Player3Lost = True
if invader == 4:
inv.Player4Lost = True
if invader == 5:
inv.Player5Lost = True
if invadeplayer == 2:
inv.Player2Land +=1
if invadeplayer == 3:
inv.Player3Land +=1
if invadeplayer == 4:
inv.Player4Land +=1
if invadeplayer == 5:
inv.Player5Land =+1
if totalinvaderpower == totalenemypower:
print("It's a tie!")
print("Their army had: " + str(totalinvaderpower) + ". While their enemy had: " + str(totalenemypower))
print("Nobody wins nor loses! Turn skipped!")
#######################################################
#AI CHOICES
# 2: Frugalis Republic (Likes to stockpile)
# 3: Dutchy of Alea (Likes to gamble)
# 4: Imperium Malum (Aggressive)
# 5: Imbecile Kingdom (Random)
def P2Move():
# 2: Frugalis Republic (Likes to stockpile)
# Invade!(1)
# Choose a card (2)
# Obtain 30 Soldiers(3,4,5)
# Obtain 30 Food (6,7,8)
# Gamble at the Pub (9,10)
roll = random.randint(1,10)
if roll == 1:
print("Invade!")
StartWar(player=2)
if roll == 2:
print("The Frugalis Republic decided to draw a card... ")
card = random.randint(1,15)
if card == 1:
inv.Player2Spies += 1
print("They got a Spy!")
print("They now have " + str(inv.Player2Spies) + " Spies.")
if card == 2:
inv.Player2Spies += 1
print("They got a Spy!")
print("They now have " + str(inv.Player2Spies) + " Spies.")
if card == 3:
inv.Player2Heroes += 1
print("They got a Hero!")
print("They now have " + str(inv.Player2Heroes) + " Heroes.")
if card == 4:
inv.Player2Heroes += 1
print("They got a Hero!")
print("They now have " + str(inv.Player2Heroes) + " Heroes.")
if card == 5:
inv.Player2Soldiers += 50
print("They saved a local village from Bandits. 50 men from the village take up their cause!")
print("They got 50 Soldiers!")
if card == 6:
inv.Player2Food += 50
print("A local village thanks them for saving them from Raiders. They give Tthem food.")
print("They got 50 Food!")
if card == 7:
inv.Player2Soldiers += 100
print("Soldiers from an enemy army defect to their side!")
print("They got 100 Soldiers!")
if card == 8:
inv.Player2Food += 100
print("Their loyal subjects have bountiful harvest!")
print("They got 100 Food!")
if card == 9:
plague = inv.Player2Soldiers * .20
ploss = round(plague)
inv.Player2Soldiers -= ploss
print("Some soldiers in their army get the plague.")
print(str(ploss) + " soldiers die from it.")
if card == 10:
locusts = inv.Player2Food * .20
lloss = round(locusts)
inv.Player2Food -= lloss
print("Some locusts eat their subjects' crops!")
print("They lose " + str(lloss) + " food.")
if card == 11:
badplague = inv.Player2Soldiers * .60
badploss = round(badplague)
inv.Player2Soldiers -= badploss
print("A bad plague runs rampant in their army's camp.")
print(str(badploss) + " soldiers die from it.")
if card == 12:
badlocusts = inv.Player2Food * .60
badlloss = round(badlocusts)
inv.Player2Food -= badlloss
print("A horde of locusts eat their subjects' crops!")
print("They lose " + str(badlloss) + " food.")
if card == 13:
inv.Player2Food +=30
inv.Player2Soldiers -=30
print("30 soldiers decide to quit and move to a farm.")
print("They gain 30 food but lose 30 soldiers")
if card == 14:
inv.Player2Food -= 30
inv.Player2Soldiers += 30
print("They host a feast for their army. Some farmers join just cause they want to join the feast!")
print("They lose 30 food but gain 30 soldiers.")
if card == 15:
inv.Player2Heroes += 1
inv.Player2Spies += 1
print("They got a hero and a spy!!!")
if roll in range(3,6):
inv.Player2Soldiers += 30
print()
print("Frugalis Republic just recuited 30 Soldiers! (+30 Soldiers)")
print("They now have " + str(inv.Player2Soldiers) + " Soldiers!")
print()
if roll in range(6,9):
inv.Player2Food += 30
print()
print("Frugalis Republic just farmed 30 Food! (+30 Food)")
print("They now have " + str(inv.Player2Food) + " Food!")
print()
if roll in range(9,11):
#Basically the user gets 5-35 food and 5-35 soldiers
randfood = random.randint(5,35)
randsoldiers = random.randint(5,35)
totals = randfood + randsoldiers
print()
print("A Lord from the Frugalis Republic went to a pub and try their hand at a game of dice...")
print("At the table sits prominent Lords and Barons from far off lands.")
print()
if totals == 10:
print("They gambled and lost big to Lord Al Kaholic!")
print("They got " + str(randfood) + " food and " + str(randsoldiers) + " soliders.")
if 11 <= totals <= 20:
print("They gambled and lost to Lord Jussfar Ted.")
print("They got " + str(randfood) + " food and " + str(randsoldiers) + " soliders.")
if 21 <= totals <= 30:
print("They gambled and lost when they diced agianst Lord Ben Dover.")
print("They got " + str(randfood) + " food and " + str(randsoldiers) + " soliders.")
if 31 <= totals <= 40:
print("They did okay when they diced agianst Baron Neu Trall.")
print("They got " + str(randfood) + " food and " + str(randsoldiers) + " soliders.")
if 41 <= totals <= 50:
print("They did well when They diced agianst Baron Pierre Pants.")
print("They got " + str(randfood) + " food and " + str(randsoldiers) + " soliders.")
if 51 <= totals <= 59:
print("They did very well at the tables! Lord Moe Ronn could not keep up!")
print("They got " + str(randfood) + " food and " + str(randsoldiers) + " soliders.")
if 60 <= totals <= 69:
print("They did excellent at the tables! Lord Suhm L. Ebuht said he has never seen such skill!")
print("They got " + str(randfood) + " food and " + str(randsoldiers) + " soliders.")
if totals == 70:
print("DANG!! They DID EXTREMELY WELL! Everyone in the pub cheers and they earned a plaque with Theyr name on it!")
print("They got " + str(randfood) + " food and " + str(randsoldiers) + " soliders.")
inv.Player2Food += randfood
inv.Player2Soldiers += randsoldiers
print()
def P3Move():
# 3: Dutchy of Alea (Likes to gamble)
# Invade!(1)
# Choose a card (2,3,4)
# Obtain 30 Soldiers(5)
# Obtain 30 Food (6,7)
# Gamble at the Pub (8,9,10)
roll = random.randint(1,10)
if roll == 1:
print("Invade!")
StartWar(player=3)
if roll in range(2,5):
print("The Dutchy of Alea decided to draw a card... ")
card = random.randint(1,15)
if card == 1:
inv.Player3Spies += 1
print("They got a Spy!")
print("They now have " + str(inv.Player3Spies) + " Spies.")
if card == 2:
inv.Player3Spies += 1
print("They got a Spy!")
print("They now have " + str(inv.Player3Spies) + " Spies.")
if card == 3:
inv.Player3Heroes += 1
print("They got a Hero!")
print("They now have " + str(inv.Player3Heroes) + " Heroes.")
if card == 4:
inv.Player3Heroes += 1
print("They got a Hero!")
print("They now have " + str(inv.Player3Heroes) + " Heroes.")
if card == 5:
inv.Player3Soldiers += 50
print("They saved a local village from Bandits. 50 men from the village take up their cause!")
print("They got 50 Soldiers!")
if card == 6:
inv.Player3Food += 50
print("A local village thanks them for saving them from Raiders. They give Tthem food.")
print("They got 50 Food!")
if card == 7:
inv.Player3Soldiers += 100
print("Soldiers from an enemy army defect to their side!")
print("They got 100 Soldiers!")
if card == 8:
inv.Player3Food += 100
print("Their loyal subjects have bountiful harvest!")
print("They got 100 Food!")
if card == 9:
plague = inv.Player3Soldiers * .20
ploss = round(plague)
inv.Player3Soldiers -= ploss
print("Some soldiers in their army get the plague.")
print(str(ploss) + " soldiers die from it.")
if card == 10:
locusts = inv.Player3Food * .20
lloss = round(locusts)
inv.Player3Food -= lloss
print("Some locusts eat their subjects' crops!")
print("They lose " + str(lloss) + " food.")
if card == 11:
badplague = inv.Player3Soldiers * .60
badploss = round(badplague)
inv.Player3Soldiers -= badploss
print("A bad plague runs rampant in their army's camp.")
print(str(badploss) + " soldiers die from it.")
if card == 12:
badlocusts = inv.Player3Food * .60
badlloss = round(badlocusts)
inv.Player3Food -= badlloss
print("A horde of locusts eat their subjects' crops!")
print("They lose " + str(badlloss) + " food.")
if card == 13:
inv.Player3Food +=30
inv.Player3Soldiers -=30
print("30 soldiers decide to quit and move to a farm.")
print("They gain 30 food but lose 30 soldiers")
if card == 14:
inv.Player3Food -= 30
inv.Player3Soldiers += 30
print("They host a feast for their army. Some farmers join just cause they want to join the feast!")
print("They lose 30 food but gain 30 soldiers.")
if card == 15:
inv.Player3Heroes += 1
inv.Player3Spies += 1
print("They got a hero and a spy!!!")
if roll == 5:
inv.Player3Soldiers += 30
print()
print("Dutchy of Alea just recuited 30 Soldiers! (+30 Soldiers)")
print("They now have " + str(inv.Player3Soldiers) + " Soldiers!")
print()
if roll in range(6,8):
inv.Player3Food += 30
print()
print("Dutchy of Alea just farmed 30 Food! (+30 Food)")
print("They now have " + str(inv.Player3Food) + " Food!")
print()
if roll in range(8,11):
#Basically the user gets 5-35 food and 5-35 soldiers
randfood = random.randint(5,35)
randsoldiers = random.randint(5,35)
totals = randfood + randsoldiers
print()
print("A Lord from the Dutchy of Alea went to a pub and try their hand at a game of dice...")
print("At the table sits prominent Lords and Barons from far off lands.")
print()
if totals == 10:
print("They gambled and lost big to Lord Al Kaholic!")
print("They got " + str(randfood) + " food and " + str(randsoldiers) + " soliders.")
if 11 <= totals <= 20:
print("They gambled and lost to Lord Jussfar Ted.")
print("They got " + str(randfood) + " food and " + str(randsoldiers) + " soliders.")
if 21 <= totals <= 30:
print("They gambled and lost when they diced agianst Lord Ben Dover.")
print("They got " + str(randfood) + " food and " + str(randsoldiers) + " soliders.")
if 31 <= totals <= 40:
print("They did okay when they diced agianst Baron Neu Trall.")
print("They got " + str(randfood) + " food and " + str(randsoldiers) + " soliders.")
if 41 <= totals <= 50:
print("They did well when They diced agianst Baron Pierre Pants.")
print("They got " + str(randfood) + " food and " + str(randsoldiers) + " soliders.")
if 51 <= totals <= 59:
print("They did very well at the tables! Lord Moe Ronn could not keep up!")
print("They got " + str(randfood) + " food and " + str(randsoldiers) + " soliders.")
if 60 <= totals <= 69:
print("They did excellent at the tables! Lord Suhm L. Ebuht said he has never seen such skill!")
print("They got " + str(randfood) + " food and " + str(randsoldiers) + " soliders.")
if totals == 70:
print("DANG!! They DID EXTREMELY WELL! Everyone in the pub cheers and they earned a plaque with Theyr name on it!")
print("They got " + str(randfood) + " food and " + str(randsoldiers) + " soliders.")
inv.Player3Food += randfood
inv.Player3Soldiers += randsoldiers
print()
def P4Move():
# 4: Imperium Malum (Aggressive)
# Invade!(1,2,3)
# Choose a card (4)
# Obtain 30 Soldiers(5,6)
# Obtain 30 Food (7,8,9)
# Gamble at the Pub (10)
roll = random.randint(1,10)
if roll in range(1,4):
print("Invade!")
StartWar(player=4)
if roll == 4:
print("The Imperium Malum decided to draw a card... ")
card = random.randint(1,15)
if card == 1:
inv.Player4Spies += 1
print("They got a Spy!")
print("They now have " + str(inv.Player4Spies) + " Spies.")
if card == 2:
inv.Player4Spies += 1
print("They got a Spy!")
print("They now have " + str(inv.Player4Spies) + " Spies.")
if card == 3:
inv.Player4Heroes += 1
print("They got a Hero!")
print("They now have " + str(inv.Player4Heroes) + " Heroes.")
if card == 4:
inv.Player4Heroes += 1
print("They got a Hero!")
print("They now have " + str(inv.Player4Heroes) + " Heroes.")
if card == 5:
inv.Player4Soldiers += 50
print("They saved a local village from Bandits. 50 men from the village take up their cause!")
print("They got 50 Soldiers!")
if card == 6:
inv.Player4Food += 50
print("A local village thanks them for saving them from Raiders. They give Tthem food.")
print("They got 50 Food!")
if card == 7:
inv.Player4Soldiers += 100
print("Soldiers from an enemy army defect to their side!")
print("They got 100 Soldiers!")
if card == 8:
inv.Player4Food += 100
print("Their loyal subjects have bountiful harvest!")
print("They got 100 Food!")
if card == 9:
plague = inv.Player4Soldiers * .20
ploss = round(plague)
inv.Player4Soldiers -= ploss
print("Some soldiers in their army get the plague.")
print(str(ploss) + " soldiers die from it.")
if card == 10:
locusts = inv.Player4Food * .20
lloss = round(locusts)
inv.Player4Food -= lloss
print("Some locusts eat their subjects' crops!")
print("They lose " + str(lloss) + " food.")
if card == 11:
badplague = inv.Player4Soldiers * .60
badploss = round(badplague)
inv.Player4Soldiers -= badploss
print("A bad plague runs rampant in their army's camp.")
print(str(badploss) + " soldiers die from it.")
if card == 12:
badlocusts = inv.Player4Food * .60
badlloss = round(badlocusts)
inv.Player4Food -= badlloss
print("A horde of locusts eat their subjects' crops!")
print("They lose " + str(badlloss) + " food.")
if card == 13:
inv.Player4Food +=30
inv.Player4Soldiers -=30
print("30 soldiers decide to quit and move to a farm.")
print("They gain 30 food but lose 30 soldiers")
if card == 14:
inv.Player4Food -= 30
inv.Player4Soldiers += 30
print("They host a feast for their army. Some farmers join just cause they want to join the feast!")
print("They lose 30 food but gain 30 soldiers.")
if card == 15:
inv.Player4Heroes += 1
inv.Player4Spies += 1
print("They got a hero and a spy!!!")
if roll in range(5,7):
inv.Player4Soldiers += 30
print()
print("Imperium Malum just recuited 30 Soldiers! (+30 Soldiers)")
print("They now have " + str(inv.Player4Soldiers) + " Soldiers!")
print()
if roll in range(7,10):
inv.Player4Food += 30
print()
print("Imperium Malum just farmed 30 Food! (+30 Food)")
print("They now have " + str(inv.Player4Food) + " Food!")
print()
if roll == 10:
#Basically the user gets 5-35 food and 5-35 soldiers
randfood = random.randint(5,35)
randsoldiers = random.randint(5,35)
totals = randfood + randsoldiers
print()
print("A Lord from the Imperium Malum went to a pub and try their hand at a game of dice...")
print("At the table sits prominent Lords and Barons from far off lands.")
print()
if totals == 10:
print("They gambled and lost big to Lord Al Kaholic!")
print("They got " + str(randfood) + " food and " + str(randsoldiers) + " soliders.")
if 11 <= totals <= 20:
print("They gambled and lost to Lord Jussfar Ted.")
print("They got " + str(randfood) + " food and " + str(randsoldiers) + " soliders.")
if 21 <= totals <= 30:
print("They gambled and lost when they diced agianst Lord Ben Dover.")
print("They got " + str(randfood) + " food and " + str(randsoldiers) + " soliders.")
if 31 <= totals <= 40:
print("They did okay when they diced agianst Baron Neu Trall.")
print("They got " + str(randfood) + " food and " + str(randsoldiers) + " soliders.")
if 41 <= totals <= 50:
print("They did well when They diced agianst Baron Pierre Pants.")
print("They got " + str(randfood) + " food and " + str(randsoldiers) + " soliders.")
if 51 <= totals <= 59:
print("They did very well at the tables! Lord Moe Ronn could not keep up!")
print("They got " + str(randfood) + " food and " + str(randsoldiers) + " soliders.")
if 60 <= totals <= 69:
print("They did excellent at the tables! Lord Suhm L. Ebuht said he has never seen such skill!")
print("They got " + str(randfood) + " food and " + str(randsoldiers) + " soliders.")
if totals == 70:
print("DANG!! They DID EXTREMELY WELL! Everyone in the pub cheers and they earned a plaque with Theyr name on it!")
print("They got " + str(randfood) + " food and " + str(randsoldiers) + " soliders.")
inv.Player4Food += randfood
inv.Player4Soldiers += randsoldiers
print()
def P5Move():
# 5: Imbecile Kingdom (Random)
# Invade!(1,2)
# Choose a card (3,4)
# Obtain 30 Soldiers(5,6)
# Obtain 30 Food (7,8)
# Gamble at the Pub (9,10)
roll = random.randint(1,10)
if roll in range(1,3):
print("Invade!")
StartWar(player=5)
if roll in range(3,5):
print("The Imbecile Kingdom decided to draw a card... ")
card = random.randint(1,15)
if card == 1:
inv.Player5Spies += 1
print("They got a Spy!")
print("They now have " + str(inv.Player5Spies) + " Spies.")
if card == 2:
inv.Player5Spies += 1
print("They got a Spy!")
print("They now have " + str(inv.Player5Spies) + " Spies.")
if card == 3:
inv.Player5Heroes += 1
print("They got a Hero!")
print("They now have " + str(inv.Player5Heroes) + " Heroes.")
if card == 4:
inv.Player5Heroes += 1
print("They got a Hero!")
print("They now have " + str(inv.Player5Heroes) + " Heroes.")
if card == 5:
inv.Player5Soldiers += 50
print("They saved a local village from Bandits. 50 men from the village take up their cause!")
print("They got 50 Soldiers!")
if card == 6:
inv.Player5Food += 50
print("A local village thanks them for saving them from Raiders. They give Tthem food.")
print("They got 50 Food!")
if card == 7:
inv.Player5Soldiers += 100
print("Soldiers from an enemy army defect to their side!")
print("They got 100 Soldiers!")
if card == 8:
inv.Player5Food += 100
print("Their loyal subjects have bountiful harvest!")
print("They got 100 Food!")
if card == 9:
plague = inv.Player5Soldiers * .20
ploss = round(plague)
inv.Player5Soldiers -= ploss
print("Some soldiers in their army get the plague.")
print(str(ploss) + " soldiers die from it.")
if card == 10:
locusts = inv.Player5Food * .20
lloss = round(locusts)
inv.Player5Food -= lloss
print("Some locusts eat their subjects' crops!")
print("They lose " + str(lloss) + " food.")
if card == 11:
badplague = inv.Player5Soldiers * .60
badploss = round(badplague)
inv.Player5Soldiers -= badploss
print("A bad plague runs rampant in their army's camp.")
print(str(badploss) + " soldiers die from it.")
if card == 12:
badlocusts = inv.Player5Food * .60
badlloss = round(badlocusts)
inv.Player5Food -= badlloss
print("A horde of locusts eat their subjects' crops!")
print("They lose " + str(badlloss) + " food.")
if card == 13:
inv.Player5Food +=30
inv.Player5Soldiers -=30
print("30 soldiers decide to quit and move to a farm.")
print("They gain 30 food but lose 30 soldiers")
if card == 14:
inv.Player5Food -= 30
inv.Player5Soldiers += 30
print("They host a feast for their army. Some farmers join just cause they want to join the feast!")
print("They lose 30 food but gain 30 soldiers.")
if card == 15:
inv.Player5Heroes += 1
inv.Player5Spies += 1
print("They got a hero and a spy!!!")
if roll in range(5,7):
inv.Player5Soldiers += 30
print()
print("Imbecile Kingdom just recuited 30 Soldiers! (+30 Soldiers)")
print("They now have " + str(inv.Player5Soldiers) + " Soldiers!")
print()
if roll in range(7,9):
inv.Player5Food += 30
print()
print("Imbecile Kingdom just farmed 30 Food! (+30 Food)")
print("They now have " + str(inv.Player5Food) + " Food!")
print()
if roll in range(9,11):
#Basically the user gets 5-35 food and 5-35 soldiers
randfood = random.randint(5,35)
randsoldiers = random.randint(5,35)
totals = randfood + randsoldiers
print()
print("A Lord from the Imbecile Kingdom went to a pub and try their hand at a game of dice...")
print("At the table sits prominent Lords and Barons from far off lands.")
print()
if totals == 10:
print("They gambled and lost big to Lord Al Kaholic!")
print("They got " + str(randfood) + " food and " + str(randsoldiers) + " soliders.")
if 11 <= totals <= 20:
print("They gambled and lost to Lord Jussfar Ted.")
print("They got " + str(randfood) + " food and " + str(randsoldiers) + " soliders.")
if 21 <= totals <= 30:
print("They gambled and lost when they diced agianst Lord Ben Dover.")
print("They got " + str(randfood) + " food and " + str(randsoldiers) + " soliders.")
if 31 <= totals <= 40:
print("They did okay when they diced agianst Baron Neu Trall.")
print("They got " + str(randfood) + " food and " + str(randsoldiers) + " soliders.")
if 41 <= totals <= 50:
print("They did well when They diced agianst Baron Pierre Pants.")
print("They got " + str(randfood) + " food and " + str(randsoldiers) + " soliders.")
if 51 <= totals <= 59:
print("They did very well at the tables! Lord Moe Ronn could not keep up!")
print("They got " + str(randfood) + " food and " + str(randsoldiers) + " soliders.")