-
Notifications
You must be signed in to change notification settings - Fork 2
/
party.py
120 lines (108 loc) · 4.57 KB
/
party.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
from events import chinese_rocket
from characters import *
class Party():
def __init__(self, party_members, money, food, hand_sanitizer, fuel, phone_charge, bullets):
self.party_members = party_members
self.money = money
self.food = food
self.hand_sanitizer = hand_sanitizer
self.fuel = fuel
self.phone_charge = phone_charge
self.bullets = bullets
#Print out party status
#Print out dead if character is dead
# def print_party_status(self):
# print("----------Party Status---------")
# for character in self.party_members:
# character.print_stats()
def print_party_status(self):
print("------------------Party Status------------------")
t = Texttable()
t.add_row(["Name:", "Health:", "Fullness:", "Morale:", "Sick:"])
for character in self.party_members:
sick_string = ""
if(character.sick == 1):
sick_string = "Sick"
else:
sick_string = "Not Sick"
t.add_row([character.name, character.health, character.fullness, character.morale, sick_string])
print(t.draw())
#print party supplies
def print_party_supplies(self):
print("---------Party Supplies---------\nMoney: %d\nFood: %d\nHand Sanitizer: %d\nFuel: %d\nPhone Charge: %d\nBullets: %d" % (self.money,self.food,self.hand_sanitizer,self.fuel,self.phone_charge,self.bullets))
#check if character is alive
def is_alive(self, character):
if(character == 'doctor'):
return self.party_members[0].is_alive()
if(character == 'engineer'):
return self.party_members[1].is_alive()
if(character == 'hunter'):
return self.party_members[2].is_alive()
if(character == 'influencer'):
return self.party_members[3].is_alive()
if(character == 'dj'):
return self.party_members[4].is_alive()
#make the whole party sick
def sick_party(self):
for character in self.party_members:
character.sick = True
#check if the ability of a party member is used
def used_ability(self,character):
if(character == 'doctor'):
return self.party_members[0].skillUsed
if(character == 'engineer'):
return self.party_members[1].skillUsed
if(character == 'hunter'):
return self.party_members[2].skillUsed
if(character == 'influencer'):
return self.party_members[3].skillUsed
if(character == 'dj'):
return self.party_members[4].skillUsed
#use the ability of a specific party member
def use_ability(self, character):
if(character == 'doctor'):
return self.party_members[0].use_special_skill()
if(character == 'engineer'):
return self.party_members[1].use_special_skill()
if(character == 'hunter'):
return self.party_members[2].use_special_skill()
if(character == 'influencer'):
return self.party_members[3].use_special_skill()
if(character == 'dj'):
return self.party_members[4].use_special_skill()
#use the ability of a specific party member
def refresh_ability(self, character):
if(character == 'doctor'):
return self.party_members[0].restore_special_skill()
if(character == 'engineer'):
return self.party_members[1].restore_special_skill()
if(character == 'hunter'):
return self.party_members[2].restore_special_skill()
if(character == 'influencer'):
return self.party_members[3].restore_special_skill()
if(character == 'dj'):
return self.party_members[4].restore_special_skill()
def get_total_health(self):
total_health = 0
for character in self.party_members:
if(character.is_alive()):
total_health += character.health
return total_health
def get_total_morale(self):
total_morale = 0
for character in self.party_members:
if(character.is_alive()):
total_morale += character.health
return total_morale
def get_total_fullness(self):
total_fullness = 0
for character in self.party_members:
if(character.is_alive()):
total_fullness += character.health
return total_fullness
def total_alive_members(self):
total_alive = 0
for character in self.party_members:
if(character.is_alive()):
total_alive += 1
return total_alive