-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathitems.py
29 lines (23 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
class Item():
def __init__(self, name, description, value):
self.name=name
self.description = description
self.value = value
def __str__(self):
return "{}\n======\n{}\nValue: {}\n".format(self.name,self.description, self.value)
class Gold(Item):
def __init__(self, amt):
self.amt=amt
super().__init__(name="Gold", description="A round coin with {} stanped on the front.".format(str(self.amt)), value= self.amt)
class Weapon (Item):
def __init__(self, name, description, value, damage):
self.damage = damage
super().__init__(name, description, value)
def __str__(self):
return "{}\n=====\n{}\nValue: {}\nDamage: {}".format(self.name, self.description, self.value, self.damage)
class Rock(Weapon):
def __init__(self):
super().__init__(name="Rock", description="A fist sized rock, suitable for bludgeoning.", value=0, damage=5)
class Dagger(Weapon):
def __init__(self):
super().__init__(name="Dagger", description="A small dagger with some rust. Somewhat more dangerous than a rock.", value=10, damage=10)