-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathweapon.py
36 lines (29 loc) · 1.28 KB
/
weapon.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
class Weapon():
#Constructor
def init (self, name, color, size, elementfire, retractbutton):
self.name = "Blade"
self.color = "Silver"
self.size = "Long"
self.elementfire = False
self.retractbutton = False
self.descripion = "It's a very long, strong, silver blade that is retractable. A switch on the sword can turn it into a fire sword."
#Accessor
def getColor(self):
return self.color
def getSize(self):
return self.size
#Mutator
def setElementfire(self):
if self.elementfire = False:
self.elementfire = True
print (self.size + self.color + self.name + "has now been enchanted with fire!")
if self.elementfire = True:
self.elementfire = False
print (self.size + self.color + self.name + "has now been enchanted with lightning!")
def setRetractbutton(self):
if self.retractbutton = False:
self.retractbutton = True
print (self.name + self.color + self.name + "has now been put away.")
if self.retractbutton = True:
self.retractbutton = False
print (self.name + self.color + self.name + "is now out and ready for combat.")