-
Notifications
You must be signed in to change notification settings - Fork 1
/
cRaces.h
244 lines (202 loc) · 7.12 KB
/
cRaces.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
#ifndef __Races__
#define __Races__
namespace UOX
{
class CRace
{
private:
struct ColourPair
{
COLOUR cMin;
COLOUR cMax;
ColourPair( COLOUR a, COLOUR b ) : cMin( a ), cMax( b )
{
}
ColourPair() : cMin( 0 ), cMax( 0 )
{
}
};
typedef std::vector< ColourPair > COLOURLIST;
typedef std::vector< RaceRelate > RACEIDLIST;
SI16 HPMod;
SI16 ManaMod;
SI16 StamMod;
private:
SKILLVAL iSkills[SKILLS];
std::string raceName;
COLOURLIST beardColours;
COLOURLIST hairColours;
COLOURLIST skinColours;
std::bitset< 8 > bools;
GENDER restrictGender;
RACEIDLIST racialEnemies;
LIGHTLEVEL lightLevel;
COLDLEVEL coldLevel;
HEATLEVEL heatLevel;
LIGHTLEVEL nightVision;
ARMORCLASS armourRestrict;
std::bitset< WEATHNUM > weatherAffected;
SECONDS weathSecs[WEATHNUM];
SI08 weathDamage[WEATHNUM];
SKILLVAL languageMin;
RANGE visDistance;
R32 poisonResistance; // % of poison to cancel
R32 magicResistance; // % of magic to cancel
bool doesHunger;
UI16 hungerRate;
SI16 hungerDamage;
public:
CRace();
CRace( int numRaces );
~CRace();
SKILLVAL Skill( int skillNum ) const;
const std::string Name( void ) const;
bool RequiresBeard( void ) const;
bool NoBeard( void ) const;
bool IsPlayerRace( void ) const;
bool AffectedBy( WeatherType iNum ) const;
void AffectedBy( bool value, WeatherType iNum );
bool NoHair( void ) const;
GENDER GenderRestriction( void ) const;
LIGHTLEVEL LightLevel( void ) const;
COLDLEVEL ColdLevel( void ) const;
HEATLEVEL HeatLevel( void ) const;
LIGHTLEVEL NightVision( void ) const;
ARMORCLASS ArmourClassRestriction( void ) const;
SECONDS WeatherSeconds( WeatherType iNum ) const;
SI08 WeatherDamage( WeatherType iNum ) const;
R32 MagicResistance( void ) const;
R32 PoisonResistance( void ) const;
SKILLVAL LanguageMin( void ) const;
RANGE VisibilityRange( void ) const;
RaceRelate RaceRelation( RACEID race ) const;
UI16 GetHungerRate( void ) const;
void SetHungerRate( UI16 newValue );
SI16 GetHungerDamage( void ) const;
void SetHungerDamage( SI16 newValue );
bool DoesHunger( void ) const;
void DoesHunger( bool newValue );
void Skill( SKILLVAL newValue, int iNum );
void Name( const std::string newName );
void RequiresBeard( bool newValue );
void NoBeard( bool newValue );
void IsPlayerRace( bool newValue );
void NoHair( bool newValue );
SI16 HPModifier( void ) const;
void HPModifier( SI16 value );
SI16 ManaModifier( void ) const;
void ManaModifier( SI16 value );
SI16 StamModifier( void ) const;
void StamModifier( SI16 value );
void MagicResistance( R32 value );
void PoisonResistance( R32 value );
void GenderRestriction( GENDER newValue );
void LightLevel( LIGHTLEVEL newValue );
void ColdLevel( COLDLEVEL newValue );
void HeatLevel( HEATLEVEL newValue );
void NightVision( LIGHTLEVEL newValue );
void ArmourClassRestriction( ARMORCLASS newValue );
void WeatherSeconds( SECONDS newValue, WeatherType iNum );
void WeatherDamage( SI08 newValue, WeatherType iNum );
void LanguageMin( SKILLVAL newValue );
void VisibilityRange( RANGE newValue );
void NumEnemyRaces( int iNum );
void RaceRelation( RaceRelate value, RACEID race );
COLOUR RandomSkin( void ) const;
COLOUR RandomHair( void ) const;
COLOUR RandomBeard( void ) const;
bool IsSkinRestricted( void ) const;
bool IsHairRestricted( void ) const;
bool IsBeardRestricted( void ) const;
bool IsValidSkin( COLOUR val ) const;
bool IsValidHair( COLOUR val ) const;
bool IsValidBeard( COLOUR val ) const;
void Load( size_t sectNum, int modCount );
CRace& operator =( CRace& trgRace );
};
class cRaces
{
private:
struct combatModifiers
{
UI08 value;
};
typedef std::vector< CRace * > RACELIST;
typedef std::vector< combatModifiers > MODIFIERLIST;
// data
RACELIST races;
MODIFIERLIST combat;
void DefaultInitCombat( void );
// functions - accessors
// Mutators
void RacialInfo( RACEID race, RACEID toSet, RaceRelate value );
bool InvalidRace( RACEID x ) const;
public:
// Functions
~cRaces();
cRaces( void );
void load( void ); // loads races
RaceRelate Compare( CChar *player1, CChar *player2 ) const;
RaceRelate CompareByRace( RACEID race1, RACEID race2 ) const; // compares chars
void gate( CChar *s, RACEID x, bool always = false ); // Race Gate
bool beardInRange( COLOUR color, RACEID x ) const;
bool skinInRange( COLOUR color, RACEID x ) const;
bool hairInRange( COLOUR color, RACEID x ) const;
bool beardRestricted( RACEID x ) const;
bool hairRestricted( RACEID x ) const;
bool skinRestricted( RACEID x ) const;
CRace * Race( RACEID x );
// Accessors
SECONDS Secs( RACEID race, WeatherType element ) const;
SI08 Damage( RACEID race, WeatherType element ) const;
bool Affect( RACEID race, WeatherType element ) const;
const std::string Name( RACEID race ) const; // Returns race name of player
SKILLVAL Skill( int skill, RACEID race ) const;
GENDER GenderRestrict( RACEID race ) const;
bool RequireBeard( RACEID race ) const;
bool IsPlayerRace( RACEID race ) const;
LIGHTLEVEL LightLevel( RACEID race ) const;
COLDLEVEL ColdLevel( RACEID race ) const;
HEATLEVEL HeatLevel( RACEID race ) const;
bool DoesHunger( RACEID race ) const;
UI16 GetHungerRate( RACEID race ) const;
SI16 GetHungerDamage( RACEID race ) const;
ARMORCLASS ArmorRestrict( RACEID race ) const;
COLOUR RandomSkin( RACEID x ) const;
COLOUR RandomHair( RACEID x ) const;
COLOUR RandomBeard( RACEID x ) const;
SI32 DamageFromSkill( int skill, RACEID x ) const;
SI32 FightPercent( int skill, RACEID x ) const;
SKILLVAL LanguageMin( RACEID x ) const;
LIGHTLEVEL VisLevel( RACEID x ) const;
RANGE VisRange( RACEID x ) const;
bool NoBeard( RACEID x ) const;
// Mutators
void Secs( RACEID race, WeatherType element, SECONDS value );
void Damage( RACEID race, WeatherType element, SI08 value );
void Affect( RACEID race, WeatherType element, bool value );
void Skill( int skill, int value, RACEID race );
void GenderRestrict( GENDER gender, RACEID race );
void RequireBeard( bool value, RACEID race );
void NoBeard( bool value, RACEID race );
void LightLevel( RACEID race, LIGHTLEVEL value );
void ColdLevel( RACEID race, COLDLEVEL value );
void HeatLevel( RACEID race, HEATLEVEL value );
void DoesHunger( RACEID race, bool value );
void SetHungerRate( RACEID race, UI16 value );
void SetHungerDamage( RACEID race, SI16 value );
void ArmorRestrict( RACEID race, ARMORCLASS value );
void RacialEnemy( RACEID race, RACEID enemy );
void RacialAlly( RACEID race, RACEID ally );
void RacialNeutral( RACEID race, RACEID neutral );
void LanguageMin( SKILLVAL toSetTo, RACEID race );
void VisLevel( RACEID x, LIGHTLEVEL bonus );
void VisRange( RACEID x, RANGE range );
void IsPlayerRace( RACEID x, bool value );
void debugPrint( RACEID race );
void debugPrintAll( void );
size_t Count( void ) const;
};
extern cRaces *Races;
}
#endif