-
-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathItem.py
28 lines (24 loc) · 956 Bytes
/
Item.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
from texttools import *
class Item:
# grade,name,effect,value
def __init__(self, itemlevel, itemgrade, itemname, itemeffect, itemvalue):
self.level = itemlevel
self.grade = itemgrade
self.name = itemname
self.effect = itemeffect
self.val = itemvalue
# prints all item stats
def printiteminfo(self):
marqueeprint('Item: ')
print(lr_justify('Level:', str(self.level), 60))
print(lr_justify('Grade:', str(self.grade), 60))
print(lr_justify('Name:', str(self.name), 60))
print(lr_justify('Effect Val:', str(self.effect), 60))
print(lr_justify('Gold Val:', str(self.val), 60))
# ['Level', 'Quality', 'Name', 'Effect']
def datadict(self):
return {'Level': str(self.level),
'Name': str(self.grade) + ' ' + str(self.name),
'Effect': str(self.effect),
'Value': str(self.val)
}