-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplayer.py
More file actions
27 lines (23 loc) · 748 Bytes
/
Copy pathplayer.py
File metadata and controls
27 lines (23 loc) · 748 Bytes
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
class Player:
def __init__(self, name):
self.name = name
self.health = 100
self.level = 0
self.xp = 0
self.xp_to_next = 20
self.max_lvl = 30
self.stat_points = 0 #points avaliable to assign
self.max_stat = 10
self.max_mana = 30
self.strength = 0
self.mana = 10
self.defense = 0
self.inventory = {} #empty dictionary instead of list so I can add item description
self.location = "entrance" #starting room
self.attack_cooldowns = {
"charge": 0
}
self.spells = [] #list of learned spells
def cal_damage(self, base):
bonus = 1 + (self.strength * 0.05)
return int(base * bonus)