source: Daodan/src/Oni_Character.h@ 437

Last change on this file since 437 was 437, checked in by rossy, 15 years ago

Daodan_Console

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