Planeshift

psraceinfo.h

Go to the documentation of this file.
00001 /*
00002  * psraceinfo.h
00003  *
00004  * Copyright (C) 2001 Atomic Blue ([email protected], http://www.atomicblue.org)
00005  *
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation (version 2 of the License)
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00017  *
00018  */
00019 
00020 
00021 
00022 #ifndef __PSRACEINFO_H__
00023 #define __PSRACEINFO_H__
00024 
00025 //=============================================================================
00026 // Crystal Space Includes
00027 //=============================================================================
00028 
00029 //=============================================================================
00030 // Project Includes
00031 //=============================================================================
00032 
00033 //=============================================================================
00034 // Local Includes
00035 //=============================================================================
00036 #include "psitem.h"
00037 #include "pscharacter.h"  // for gender 
00038 
00039 enum PSRACEINFO_STAMINA
00040 {
00041     PSRACEINFO_STAMINA_PHYSICAL_STILL = 0,
00042     PSRACEINFO_STAMINA_PHYSICAL_WALK,
00043     PSRACEINFO_STAMINA_MENTAL_STILL,
00044     PSRACEINFO_STAMINA_MENTAL_WALK
00045 };
00046 
00047 struct psRaceStartingLocation
00048 {
00049     float x,y,z,yrot;
00050     float range; 
00051     const char* sector_name;
00052 };
00053 
00054 struct psRaceInfo
00055 {
00056 protected:
00057     unsigned short attributes[PSITEMSTATS_STAT_COUNT];
00058 
00059 public:
00060     psRaceInfo();
00061     ~psRaceInfo();
00062     bool Load(iResultRow &row);
00063 
00064     bool LoadBaseSpeeds(iObjectRegistry* object_reg);
00065 
00066     unsigned int uid;
00067     unsigned int race;
00068     csString name;
00069     csString sex;
00070 
00071     PSCHARACTER_GENDER gender;
00072 
00073     csString mesh_name;
00074     csString base_texture_name;
00075     csVector3 size;
00076     int initialCP;
00077     uint32 natural_armor_id;
00078     uint32 natural_weapon_id;
00079     float runMinSpeed,runBaseSpeed,runMaxSpeed;
00080     float walkMinSpeed,walkBaseSpeed,walkMaxSpeed;
00081 
00082     float GetBaseAttribute(PSITEMSTATS_STAT attrib);
00083 
00084 private:
00085 
00086     csString helmGroup;         
00087     csString BracerGroup;       
00088     csString BeltGroup;         
00089     csString CloakGroup;        
00090 
00091     csString MounterAnim;       
00092 
00093     float speedModifier;        
00094 
00095     float scale;                
00096 
00097     void  SetBaseAttribute(PSITEMSTATS_STAT attrib, float val);
00098 public:
00099 
00100     float baseRegen[4];
00101 
00102     csArray<psRaceStartingLocation> startingLocations;
00103 
00104     void GetStartingLocation(float &x,float &y, float &z,float &rot,float &range,const char* &sectorname);
00105     void GetSize(csVector3 &size)
00106     {
00107         size = this->size;
00108     };
00109 
00113     const char* GetName()
00114     {
00115         return name.GetDataSafe();
00116     }
00117 
00118     const char* GetHonorific();
00119     const char* GetObjectPronoun();
00120     const char* GetPossessive();
00121 
00122     csString ReadableRaceGender();
00123 
00124     const char* GetGender()
00125     {
00126         return sex;
00127     }
00128     const char* GetRace()
00129     {
00130         return name;
00131     }
00132 
00133     const char* GetMeshName()
00134     {
00135         return mesh_name.GetDataSafe();
00136     }
00137 
00141     const char* GetTextureName()
00142     {
00143         return base_texture_name.GetDataSafe();
00144     }
00145 
00146     const char* GetHelmGroup()
00147     {
00148         return helmGroup.GetDataSafe();
00149     }
00150     const char* GetBracerGroup()
00151     {
00152         return BracerGroup.GetDataSafe();
00153     }
00154     const char* GetBeltGroup()
00155     {
00156         return BeltGroup.GetDataSafe();
00157     }
00158     const char* GetCloakGroup()
00159     {
00160         return CloakGroup.GetDataSafe();
00161     }
00162 
00163     const char* GetMounterAnim()
00164     {
00165         return MounterAnim.GetDataSafe();
00166     }
00167 
00171     uint32 GetNaturalArmorID()
00172     {
00173         return natural_armor_id;
00174     }
00175 
00179     uint32 GetNaturalWeaponID()
00180     {
00181         return natural_weapon_id;
00182     }
00183 
00184     float GetSpeedModifier()
00185     {
00186         return speedModifier;
00187     }
00188 
00192     float GetScale()
00193     {
00194         return scale;
00195     }
00196 
00200     int GetRaceID()
00201     {
00202         return race;
00203     }
00204 
00208     int GetUID()
00209     {
00210         return uid;
00211     }
00212 
00213 
00214 };
00215 
00216 
00217 
00218 #endif
00219