-
Notifications
You must be signed in to change notification settings - Fork 0
/
Items.py
38 lines (30 loc) · 1.13 KB
/
Items.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
from cmu_112_graphics import *
from helpers import *
# It's a class that creates an item object that can be used in the game.
# """
# It takes a dictionary and assigns the values to the variables.
# :param itemDict: A dictionary containing all the information about the item
# """
class Items:
def __init__(self, itemDict):
self.itemName = itemDict.get('itemName')
self.itemType = itemDict.get('itemType')
self.maxStackSize = itemDict.get('maxStackSize')
self.itemModifier = itemDict.get('itemModifier')
self.itemModifierValue = itemDict.get('itemModifierValue')
self.itemImage = itemDict.get('itemImagePath')
self.item = itemDict
pass
def getStats(self):
return (self.itemName, self.itemType, self.itemModifier, self.itemModifierValue)
def getItem(self):
return self.item
pass
def getItemImage(self):
return self.itemImage
def setItemImage(self, image):
self.itemImage = image
def getItemType(self):
return self.itemType
def useItem(self):
return self.itemModifier, self.itemModifierValue