-
Notifications
You must be signed in to change notification settings - Fork 0
/
items.py
38 lines (31 loc) · 1.35 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
class Item(object):
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 {} stamped on the front".format(str(self.amt)),
value=self.amt)
class Weapon(Item):
def __init__(self,name,descripttion,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)