-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathitem.py
More file actions
101 lines (86 loc) · 2.18 KB
/
Copy pathitem.py
File metadata and controls
101 lines (86 loc) · 2.18 KB
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
import random
# Confirm commit
class Item:
def __init__(self, name, type, damage, healing, uses):
self.name = name
self.damage = damage
self.healing = healing
self.uses = uses
self.type = type
specialItems = [
Item("Gate Key", "Special", 0, 0, 0)
]
perGameItems = [
Item("Teleporter", "Utility", 0, 0, 0)
]
items = [
Item("Children's Advil", "Healing", 0, 10, 0),
Item("Foam Sword", "Weapon", 2, 0, 0),
Item("Stick", "Weapon", 5, 0, 0),
Item("Sword", "Weapon", 10, 0, 0),
Item("Water Bottle", "Healing/Weapon", 1, 5, 0),
Item("Map", "Info", 0, 0, 0),
Item("Key Map", "Info", 0, 0, 0),
Item("Gate Map", "Info", 0, 0, 0),
Item("Flower Pot", "Extra", 0, 0, 0)
]
def getRandomItem():
return random.choice(items)
def doesExist(item):
for i in items:
if i.name == item:
return True
return False
def doesSpecialExist(item):
for i in specialItems:
if i.name == item:
return True
return False
def doesPerGameExist(item):
for i in perGameItems:
if i.name == item:
return True
return False
def addItem(item):
for i in items:
if i.name == item:
return i
for i in specialItems:
if i.name == item:
return i
for i in perGameItems:
if i.name == item:
return i
def getSpecialItem(item):
for i in specialItems:
if i.name == item:
return i
def getPerGameItem(item):
for i in perGameItems:
if i.name == item:
return i
def isSpecialItem(item):
for i in specialItems:
if i.name == item:
return True
return False
def getType(item):
for i in items:
if i.name == item:
return i.type
for i in specialItems:
if i.name == item:
return i.type
for i in perGameItems:
if i.name == item:
return i.type
def getName(item):
for i in items:
if i.name == item:
return i.name
for i in specialItems:
if i.name == item:
return i.name
for i in perGameItems:
if i.name == item:
return i.name