source: Daodan/src/Oni_Character.h@ 435

Last change on this file since 435 was 435, checked in by gumby, 15 years ago

Added ActiveCharacter struct and associated structs...

File size: 17.5 KB
RevLine 
[427]1#pragma once
[428]2#ifndef ONI_CHARACTER_H
3#define ONI_CHARACTER_H
[427]4
5#include "Daodan.h"
6#include <stdint.h>
7
8typedef struct {
9 float X;
10 float Y;
11 float Z;
12} Vector3; //probably move to utilities...
13
14typedef struct {
[435]15 float X;
16 float Y;
17 float Z;
18 float W;
19} Quaternion;
20
21typedef struct {
22 float RotationScale[9];
23 Vector3 Translation;
24} Matrix4x3
25
26typedef struct {
27 Vector3 Center;
28 float Radius;
29} Sphere;
30
31typedef struct {
32 Sphere Sphere_; //fix this name
33 int Child1;
34 int Child2;
35} SphereTreeNode;
36
37typedef struct {
38 Vector3 Min;
39 Vector3 Max;
40} BoundingBox;
41
42
43enum { //action flags
44 Action_Escape = 1,
45 Action_Console = 2,
46 Action_PauseScreen = 4,
47 Action_Cutscene_1 = 8,
48 Action_Cutscene_2 = 0x10,
49 Action_F4 = 0x20,
50 Action_F5 = 0x40,
51 Action_F6 = 0x80,
52 Action_F7 = 0x100,
53 Action_F8 = 0x200,
54 Action_StartRecord = 0x400,
55 Action_StopRecord = 0x800,
56 Action_PlayRecord = 0x1000,
57 Action_F12 = 0x2000,
58 Action_Unknown1 = 0x4000,
59 Action_LookMode = 0x8000,
60 Action_Screenshot = 0x10000,
61 Action_Unknown2 = 0x20000,
62 Action_Unknown3 = 0x40000,
63 Action_Unknown4 = 0x80000,
64 Action_Unknown5 = 0x100000,
65 Action_Forward = 0x200000,
66 Action_Backward = 0x400000,
67 Action_TurnLeft = 0x800000,
68 Action_TurnRight = 0x1000000,
69 Action_StepLeft = 0x2000000,
70 Action_StepRight = 0x4000000,
71 Action_Jump = 0x8000000,
72 Action_Crouch = 0x10000000,
73 Action_Punch = 0x20000000,
74 Action_Kick = 0x40000000,
75 Action_Block = 0x80000000,
76 //used in second action field
77 Action2_Walk = 1,
78 Action2_Action = 2,
79 Action2_Hypo = 4,
80 Action2_Reload = 8,
81 Action2_Swap = 0x10,
82 Action2_Drop = 0x20,
83 Action2_Fire1 = 0x40,
84 Action2_Fire2 = 0x80,
85 Action2_Fire3 = 0x100
86};
87
88
89typedef struct {
90 int32_t Actions1;
91 int32_t Actions2;
92} InputAction;
93
94
95typedef struct {
96 float MouseDeltaX;
97 float MouseDeltaY;
98 float field_8;
99 float field_C;
100 InputAction Current;
101 InputAction Stopped;
102 InputAction Start;
103 InputAction Stop;
104} GameInput;
105
106typedef struct {
[432]107 int Type; //'CHAR' etc.
[427]108 int ObjectId; //not needed
109 int Flags; //The flags of the object...not used for CHAR
110 Vector3 Position; //Position of Object
111 Vector3 Rotation; //Rotation of Object
112 int EditorCallbacks; //Lets try not to mess with it for now. :P
113 int field_28; //unknown
114} OSD_Header;
115
116typedef struct {
[435]117 int32_t Flags;
118 int32_t Frame;
119 int32_t field_8;
120 int32_t field_C;
121 int32_t field_10;
122 int32_t field_14;
123 int32_t field_18;
124 int32_t field_1C;
125 int32_t FILMInstance;
126} PlayingFilm;
127
128typedef struct {
[428]129 uint32_t Options; //A bitset. Someone had better define these
[427]130 char Class[64]; //Name of the ONCC we use. ONCCName in idb
131 char Name[32]; //Name of the character. ie: ai2_spawn Muro
132 char Weapon[64]; //Name of the weapon he holds. ONWCName in idb
133 char ScriptSpawn[32]; //Script function called when char spawns
134 char ScriptDie[32]; //Script function called when char dies
135 char ScriptAware[32]; //Script function called when char detects something
136 char ScriptAlarm[32]; //Script function called when char is alarmed at something
137 char ScriptHurt[32]; //Script function called when char is hurt for the first time
138 char ScriptDefeat[32]; //Script function called when char is at 1 HP
139 char ScriptNoPath[32]; //Script function called when char loses path. Broken.
140 char ScriptNoAmmo[32]; //Script function called when char is out of ammo for the first time. Char must have ammo at spawn.
141 int32_t AdditionalHealth; //Additional Health given to the character
142 int16_t AmmoUsed; //Ammo given for the char to use
143 int16_t AmmoDropped; //Ammo the char drops
144 int16_t CellsUsed; //Cells given for the char to use
145 int16_t CellsDropped; //Cells the char drops
146 int16_t HypoUsed; //Hypo given for the char to use
147 int16_t HypoDropped; //Hypo the char drops
148 int16_t ShieldUsed; //Bullet shield given for the char to use
149 int16_t ShieldDropped; //Bullet shield the char drops
150 int16_t CloakUsed; //Phase Cloak given for the char to use
151 int16_t CloakDropped; //Phase Cloak the char drops
152 int16_t NCIUsed; //Don't use this...
153 int16_t NCIDropped; //Don't use this...
154 int32_t TeamID; //Team ID
155 int32_t AmmoPercent; //Percent of weapon ammo full
156 int32_t JobID; //Job ID...
157 //0 - none
158 //1 - idle
159 //2 - guard (never used in Oni)
160 //3 - patrol
161 //4 - teambattle (never used in Oni)
162 int16_t PatrolID; //patrol path ID (reference to the Patrol_Path.BINA file)
163 int16_t CombatID; //combat ID (reference to the Combat.BINA file)
164 int16_t MeleeID; //melee ID (reference to the Melee Profile.BINA file)
165 int16_t NeutralID; //neutral ID (reference to the Neutral.BINA file)
166 int32_t AlarmGroups; //Bitset. http://wiki.oni2.net/CHAR
167 int32_t InitialAlertLevel; //0 - lull, 1 - low, 2 - medium, 3 - high, 4 - combat
168 int32_t MinimalAlertLevel; //0 - lull, 1 - low, 2 - medium, 3 - high, 4 - combat
169 int32_t StartJobAlertLevel; //0 - lull, 1 - low, 2 - medium, 3 - high, 4 - combat
170 int32_t InvestigatingAlertLevel;//0 - lull, 1 - low, 2 - medium, 3 - high, 4 - combat
171 int32_t PursuitStrongLow;
172 int32_t PursuitWeakLow;
173 int32_t PursuitStrongHigh;
174 int32_t PursuitWeakHigh;
175 int32_t Pursuit5;
176 int32_t field_1FC;
177} CharacterOSD;
178
179typedef struct {
180 OSD_Header Header;
181 CharacterOSD OSD;
182} CharacterObject;
[428]183
[435]184typedef struct {
185 Vector3 Center;
186 float Radius;
187} BoundingSphere;
188
189typedef struct {
190 int32_t ONCP; //probably pointer
191 int32_t field_4; //who knows?
192 int32_t Instance; //probably link to actual particle
193 int32_t Bone; //duh
194} AttachedParticle;
195typedef struct { //Inventory
196 int32_t Weapons[3];
197 int16_t field_1A0; //10 bucks says this is the current weapon
198 int16_t AmmoUsed; //Ammo given for the char to use
199 int16_t HypoUsed; //Hypo given for the char to use
200 int16_t CellsUsed; //Cells given for the char to use
201 int16_t AmmoDropped; //Ammo the char drops
202 int16_t HypoDropped; //Hypo the char drops
203 int16_t CellsDropped; //Cells the char drops
204 int16_t field_1A; //who knows? InverseHypoRegenRate?
205 int16_t field_1C;
206 int16_t field_1E;
207 int16_t hasLSI;
208 int16_t field_1B6;
209 int16_t ShieldUsed; //Bullet shield given for the char to use
210 int16_t CloakUsed; //Phase Cloak given for the char to use
211 int16_t field_28; //probably bullet shield dropped
212 int16_t DoorKeys; //Lol. We can use this later for other sorts of items.
213} Inventory;
214
215typedef strcut { //ActiveCharacter
216 int16_t Number;
217 int16_t field_2; //probably Number is an int32
218 int32_t PhyContext;
219 SphereTree SphereTree1; //probably SphereTree[7]...
220 SphereTree SphereTree3[4];
221 SphereTree SphereTree2[2];
222 int16_t field_B0;
223 int16_t field_B2;
224 int16_t field_B4;
225 int16_t field_B6;
226 Vector3 field_B8;
227 Vector3 AccelerateWith;
228 int16_t field_D0;
229 Vector3 field_D4;
230 int32_t field_E0;
231 int32_t field_E4;
232 int32_t field_E8;
233 int32_t field_EC;
234 int32_t field_F0;
235 int32_t field_F4;
236 int32_t field_E0;
237 int16_t IsInAir;
238 Vector3 FallingVelocity;
239 Vector3 JumpVelocity;
240 int16_t field_110;
241 int16_t field_112;
242 int32_t field_114;
243 int32_t field_118;
244 int32_t field_11C;
245 int32_t field_120;
246 int32_t field_124;
247 int32_t field_128;
248 int32_t field_12C;
249 BoundingSphere BoundingSphere_; //fix this name
250 Vector3 field_140;
251 Vector3 field_14C;
252 int32_t field_158;
253 int32_t field_15C;
254 Vector3 Location;
255 int32_t field_16C[6]; //16C-184 ???
256 int32_t AkiraNode;
257 int32_t GraphNode;
258 int32_t PelvisHeight;
259 int32_t MovementStatePtr;
260 int32_t ActiveWeapon; //NOTE: FIGURE OUT THIS MESS OF INVENTORY...
261 int32_t field_198; //maybe weap 3, maybe not...
262 int32_t InventoryWeapon;
263 int16_t field_1A0; //unused?
264 int16_t AmmoUsable; //Ammo given for the char to use
265 int16_t HypoUsable; //Hypo given for the char to use
266 int16_t CellsUsable; //Cells given for the char to use
267 int16_t AmmoDropped; //Ammo the char drops
268 int16_t HypoDropped; //Hypo the char drops
269 int16_t CellsDropped; //Cells the char drops
270 int16_t field_1AE;
271 int16_t InverseHypoRegenRate;
272 int16_t ShieldDropped;
273 int16_t CloakDropped;
274 int16_t field_1B4;
275 int16_t field_1B6;
276 int16_t ShieldUsable;
277 int16_t CloakUsable;
278 int16_t field_1BC[9]; //1BC-1E0
279 int32_t NotIdleStartTime;
280 int32_t TimeToIdle;
281 int32_t field_1E8[1315]; //1E8-1648 what the hell is all this?
282 BoundingBox BoundingBox_; //fix this name
283 int32_t field_1660;
284 int32_t field_1664;
285 int32_t ShieldPower; //Same as Boss Shield Power???
286 int32_t field_166C;
287 int32_t NumberOfKills; //^_^
288 int32_t InflictedDamage; //^_^
289 int32_t field_1678[260]; //1678-1A88 more wtf
290 int32_t field_1A88; //here starts animation junk? It was 4 bools in idb O_o
291 int32_t Executor_AimingDirection; //possibly throw junk?
292 int32_t field_1A98;
293 int32_t field_1A9C;
294 int32_t Executor_ActualMovementMode;
295 int32_t field_1AA4;
296 int32_t field_1AA8;
297 int32_t field_1AAC;
298 int32_t Executor_HasFacingOverride; //a bool...
299 float Executor_AimingSpeed;
300 bool field_1AB8; //actually a bitset...
301 bool Executor_HasMoveOverride;
302 int16_t field_1ABA;
303 int32_t field_1ABC;
304 int32_t field_1AC0;
305 int32_t field_1AC4;
306 int32_t Executor_FacingOverride;
307 int32_t Executor_HasAttackOverride; //another bool :P
308 int32_t field_1AC4;
309 int32_t field_1AD0;
310 int32_t field_1AD4;
311 int32_t field_1AD8;
312 int32_t field_1ADC;
313 int32_t field_1AE0;
314 int32_t field_1AE4;
315 int32_t Executor_HasThrowOverride; //another another bool
316 int32_t field_1AEC;
317 int32_t field_1AF0;
318 int32_t field_1AF4;
319 int32_t Animation;
320 int16_t AnimationToState;
321 int16_t AnimationFromState;
322 int16_t AnimationType;
323 int16_t NextAnimationType;
324 int16_t field_1B04;
325 int16_t field_1B06;
326 int32_t Stitch; //bool
327 float StitchHeight;
328 int16_t InterpolationFromState;
329 int16_t field_1B12;
330 Vector3 StitchVelocity;
331 int16_t InterpolationCurrentFrame;
332 int16_t InterpolationLength;
333 Quaternion InterpolationStartRotations[19];
334 int32_t field_1C54;
335 int32_t field_1C58;
336 int32_t field_1C5C;
337 int32_t field_1C60;
338 int32_t Overlay;
339 int32_t field_1C60;
340 int32_t field_1C64;
341 int32_t field_1C68;
342 int32_t field_1C6C;
343 int32_t field_1C70;
344 int32_t field_1C74;
345 int32_t field_1C78;
346 int32_t field_1C7C;
347 int32_t field_1C80;
348 int32_t field_1C84;
349 int16_t Frame;
350 int16_t SoftPause;
351 int16_t HardPause;
352 int16_t field1C8E;
353 int32_t field1C90;
354 int16_t field1C94;
355 int16_t field1C96;
356 int16_t Dizzy;
357 int16_t field1C9A;
358 int32_t field1C9C;
359 int16_t AnimationVarient;
360 int16_t TimeToPeace;
361 int16_t NumAnimationAttachedParticles;
362 int16_t field_1CA6; //spacing
363 AttachedParticle AnimationAttachedParticles[16];
364 int32_t TRAMParticles;
365 bool FixedParticlesAttached;
366 bool FixedParticlesStarted;
367 int16_t NumFixedParticles;
368 AttachedParticle FixedParticles[16];
369 int16_t CurrentAnimationType;
370 int16_t field_1EB2; //spacing
371 int32_t field_1EB4;
372 int32_t field_1EB8;
373 int32_t field_1EBC;
374 int32_t field_1EC0;
375 int32_t field_1EC4;
376 int32_t field_1EC8;
377 int32_t field_1ED0;
378 int32_t field_1ED4;
379 int32_t field_1ED8;
380 int32_t field_1EE0;
381 int32_t field_1EE4;
382 int32_t field_1EE8;
383 Quaternion Rotations[19];
384 Quaternion OverlayRotations[19];
385 int32_t field_2150;
386 int32_t field_2154;
387 GameInput Input;
388 InputAction PreviousActions;
389 int32_t SprintTimer;
390 int32_t field_2194;
391 Vector3 field_2198;
392 int32_t field_21A4;
393 int32_t field_21A8;
394 int32_t field_21AC;
395 Vector3 field_21B0;
396 float HeadFacing;
397 float HeadPitch;
398 int32_t field_21C4;
399 int32_t field_21C8;
400 int32_t field_21D0;
401 int32_t field_21D4;
402 bool field_21D8;
403 bool field_21D9;
404 bool field_21DA;
405 bool field_21DB;
406 bool field_21DC;
407 bool field_21DD;
408 bool field_21DE;
409 bool field_21DF;
410 bool field_21E0;
411 bool HasAlternateTrigger;
412 bool field_21E2;
413 bool ReleaseTrigger;
414 bool ReleaseAlternateTrigger;
415 bool TurningLeft;
416 bool TurningRight;
417 bool field_21E7;
418 int32_t field_21E8;
419 int32_t field_21EC;
420 int32_t field_21F0;
421 PlayingFilm PlayingFilm_; //fix this name
422 int32_t field_2218[24]; //2218-2278
423 Matrix4x3 BoneMatrices[19];
424 Matrix4x3 WeaponMatrix;
425 int32_t field_2638[113]; //2638-27FC
426 int16_t ShadowIndex;
427 int16_t field_27FE;
428 int16_t field_2780;
429 bool ShieldParts[19];
430 bool field_2815; //padding...
431 bool field_2816;
432 bool field_2817;
433 int32_t field_2818[8];
434} ActiveCharacter;
435
436
437typedef struct { //Character
438 int16_t Number;
439 int16_t ActiveCharacterIndex;
440 int32_t Flags;
441 int16_t field_8;
442 int32_t ONCC; //change type to ONCC when we get that far...
443 int32_t field_10;
444 int16_t Team;
445 char Name[32];
446 float BodySize;
447 int32_t Health;
448 int32_t MaxHealth;
449 int32_t ASIA_ID; //might be 16 with 2 byte padding
450 int32_t field_44;
451 char ScriptSpawn[32]; //Script function called when char spawns
452 char ScriptDie[32]; //Script function called when char dies
453 char ScriptAware[32]; //Script function called when char detects something
454 char ScriptAlarm[32]; //Script function called when char is alarmed at something
455 char ScriptHurt[32]; //Script function called when char is hurt for the first time
456 char ScriptDefeat[32]; //Script function called when char is at 1 HP
457 char ScriptNoAmmo[32]; //Script function called when char is out of ammo for the first time. Char must have ammo at spawn.
458 char ScriptNoPath[32]; //Script function called when char loses path. Broken.
459 Vector3 Position;
460 Vector3 LastPosition;
461 Vector3 Location;
462 float Facing;
463 float DesiredFacing;
464 float CosmeticFacing;
465 float field_178;
466 float field_17C;
467 float field_180;
468 int32_t BNV;
469 int32_t GraphNode;
470 int32_t PelvisHeight;
471 int32_t GraphNode;
472 float PelvisHeight;
473 float field_190;
474 Inventory Inventory_; //is there a better way to do this?
475 Vector3 Velocity;
476 int32_t field_1D0;
477 int32_t field_1D4;
478 int32_t field_1D8;
479 int32_t field_1DC;
480 int32_t field_1E0;
481 int32_t IdleDelay;
482 int32_t field_1E8;
483 int32_t field_1DC;
484 int32_t CombatFlags;
485 int32_t JobId;
486 int32_t Goal;
487 int32_t field_1FC;
488 int32_t field_200;
489 int32_t field_204;
490 int32_t field_208[107]; //its all undocumented through here
491 int32_t CombatState; //I think....
492 int32_t field_8BB;
493 int32_t PatrolPathOSD[10]; //actually another struct. Not needed atm.
494 int32_t PatrolPathPoints[5][64] //64 of another struct
495 int32_t field_DE8[98]; //DE8-F70
496 int32_t CombatStatePtr;
497 int32_t KnowledgeState[4]; //Another struct
498 int32_t field_F84;
499 int32_t AlertDecayTimer;
500 int32_t field_F8C;
501 int32_t field_F90;
502 int32_t InitialAlertLevel; //0 - lull, 1 - low, 2 - medium, 3 - high, 4 - combat
503 int32_t MinimalAlertLevel; //0 - lull, 1 - low, 2 - medium, 3 - high, 4 - combat
504 int32_t StartJobAlertLevel; //0 - lull, 1 - low, 2 - medium, 3 - high, 4 - combat
505 int32_t InvestigatingAlertLevel;//0 - lull, 1 - low, 2 - medium, 3 - high, 4 - combat
506 int32_t StartleTime;
507 int32_t field_FA8;
508 int32_t field_FAC;
509 int32_t field_FB0;
510 int32_t PursuitStrongLow;
511 int32_t PursuitWeakLow;
512 int32_t PursuitStrongHigh;
513 int32_t PursuitWeakHigh;
514 int32_t Pursuit5;
515 int32_t field_FC8[16];
516 int32_t AlarmGroups; //a bitset
517 int32_t field_FDC[16]; //FDC-F68
518 int32_t field_F68;
519 int32_t DazeTimer;
520 int32_t field_1024[16]; //1024-1064
521 int32_t MeleePtr; //probably MELE. Looks somewhat important.
522 int32_t field_106C[270]; //106C-14A4 skipping lots of junk and a little pathfinding stuff that we might want later.
523 int32_t MovementModifiers; //hopefully sprinting, pistol, rifle, etc.
524 int32_t field_14B4[101]; //14B4-1648 Glossing over a few other things we don't need having to do with AI direction.
525 int32_t BossShieldPower; //a multiplier? or just a flag? who knows
526 int32_t field_1668[6];
527 int32_t CurrentConsoleActionMarker; //not sure.
528 int32_t field_1684[7]; // done. hopefully i didnt screw this up somewhere.
529} Character;
530
[428]531enum {
532 team_konoko,
533 team_tctf,
534 team_syndicate,
535 team_neutral,
536 team_securityguard,
537 team_rougekonoko,
538 team_switzerland,
539 team_syndicateaccessory,
540};
541
[434]542
543int chr_isplayer = 0x00000001; //is player character
544int chr_randomskin = 0x00000002; //gets random skin from ONCV
545int chr_notprespawned = 0x00000004; //isn't spawned at level creation
546int chr_noncombatant = 0x00000008; //doesn't fight
547int chr_multispawnable = 0x00000010; //can spawn up to 5 without forcing
548int chr_unknown = 0x00000020; //
549int chr_unkillable = 0x00000040; //can only be brought to 1 hp
550int chr_superammo = 0x00000080; //infinite ammo
551int chr_omniscient = 0x00000100; //touchofdeath
552int chr_haslsi = 0x00000200; //drops an lsi
553int chr_boss = 0x00000400; //is a boss character
554int chr_upgradedifficulty = 0x00000800; //upgrade the difficulty if you play on med\hard
555int chr_noautodrop = 0x00001000; //uses drop fields instead of has fields on death
556
[432]557int16_t ONICALL ONrGameState_NewCharacter(CharacterObject* CHAR, void* AISA, void* flag, int* list_location);
[435]558//int16_t ONICALL ONrGameState_GetPlayerCharacter();
[428]559
[435]560
[428]561#endif
Note: See TracBrowser for help on using the repository browser.