-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathG) Dungeon Hack.py
115 lines (92 loc) · 4.23 KB
/
G) Dungeon Hack.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
import random
def game():
print("Choose your party and enter the dungeon")
print("to slay the beast and steal his treasure !! ")
print("")
print( "Fighter, ","Wizard, ","Thief, ","Paladin, ","Rogue ")
group=[] # An empty list which begins with no items
open_slot= True
loop=0
power=0
scout=0
magic=0
while open_slot:
user_input=input("who are you going to take with you ? : ")
user_input=user_input.upper()
if user_input=="FIGHTER":
print("you have chosen the Fighter")
group.append(user_input)
power+=5
elif user_input=="THIEF":
print("you have chosen the Thief")
group.append(user_input)
scout+=5
elif user_input=="WIZARD":
print("you have chosen the Wizard")
group.append(user_input)
magic+=5
elif user_input=="ROGUE":
print("you have chosen the rogue")
group.append(user_input)
scout+=random.randint(2,5)
power+=random.randint(2,5)
elif user_input=="PALADIN":
print("you have chosen the Paladin")
group.append(user_input)
power+= random.randint(2,5)
magic+= random.randint(2,5)
else:
print("not a valid choice, but don't worry i'll pick someone for you")
list=("VILLAGE IDIOT","SNOTLING JESTER","PROFESSIONAL COWARD","SAD CLOWN")
wildcard=random.choice(list)
group.append(wildcard)
power+= random.randint(1,3)
magic+=random.randint(1,3)
scout+=random.randint(1,2)
loop+=1
if loop==4:
open_slot= False
print("Your party is full, it is time to begin your adventure")
print("You party consist of:")
for x in range(len(group)): # This only really numbers your characters in your group
print (x+1,group[x]) # For x in range = For every 'item' in the group whilst len find the length of the list which will be (4)
# x+1 because range starts at 0, group[x]=acquire the value of the 'item' which will be PALADIN,ROGUE etc etc
dungeon=input(" Pick dungeon: Hard or Easy ?")
dungeon=dungeon.lower()
input("You go into the dungeon and.... ")
if dungeon== "hard":
if power>=12 and scout>=5 and magic>=7:
print ("You slay the beast and find the treasure !!, you win all the loot ")
print ("Your party stats are : power=",power, "scout=",scout,"magic=",magic)
elif power>12 and scout>=5 and magic<7:
print("You slay the beast but did not find any treasure, you lose")
print ("Your party stats are : power=",power, "scout=",scout,"magic=",magic)
else:
print("you are defeated by the beast, your party was too weak, you lose ")
print ("Your party stats are : power=",power, "scout=",scout,"magic=",magic)
print("Game over")
play=input("play again Y/N ? : ")
if play == "y" or"Y":
game()
else:
print("good bye")
quit()
else:
if power>=10 and scout>=5 and magic>=5:
print ("You slay the beast and find the treasure !!, you win, try the hard dungeon ")
print ("Your party stats are : power=",power, "scout=",scout,"magic=",magic)
elif power>10 and magic>=5 and scout<5:
print("You slay the beast but did not find any treasure, you lose")
print ("Your party stats are : power=",power, "scout=",scout,"magic=",magic)
else:
print("you are defeated by the beast, your party was too weak, you lose ")
print ("Your party stats are : power=",power, "scout=",scout,"magic=",magic)
print("Game over")
play=input("play again Y/N ? : ")
if play == "y" or"Y":
game()
else:
print("good bye")
quit()
game()
#https://github.com/Ninedeadeyes/15-mini-python-games-