-
Notifications
You must be signed in to change notification settings - Fork 0
/
gloomhaven_deck.py
58 lines (50 loc) · 1.48 KB
/
gloomhaven_deck.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
import random
dictOfCards = {'-2': 1, '-1': 5, '0': 5, '+1': 5, '+2': 1, '2x': 1, 'Miss': 1,'Curse': 0,'Blessing': 0}
print(dictOfCards)
while True:
remainingCards = []
for k, v in dictOfCards.items():
for i in range(v):
remainingCards.append(k)
random.shuffle(remainingCards)
pendingShuffle = False
print("Deck shuffled")
print("Input (c)urse to add a curse")
print("Input (b)less to add a blessing")
for card in remainingCards:
print('')
inp = input("Draw a card?")
if inp.lower() == 'c' or inp.lower() == 'curse':
dictOfCards['Curse'] = dictOfCards['Curse'] + 1
print("Curse added to deck")
pendingShuffle = True
elif inp.lower() == 'b' or inp.lower() == 'bless':
dictOfCards['Blessing'] = dictOfCards['Blessing'] + 1
print("Blessing added to deck")
pendingShuffle = True
else:
print(card)
if card == '2x' or card == 'Miss':
pendingShuffle = True
elif card == 'Curse':
dictOfCards['Curse'] = dictOfCards['Curse'] - 1
print('')
print("Curse removed from deck")
elif card == 'Blessing':
dictOfCards['Blessing'] = dictOfCards['Blessing'] - 1
print('')
print("Blessing removed from deck")
if pendingShuffle:
inp = ''
while inp.lower() != 'y' and inp.lower() != 'n':
print('')
inp = input("Shuffle deck? [y/n]")
if inp.lower() == 'y':
pendingShuffle = False
break
elif inp.lower() == 'n':
break
else:
print("Only yes or no are acceptable")
if not pendingShuffle:
break