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 ########################################################
20 """ Represents the equiption of a fighter. """
23 """ A string representing the head equiption. """
26 """ A string representing the armor equiption. """
29 """ A string representing the left hand/arm equiption. """
31 """ A string representing the right hand/arm equiption. """
33 def __init__(self
,head
,armor
,l
,r
):
44 """Change head armor."""
52 """Change body armor."""
56 """Get left arm weapon/armor."""
60 """Change left arm weapon/armor."""
64 """Get right arm weapon/armor."""
68 """Change right arm weapon/armor."""
71 def computeAtkMod(self
):
72 """Compute attack modifier. Currently hard-coded."""
73 # Left/Right Attack Mods
74 if self
.__left
== 'Sword' or self
.__right
== 'Sword':
76 elif self
.__left
== 'Katana' or self
.__right
== 'Katana':
78 elif self
.__left
== 'Bow' or self
.__right
== 'Bow':
80 elif self
.__left
== 'Staff' or self
.__right
== 'Staff':
84 def computeDefMod(self
):
85 """Compute defense modifier. Currently hard-coded."""
89 if self
.__head
== 'Helm':
91 # Left/Right Defense Mods
92 if self
.__left
== 'Shield' or self
.__right
== 'Shield':
95 if self
.__armor
== 'Chain Mail':
97 elif self
.__armor
== 'Cloak':
102 def computeEvaMod(self
):
103 """Compute evasion modifier. Currently hard-coded."""
106 # Left/Right Evasion Mods
107 if self
.__left
== 'Shield' or self
.__right
== 'Shield':
109 if self
.__left
== 'Sword' or self
.__right
== 'Sword':
111 if self
.__left
== 'Katana' or self
.__right
== 'Katana':
113 if self
.__left
== 'Staff' or self
.__right
== 'Staff':
116 if self
.__armor
== 'Chain Mail':
118 elif self
.__armor
== 'Cloak':