-
Notifications
You must be signed in to change notification settings - Fork 0
/
Defense.py
131 lines (117 loc) · 5.39 KB
/
Defense.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
import main
def defence1(staminalost, staminaGained, paidHealth): #In all scenarios defender gains 10 Stamina
if main.computer_choice < 5 and main.Choice_Player > 4: #If Player is defender, Computer is Attacker
damage = (int(main.Choice_Computer)) * 10
if main.Stamina_Player < 40: #Makes sure that Stamina doesn't exceed max
main.Stamina_Player += 10
else:
main.Stamina_Player = 50
main.HP_Player -= (0.2*damage)
elif main.Choice_Computer > 4 and main.Choice_Player < 5: #If Computer is defender, Player is Attacker
damage = (int(main.Choice_Player)) * 10
if main.Stamina_Computer < 40:
main.Stamina_Computer += 10
else:
main.Stamina_Computer = 50
main.Stamina_Computer -= (0.2*damage)
elif main.computer_choice > 4 and main.Choice_Player > 4: #If both defenders
staminalost = 10
staminaGained = 10
paidHealth = 10
if main.Choice_Computer == 5 and main.Choice_Player == 5: #if both are 5
main.Stamina_Computer +=10
main.Stamina_Player += 10
main.HP_Player -= 10
main.HP_Player -= 10
elif main.Choice_Computer == 5 and main.Choice_Player == 6 or main.Choice_Computer == 6 and main.Choice_Player == 5: #if only one is 5
if main.choice_Computer == 5:
main.Stamina_Computer -= staminalost
main.HP_Computer += paidHealth
elif main.choice_Computer == 6:
main.Stamina_Player -= staminalost #Only takes out Stamina for player, doesn't do HP since this is defence 1, defence 2 will initiate the HP Removal
main.HP_Player += paidHealth
def defence2(staminalost, staminagained, paidHealth):
if main.computer_choice < 5 and main.Choice_Player > 4: #Player is defender, Computer is Attacker
damage = (int(main.Choice_Computer)) * 10
if main.Stamina_Player < 30:
main.Stamina_Player += 20
main.HP_Player -= damage
else:
main.Stamina_Player = 50
main.HP_Player -= damage
elif main.Choice_Computer > 4 and main.Choice_Player < 5: #Computer defender, Player Attacker
damage = (int(main.Choice_Player)) * 10
if main.Stamina_Computer < 30:
main.Stamina_Computer += 20
main.Stamina_Computer-= damage
else:
main.Stamina_Computer = 50
main.Stamina_Computer -= damage
elif main.computer_choice > 4 and main.Choice_Player > 4: #Both defender
staminalost = 10
staminagained = 10
paidHealth = 10
if main.Choice_Computer == 6 and main.Choice_Player == 6: #if both defend same
main.Stamina_Computer +=10
main.Stamina_Player += 10
main.HP_Player -= 10
main.HP_Player -= 10
elif main.Choice_Computer == 5 and main.Choice_Player == 6 or main.Choice_Computer == 6 and main.Choice_Player == 5:
if main.choice_Computer == 5:
main.Stamina_Player += staminagained
main.HP_Computer += paidHealth
elif main.choice_Computer == 6:
main.Stamina_Player -= staminalost
main.HP_Player += paidHealth
'''
if main.computer_choice < 5 and main.Choice_Player > 4:
damage = (int(main.Choice_Computer)) * 10
def defence1(staminalost, staminagained, paidHealth):
if main.Stamina_Player < 40:
main.Stamina_Player += 10
else:
main.Stamina_Player = 50
main.HP_Player -= (0.2*damage)
def defence2(defence):
if main.Stamina_Player < 30:
main.Stamina_Player += 20
main.HP_Player -= damage
else:
main.Stamina_Player = 50
main.HP_Player -= damage
elif main.computer_choice > 4 and main.Choice_Player > 4:
def bothDef(staminalost, staminagained, paidHealth):
staminalost = 10
staminagained = 10
paidHealth = 10
if main.Choice_Computer == 5 and main.Choice_Player == 5:
main.Stamina_Computer = main.Choice_Player = 5
elif main.Choice_Computer == 6 and main.Choice_Player == 6:
main.Stamina_Computer = main.Choice_Player = 6
elif main.Choice_Computer == 5 and main.Choice_Player == 6 or main.Choice_Computer == 6 and main.Choice_Player == 5:
if main.choice_Computer == 5:
main.Stamina_Computer -= staminalost
main.Stamina_Player += staminagained
main.HP_Computer += paidHealth
main.HP_Player -= paidHealth
elif main.choice_Computer == 6:
main.Stamina_Computer += staminagained
main.Stamina_Player -= staminalost
main.HP_Computer -= paidHealth
main.HP_Player += paidHealth
elif main.Choice_Computer > 4 and main.Choice_Player < 5:
damage = (int(main.Choice_Player)) * 10
def defence1(staminalost, staminagained, paidHealth):
if main.Stamina_Computer < 40:
main.Stamina_Computer += 10
else:
main.Stamina_Computer = 50
main.Stamina_Computer -= (0.2*damage)
def defence2(defence):
if main.Stamina_Computer < 30:
main.Stamina_Computer += 20
main.Stamina_Computer-= damage
else:
main.Stamina_Computer = 50
main.Stamina_Computer -= damage
'''