Planeshift
psraceinfo.h
Go to the documentation of this file.
1 /*
2  * psraceinfo.h
3  *
4  * Copyright (C) 2001 Atomic Blue (info@planeshift.it, http://www.atomicblue.org)
5  *
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation (version 2 of the License)
10  * This program 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.
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17  *
18  */
19 
20 
21 
22 #ifndef __PSRACEINFO_H__
23 #define __PSRACEINFO_H__
24 
25 //=============================================================================
26 // Crystal Space Includes
27 //=============================================================================
28 
29 //=============================================================================
30 // Project Includes
31 //=============================================================================
32 
33 //=============================================================================
34 // Local Includes
35 //=============================================================================
36 #include "psitem.h"
37 #include "pscharacter.h" // for gender
38 
40 {
45 };
46 
48 {
49  float x,y,z,yrot;
50  float range;
51  const char* sector_name;
52 };
53 
58 struct psRaceInfo
59 {
60 protected:
61  unsigned short attributes[PSITEMSTATS_STAT_COUNT];
62 
63 public:
64  psRaceInfo();
65  ~psRaceInfo();
66  bool Load(iResultRow &row);
67 
68  bool LoadBaseSpeeds(iObjectRegistry* object_reg);
69 
70  unsigned int uid;
71  unsigned int race;
72  csString name;
73  csString sex;
74 
76 
77  csString mesh_name;
79  csVector3 size;
80  int initialCP;
83  float runMinSpeed,runBaseSpeed,runMaxSpeed;
84  float walkMinSpeed,walkBaseSpeed,walkMaxSpeed;
85 
86  float GetBaseAttribute(PSITEMSTATS_STAT attrib);
87 
88 private:
89 
90  csString helmGroup;
91  csString BracerGroup;
92  csString BeltGroup;
93  csString CloakGroup;
94 
95  csString MounterAnim;
96 
97  float speedModifier;
98 
99  float scale;
100 
101  void SetBaseAttribute(PSITEMSTATS_STAT attrib, float val);
102 public:
103 
104  float baseRegen[4];
105 
106  csArray<psRaceStartingLocation> startingLocations;
107 
108  void GetStartingLocation(float &x,float &y, float &z,float &rot,float &range,const char* &sectorname);
109  void GetSize(csVector3 &size)
110  {
111  size = this->size;
112  };
113 
117  const char* GetName()
118  {
119  return name.GetDataSafe();
120  }
121 
122  const char* GetHonorific();
123  const char* GetObjectPronoun();
124  const char* GetPossessive();
125 
126  csString ReadableRaceGender();
127 
128  const char* GetGender()
129  {
130  return sex;
131  }
132  const char* GetRace()
133  {
134  return name;
135  }
136 
137  const char* GetMeshName()
138  {
139  return mesh_name.GetDataSafe();
140  }
141 
145  const char* GetTextureName()
146  {
147  return base_texture_name.GetDataSafe();
148  }
149 
150  const char* GetHelmGroup()
151  {
152  return helmGroup.GetDataSafe();
153  }
154  const char* GetBracerGroup()
155  {
156  return BracerGroup.GetDataSafe();
157  }
158  const char* GetBeltGroup()
159  {
160  return BeltGroup.GetDataSafe();
161  }
162  const char* GetCloakGroup()
163  {
164  return CloakGroup.GetDataSafe();
165  }
166 
167  const char* GetMounterAnim()
168  {
169  return MounterAnim.GetDataSafe();
170  }
171 
176  {
177  return natural_armor_id;
178  }
179 
184  {
185  return natural_weapon_id;
186  }
187 
189  {
190  return speedModifier;
191  }
192 
196  float GetScale()
197  {
198  return scale;
199  }
200 
204  int GetRaceID()
205  {
206  return race;
207  }
208 
212  int GetUID()
213  {
214  return uid;
215  }
216 
217 
218 };
219 
220 
221 
222 #endif
223 
const char * GetHelmGroup()
Definition: psraceinfo.h:150
csString sex
Definition: psraceinfo.h:73
csArray< psRaceStartingLocation > startingLocations
Definition: psraceinfo.h:106
uint32 natural_armor_id
Definition: psraceinfo.h:81
const char * GetName()
Gets the name of this race.
Definition: psraceinfo.h:117
const char * GetTextureName()
Gets the name of the texture associated to this race, if any.
Definition: psraceinfo.h:145
float GetSpeedModifier()
Definition: psraceinfo.h:188
float range
the range in which a random position will be choosen.
Definition: psraceinfo.h:50
const char * GetBeltGroup()
Definition: psraceinfo.h:158
const char * GetRace()
Definition: psraceinfo.h:132
const char * GetMounterAnim()
Definition: psraceinfo.h:167
uint32 GetNaturalArmorID()
Returns the natural armor stat id used for this race when it&#39;s not equipping an armor.
Definition: psraceinfo.h:175
uint32 natural_weapon_id
Definition: psraceinfo.h:82
int initialCP
Definition: psraceinfo.h:80
PSITEMSTATS_STAT
Definition: psitemstats.h:69
const char * GetGender()
Definition: psraceinfo.h:128
Defines characteristics of a race associated to an NPC, player or pet.
Definition: psraceinfo.h:58
float walkMinSpeed
Definition: psraceinfo.h:84
const char * GetCloakGroup()
Definition: psraceinfo.h:162
const char * sector_name
Definition: psraceinfo.h:51
PSRACEINFO_STAMINA
Definition: psraceinfo.h:39
PSCHARACTER_GENDER
Definition: charmessages.h:14
csString base_texture_name
Definition: psraceinfo.h:78
csString mesh_name
Definition: psraceinfo.h:77
void GetSize(csVector3 &size)
Definition: psraceinfo.h:109
const char * GetBracerGroup()
Definition: psraceinfo.h:154
int GetRaceID()
Gets the id of the race (regardless of sex).
Definition: psraceinfo.h:204
PSCHARACTER_GENDER gender
Definition: psraceinfo.h:75
csString name
Definition: psraceinfo.h:72
unsigned int uid
Definition: psraceinfo.h:70
const char * GetMeshName()
Definition: psraceinfo.h:137
csVector3 size
Definition: psraceinfo.h:79
uint32 GetNaturalWeaponID()
Returns the natural weapon stat id used for this race when it&#39;s not equipping a weapon.
Definition: psraceinfo.h:183
unsigned int race
Definition: psraceinfo.h:71
int GetUID()
Gets the id of the specific race (considering also its sex, and alternative versions),.
Definition: psraceinfo.h:212
float runMinSpeed
Definition: psraceinfo.h:83
float GetScale()
Gets the scale override, if any, of this race.
Definition: psraceinfo.h:196