minor updates.
[asgard.git] / statistic.py
blobf21ee2f3730879e6dc5a30496187d9cb1a1cb042
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 Statistic:
20 """ Represents a statistic associated with a Fighter object, along with
21 a number of statistic meta data. """
23 name = ""
24 """ Name of statistic. (i.e. "hp") """
26 current = 0
27 """ Current value. (i.e. 350 points) """
29 max = 0
30 """ Maximum value. (i.e. 500 points) If < 0, this statistic is deleted
31 from Fighter after the battle is over. """
33 afterBattle = True
34 """ Whether the statistic retains its "current" value after battle. """
36 plus = 0
37 """ How much this stat goes up (maximally), on level up. """
39 chance = 0.0
40 """ The chances that it will go up on level up. """
42 growthRate = 0.0
43 """ Some things do not grow at a constant rate, i.e HP. This determines
44 how fast a stat grows with reference to it's previous value. For
45 example, HP = HP + (HP * growthRate). """
48 def __init__(self,name,current,max,afterBattle,plus,chance,growthRate):
49 """Simple Constructor."""
50 self.__name = name
51 self.__current = current
52 self.__max = max
53 self.__afterBattle = afterBattle
54 self.__plus = plus
55 self.__chance = chance
56 self.__growthRate = growthRate
58 def getName(self):
59 return self.__name
61 def setName(self,n):
62 self.__name = n
64 def getCurrent(self):
65 return self.__current
67 def setCurrent(self,c):
68 self.__current = c
70 def getMax(self):
71 return self.__max
73 def setMax(self,m):
74 self.__max = m
76 def getAfterBattle(self):
77 return self.__afterBattle
79 def setAfterBattle(self,a):
80 self.__afterBattle = a
82 def getChance(self):
83 return self.__chance
85 def setChance(self,c):
86 self.__chance = c
88 def getPlus(self):
89 return self.__plus
91 def setPlus(self,p):
92 self.__plus = p
94 def getGrowthRate(self):
95 return self.__growthRate
97 def setGrowthRate(self,g):
98 self.__growthRate = g