updated blackmage stats
[asgard.git] / equiption.py
blobc3425b3c74f826e7cc9eb6c9e0d27068ef91bf8d
1 ########################################################
2 #Copyright (c) 2006 Russ Adams, Sean Eubanks, Asgard Contributors
3 #This file is part of Asgard.
5 #Asgard is free software; you can redistribute it and/or modify
6 #it under the terms of the GNU General Public License as published by
7 #the Free Software Foundation; either version 2 of the License, or
8 #(at your option) any later version.
10 #Asgard is distributed in the hope that it will be useful,
11 #but WITHOUT ANY WARRANTY; without even the implied warranty of
12 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 #GNU General Public License for more details.
15 #You should have received a copy of the GNU General Public License
16 #along with Asgard; if not, write to the Free Software
17 #Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 ########################################################
19 class Equiption:
21 def __init__(self,head,armor,l,r):
22 self.__head = head
23 self.__armor = armor
24 self.__left = l
25 self.__right = r
27 def getHead(self):
28 """Get head armor."""
29 return self.__head
31 def setHead(self,h):
32 """Change head armor."""
33 self.__head = h
35 def getArmor(self):
36 """Get body armor."""
37 return self.__armor
39 def setArmor(self,a):
40 """Change body armor."""
41 self.__armor = a
43 def getLeft(self):
44 """Get left arm weapon/armor."""
45 return self.__left
47 def setLeft(self,l):
48 """Change left arm weapon/armor."""
49 self.__left = l
51 def getRight(self):
52 """Get right arm weapon/armor."""
53 return self.__right
55 def setRight(self,r):
56 """Change right arm weapon/armor."""
57 self.__right = r
59 def computeAtkMod(self):
60 """Compute attack modifier."""
61 # Left/Right Attack Mods
62 if self.__left == 'Sword' or self.__right == 'Sword':
63 return 10
64 elif self.__left == 'Katana' or self.__right == 'Katana':
65 return 12
66 elif self.__left == 'Bow' or self.__right == 'Bow':
67 return 5
68 elif self.__left == 'Staff' or self.__right == 'Staff':
69 return 7
72 def computeDefMod(self):
73 """Compute defense modifier."""
74 dMod = 0
76 # Head Defense Mods
77 if self.__head == 'Helm':
78 dMod += 2
79 # Left/Right Defense Mods
80 if self.__left == 'Shield' or self.__right == 'Shield':
81 dMod += 3
82 # Armor Defense Mods
83 if self.__armor == 'Chain Mail':
84 dMod += 8
85 elif self.__armor == 'Cloak':
86 dMod += 3
88 return dMod
90 def computeEvaMod(self):
91 """Compute evasion modifier."""
92 eMod = 0
94 # Left/Right Evasion Mods
95 if self.__left == 'Shield' or self.__right == 'Shield':
96 eMod += 1
97 if self.__left == 'Sword' or self.__right == 'Sword':
98 eMod += 3
99 if self.__left == 'Katana' or self.__right == 'Katana':
100 eMod += 1
101 if self.__left == 'Staff' or self.__right == 'Staff':
102 eMod += 5
103 # Armor Evasion Mods
104 if self.__armor == 'Chain Mail':
105 eMod += 4
106 elif self.__armor == 'Cloak':
107 eMod += 6
109 return eMod