-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlayer.py
65 lines (55 loc) · 1.74 KB
/
Player.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
import time
import datetime
class Player(): #Clase donde se guarda toda la información del usuario
def __init__(self,username, password, age, avatar):
self.username = username
self.__password = password
self.__age = age
self.avatar = avatar
self.difficulty = None
self.lives = 5
self.time = None
self.time_future = None
self.clues_count = None
self.__inventory = []
def get_username(self):
return self.username
def get_avatar(self):
return self.avatar
def set_difficulty(self,diff):
self.difficulty = diff
def get_difficulty(self):
return self.difficulty
def get_lives(self):
return self.lives
def set_lives(self, new_lives):
self.lives = new_lives
def get_bar_health(self):
print(f"❤️ Vidas: {self.lives} ")
print(f"🔑 Pistas: {self.clues_count} ")
def get_clues_count(self):
return self.clues_count
def set_clues_count(self, new_clues_count):
self.clues_count = new_clues_count
def get_time(self):
return self.time
def set_time(self, new_time):
self.time = new_time
def get_inventory(self):
return self. __inventory
def show_inventory(self):
if len(self.__inventory) > 0:
print("Inventario: ")
for i in range(len(self.__inventory)):
print(f"{i+1}.{self.__inventory[i]}")
else:
print("Usted todavía no posee recompensas")
def add_award(self, new_award):
if new_award not in self.__inventory:
self.__inventory.append(new_award)
else:
print("Sin embargo, ya tenías la recompenza en tu inventario.")
def set_time_future(self, new_time):
self.time_future = new_time
def get_time_left(self):
return datetime.timedelta(seconds=round(self.time_future-time.time()))