Subversion Repositories Games.Carmageddon

Rev

Rev 18 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 pmbaty 1
#ifndef _OPPONENT_H_
2
#define _OPPONENT_H_
3
 
20 pmbaty 4
#include "brender/br_types.h"
1 pmbaty 5
#include "dr_types.h"
6
 
7
#define CAR_SPEC_IS_OPPONENT(CAR_SPEC) (VEHICLE_TYPE_FROM_ID((CAR_SPEC)->car_ID) == eVehicle_opponent)
8
#define CAR_SPEC_IS_ROZZER(CAR_SPEC) (VEHICLE_TYPE_FROM_ID((CAR_SPEC)->car_ID) == eVehicle_rozzer)
9
 
10
#define CAR_SPEC_GET_SPEED_FACTOR(CAR_SPEC) (CAR_SPEC_IS_ROZZER(CAR_SPEC) ? gCop_speed_factor : gOpponent_speed_factor)
11
 
12
extern br_actor* gOppo_path_actor;
13
extern br_model* gOppo_path_model;
14
extern br_material* gMat_dk_yel;
15
extern br_material* gMat_md_yel;
16
extern br_material* gMat_lt_yel;
17
extern br_material* gMat_dk_red;
18
extern br_material* gMat_lt_red;
19
extern br_material* gMat_dk_grn;
20
extern br_material* gMat_lt_grn;
21
extern br_material* gMat_dk_blu;
22
extern br_material* gMat_lt_blu;
23
extern br_material* gMat_dk_turq;
24
extern br_material* gMat_lt_turq;
25
extern br_material* gMat_dk_gry;
26
extern br_material* gMat_md_gry;
27
extern br_material* gMat_lt_gry;
28
extern int gMellow_opponents;
29
extern int gTest_toggle;
30
extern int gAlready_elasticating;
31
extern int gVertices_used_in_non_edit_paths;
32
extern int gFaces_used_in_non_edit_paths;
33
extern int gMats_allocated;
34
extern int gOppo_paths_shown;
35
extern int gMade_path_filename;
36
extern int gBIG_APC_index;
37
extern char* gPath_section_type_names[3];
38
extern int gMin_bangness;
39
extern int gMax_bangness;
40
extern tU32 gNext_elastication;
41
extern tU32 gNext_write_during_elastication;
42
extern char* gCop_name;
43
extern char* gDrone_name;
44
extern int gChallenger_index__opponent; // suffix added to avoid duplicate symbol
45
extern int gSFS_count;
46
extern int gSFS_total_cycles;
47
extern int gSFS_max_cycles;
48
extern float gOpponent_nastyness_frigger;
49
extern char gOppo_path_filename[256];
50
extern br_scalar gIn_view_distance;
51
extern tU8* gBit_per_node;
52
extern int gGrudge_reduction_per_period;
53
extern int gSFS_cycles_this_time;
54
extern br_scalar gMinimum_yness_before_knackerisation;
55
extern int gWanky_arse_tit_fuck;
56
extern br_scalar gHead_on_cos_value;
57
extern tU32 gNext_grudge_reduction;
58
extern br_scalar gCop_pursuit_speed_percentage_multiplier;
59
extern br_scalar gDefinite_cop_pursuit_speed;
60
extern int gAcknowledged_start;
61
extern int gStart_jumped;
62
extern int gNum_of_opponents_getting_near;
63
extern int gNumber_of_cops_before_faffage;
64
extern int gFirst_frame;
65
extern tU32 gAcme_frame_count;
66
extern br_scalar gDefinite_no_cop_pursuit_speed;
67
extern int gNum_of_opponents_completing_race;
68
extern int gNum_of_opponents_pursuing;
69
extern int gActive_car_list_rebuild_required;
70
extern br_scalar gFrame_period_for_this_munging_in_secs;
71
extern int gBig_bang;
72
extern int gProcessing_opponents;
73
extern tU32 gFrame_period_for_this_munging;
74
extern tU32 gTime_stamp_for_this_munging;
75
extern tS16 gMobile_section;
76
 
77
void PointActorAlongThisBloodyVector(br_actor* pThe_actor, br_vector3* pThe_vector);
78
 
79
void ProcessCurrentObjective(tOpponent_spec* pOpponent_spec, tProcess_objective_command pCommand);
80
 
81
tS16 ReallocExtraPathNodes(int pHow_many_then);
82
 
83
tS16 ReallocExtraPathSections(int pHow_many_then);
84
 
85
int PointVisibleFromHere(br_vector3* pFrom, br_vector3* pTo);
86
 
87
tS16 FindNearestPathNode(br_vector3* pActor_coords, br_scalar* pDistance);
88
 
89
tS16 FindNearestPathSection(br_vector3* pActor_coords, br_vector3* pPath_direction, br_vector3* pIntersect, br_scalar* pDistance);
90
 
91
tS16 FindNearestGeneralSection(tCar_spec* pPursuee, br_vector3* pActor_coords, br_vector3* pPath_direction, br_vector3* pIntersect, br_scalar* pDistance);
92
 
93
void DeadStopCar(tCar_spec* pCar_spec);
94
 
95
void TurnOpponentPhysicsOn(tOpponent_spec* pOpponent_spec);
96
 
97
void TurnOpponentPhysicsOff(tOpponent_spec* pOpponent_spec);
98
 
99
void NewObjective(tOpponent_spec* pOpponent_spec, tOpponent_objective_type pObjective_type, ...);
100
 
101
void CalcRaceRoute(tOpponent_spec* pOpponent_spec);
102
 
103
void TopUpRandomRoute(tOpponent_spec* pOpponent_spec, int pSections_to_add);
104
 
105
int SearchForSection(tRoute_section* pTemp_store, tRoute_section* pPerm_store, int* pNum_of_perm_store_sections, tS16 pTarget_section, int pDepth, br_scalar pDistance_so_far, tOpponent_spec* pOpponent_spec);
106
 
107
void CalcGetNearPlayerRoute(tOpponent_spec* pOpponent_spec, tCar_spec* pPlayer);
108
 
109
void CalcReturnToStartPointRoute(tOpponent_spec* pOpponent_spec);
110
 
111
void ClearOpponentsProjectedRoute(tOpponent_spec* pOpponent_spec);
112
 
113
int AddToOpponentsProjectedRoute(tOpponent_spec* pOpponent_spec, tS16 pSection_no, int pDirection);
114
 
115
int ShiftOpponentsProjectedRoute(tOpponent_spec* pOpponent_spec, int pPlaces);
116
 
117
void StunTheBugger(tOpponent_spec* pOpponent_spec, int pMilliseconds);
118
 
119
void UnStunTheBugger(tOpponent_spec* pOpponent_spec);
120
 
121
void ProcessCompleteRace(tOpponent_spec* pOpponent_spec, tProcess_objective_command pCommand);
122
 
123
void StartRecordingTrail(tCar_spec* pPursuee);
124
 
125
void RecordNextTrailNode(tCar_spec* pPursuee);
126
 
127
tS16 FindNearestTrailSection(tOpponent_spec* pOpponent_spec, tCar_spec* pPursuee, br_vector3* pSection_v, br_vector3* pIntersect, br_scalar* pDistance);
128
 
129
tS16 CalcNextTrailSection(tOpponent_spec* pOpponent_spec, int pSection);
130
 
131
void ProcessPursueAndTwat(tOpponent_spec* pOpponent_spec, tProcess_objective_command pCommand);
132
 
133
void ProcessRunAway(tOpponent_spec* pOpponent_spec, tProcess_objective_command pCommand);
134
 
135
void ProcessWaitForSomeHaplessSod(tOpponent_spec* pOpponent_spec, tProcess_objective_command pCommand);
136
 
137
void ProcessReturnToStart(tOpponent_spec* pOpponent_spec, tProcess_objective_command pCommand);
138
 
139
void ProcessLevitate(tOpponent_spec* pOpponent_spec, tProcess_objective_command pCommand);
140
 
141
void ProcessGetNearPlayer(tOpponent_spec* pOpponent_spec, tProcess_objective_command pCommand);
142
 
143
void ProcessFrozen(tOpponent_spec* pOpponent_spec, tProcess_objective_command pCommand);
144
 
145
int HeadOnWithPlayerPossible(tOpponent_spec* pOpponent_spec);
146
 
147
int AlreadyPursuingCar(tOpponent_spec* pOpponent_spec, tCar_spec* pPursuee);
148
 
149
int LastTwatteeAPlayer(tOpponent_spec* pOpponent_spec);
150
 
151
int LastTwatterAPlayer(tOpponent_spec* pOpponent_spec);
152
 
153
void ObjectiveComplete(tOpponent_spec* pOpponent_spec);
154
 
155
void TeleportOpponentToNearestSafeLocation(tOpponent_spec* pOpponent_spec);
156
 
157
void ChooseNewObjective(tOpponent_spec* pOpponent_spec, int pMust_choose_one);
158
 
159
void ProcessThisOpponent(tOpponent_spec* pOpponent_spec);
160
 
161
int IsNetCarActive(br_vector3* pPoint);
162
 
163
void RebuildActiveCarList(void);
164
 
165
void ForceRebuildActiveCarList(void);
166
 
167
void StartToCheat(tOpponent_spec* pOpponent_spec);
168
 
169
void OiStopCheating(tOpponent_spec* pOpponent_spec);
170
 
171
int TeleportCopToStart(tOpponent_spec* pOpponent_spec);
172
 
173
void CalcDistanceFromHome(tOpponent_spec* pOpponent_spec);
174
 
175
int MassageOpponentPosition(tOpponent_spec* pOpponent_spec, int pMassage_count);
176
 
177
int RematerialiseOpponentOnThisSection(tOpponent_spec* pOpponent_spec, br_scalar pSpeed, tS16 pSection_no);
178
 
179
int RematerialiseOpponentOnNearestSection(tOpponent_spec* pOpponent_spec, br_scalar pSpeed);
180
 
181
int RematerialiseOpponent(tOpponent_spec* pOpponent_spec, br_scalar pSpeed);
182
 
183
void CalcPlayerConspicuousness(tOpponent_spec* pOpponent_spec);
184
 
185
void CalcOpponentConspicuousnessWithAViewToCheatingLikeFuck(tOpponent_spec* pOpponent_spec);
186
 
187
void ChallengeOccurred(int pChallenger_index, int pAccepted);
188
 
189
void LoadCopCars(void);
190
 
191
void LoadInOppoPaths(FILE* pF);
192
 
193
void DisposeOpponentPaths(void);
194
 
195
void MungeOpponents(tU32 pFrame_period);
196
 
197
void SetInitialCopPositions(void);
198
 
199
void InitOpponents(tRace_info* pRace_info);
200
 
201
void DisposeOpponents(void);
202
 
203
void WakeUpOpponentsToTheFactThatTheStartHasBeenJumped(int pWhat_the_countdown_was);
204
 
205
void ReportMurderToPoliceDepartment(tCar_spec* pCar_spec);
206
 
207
int GetCarCount(tVehicle_type pCategory);
208
 
209
tCar_spec* GetCarSpec(tVehicle_type pCategory, int pIndex);
210
 
211
char* GetDriverName(tVehicle_type pCategory, int pIndex);
212
 
213
tOpponent_spec* GetOpponentSpecFromCarSpec(tCar_spec* pCar_spec);
214
 
215
tCar_spec* GetCarSpecFromGlobalOppoIndex(int pIndex);
216
 
217
int GetOpponentsRealSection(tOpponent_spec* pOpponent_spec, int pSection_no);
218
 
219
int GetOpponentsFirstSection(tOpponent_spec* pOpponent_spec);
220
 
221
int GetOpponentsNextSection(tOpponent_spec* pOpponent_spec, tS16 pCurrent_section);
222
 
223
tS16 GetOpponentsSectionStartNode(tOpponent_spec* pOpponent_spec, tS16 pSection);
224
 
225
tS16 GetOpponentsSectionFinishNode(tOpponent_spec* pOpponent_spec, tS16 pSection);
226
 
227
br_vector3* GetOpponentsSectionStartNodePoint(tOpponent_spec* pOpponent_spec, tS16 pSection);
228
 
229
br_vector3* GetOpponentsSectionFinishNodePoint(tOpponent_spec* pOpponent_spec, tS16 pSection);
230
 
231
br_scalar GetOpponentsSectionWidth(tOpponent_spec* pOpponent_spec, tS16 pSection);
232
 
233
int GetOpponentsSectionMinSpeed(tOpponent_spec* pOpponent_spec, tS16 pSection, int pTowards_finish);
234
 
235
int GetOpponentsSectionMaxSpeed(tOpponent_spec* pOpponent_spec, tS16 pSection, int pTowards_finish);
236
 
237
void InitOpponentPsyche(int pOpponent_index);
238
 
239
void ClearTwattageOccurrenceVariables(tOpponent_spec* pOpponent_spec);
240
 
241
void TwoCarsHitEachOther(tCar_spec* pA_car, tCar_spec* pAnother_car);
242
 
243
void RecordOpponentTwattageOccurrence(tCar_spec* pTwatter, tCar_spec* pTwattee);
244
 
245
void ToggleOpponentTest(void);
246
 
247
void ToggleOpponentProcessing(void);
248
 
249
void ToggleMellowOpponents(void);
250
 
251
void RepairOpponentsSystems(void);
252
 
253
void CopyVertex__opponent(br_vertex* pDest_vertex, br_vertex* pSrc_vertex);
254
 
255
void CopyFace__opponent(br_face* pDest_face, br_face* pSrc_face);
256
 
257
void DeleteSection(tS16 pSection_to_delete);
258
 
259
void DeleteNode(tS16 pNode_to_delete, int pAnd_sections);
260
 
261
void DeleteOrphanNodes(void);
262
 
263
void InsertThisNodeInThisSectionHere(tS16 pInserted_node, tS16 pSection_no, br_vector3* pWhere);
264
 
265
void TrackElasticateyPath(void);
266
 
267
void RecalcNearestPathSectionSpeed(int pMax_not_min, int pAdjustment);
268
 
269
void RecalcNearestPathSectionWidth(br_scalar pAdjustment);
270
 
271
void CalcNegativeXVector(br_vector3* pNegative_x_vector, br_vector3* pStart, br_vector3* pFinish, br_scalar pLength);
272
 
273
void MakeVertexAndOffsetIt(br_model* pModel, int pVertex_num, br_scalar pX, br_scalar pY, br_scalar pZ, br_vector3* pOffset);
274
 
275
void MakeFaceAndTextureIt(br_model* pModel, int pFace_num, int pV0, int pV1, int pV2, br_material* pMaterial);
276
 
277
void MakeSection(br_uint_16 pFirst_vertex, br_uint_16 pFirst_face, br_vector3* pStart, br_vector3* pFinish, br_scalar pWidth, br_material* pMaterial_centre_lt, br_material* pMaterial_centre_dk, br_material* pMaterial_edges_start_lt, br_material* pMaterial_edges_start_dk, br_material* pMaterial_edges_finish_lt, br_material* pMaterial_edges_finish_dk);
278
 
279
void MakeCube(br_uint_16 pFirst_vertex, br_uint_16 pFirst_face, br_vector3* pPoint, br_material* pMaterial_1, br_material* pMaterial_2, br_material* pMaterial_3);
280
 
281
void CalcNumberOfFacesAndVerticesForOppoPathModel(br_uint_16* pFace_index_ptr, br_uint_16* pVertex_index_ptr);
282
 
283
void ReallocModelFacesAndVertices(br_model* pModel, int pNum_faces, int pNum_vertices);
284
 
285
br_material* CreateSimpleMaterial(int pColour_index);
286
 
287
void AllocateMatsForOppoPathModel(void);
288
 
289
void RebuildOppoPathModel(void);
290
 
291
int ConsistencyCheck(void);
292
 
293
void ShowOppoPaths(void);
294
 
295
void WriteOutOppoPaths(void);
296
 
297
int NewNodeOKHere(void);
298
 
299
void ShowHideOppoPaths(void);
300
 
301
void DropElasticateyNode(void);
302
 
303
void InsertAndElasticate(void);
304
 
305
void InsertAndDontElasticate(void);
306
 
307
void DropDeadEndNode(void);
308
 
309
void DropNodeOnNodeAndStopElasticating(void);
310
 
311
void WidenOppoPathSection(void);
312
 
313
void NarrowOppoPathSection(void);
314
 
315
void IncreaseSectionMinSpeed(void);
316
 
317
void DecreaseSectionMinSpeed(void);
318
 
319
void IncreaseSectionMaxSpeed(void);
320
 
321
void DecreaseSectionMaxSpeed(void);
322
 
323
void PullOppoPoint(void);
324
 
325
void ShowNodeInfo(void);
326
 
327
void ShowSectionInfo1(void);
328
 
329
void ShowSectionInfo2(void);
330
 
331
void DeleteOppoPathSection(void);
332
 
333
void DeleteOppoPathNodeAndSections(void);
334
 
335
void DeleteOppoPathNodeAndJoin(void);
336
 
337
void ReverseSectionDirection(void);
338
 
339
void CycleSectionType(void);
340
 
341
void ToggleOneWayNess(void);
342
 
343
void CopStartPointInfo(void);
344
 
345
void DropCopStartPoint(void);
346
 
347
void DeleteCopStartPoint(void);
348
 
349
void CycleCopStartPointType(void);
350
 
351
#endif