source: Daodan/src/Oni_Character.h@ 483

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

Added AI deafness for Shinobi mode
---
Turned on gl mod by default
--
Fixed gl mod
Fixed gamma ramp
---
Added typedef onibool
Added variable ai2_deaf

File size: 18.7 KB
Line 
1#pragma once
2#ifndef ONI_CHARACTER_H
3#define ONI_CHARACTER_H
4
5#include "Oni.h"
6#include <stdint.h>
7#include <stdbool.h>
8
9typedef struct {
10 float X;
11 float Y;
12 float Z;
13} Vector3; //probably move to utilities...
14
15typedef struct {
16 float X;
17 float Y;
18 float Z;
19 float W;
20} Quaternion;
21
22typedef struct {
23 float RotationScale[9];
24 Vector3 Translation;
25} Matrix4x3;
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,
86 Action2_Fire3 = 0x100,
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 {
108 int Type; //'CHAR' etc.
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 {
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 {
130 uint32_t Options; //A bitset. Someone had better define these
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;
184
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;
196
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 char hasLSI;
210 char field_1B5;
211 int16_t field_1B6;
212 int16_t ShieldUsed; //Bullet shield given for the char to use
213 int16_t CloakUsed; //Phase Cloak given for the char to use
214 int32_t field_28; //probably bullet shield dropped
215 int32_t DoorKeys; //Lol. We can use this later for other sorts of items.
216} Inventory;
217
218typedef struct { //ActiveCharacter
219 int16_t Number;
220 int16_t field_2; //probably Number is an int32
221 int32_t PhyContext;
222 SphereTreeNode SphereTree1; //probably SphereTree[7]...
223 SphereTreeNode SphereTree3[4];
224 SphereTreeNode SphereTree2[2];
225 int16_t field_B0;
226 int16_t field_B2;
227 int16_t field_B4;
228 int16_t field_B6;
229 Vector3 field_B8;
230 Vector3 AccelerateWith;
231 int32_t field_D0;
232 Vector3 field_D4;
233 int32_t field_E0;
234 int32_t field_E4;
235 int32_t field_E8;
236 int32_t field_EC;
237 float SomePhyPosY;
238 int16_t field_F4;
239 int16_t IsInAirTimer;
240 Vector3 FallingVelocity;
241 Vector3 JumpVelocity;
242 char StartJumpPending;
243 char field_111;
244 int16_t field_112;
245 Vector3 field_114;
246 int32_t LastDamageSourceCharacter;
247 int32_t field_11C;
248 int32_t field_120;
249 int32_t field_124;
250 int32_t field_128;
251 int32_t field_12C;
252 BoundingSphere BoundingSphere_; //fix this name
253 Vector3 field_140;
254 Vector3 field_14C;
255 int32_t field_158;
256 int32_t field_15C;
257 Vector3 Location;
258 int32_t field_16C[6]; //16C-184 ???
259 int32_t AkiraNode;
260 int32_t GraphNode;
261 int32_t PelvisHeight;
262 int32_t MovementStatePtr;
263 int32_t ActiveWeapon; //NOTE: FIGURE OUT THIS MESS OF INVENTORY...
264 int32_t field_198; //maybe weap 3, maybe not...
265 int32_t InventoryWeapon;
266 int16_t field_1A0; //unused?
267 int16_t AmmoUsable; //Ammo given for the char to use
268 int16_t HypoUsable; //Hypo given for the char to use
269 int16_t CellsUsable; //Cells given for the char to use
270 int16_t AmmoDropped; //Ammo the char drops
271 int16_t HypoDropped; //Hypo the char drops
272 int16_t CellsDropped; //Cells the char drops
273 int16_t field_1AE;
274 int16_t InverseHypoRegenRate;
275 int16_t ShieldDropped;
276 int16_t CloakDropped;
277 int16_t field_1B4;
278 int16_t field_1B6;
279 int16_t ShieldUsable;
280 int16_t CloakUsable;
281 int16_t field_1BC[9]; //1BC-1E0
282 int32_t NotIdleStartTime;
283 int32_t TimeToIdle;
284 int32_t field_1E8[1315]; //1E8-1648 what the hell is all this?
285 BoundingBox BoundingBox_; //fix this name
286 int32_t field_1660;
287 int32_t field_1664;
288 int32_t ShieldPower; //Same as Boss Shield Power???
289 int32_t field_166C;
290 int32_t NumberOfKills; //^_^
291 int32_t InflictedDamage; //^_^
292 int32_t field_1678[260]; //1678-1A88 more wtf
293 int32_t field_1A88; //here starts animation junk? It was 4 bools in idb O_o
294 int32_t Executor_AimingDirection; //possibly throw junk?
295 int32_t field_1A98;
296 int32_t field_1A9C;
297 int32_t Executor_ActualMovementMode;
298 int32_t field_1AA4;
299 int32_t field_1AA8;
300 int32_t field_1AAC;
301 int32_t Executor_HasFacingOverride; //a bool...
302 float Executor_AimingSpeed;
303 onibool field_1AB8; //actually a bitset...
304 onibool Executor_HasMoveOverride;
305 int16_t field_1ABA;
306 int32_t field_1ABC;
307 int32_t field_1AC0;
308 int32_t field_1AC4;
309 int32_t Executor_FacingOverride;
310 int32_t Executor_HasAttackOverride; //another bool :P
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_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 onibool FixedParticlesAttached;
366 onibool 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 onibool field_21D8;
403 onibool field_21D9;
404 onibool field_21DA;
405 onibool field_21DB;
406 onibool field_21DC;
407 onibool field_21DD;
408 onibool field_21DE;
409 onibool field_21DF;
410 onibool field_21E0;
411 onibool HasAlternateTrigger;
412 onibool field_21E2;
413 onibool ReleaseTrigger;
414 onibool ReleaseAlternateTrigger;
415 onibool TurningLeft;
416 onibool TurningRight;
417 onibool 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 onibool ShieldParts[19];
430 onibool field_2815; //padding...
431 onibool field_2816;
432 onibool field_2817;
433 int32_t field_2818[8];
434} ActiveCharacter;
435
436//This struct is good.
437typedef struct { //Character
438 char Number;
439 char field_2;
440 int16_t ActiveCharacterIndex;
441 int32_t Flags;
442 int32_t field_8;
443 int32_t ONCC; //change type to ONCC when we get that far...
444 int16_t field_10;
445 int16_t Team;
446 char Name[32];
447 float BodySize;
448 int32_t Health;
449 int32_t MaxHealth;
450 int32_t ASIA_ID; //might be 16 with 2 byte padding
451 int32_t field_44;
452 char ScriptSpawn[32]; //Script function called when char spawns
453 char ScriptDie[32]; //Script function called when char dies
454 char ScriptAware[32]; //Script function called when char detects something
455 char ScriptAlarm[32]; //Script function called when char is alarmed at something
456 char ScriptHurt[32]; //Script function called when char is hurt for the first time
457 char ScriptDefeat[32]; //Script function called when char is at 1 HP
458 char ScriptNoAmmo[32]; //Script function called when char is out of ammo for the first time. Char must have ammo at spawn.
459 char ScriptNoPath[32]; //Script function called when char loses path. Broken.
460 Vector3 Position;
461 Vector3 LastPosition;
462 Vector3 Location;
463 float Facing;
464 float DesiredFacing;
465 float CosmeticFacing;
466 float field_178;
467 float field_17C;
468 float field_180;
469 int32_t BNV;
470 int32_t GraphNode;
471 float PelvisHeight;
472 float field_190;
473 Inventory Inventory_; //is there a better way to do this?
474 Vector3 Velocity;
475 int32_t field_1D0;
476 int32_t Recoil;
477 int32_t field_1D8;
478 int32_t field_1DC;
479 int32_t LastNotIdleGameTime;
480 int32_t IdleDelay;
481 int32_t Type;
482 int32_t field_1EC;
483 int32_t CombatFlags;
484 int32_t JobId;
485 int32_t Goal;
486 int32_t field_1FC;
487 int32_t field_200;
488 int32_t field_204;
489 int32_t field_208[428]; //208-8B8
490 int32_t CombatState; //I think....
491 int32_t field_8BC;
492 int32_t PatrolPathOSD[10]; //actually another struct. Not needed atm.
493 int32_t PatrolPathPoints[5][64]; //64 of another struct
494 int32_t field_DE8[98]; //DE8-F70
495 int32_t CombatStatePtr;
496 int32_t KnowledgeState[4]; //Another struct
497 int32_t field_F84;
498 int32_t AlertDecayTimer;
499 int32_t field_F8C;
500 int32_t field_F90;
501 int32_t InitialAlertLevel; //0 - lull, 1 - low, 2 - medium, 3 - high, 4 - combat
502 int32_t MinimalAlertLevel; //0 - lull, 1 - low, 2 - medium, 3 - high, 4 - combat
503 int32_t StartJobAlertLevel; //0 - lull, 1 - low, 2 - medium, 3 - high, 4 - combat
504 int32_t InvestigatingAlertLevel;//0 - lull, 1 - low, 2 - medium, 3 - high, 4 - combat
505 int32_t StartleTime;
506 int32_t field_FA8;
507 int32_t field_FAC;
508 int32_t field_FB0;
509 int32_t PursuitStrongLow;
510 int32_t PursuitWeakLow;
511 int32_t PursuitStrongHigh;
512 int32_t PursuitWeakHigh;
513 int32_t Pursuit5;
514 int32_t field_FC8[4];
515 int32_t AlarmGroups; //a bitset
516 int32_t field_FDC[17]; //FDC-1020
517 int32_t DazeTimer;
518 int32_t field_1024[17]; //1024-1068
519 int32_t MeleePtr; //probably MELE. Looks somewhat important.
520 int32_t field_106C[270]; //106C-14A4 skipping lots of junk and a little pathfinding stuff that we might want later.
521 int32_t MovementMode;
522 int32_t field_14A8;
523 int32_t field_14AC;
524 int32_t MovementModifiers; //hopefully sprinting, pistol, rifle, etc.
525 int32_t field_14B4[101]; //14B4-1648 Glossing over a few other things we don't need having to do with AI direction.
526 BoundingBox BoundingBox_;
527 int32_t field_1660;
528 int32_t BossShieldPower; //a multiplier? or just a flag? who knows
529 int32_t field_1668[6];
530 int32_t CurrentConsoleActionMarker; //not sure.
531 int32_t field_1684[7];
532} Character;
533
534enum {
535 team_konoko,
536 team_tctf,
537 team_syndicate,
538 team_neutral,
539 team_securityguard,
540 team_rougekonoko,
541 team_switzerland,
542 team_syndicateaccessory,
543};
544
545typedef enum {
546 chr_isplayer = 1 << 0,
547 chr_randomskin = 1 << 1,
548 chr_notprespawned = 1 << 2,
549 chr_noncombatant = 1 << 3,
550 chr_multispawnable = 1 << 4,
551 chr_unkillable = 1 << 5,
552 chr_superammo = 1 << 6,
553 chr_omniscient = 1 << 8,
554 chr_haslsi = 1 << 9,
555 chr_boss = 1 << 10,
556 chr_upgradedifficulty = 1 << 11,
557 chr_noautodrop = 1 << 12,
558 chr_dontaim = 1 << 13,
559 chr_nocollision = 1 << 17,
560 chr_noshadow = 1 << 24,
561 chr_invincible = 1 << 25,
562 chr_bossshield = 1 << 30,
563 chr_weaponimmune = 1 << 31,
564} chr_flags;
565/*
566enum {
567chr_isplayer = 0x00000001, //is player character
568chr_randomskin = 0x00000002, //gets random skin from ONCV
569chr_notprespawned = 0x00000004, //isn't spawned at level creation
570chr_noncombatant = 0x00000008, //doesn't fight
571chr_multispawnable = 0x00000010, //can spawn up to 5 without forcing
572chr_unknown = 0x00000020, //
573chr_unkillable = 0x00000040, //can only be brought to 1 hp
574chr_superammo = 0x00000080, //infinite ammo
575chr_omniscient = 0x00000100, //touchofdeath
576chr_haslsi = 0x00000200, //drops an lsi
577chr_boss = 0x00000400, //is a boss character
578chr_upgradedifficulty = 0x00000800, //upgrade the difficulty if you play on med\hard
579chr_noautodrop = 0x00001000, //uses drop fields instead of has fields on death
580}; //
581*/
582int16_t ONICALL ONrGameState_NewCharacter(CharacterObject* CHAR, void* AISA, void* flag, int* list_location);
583int32_t* ONICALL ONrGetActiveCharacter(void* CharacterPtr);
584//int16_t ONICALL ONrGameState_GetPlayerCharacter();
585
586//probably need to name these better.
587#define char_unkillable (1 << 5)
588#define char_superammo (1 << 6)
589#define char_unstoppable (1 << 8)
590#define char_deathlock (1 << 10)
591#define char_dontaim (1 << 13)
592#define char_nocollision (1 << 17)
593#define char_noshadow (1 << 24)
594#define char_invincible (1 << 25)
595#define char_bossshield (1 << 30)
596#define char_weaponimmune (1 << 31)
597
598#endif
Note: See TracBrowser for help on using the repository browser.