forked from Matthew2000/OLD_Elementals-The-Shadow-Wars
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathItems.py
63 lines (45 loc) · 1.91 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
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
from enum import Enum
class Weapons(Enum):
Sword = 1
Dagger = 2
Club = 3
class Armours(Enum):
Helmet = "helmet"
Chest = "chest"
Gloves = "gloves"
Belt = "belt"
Pants = "pants"
Shoes = "shoes"
all_weapons = []
all_armours = []
all_items = []
class Item:
def __init__(self, name, value, description, equipable):
self.name = name
self.value = value
self.description = description
self.equipable = equipable
all_items.append(self)
class Weapon(Item):
def __init__(self, name, value, description, damage, weapon_type: Weapons):
self.damage = damage
self.weapon_type = weapon_type
super().__init__(name, value, description, True)
all_weapons.append(self)
class Armour(Item):
def __init__(self, name, value, description, protection, armour_type: Armours):
self.protection = protection
self.armour_type = armour_type
super().__init__(name, value, description, True)
all_armours.append(self)
WolfPelt = Item("Wolf Pelt", 10, "The hide of a wolf", False)
# TODO add more weapons and armours
IronSword = Weapon("Iron Sword", 50, "a sword made out of iron", 20, Weapons.Sword)
IronDagger = Weapon("Iron Dagger", 20, "a dagger made out of iron", 5, Weapons.Dagger)
IronClub = Weapon("Iron Club", 30, "a club made out of iron", 10, Weapons.Club)
LeatherHelmet = Armour("Leather Helmet", 10, "a helmet made out of leather", 10, Armours.Helmet)
LeatherArmour = Armour("Leather Armour", 10, "armour made out of leather", 15, Armours.Chest)
LeatherGloves = Armour("Leather Gloves", 10, "gloves made out of leather", 5, Armours.Gloves)
LeatherBelt = Armour("Leather Belt", 10, "a belt made out of leather", 5, Armours.Belt)
LeatherPants = Armour("Leather Pants", 10, "pants made out of leather", 15, Armours.Pants)
LeatherShoes = Armour("Leather Shoes", 10, "shoes made out of leather", 5, Armours.Shoes)