All Doom 3 AI is now native.

This commit is contained in:
Justin Marshall
2026-05-23 14:19:48 -07:00
parent 654e209e95
commit 027067a122
132 changed files with 61205 additions and 240 deletions
+393 -157
View File
@@ -44,12 +44,11 @@ idAnimState::idAnimState
=====================
*/
idAnimState::idAnimState() {
self = NULL;
animator = NULL;
thread = NULL;
idleAnim = true;
disabled = true;
channel = ANIMCHANNEL_ALL;
self = NULL;
animator = NULL;
idleAnim = true;
disabled = true;
channel = ANIMCHANNEL_ALL;
animBlendFrames = 0;
lastAnimBlendFrames = 0;
}
@@ -60,7 +59,6 @@ idAnimState::~idAnimState
=====================
*/
idAnimState::~idAnimState() {
delete thread;
}
/*
@@ -68,22 +66,24 @@ idAnimState::~idAnimState() {
idAnimState::Save
=====================
*/
void idAnimState::Save( idSaveGame *savefile ) const {
void idAnimState::Save(idSaveGame* savefile) const {
savefile->WriteObject( self );
savefile->WriteBool(idleAnim);
savefile->WriteInt(animBlendFrames);
savefile->WriteInt(lastAnimBlendFrames);
savefile->WriteObject(self);
// Save the entity owner of the animator
savefile->WriteObject( animator->GetEntity() );
savefile->WriteObject(animator->GetEntity());
savefile->WriteObject( thread );
savefile->WriteInt(channel);
savefile->WriteBool(disabled);
savefile->WriteString( state );
savefile->WriteInt( animBlendFrames );
savefile->WriteInt( lastAnimBlendFrames );
savefile->WriteInt( channel );
savefile->WriteBool( idleAnim );
savefile->WriteBool( disabled );
// RAVEN BEGIN
// abahr:
stateThread.Save(savefile);
// RAVEN END
}
/*
@@ -91,24 +91,27 @@ void idAnimState::Save( idSaveGame *savefile ) const {
idAnimState::Restore
=====================
*/
void idAnimState::Restore( idRestoreGame *savefile ) {
savefile->ReadObject( reinterpret_cast<idClass *&>( self ) );
void idAnimState::Restore(idRestoreGame* savefile) {
idEntity *animowner;
savefile->ReadObject( reinterpret_cast<idClass *&>( animowner ) );
if ( animowner ) {
savefile->ReadBool(idleAnim);
savefile->ReadInt(animBlendFrames);
savefile->ReadInt(lastAnimBlendFrames);
savefile->ReadObject(reinterpret_cast<idClass*&>(self));
idEntity* animowner;
savefile->ReadObject(reinterpret_cast<idClass*&>(animowner));
if (animowner) {
animator = animowner->GetAnimator();
}
savefile->ReadObject( reinterpret_cast<idClass *&>( thread ) );
savefile->ReadInt(channel);
savefile->ReadBool(disabled);
savefile->ReadString( state );
savefile->ReadInt( animBlendFrames );
savefile->ReadInt( lastAnimBlendFrames );
savefile->ReadInt( channel );
savefile->ReadBool( idleAnim );
savefile->ReadBool( disabled );
// RAVEN BEGIN
// abahr:
stateThread.Restore(savefile, self);
// RAVEN END
}
/*
@@ -116,19 +119,18 @@ void idAnimState::Restore( idRestoreGame *savefile ) {
idAnimState::Init
=====================
*/
void idAnimState::Init( idActor *owner, idAnimator *_animator, int animchannel ) {
assert( owner );
assert( _animator );
// RAVEN BEGIN
// bdube: converted self to entity ptr so any entity can use it
void idAnimState::Init(idEntity* owner, idAnimator* _animator, int animchannel) {
// RAVEN BEGIN
assert(owner);
assert(_animator);
self = owner;
animator = _animator;
channel = animchannel;
if ( !thread ) {
thread = new idThread();
thread->ManualDelete();
}
thread->EndThread();
thread->ManualControl();
stateThread.SetName(va("%s_anim_%d", owner->GetName(), animchannel));
stateThread.SetOwner(owner);
}
/*
@@ -136,9 +138,20 @@ void idAnimState::Init( idActor *owner, idAnimator *_animator, int animchannel )
idAnimState::Shutdown
=====================
*/
void idAnimState::Shutdown( void ) {
delete thread;
thread = NULL;
void idAnimState::Shutdown(void) {
stateThread.Clear(true);
}
/*
=====================
idAnimState::PostState
=====================
*/
void idAnimState::PostState(const char* statename, int blendFrames, int delay, int flags) {
if (SRESULT_OK != stateThread.PostState(statename, blendFrames, delay, flags)) {
gameLocal.Error("Could not find state function '%s' for entity '%s'", statename, self->GetName());
}
disabled = false;
}
/*
@@ -146,29 +159,15 @@ void idAnimState::Shutdown( void ) {
idAnimState::SetState
=====================
*/
void idAnimState::SetState( const char *statename, int blendFrames ) {
const function_t *func;
func = self->scriptObject.GetFunction( statename );
if ( !func ) {
assert( 0 );
gameLocal.Error( "Can't find function '%s' in object '%s'", statename, self->scriptObject.GetTypeName() );
void idAnimState::SetState(const char* statename, int blendFrames, int flags) {
if (SRESULT_OK != stateThread.SetState(statename, blendFrames, 0, flags)) {
gameLocal.Error("Could not find state function '%s' for entity '%s'", statename, self->GetName());
}
state = statename;
disabled = false;
animBlendFrames = blendFrames;
lastAnimBlendFrames = blendFrames;
thread->CallFunction( self, func, true );
animBlendFrames = blendFrames;
lastAnimBlendFrames = blendFrames;
disabled = false;
idleAnim = false;
if ( ai_debugScript.GetInteger() == self->entityNumber ) {
gameLocal.Printf( "%d: %s: Animstate: %s\n", gameLocal.time, self->name.c_str(), state.c_str() );
}
}
/*
@@ -176,9 +175,9 @@ void idAnimState::SetState( const char *statename, int blendFrames ) {
idAnimState::StopAnim
=====================
*/
void idAnimState::StopAnim( int frames ) {
void idAnimState::StopAnim(int frames) {
animBlendFrames = 0;
animator->Clear( channel, gameLocal.time, FRAME2MS( frames ) );
animator->Clear(channel, gameLocal.time, FRAME2MS(frames));
}
/*
@@ -186,9 +185,9 @@ void idAnimState::StopAnim( int frames ) {
idAnimState::PlayAnim
=====================
*/
void idAnimState::PlayAnim( int anim ) {
if ( anim ) {
animator->PlayAnim( channel, anim, gameLocal.time, FRAME2MS( animBlendFrames ) );
void idAnimState::PlayAnim(int anim) {
if (anim) {
animator->PlayAnim(channel, anim, gameLocal.time, FRAME2MS(animBlendFrames));
}
animBlendFrames = 0;
}
@@ -198,9 +197,9 @@ void idAnimState::PlayAnim( int anim ) {
idAnimState::CycleAnim
=====================
*/
void idAnimState::CycleAnim( int anim ) {
if ( anim ) {
animator->CycleAnim( channel, anim, gameLocal.time, FRAME2MS( animBlendFrames ) );
void idAnimState::CycleAnim(int anim) {
if (anim) {
animator->CycleAnim(channel, anim, gameLocal.time, FRAME2MS(animBlendFrames));
}
animBlendFrames = 0;
}
@@ -210,7 +209,7 @@ void idAnimState::CycleAnim( int anim ) {
idAnimState::BecomeIdle
=====================
*/
void idAnimState::BecomeIdle( void ) {
void idAnimState::BecomeIdle(void) {
idleAnim = true;
}
@@ -219,7 +218,7 @@ void idAnimState::BecomeIdle( void ) {
idAnimState::Disabled
=====================
*/
bool idAnimState::Disabled( void ) const {
bool idAnimState::Disabled(void) const {
return disabled;
}
@@ -228,16 +227,18 @@ bool idAnimState::Disabled( void ) const {
idAnimState::AnimDone
=====================
*/
bool idAnimState::AnimDone( int blendFrames ) const {
bool idAnimState::AnimDone(int blendFrames) const {
int animDoneTime;
animDoneTime = animator->CurrentAnim( channel )->GetEndTime();
if ( animDoneTime < 0 ) {
animDoneTime = animator->CurrentAnim(channel)->GetEndTime();
if (animDoneTime < 0) {
// playing a cycle
return false;
} else if ( animDoneTime - FRAME2MS( blendFrames ) <= gameLocal.time ) {
}
else if (animDoneTime - FRAME2MS(blendFrames) <= gameLocal.time) {
return true;
} else {
}
else {
return false;
}
}
@@ -247,7 +248,7 @@ bool idAnimState::AnimDone( int blendFrames ) const {
idAnimState::IsIdle
=====================
*/
bool idAnimState::IsIdle( void ) const {
bool idAnimState::IsIdle(void) const {
return disabled || idleAnim;
}
@@ -256,12 +257,12 @@ bool idAnimState::IsIdle( void ) const {
idAnimState::GetAnimFlags
=====================
*/
animFlags_t idAnimState::GetAnimFlags( void ) const {
animFlags_t idAnimState::GetAnimFlags(void) const {
animFlags_t flags;
memset( &flags, 0, sizeof( flags ) );
if ( !disabled && !AnimDone( 0 ) ) {
flags = animator->GetAnimFlags( animator->CurrentAnim( channel )->AnimNum() );
memset(&flags, 0, sizeof(flags));
if (!disabled && !AnimDone(0)) {
flags = animator->GetAnimFlags(animator->CurrentAnim(channel)->AnimNum());
}
return flags;
@@ -272,14 +273,11 @@ animFlags_t idAnimState::GetAnimFlags( void ) const {
idAnimState::Enable
=====================
*/
void idAnimState::Enable( int blendFrames ) {
if ( disabled ) {
void idAnimState::Enable(int blendFrames) {
if (disabled) {
disabled = false;
animBlendFrames = blendFrames;
lastAnimBlendFrames = blendFrames;
if ( state.Length() ) {
SetState( state.c_str(), blendFrames );
}
}
}
@@ -288,7 +286,7 @@ void idAnimState::Enable( int blendFrames ) {
idAnimState::Disable
=====================
*/
void idAnimState::Disable( void ) {
void idAnimState::Disable(void) {
disabled = true;
idleAnim = false;
}
@@ -298,18 +296,12 @@ void idAnimState::Disable( void ) {
idAnimState::UpdateState
=====================
*/
bool idAnimState::UpdateState( void ) {
if ( disabled ) {
bool idAnimState::UpdateState(void) {
if (disabled) {
return false;
}
if ( ai_debugScript.GetInteger() == self->entityNumber ) {
thread->EnableDebugInfo();
} else {
thread->DisableDebugInfo();
}
thread->Execute();
stateThread.Execute();
return true;
}
@@ -377,8 +369,8 @@ CLASS_DECLARATION( idAFEntity_Gibbable, idActor )
EVENT( AI_GetPainAnim, idActor::Event_GetPainAnim )
EVENT( AI_SetAnimPrefix, idActor::Event_SetAnimPrefix )
EVENT( AI_StopAnim, idActor::Event_StopAnim )
EVENT( AI_PlayAnim, idActor::Event_PlayAnim )
EVENT( AI_PlayCycle, idActor::Event_PlayCycle )
EVENT( AI_PlayAnim, idActor::Event_PlayAnimScript )
EVENT( AI_PlayCycle, idActor::Event_PlayCycleScript)
EVENT( AI_IdleAnim, idActor::Event_IdleAnim )
EVENT( AI_SetSyncedAnimWeight, idActor::Event_SetSyncedAnimWeight )
EVENT( AI_SetBlendFrames, idActor::Event_SetBlendFrames )
@@ -1315,6 +1307,12 @@ idActor::SetState
void idActor::SetState( const char *statename ) {
const function_t *newState;
if (HasNativeFunction(statename)) {
idStr _stateName = statename;
CallNativeEvent(_stateName);
return;
}
newState = GetScriptFunction( statename );
SetState( newState );
}
@@ -1886,64 +1884,70 @@ void idActor::GetNAVLocation( idNAV *aas, idVec3 &pos, int &areaNum ) const {
idActor::SetAnimState
=====================
*/
void idActor::SetAnimState( int channel, const char *statename, int blendFrames ) {
const function_t *func;
func = scriptObject.GetFunction( statename );
if ( !func ) {
assert( 0 );
gameLocal.Error( "Can't find function '%s' in object '%s'", statename, scriptObject.GetTypeName() );
}
switch( channel ) {
case ANIMCHANNEL_HEAD :
headAnim.SetState( statename, blendFrames );
allowEyeFocus = true;
break;
case ANIMCHANNEL_TORSO :
torsoAnim.SetState( statename, blendFrames );
legsAnim.Enable( blendFrames );
allowPain = true;
allowEyeFocus = true;
void idActor::SetAnimState(int channel, const char* statename, int blendFrames, int flags) {
switch (channel) {
case ANIMCHANNEL_HEAD:
headAnim.GetStateThread().Clear();
break;
case ANIMCHANNEL_LEGS :
legsAnim.SetState( statename, blendFrames );
torsoAnim.Enable( blendFrames );
allowPain = true;
allowEyeFocus = true;
case ANIMCHANNEL_TORSO:
torsoAnim.GetStateThread().Clear();
legsAnim.Enable(blendFrames);
break;
default:
gameLocal.Error( "idActor::SetAnimState: Unknown anim group" );
case ANIMCHANNEL_LEGS:
legsAnim.GetStateThread().Clear();
torsoAnim.Enable(blendFrames);
break;
}
//OnStateChange(channel);
PostAnimState(channel, statename, blendFrames, 0, flags);
}
/*
=====================
idActor::SetAnimState
=====================
*/
void idActor::SetAnimState( int channel, const char *statename, int blendFrames ) {
switch (channel) {
case ANIMCHANNEL_HEAD:
headAnim.GetStateThread().Clear();
break;
case ANIMCHANNEL_TORSO:
torsoAnim.GetStateThread().Clear();
legsAnim.Enable(blendFrames);
break;
case ANIMCHANNEL_LEGS:
legsAnim.GetStateThread().Clear();
torsoAnim.Enable(blendFrames);
break;
}
//OnStateChange(channel);
PostAnimState(channel, statename, blendFrames, 0, 0);
}
/*
=====================
idActor::GetAnimState
=====================
*/
const char *idActor::GetAnimState( int channel ) const {
switch( channel ) {
case ANIMCHANNEL_HEAD :
return headAnim.state;
break;
case ANIMCHANNEL_TORSO :
return torsoAnim.state;
break;
case ANIMCHANNEL_LEGS :
return legsAnim.state;
break;
idAnimState& idActor::GetAnimState(int channel) {
switch (channel) {
case ANIMCHANNEL_LEGS: return legsAnim;
case ANIMCHANNEL_TORSO: return torsoAnim;
case ANIMCHANNEL_HEAD: return headAnim;
default:
gameLocal.Error( "idActor::GetAnimState: Unknown anim group" );
return NULL;
break;
gameLocal.Error("idActor::GetAnimState: Unknown anim channel");
return torsoAnim;
}
}
@@ -1953,27 +1957,36 @@ idActor::InAnimState
=====================
*/
bool idActor::InAnimState( int channel, const char *statename ) const {
switch( channel ) {
case ANIMCHANNEL_HEAD :
if ( headAnim.state == statename ) {
switch (channel) {
case ANIMCHANNEL_HEAD:
{
rvStateThread& stateThread = ((idActor*)this)->headAnim.GetStateThread();
if (stateThread.CurrentState() == statename) {
return true;
}
break;
}
break;
case ANIMCHANNEL_TORSO :
if ( torsoAnim.state == statename ) {
case ANIMCHANNEL_TORSO:
{
rvStateThread& stateThread = ((idActor*)this)->torsoAnim.GetStateThread();
if (stateThread.CurrentState() == statename) {
return true;
}
break;
}
break;
case ANIMCHANNEL_LEGS :
if ( legsAnim.state == statename ) {
case ANIMCHANNEL_LEGS:
{
rvStateThread& stateThread = ((idActor*)this)->legsAnim.GetStateThread();
if (stateThread.CurrentState() == statename) {
return true;
}
break;
}
break;
default:
gameLocal.Error( "idActor::InAnimState: Unknown anim group" );
gameLocal.Error("idActor::InAnimState: Unknown anim group");
break;
}
@@ -2574,12 +2587,159 @@ void idActor::Event_StopAnim( int channel, int frames ) {
}
}
bool idActor::HasAnim(int channel, const char* animname, bool forcePrefix) {
return GetAnim(channel, animname) != NULL;
}
/*
=====================
idActor::PostAnimState
=====================
*/
void idActor::PostAnimState(int channel, const char* statename, int blendFrames, int delay, int flags) {
GetAnimState(channel).PostState(statename, blendFrames, delay, flags);
}
/*
=====================
idActor::GetAnimStateVar
=====================
*/
idAnimState& idActor::GetAnimStateVar(int channel)
{
switch (channel)
{
case ANIMCHANNEL_LEGS:
return legsAnim;
case ANIMCHANNEL_TORSO:
return torsoAnim;
case ANIMCHANNEL_HEAD:
return headAnim;
default:
gameLocal.Error("idActor::GetAnimState: Unknown anim channel");
return torsoAnim;
}
}
/*
=====================
idActor::GetAnimStateVar
=====================
*/
const idAnimState& idActor::GetAnimStateVar(int channel) const
{
switch (channel)
{
case ANIMCHANNEL_LEGS:
return legsAnim;
case ANIMCHANNEL_TORSO:
return torsoAnim;
case ANIMCHANNEL_HEAD:
return headAnim;
default:
gameLocal.Error("idActor::GetAnimState: Unknown anim channel");
return torsoAnim;
}
}
/*
================
idActor::AnimDone
================
*/
bool idActor::AnimDone(int channel, int blendFrames) const
{
return GetAnimStateVar(channel).AnimDone(blendFrames);
}
/*
===============
idActor::Event_PlayAnim
===============
*/
void idActor::Event_PlayAnim( int channel, const char *animname ) {
void idActor::Event_PlayAnim(int channel, const char* animname, int blendFrames) {
animFlags_t flags;
idEntity* headEnt;
int anim;
anim = GetAnim(channel, animname);
if (!anim) {
if ((channel == ANIMCHANNEL_HEAD) && head.GetEntity()) {
gameLocal.DPrintf("missing '%s' animation on '%s' (%s)\n", animname, name.c_str(), spawnArgs.GetString("def_head", ""));
}
else {
gameLocal.DPrintf("missing '%s' animation on '%s' (%s)\n", animname, name.c_str(), GetEntityDefName());
}
idThread::ReturnInt(0);
return;
}
switch (channel) {
case ANIMCHANNEL_HEAD:
headEnt = head.GetEntity();
if (headEnt) {
headAnim.idleAnim = false;
headAnim.PlayAnim(anim);
flags = headAnim.GetAnimFlags();
if (!flags.prevent_idle_override) {
if (torsoAnim.IsIdle()) {
torsoAnim.animBlendFrames = headAnim.lastAnimBlendFrames;
SyncAnimChannels(ANIMCHANNEL_TORSO, ANIMCHANNEL_HEAD, headAnim.lastAnimBlendFrames);
if (legsAnim.IsIdle()) {
legsAnim.animBlendFrames = headAnim.lastAnimBlendFrames;
SyncAnimChannels(ANIMCHANNEL_LEGS, ANIMCHANNEL_HEAD, headAnim.lastAnimBlendFrames);
}
}
}
}
break;
case ANIMCHANNEL_TORSO:
torsoAnim.idleAnim = false;
torsoAnim.PlayAnim(anim);
flags = torsoAnim.GetAnimFlags();
if (!flags.prevent_idle_override) {
if (headAnim.IsIdle()) {
headAnim.animBlendFrames = torsoAnim.lastAnimBlendFrames;
SyncAnimChannels(ANIMCHANNEL_HEAD, ANIMCHANNEL_TORSO, torsoAnim.lastAnimBlendFrames);
}
if (legsAnim.IsIdle()) {
legsAnim.animBlendFrames = torsoAnim.lastAnimBlendFrames;
SyncAnimChannels(ANIMCHANNEL_LEGS, ANIMCHANNEL_TORSO, torsoAnim.lastAnimBlendFrames);
}
}
break;
case ANIMCHANNEL_LEGS:
legsAnim.idleAnim = false;
legsAnim.PlayAnim(anim);
flags = legsAnim.GetAnimFlags();
if (!flags.prevent_idle_override) {
if (torsoAnim.IsIdle()) {
torsoAnim.animBlendFrames = legsAnim.lastAnimBlendFrames;
SyncAnimChannels(ANIMCHANNEL_TORSO, ANIMCHANNEL_LEGS, legsAnim.lastAnimBlendFrames);
if (headAnim.IsIdle()) {
headAnim.animBlendFrames = legsAnim.lastAnimBlendFrames;
SyncAnimChannels(ANIMCHANNEL_HEAD, ANIMCHANNEL_LEGS, legsAnim.lastAnimBlendFrames);
}
}
}
break;
default:
gameLocal.Error("Unknown anim group");
break;
}
idThread::ReturnInt(1);
}
/*
===============
idActor::Event_PlayAnim
===============
*/
void idActor::Event_PlayAnimScript( int channel, const char *animname ) {
animFlags_t flags;
idEntity *headEnt;
int anim;
@@ -2656,10 +2816,10 @@ void idActor::Event_PlayAnim( int channel, const char *animname ) {
/*
===============
idActor::Event_PlayCycle
idActor::Event_PlayCycleScript
===============
*/
void idActor::Event_PlayCycle( int channel, const char *animname ) {
void idActor::Event_PlayCycleScript( int channel, const char *animname ) {
animFlags_t flags;
int anim;
@@ -2728,6 +2888,82 @@ void idActor::Event_PlayCycle( int channel, const char *animname ) {
idThread::ReturnInt( true );
}
/*
===============
idActor::Event_PlayCycle
===============
*/
void idActor::Event_PlayCycle(int channel, const char* animname, int blendFrames) {
animFlags_t flags;
int anim;
anim = GetAnim(channel, animname);
if (!anim) {
if ((channel == ANIMCHANNEL_HEAD) && head.GetEntity()) {
gameLocal.DPrintf("missing '%s' animation on '%s' (%s)\n", animname, name.c_str(), spawnArgs.GetString("def_head", ""));
}
else {
gameLocal.DPrintf("missing '%s' animation on '%s' (%s)\n", animname, name.c_str(), GetEntityDefName());
}
idThread::ReturnInt(false);
return;
}
switch (channel) {
case ANIMCHANNEL_HEAD:
headAnim.idleAnim = false;
headAnim.CycleAnim(anim);
flags = headAnim.GetAnimFlags();
if (!flags.prevent_idle_override) {
if (torsoAnim.IsIdle() && legsAnim.IsIdle()) {
torsoAnim.animBlendFrames = headAnim.lastAnimBlendFrames;
SyncAnimChannels(ANIMCHANNEL_TORSO, ANIMCHANNEL_HEAD, headAnim.lastAnimBlendFrames);
legsAnim.animBlendFrames = headAnim.lastAnimBlendFrames;
SyncAnimChannels(ANIMCHANNEL_LEGS, ANIMCHANNEL_HEAD, headAnim.lastAnimBlendFrames);
}
}
break;
case ANIMCHANNEL_TORSO:
torsoAnim.idleAnim = false;
torsoAnim.CycleAnim(anim);
flags = torsoAnim.GetAnimFlags();
if (!flags.prevent_idle_override) {
if (headAnim.IsIdle()) {
headAnim.animBlendFrames = torsoAnim.lastAnimBlendFrames;
SyncAnimChannels(ANIMCHANNEL_HEAD, ANIMCHANNEL_TORSO, torsoAnim.lastAnimBlendFrames);
}
if (legsAnim.IsIdle()) {
legsAnim.animBlendFrames = torsoAnim.lastAnimBlendFrames;
SyncAnimChannels(ANIMCHANNEL_LEGS, ANIMCHANNEL_TORSO, torsoAnim.lastAnimBlendFrames);
}
}
break;
case ANIMCHANNEL_LEGS:
legsAnim.idleAnim = false;
legsAnim.CycleAnim(anim);
flags = legsAnim.GetAnimFlags();
if (!flags.prevent_idle_override) {
if (torsoAnim.IsIdle()) {
torsoAnim.animBlendFrames = legsAnim.lastAnimBlendFrames;
SyncAnimChannels(ANIMCHANNEL_TORSO, ANIMCHANNEL_LEGS, legsAnim.lastAnimBlendFrames);
if (headAnim.IsIdle()) {
headAnim.animBlendFrames = legsAnim.lastAnimBlendFrames;
SyncAnimChannels(ANIMCHANNEL_HEAD, ANIMCHANNEL_LEGS, legsAnim.lastAnimBlendFrames);
}
}
}
break;
default:
gameLocal.Error("Unknown anim group");
}
idThread::ReturnInt(true);
}
/*
===============
idActor::Event_IdleAnim
@@ -3014,7 +3250,7 @@ idActor::Event_GetAnimState
void idActor::Event_GetAnimState( int channel ) {
const char *state;
state = GetAnimState( channel );
state = GetAnimState(channel).GetStateThread().CurrentState();
idThread::ReturnString( state );
}
+50 -26
View File
@@ -57,39 +57,47 @@ class idDeclParticle;
class idAnimState {
public:
bool idleAnim;
idStr state;
int animBlendFrames;
int lastAnimBlendFrames; // allows override anims to blend based on the last transition time
public:
idAnimState();
~idAnimState();
idAnimState();
~idAnimState();
void Save( idSaveGame *savefile ) const;
void Restore( idRestoreGame *savefile );
void Save(idSaveGame* savefile) const;
void Restore(idRestoreGame* savefile);
void Init( idActor *owner, idAnimator *_animator, int animchannel );
void Shutdown( void );
void SetState( const char *name, int blendFrames );
void StopAnim( int frames );
void PlayAnim( int anim );
void CycleAnim( int anim );
void BecomeIdle( void );
bool UpdateState( void );
bool Disabled( void ) const;
void Enable( int blendFrames );
void Disable( void );
bool AnimDone( int blendFrames ) const;
bool IsIdle( void ) const;
animFlags_t GetAnimFlags( void ) const;
void Init(idEntity* owner, idAnimator* _animator, int animchannel);
void Shutdown(void);
void SetState(const char* name, int blendFrames, int flags = 0);
void PostState(const char* name, int blendFrames = 0, int delay = 0, int flags = 0);
void StopAnim(int frames);
void PlayAnim(int anim);
void CycleAnim(int anim);
void BecomeIdle(void);
bool UpdateState(void);
bool Disabled(void) const;
void Enable(int blendFrames);
void Disable(void);
bool AnimDone(int blendFrames) const;
bool IsIdle(void) const;
animFlags_t GetAnimFlags(void) const;
rvStateThread& GetStateThread(void);
idAnimator* GetAnimator(void) const { return animator; };
private:
idActor * self;
idAnimator * animator;
idThread * thread;
// RAVEN BEGIN
// bdube: converted self to entity ptr so any entity can use it
idEntity* self;
// RAVEN END
idAnimator* animator;
int channel;
bool disabled;
rvStateThread stateThread;
};
class idAttachInfo {
@@ -106,6 +114,8 @@ typedef struct {
class idActor : public idAFEntity_Gibbable {
public:
friend class rvmAIObject;
CLASS_PROTOTYPE( idActor );
int team;
@@ -135,6 +145,10 @@ public:
void CheckBlink( void );
void SetAnimState(int channel, const char* statename, int blendFrames, int flags);
void PostAnimState(int channel, const char* statename, int blendFrames, int delay = 0, int flags = 0);
void StopAnimState(int channel);
virtual bool GetPhysicsToVisualTransform( idVec3 &origin, idMat3 &axis );
virtual bool GetPhysicsToSoundTransform( idVec3 &origin, idMat3 &axis );
@@ -198,7 +212,7 @@ public:
int GetAnim( int channel, const char *name );
void UpdateAnimState( void );
void SetAnimState( int channel, const char *name, int blendFrames );
const char * GetAnimState( int channel ) const;
idAnimState& GetAnimState(int channel);
bool InAnimState( int channel, const char *name ) const;
const char * WaitState( void ) const;
void SetWaitState( const char *_waitstate );
@@ -270,7 +284,10 @@ protected:
// copies animation from body to head joints
void CopyJointsFromBodyToHead( void );
private:
void Event_PlayAnim(int channel, const char* animname, int blendFrames);
void Event_PlayCycle(int channel, const char* animname, int blendFrames);
bool HasAnim(int channel, const char* animname, bool forcePrefix);
protected:
void SyncAnimChannels( int channel, int syncToChannel, int blendFrames );
void FinishSetup( void );
void SetupHead( void );
@@ -290,8 +307,8 @@ private:
void Event_EnablePain( void );
void Event_GetPainAnim( void );
void Event_StopAnim( int channel, int frames );
void Event_PlayAnim( int channel, const char *name );
void Event_PlayCycle( int channel, const char *name );
void Event_PlayAnimScript( int channel, const char *name );
void Event_PlayCycleScript( int channel, const char *name );
void Event_IdleAnim( int channel, const char *name );
void Event_SetSyncedAnimWeight( int channel, int anim, float weight );
void Event_OverrideAnim( int channel );
@@ -316,6 +333,13 @@ private:
void Event_SetState( const char *name );
void Event_GetState( void );
void Event_GetHead( void );
idAnimState& GetAnimStateVar(int channel);
const idAnimState& GetAnimStateVar(int channel) const;
};
ID_INLINE rvStateThread& idAnimState::GetStateThread(void) {
return stateThread;
}
#endif /* !__GAME_ACTOR_H__ */
+4
View File
@@ -1584,6 +1584,10 @@ void idPlayer::Spawn( void ) {
#endif
}
}
// Start in idle
SetAnimState(ANIMCHANNEL_TORSO, "Torso_Idle", 0);
SetAnimState(ANIMCHANNEL_LEGS, "Legs_Idle", 0);
}
/*
+36
View File
@@ -695,6 +695,42 @@ public:
void Event_LevelTrigger( void );
void Event_Gibbed( void );
void Event_GetIdealWeapon( void );
stateResult_t Wait_Alive(stateParms_t* parms);
stateResult_t Wait_ReloadAnim(stateParms_t* parms);
stateResult_t Torso_Idle(stateParms_t* parms);
stateResult_t Torso_IdleThink(stateParms_t* parms);
stateResult_t Torso_Teleport(stateParms_t* parms);
stateResult_t Torso_RaiseWeapon(stateParms_t* parms);
stateResult_t Torso_LowerWeapon(stateParms_t* parms);
stateResult_t Torso_Fire(stateParms_t* parms);
stateResult_t Torso_Fire_Windup(stateParms_t* parms);
stateResult_t Torso_Reload(stateParms_t* parms);
stateResult_t Torso_Pain(stateParms_t* parms);
stateResult_t Torso_Dead(stateParms_t* parms);
stateResult_t Torso_Emote(stateParms_t* parms);
stateResult_t Legs_Idle(stateParms_t* parms);
stateResult_t Legs_Run_Forward(stateParms_t* parms);
stateResult_t Legs_Run_Backward(stateParms_t* parms);
stateResult_t Legs_Run_Left(stateParms_t* parms);
stateResult_t Legs_Run_Right(stateParms_t* parms);
stateResult_t Legs_Walk_Forward(stateParms_t* parms);
stateResult_t Legs_Walk_Backward(stateParms_t* parms);
stateResult_t Legs_Walk_Left(stateParms_t* parms);
stateResult_t Legs_Walk_Right(stateParms_t* parms);
stateResult_t Legs_Crouch(stateParms_t* parms);
stateResult_t Legs_Uncrouch(stateParms_t* parms);
stateResult_t Legs_Crouch_Idle(stateParms_t* parms);
stateResult_t Legs_Crouch_Forward(stateParms_t* parms);
stateResult_t Legs_Crouch_Backward(stateParms_t* parms);
stateResult_t Legs_Jump(stateParms_t* parms);
stateResult_t Legs_Fall(stateParms_t* parms);
stateResult_t Legs_Land(stateParms_t* parms);
stateResult_t Legs_Dead(stateParms_t* parms);
bool IsLegsIdle(bool crouching) const;
};
ID_INLINE bool idPlayer::IsReady( void ) {
+913
View File
@@ -0,0 +1,913 @@
// Player_Anim.cpp
//
#include "precompiled.h"
#pragma hdrstop
#include "Game_local.h"
/*
================
idPlayer::Torso_Idle
================
*/
stateResult_t idPlayer::Torso_Idle(stateParms_t* parms) {
if (SRESULT_WAIT == Torso_IdleThink(parms)) {
Event_PlayCycle(ANIMCHANNEL_TORSO, "idle", /* parms->blendFrames */ 0);
PostAnimState(ANIMCHANNEL_TORSO, "Torso_IdleThink", /* parms->blendFrames */ 0);
}
return SRESULT_DONE;
}
/*
================
idPlayer::Torso_IdleThink
================
*/
stateResult_t idPlayer::Torso_IdleThink(stateParms_t* parms) {
if (AI_TELEPORT) {
PostAnimState(ANIMCHANNEL_TORSO, "Torso_Teleport", 0);
return SRESULT_DONE;
}
if (AI_WEAPON_FIRED) {
PostAnimState(ANIMCHANNEL_TORSO, "Torso_Fire", 0);
return SRESULT_DONE;
}
//if (AI_ATTACK_HELD && weapon && weapon->wfl.hasWindupAnim) {
// PostAnimState(ANIMCHANNEL_TORSO, "Torso_Fire_Windup", 0);
// return SRESULT_DONE;
//}
if (AI_ATTACK_HELD && HasAnim(ANIMCHANNEL_TORSO, "startfire", false)) {
PostAnimState(ANIMCHANNEL_TORSO, "Torso_Fire_StartFire", 2);
return SRESULT_DONE;
}
if (AI_PAIN) {
PostAnimState(ANIMCHANNEL_TORSO, "Torso_Pain", 0);
return SRESULT_DONE;
}
//if (emote != PE_NONE) {
// PostAnimState(ANIMCHANNEL_TORSO, "Torso_Emote", 5);
// return SRESULT_DONE;
//}
return SRESULT_WAIT;
}
/*
================
idPlayer::Torso_Teleport
================
*/
stateResult_t idPlayer::Torso_Teleport(stateParms_t* parms) {
enum {
STAGE_INIT,
STAGE_WAIT
};
switch (parms->stage) {
case STAGE_INIT:
AI_TELEPORT = false;
Event_PlayAnim(ANIMCHANNEL_TORSO, "teleport", /* parms->blendFrames */ 0);
SRESULT_STAGE(STAGE_WAIT);
case STAGE_WAIT:
if (AnimDone(ANIMCHANNEL_TORSO, 4)) {
PostAnimState(ANIMCHANNEL_TORSO, "Torso_Idle", 4);
return SRESULT_DONE;
}
return SRESULT_WAIT;
}
return SRESULT_ERROR;
}
/*
================
idPlayer::Torso_RaiseWeapon
================
*/
stateResult_t idPlayer::Torso_RaiseWeapon(stateParms_t* parms) {
Event_PlayAnim(ANIMCHANNEL_TORSO, "raise", /* parms->blendFrames */ 0);
PostAnimState(ANIMCHANNEL_TORSO, "Wait_TorsoAnim", 3);
PostAnimState(ANIMCHANNEL_TORSO, "Torso_Idle", 3);
return SRESULT_DONE;
}
/*
================
idPlayer::Torso_LowerWeapon
================
*/
stateResult_t idPlayer::Torso_LowerWeapon(stateParms_t* parms) {
Event_PlayAnim(ANIMCHANNEL_TORSO, "lower", /* parms->blendFrames */ 0);
PostAnimState(ANIMCHANNEL_TORSO, "Wait_TorsoAnim", 3);
return SRESULT_DONE;
}
/*
================
idPlayer::Torso_Fire
================
*/
stateResult_t idPlayer::Torso_Fire(stateParms_t* parms) {
enum {
TORSO_FIRE_INIT,
TORSO_FIRE_WAIT,
TORSO_FIRE_AIM,
TORSO_FIRE_AIMWAIT
};
switch (parms->stage) {
// Start the firing sequence
case TORSO_FIRE_INIT:
Event_PlayAnim(ANIMCHANNEL_TORSO, "fire", /* parms->blendFrames */ 0);
AI_WEAPON_FIRED = false;
SRESULT_STAGE(TORSO_FIRE_WAIT);
// Wait for the firing animation to be finished
case TORSO_FIRE_WAIT:
if (AI_WEAPON_FIRED) {
PostAnimState(ANIMCHANNEL_TORSO, "Torso_Fire", /* parms->blendFrames */ 0);
return SRESULT_DONE;
}
if (AnimDone(ANIMCHANNEL_TORSO, /* parms->blendFrames */ 0)) {
PostAnimState(ANIMCHANNEL_TORSO, "Torso_Idle", /* parms->blendFrames */ 0);
return SRESULT_DONE;
}
return SRESULT_WAIT;
// Keep the gun aimed but dont shoot
case TORSO_FIRE_AIM:
Event_PlayAnim(ANIMCHANNEL_TORSO, "aim", 3);
SRESULT_STAGE(TORSO_FIRE_AIMWAIT);
// Keep the gun aimed as long as the attack button is held and nothing is firing
case TORSO_FIRE_AIMWAIT:
if (AI_WEAPON_FIRED) {
PostAnimState(ANIMCHANNEL_TORSO, "Torso_Fire", 3);
return SRESULT_DONE;
}
else if (!AI_ATTACK_HELD) {
PostAnimState(ANIMCHANNEL_TORSO, "Torso_Idle", /* parms->blendFrames */ 0);
return SRESULT_DONE;
}
return SRESULT_WAIT;
}
return SRESULT_DONE;
}
/*
================
idPlayer::Torso_Fire_Windup
================
*/
stateResult_t idPlayer::Torso_Fire_Windup(stateParms_t* parms) {
enum {
TORSO_FIRE_INIT,
TORSO_WINDUP_WAIT,
TORSO_FIRE_LOOP,
TORSO_FIRE_WAIT,
TORSO_WINDDOWN_START,
TORSO_WINDDOWN_WAIT,
TORSO_FIRE_AIM,
TORSO_FIRE_AIMWAIT
};
switch (parms->stage) {
// Start the firing sequence
case TORSO_FIRE_INIT:
//jshepard: HACK for now we're blending here, but we need to support charge up anims here
Event_PlayAnim(ANIMCHANNEL_TORSO, "fire", 4);
AI_WEAPON_FIRED = false;
SRESULT_STAGE(TORSO_WINDUP_WAIT);
// wait for the windup anim to end, or the attackHeld to be false.
case TORSO_WINDUP_WAIT:
if (!AI_ATTACK_HELD) {
SRESULT_STAGE(TORSO_WINDDOWN_START);
}
if (AnimDone(ANIMCHANNEL_TORSO, /* parms->blendFrames */ 0)) {
SRESULT_STAGE(TORSO_FIRE_LOOP);
}
return SRESULT_WAIT;
// play the firing loop
case TORSO_FIRE_LOOP:
if (!AI_ATTACK_HELD) {
SRESULT_STAGE(TORSO_WINDDOWN_START);
}
Event_PlayAnim(ANIMCHANNEL_TORSO, "fire", /* parms->blendFrames */ 0);
SRESULT_STAGE(TORSO_FIRE_WAIT);
// loop the fire anim
case TORSO_FIRE_WAIT:
if (!AI_ATTACK_HELD) {
SRESULT_STAGE(TORSO_WINDDOWN_START);
}
//loop the attack anim
if (AnimDone(ANIMCHANNEL_TORSO, /* parms->blendFrames */ 0)) {
Event_PlayAnim(ANIMCHANNEL_TORSO, "fire", /* parms->blendFrames */ 0);
SRESULT_STAGE(TORSO_FIRE_WAIT);
}
return SRESULT_WAIT;
//wind down
case TORSO_WINDDOWN_START:
//jshepard: HACK just blend back into idle for now, we could support winddown anims here.
PostAnimState(ANIMCHANNEL_TORSO, "Torso_Idle", 4);
AI_WEAPON_FIRED = false;
return SRESULT_DONE;
}
return SRESULT_DONE;
}
/*
================
idPlayer::Torso_Reload
================
*/
stateResult_t idPlayer::Torso_Reload(stateParms_t* parms) {
enum {
TORSO_RELOAD_START,
TORSO_RELOAD_STARTWAIT,
TORSO_RELOAD_LOOP,
TORSO_RELOAD_LOOPWAIT,
TORSO_RELOAD_WAIT,
TORSO_RELOAD_END
};
switch (parms->stage) {
// Start the reload by either playing the reload animation or the reload_start animation
case TORSO_RELOAD_START:
if (HasAnim(ANIMCHANNEL_TORSO, "reload_start", false)) {
Event_PlayAnim(ANIMCHANNEL_TORSO, "reload_start", /* parms->blendFrames */ 0);
SRESULT_STAGE(TORSO_RELOAD_STARTWAIT);
}
Event_PlayAnim(ANIMCHANNEL_TORSO, "reload", /* parms->blendFrames */ 0);
SRESULT_STAGE(TORSO_RELOAD_WAIT);
// Wait for the reload_start animation to finish and transition to reload_loop
case TORSO_RELOAD_STARTWAIT:
if (AnimDone(ANIMCHANNEL_TORSO, 0)) {
SRESULT_STAGE(TORSO_RELOAD_LOOP);
}
else if (AI_WEAPON_FIRED) {
PostAnimState(ANIMCHANNEL_TORSO, "Torso_Idle", 3);
return SRESULT_DONE;
}
return SRESULT_WAIT;
// Play a single reload from the reload loop
case TORSO_RELOAD_LOOP:
if (!AI_RELOAD) {
SRESULT_STAGE(TORSO_RELOAD_END);
}
Event_PlayAnim(ANIMCHANNEL_TORSO, "reload_loop", 0);
SRESULT_STAGE(TORSO_RELOAD_LOOPWAIT);
// Wait for the looping reload to finish and either start a new one or end the reload
case TORSO_RELOAD_LOOPWAIT:
if (AnimDone(ANIMCHANNEL_TORSO, 0)) {
SRESULT_STAGE(TORSO_RELOAD_LOOP);
}
else if (AI_WEAPON_FIRED) {
PostAnimState(ANIMCHANNEL_TORSO, "Torso_Idle", 3);
return SRESULT_DONE;
}
return SRESULT_WAIT;
// End the reload
case TORSO_RELOAD_END:
if (AI_WEAPON_FIRED) {
PostAnimState(ANIMCHANNEL_TORSO, "Torso_Idle", 3);
return SRESULT_DONE;
}
Event_PlayAnim(ANIMCHANNEL_TORSO, "reload_end", 3);
SRESULT_STAGE(TORSO_RELOAD_WAIT);
// Wait for reload to finish (called by both reload_end and reload)
case TORSO_RELOAD_WAIT:
if (AI_WEAPON_FIRED || AnimDone(ANIMCHANNEL_TORSO, 3)) {
PostAnimState(ANIMCHANNEL_TORSO, "Torso_Idle", 3);
return SRESULT_DONE;
}
return SRESULT_WAIT;
}
return SRESULT_DONE;
}
/*
================
idPlayer::Torso_Pain
================
*/
stateResult_t idPlayer::Torso_Pain(stateParms_t* parms) {
Event_PlayAnim(ANIMCHANNEL_TORSO, painAnim.Length() ? painAnim : "pain", /* parms->blendFrames */ 0);
PostAnimState(ANIMCHANNEL_TORSO, "Wait_TorsoAnim", 4);
PostAnimState(ANIMCHANNEL_TORSO, "Torso_Idle", 4);
return SRESULT_DONE;
}
/*
================
idPlayer::Torso_Dead
================
*/
stateResult_t idPlayer::Torso_Dead(stateParms_t* parms) {
PostAnimState(ANIMCHANNEL_TORSO, "Wait_Alive", 0);
PostAnimState(ANIMCHANNEL_TORSO, "Torso_Idle", 0);
return SRESULT_DONE;
}
/*
================
idPlayer::Torso_Emote
================
*/
stateResult_t idPlayer::Torso_Emote(stateParms_t* parms) {
#if 0
enum {
STAGE_INIT,
STAGE_WAIT
};
switch (parms->stage) {
case STAGE_INIT:
if (emote == PE_GRAB_A) {
Event_PlayAnim(ANIMCHANNEL_TORSO, "grab_a", /* parms->blendFrames */ 0);
}
else if (emote == PE_GRAB_B) {
Event_PlayAnim(ANIMCHANNEL_TORSO, "grab_b", /* parms->blendFrames */ 0);
}
else if (emote == PE_SALUTE) {
Event_PlayAnim(ANIMCHANNEL_TORSO, "salute", /* parms->blendFrames */ 0);
}
else if (emote == PE_CHEER) {
Event_PlayAnim(ANIMCHANNEL_TORSO, "cheer", /* parms->blendFrames */ 0);
}
else if (emote == PE_TAUNT) {
Event_PlayAnim(ANIMCHANNEL_TORSO, "taunt", /* parms->blendFrames */ 0);
}
emote = PE_NONE;
SRESULT_STAGE(STAGE_WAIT);
case STAGE_WAIT:
if (AnimDone(ANIMCHANNEL_TORSO, /* parms->blendFrames */ 0)) {
PostAnimState(ANIMCHANNEL_TORSO, "Torso_Idle", /* parms->blendFrames */ 0);
return SRESULT_DONE;
}
return SRESULT_WAIT;
}
return SRESULT_ERROR;
#else
gameLocal.Error("Not implemented!");
return SRESULT_ERROR;
#endif
}
/*
===============================================================================
AI Leg States
===============================================================================
*/
/*
================
idPlayer::IsLegsIdle
================
*/
bool idPlayer::IsLegsIdle(bool crouching) const {
return ((AI_CROUCH == crouching) && AI_ONGROUND && (AI_FORWARD == AI_BACKWARD) && (AI_STRAFE_LEFT == AI_STRAFE_RIGHT));
}
/*
================
idPlayer::Legs_Idle
================
*/
stateResult_t idPlayer::Legs_Idle(stateParms_t* parms) {
enum {
STAGE_INIT,
STAGE_WAIT
};
switch (parms->stage) {
case STAGE_INIT:
if (AI_CROUCH) {
PostAnimState(ANIMCHANNEL_LEGS, "Legs_Crouch", /* parms->blendFrames */ 0);
return SRESULT_DONE;
}
Event_IdleAnim(ANIMCHANNEL_LEGS, "idle");
SRESULT_STAGE(STAGE_WAIT);
case STAGE_WAIT:
// If now crouching go back to idle so we can transition to crouch
if (AI_CROUCH) {
PostAnimState(ANIMCHANNEL_LEGS, "Legs_Crouch", 4);
return SRESULT_DONE;
}
else if (AI_JUMP) {
PostAnimState(ANIMCHANNEL_LEGS, "Legs_Jump", 4);
return SRESULT_DONE;
}
else if (!AI_ONGROUND) {
PostAnimState(ANIMCHANNEL_LEGS, "Legs_Fall", 4);
return SRESULT_DONE;
}
else if (AI_FORWARD && !AI_BACKWARD) {
if (usercmd.buttons & BUTTON_RUN) {
Event_PlayCycle(ANIMCHANNEL_LEGS, "run_forward", /* parms->blendFrames */ 0);
PostAnimState(ANIMCHANNEL_LEGS, "Legs_Run_Forward", /* parms->blendFrames */ 0);
}
else {
Event_PlayCycle(ANIMCHANNEL_LEGS, "walk", /* parms->blendFrames */ 0);
PostAnimState(ANIMCHANNEL_LEGS, "Legs_Walk_Forward", /* parms->blendFrames */ 0);
}
return SRESULT_DONE;
}
else if (AI_BACKWARD && !AI_FORWARD) {
if (usercmd.buttons & BUTTON_RUN) {
Event_PlayCycle(ANIMCHANNEL_LEGS, "run_backwards", /* parms->blendFrames */ 0);
PostAnimState(ANIMCHANNEL_LEGS, "Legs_Run_Backward", /* parms->blendFrames */ 0);
}
else {
Event_PlayCycle(ANIMCHANNEL_LEGS, "walk_backwards", /* parms->blendFrames */ 0);
PostAnimState(ANIMCHANNEL_LEGS, "Legs_Walk_Backward", /* parms->blendFrames */ 0);
}
return SRESULT_DONE;
}
else if (AI_STRAFE_LEFT && !AI_STRAFE_RIGHT) {
if (usercmd.buttons & BUTTON_RUN) {
Event_PlayCycle(ANIMCHANNEL_LEGS, "run_strafe_left", /* parms->blendFrames */ 0);
PostAnimState(ANIMCHANNEL_LEGS, "Legs_Run_Left", /* parms->blendFrames */ 0);
}
else {
Event_PlayCycle(ANIMCHANNEL_LEGS, "walk_left", /* parms->blendFrames */ 0);
PostAnimState(ANIMCHANNEL_LEGS, "Legs_Walk_Left", /* parms->blendFrames */ 0);
}
return SRESULT_DONE;
}
else if (AI_STRAFE_RIGHT && !AI_STRAFE_LEFT) {
if (usercmd.buttons & BUTTON_RUN) {
Event_PlayCycle(ANIMCHANNEL_LEGS, "run_strafe_right", /* parms->blendFrames */ 0);
PostAnimState(ANIMCHANNEL_LEGS, "Legs_Run_Right", /* parms->blendFrames */ 0);
}
else {
Event_PlayCycle(ANIMCHANNEL_LEGS, "walk_right", /* parms->blendFrames */ 0);
PostAnimState(ANIMCHANNEL_LEGS, "Legs_Walk_Right", /* parms->blendFrames */ 0);
}
return SRESULT_DONE;
}
return SRESULT_WAIT;
}
return SRESULT_ERROR;
}
/*
================
idPlayer::Legs_Crouch_Idle
================
*/
stateResult_t idPlayer::Legs_Crouch_Idle(stateParms_t* parms) {
enum {
STAGE_INIT,
STAGE_WAIT
};
switch (parms->stage) {
case STAGE_INIT:
if (!AI_CROUCH) {
PostAnimState(ANIMCHANNEL_LEGS, "Legs_Uncrouch", /* parms->blendFrames */ 0);
return SRESULT_DONE;
}
Event_PlayCycle(ANIMCHANNEL_LEGS, "crouch", /* parms->blendFrames */ 0);
SRESULT_STAGE(STAGE_WAIT);
case STAGE_WAIT:
if (!AI_CROUCH || AI_JUMP) {
PostAnimState(ANIMCHANNEL_LEGS, "Legs_Uncrouch", 4);
return SRESULT_DONE;
}
else if ((AI_FORWARD && !AI_BACKWARD) || (AI_STRAFE_LEFT != AI_STRAFE_RIGHT)) {
PostAnimState(ANIMCHANNEL_LEGS, "Legs_Crouch_Forward", /* parms->blendFrames */ 0);
return SRESULT_DONE;
}
else if (AI_BACKWARD && !AI_FORWARD) {
PostAnimState(ANIMCHANNEL_LEGS, "Legs_Crouch_Backward", /* parms->blendFrames */ 0);
return SRESULT_DONE;
}
return SRESULT_WAIT;
}
return SRESULT_ERROR;
}
/*
================
idPlayer::Legs_Crouch
================
*/
stateResult_t idPlayer::Legs_Crouch(stateParms_t* parms) {
enum {
STAGE_INIT,
STAGE_WAIT
};
switch (parms->stage) {
case STAGE_INIT:
Event_PlayAnim(ANIMCHANNEL_LEGS, "crouch_down", /* parms->blendFrames */ 0);
SRESULT_STAGE(STAGE_WAIT);
case STAGE_WAIT:
if (!IsLegsIdle(true) || AnimDone(ANIMCHANNEL_LEGS, 4)) {
PostAnimState(ANIMCHANNEL_LEGS, "Legs_Crouch_Idle", /* parms->blendFrames */ 0);
return SRESULT_DONE;
}
return SRESULT_WAIT;
}
return SRESULT_ERROR;
}
/*
================
idPlayer::Legs_Uncrouch
================
*/
stateResult_t idPlayer::Legs_Uncrouch(stateParms_t* parms) {
enum {
STAGE_INIT,
STAGE_WAIT
};
switch (parms->stage) {
case STAGE_INIT:
Event_PlayAnim(ANIMCHANNEL_LEGS, "crouch_up", /* parms->blendFrames */ 0);
SRESULT_STAGE(STAGE_WAIT);
case STAGE_WAIT:
if (!IsLegsIdle(false) || AnimDone(ANIMCHANNEL_LEGS, 4)) {
PostAnimState(ANIMCHANNEL_LEGS, "Legs_Idle", 4);
return SRESULT_DONE;
}
return SRESULT_WAIT;
}
return SRESULT_ERROR;
}
/*
================
idPlayer::Legs_Run_Forward
================
*/
stateResult_t idPlayer::Legs_Run_Forward(stateParms_t* parms) {
if (!AI_JUMP && AI_ONGROUND && !AI_CROUCH && !AI_BACKWARD && AI_FORWARD) {
if (usercmd.buttons & BUTTON_RUN) {
return SRESULT_WAIT;
}
else {
Event_PlayCycle(ANIMCHANNEL_LEGS, "walk", /* parms->blendFrames */ 0);
PostAnimState(ANIMCHANNEL_LEGS, "Legs_Walk_Forward", /* parms->blendFrames */ 0);
return SRESULT_DONE;
}
}
PostAnimState(ANIMCHANNEL_LEGS, "Legs_Idle", /* parms->blendFrames */ 0);
return SRESULT_DONE;
}
/*
================
idPlayer::Legs_Run_Backward
================
*/
stateResult_t idPlayer::Legs_Run_Backward(stateParms_t* parms) {
if (!AI_JUMP && AI_ONGROUND && !AI_CROUCH && !AI_FORWARD && AI_BACKWARD) {
if (usercmd.buttons & BUTTON_RUN) {
return SRESULT_WAIT;
}
else {
Event_PlayCycle(ANIMCHANNEL_LEGS, "walk_backwards", /* parms->blendFrames */ 0);
PostAnimState(ANIMCHANNEL_LEGS, "Legs_Walk_Backward", /* parms->blendFrames */ 0);
return SRESULT_DONE;
}
}
PostAnimState(ANIMCHANNEL_LEGS, "Legs_Idle", /* parms->blendFrames */ 0);
return SRESULT_DONE;
}
/*
================
idPlayer::Legs_Run_Left
================
*/
stateResult_t idPlayer::Legs_Run_Left(stateParms_t* parms) {
if (!AI_JUMP && AI_ONGROUND && !AI_CROUCH && (AI_FORWARD == AI_BACKWARD) && AI_STRAFE_LEFT && !AI_STRAFE_RIGHT) {
if (usercmd.buttons & BUTTON_RUN) {
return SRESULT_WAIT;
}
else {
Event_PlayCycle(ANIMCHANNEL_LEGS, "walk_left", /* parms->blendFrames */ 0);
PostAnimState(ANIMCHANNEL_LEGS, "Legs_Walk_Left", /* parms->blendFrames */ 0);
return SRESULT_DONE;
}
}
PostAnimState(ANIMCHANNEL_LEGS, "Legs_Idle", /* parms->blendFrames */ 0);
return SRESULT_DONE;
}
/*
================
idPlayer::Legs_Run_Right
================
*/
stateResult_t idPlayer::Legs_Run_Right(stateParms_t* parms) {
if (!AI_JUMP && AI_ONGROUND && !AI_CROUCH && (AI_FORWARD == AI_BACKWARD) && AI_STRAFE_RIGHT && !AI_STRAFE_LEFT) {
if (usercmd.buttons & BUTTON_RUN) {
return SRESULT_WAIT;
}
else {
Event_PlayCycle(ANIMCHANNEL_LEGS, "walk_right", /* parms->blendFrames */ 0);
PostAnimState(ANIMCHANNEL_LEGS, "Legs_Walk_Right", /* parms->blendFrames */ 0);
return SRESULT_DONE;
}
}
PostAnimState(ANIMCHANNEL_LEGS, "Legs_Idle", /* parms->blendFrames */ 0);
return SRESULT_DONE;
}
/*
================
idPlayer::Legs_Walk_Forward
================
*/
stateResult_t idPlayer::Legs_Walk_Forward(stateParms_t* parms) {
if (!AI_JUMP && AI_ONGROUND && !AI_CROUCH && !AI_BACKWARD && AI_FORWARD) {
if (!(usercmd.buttons & BUTTON_RUN)) {
return SRESULT_WAIT;
}
else {
Event_PlayCycle(ANIMCHANNEL_LEGS, "run_forward", /* parms->blendFrames */ 0);
PostAnimState(ANIMCHANNEL_LEGS, "Legs_Run_Forward", /* parms->blendFrames */ 0);
return SRESULT_DONE;
}
}
PostAnimState(ANIMCHANNEL_LEGS, "Legs_Idle", /* parms->blendFrames */ 0);
return SRESULT_DONE;
}
/*
================
idPlayer::Legs_Walk_Backward
================
*/
stateResult_t idPlayer::Legs_Walk_Backward(stateParms_t* parms) {
if (!AI_JUMP && AI_ONGROUND && !AI_CROUCH && !AI_FORWARD && AI_BACKWARD) {
if (!(usercmd.buttons & BUTTON_RUN)) {
return SRESULT_WAIT;
}
else {
Event_PlayCycle(ANIMCHANNEL_LEGS, "run_backwards", /* parms->blendFrames */ 0);
PostAnimState(ANIMCHANNEL_LEGS, "Legs_Run_Backward", /* parms->blendFrames */ 0);
return SRESULT_DONE;
}
}
PostAnimState(ANIMCHANNEL_LEGS, "Legs_Idle", /* parms->blendFrames */ 0);
return SRESULT_DONE;
}
/*
================
idPlayer::Legs_Walk_Left
================
*/
stateResult_t idPlayer::Legs_Walk_Left(stateParms_t* parms) {
if (!AI_JUMP && AI_ONGROUND && !AI_CROUCH && (AI_FORWARD == AI_BACKWARD) && AI_STRAFE_LEFT && !AI_STRAFE_RIGHT) {
if (!(usercmd.buttons & BUTTON_RUN)) {
return SRESULT_WAIT;
}
else {
Event_PlayCycle(ANIMCHANNEL_LEGS, "run_strafe_left", /* parms->blendFrames */ 0);
PostAnimState(ANIMCHANNEL_LEGS, "Legs_Run_Left", /* parms->blendFrames */ 0);
return SRESULT_DONE;
}
}
PostAnimState(ANIMCHANNEL_LEGS, "Legs_Idle", /* parms->blendFrames */ 0);
return SRESULT_DONE;
}
/*
================
idPlayer::Legs_Walk_Right
================
*/
stateResult_t idPlayer::Legs_Walk_Right(stateParms_t* parms) {
if (!AI_JUMP && AI_ONGROUND && !AI_CROUCH && (AI_FORWARD == AI_BACKWARD) && AI_STRAFE_RIGHT && !AI_STRAFE_LEFT) {
if (!(usercmd.buttons & BUTTON_RUN)) {
return SRESULT_WAIT;
}
else {
Event_PlayCycle(ANIMCHANNEL_LEGS, "run_strafe_right", /* parms->blendFrames */ 0);
PostAnimState(ANIMCHANNEL_LEGS, "Legs_Run_Right", /* parms->blendFrames */ 0);
return SRESULT_DONE;
}
}
PostAnimState(ANIMCHANNEL_LEGS, "Legs_Idle", /* parms->blendFrames */ 0);
return SRESULT_DONE;
}
/*
================
idPlayer::Legs_Crouch_Forward
================
*/
stateResult_t idPlayer::Legs_Crouch_Forward(stateParms_t* parms) {
enum {
STAGE_INIT,
STAGE_WAIT
};
switch (parms->stage) {
case STAGE_INIT:
Event_PlayCycle(ANIMCHANNEL_LEGS, "crouch_walk", /* parms->blendFrames */ 0);
SRESULT_STAGE(STAGE_WAIT);
case STAGE_WAIT:
if (!AI_JUMP && AI_ONGROUND && AI_CROUCH && ((!AI_BACKWARD && AI_FORWARD) || (AI_STRAFE_LEFT != AI_STRAFE_RIGHT))) {
return SRESULT_WAIT;
}
PostAnimState(ANIMCHANNEL_LEGS, "Legs_Crouch_Idle", 2);
return SRESULT_DONE;
}
return SRESULT_DONE;
}
/*
================
idPlayer::Legs_Crouch_Backward
================
*/
stateResult_t idPlayer::Legs_Crouch_Backward(stateParms_t* parms) {
enum {
STAGE_INIT,
STAGE_WAIT
};
switch (parms->stage) {
case STAGE_INIT:
Event_PlayCycle(ANIMCHANNEL_LEGS, "crouch_walk_backward", /* parms->blendFrames */ 0);
SRESULT_STAGE(STAGE_WAIT);
case STAGE_WAIT:
if (!AI_JUMP && AI_ONGROUND && AI_CROUCH && !AI_FORWARD && AI_BACKWARD) {
return SRESULT_WAIT;
}
PostAnimState(ANIMCHANNEL_LEGS, "Legs_Crouch_Idle", /* parms->blendFrames */ 0);
return SRESULT_DONE;
}
return SRESULT_ERROR;
}
/*
================
idPlayer::Legs_Jump
================
*/
stateResult_t idPlayer::Legs_Jump(stateParms_t* parms) {
enum {
STAGE_INIT,
STAGE_WAIT
};
switch (parms->stage) {
case STAGE_INIT:
// prevent infinite recursion
AI_JUMP = false;
if (AI_RUN) {
Event_PlayAnim(ANIMCHANNEL_LEGS, "run_jump", /* parms->blendFrames */ 0);
}
else {
Event_PlayAnim(ANIMCHANNEL_LEGS, "jump", /* parms->blendFrames */ 0);
}
SRESULT_STAGE(STAGE_WAIT);
case STAGE_WAIT:
if (AI_ONGROUND) {
PostAnimState(ANIMCHANNEL_LEGS, "Legs_Land", 4);
return SRESULT_DONE;
}
if (AnimDone(ANIMCHANNEL_LEGS, 4)) {
PostAnimState(ANIMCHANNEL_LEGS, "Legs_Fall", 4);
return SRESULT_DONE;
}
return SRESULT_WAIT;
}
return SRESULT_ERROR;
}
/*
================
idPlayer::Legs_Fall
================
*/
stateResult_t idPlayer::Legs_Fall(stateParms_t* parms) {
enum {
STAGE_INIT,
STAGE_WAIT
};
switch (parms->stage) {
case STAGE_INIT:
if (AI_ONGROUND) {
PostAnimState(ANIMCHANNEL_LEGS, "Legs_Land", 2);
return SRESULT_DONE;
}
Event_PlayCycle(ANIMCHANNEL_LEGS, "fall", /* parms->blendFrames */ 0);
SRESULT_STAGE(STAGE_WAIT);
case STAGE_WAIT:
if (AI_ONGROUND) {
PostAnimState(ANIMCHANNEL_LEGS, "Legs_Land", 2);
return SRESULT_DONE;
}
return SRESULT_WAIT;
}
return SRESULT_DONE;
}
/*
================
idPlayer::Legs_Land
================
*/
stateResult_t idPlayer::Legs_Land(stateParms_t* parms) {
enum {
STAGE_INIT,
STAGE_WAIT
};
switch (parms->stage) {
case STAGE_INIT:
if (IsLegsIdle(false) && (AI_HARDLANDING || AI_SOFTLANDING)) {
if (AI_HARDLANDING) {
Event_PlayAnim(ANIMCHANNEL_LEGS, "hard_land", /* parms->blendFrames */ 0);
}
else {
Event_PlayAnim(ANIMCHANNEL_LEGS, "soft_land", /* parms->blendFrames */ 0);
}
SRESULT_STAGE(STAGE_WAIT);
}
PostAnimState(ANIMCHANNEL_LEGS, "Legs_Idle", 4);
return SRESULT_DONE;
case STAGE_WAIT:
if (!IsLegsIdle(false) || AnimDone(ANIMCHANNEL_LEGS, /* parms->blendFrames */ 0)) {
PostAnimState(ANIMCHANNEL_LEGS, "Legs_Idle", /* parms->blendFrames */ 0);
return SRESULT_DONE;
}
return SRESULT_WAIT;
}
return SRESULT_ERROR;
}
/*
================
idPlayer::Legs_Dead
================
*/
stateResult_t idPlayer::Legs_Dead(stateParms_t* parms) {
PostAnimState(ANIMCHANNEL_LEGS, "Wait_Alive", 0);
PostAnimState(ANIMCHANNEL_LEGS, "Legs_Idle", 0);
return SRESULT_DONE;
}
/*
================
idPlayer::Wait_Alive
Waits until the player is alive again.
================
*/
stateResult_t idPlayer::Wait_Alive(stateParms_t* parms) {
if (AI_DEAD) {
return SRESULT_WAIT;
}
return SRESULT_DONE;
}
/*
================
idPlayer::Wait_ReloadAnim
================
*/
stateResult_t idPlayer::Wait_ReloadAnim(stateParms_t* parms) {
// The gun firing can cancel any of the relod animations
if (AI_WEAPON_FIRED) {
SetAnimState(ANIMCHANNEL_TORSO, "Torso_Idle", /* parms->blendFrames */ 0);
return SRESULT_DONE;
}
// wait for the animation to finish
if (AnimDone(ANIMCHANNEL_TORSO, /* parms->blendFrames */ 0)) {
return SRESULT_DONE;
}
return SRESULT_WAIT;
}
+171 -3
View File
@@ -138,6 +138,9 @@ idAI::idAI
=====================
*/
idAI::idAI() {
nativeAIObject = NULL;
nativeAIObjectName.Clear();
aas = NULL;
travelFlags = TFL_WALK | TFL_AIR;
@@ -244,6 +247,7 @@ idAI::~idAI
=====================
*/
idAI::~idAI() {
ShutdownNativeAIObject();
delete projectileClipModel;
DeconstructScriptObject();
scriptObject.Free();
@@ -548,6 +552,9 @@ void idAI::Restore(idRestoreGame* savefile) {
// Link the script variables back to the scriptobject
LinkScriptVariables();
// Recreate the native state-machine object from the entityDef/spawnArg.
InitNativeAIObject();
if (restorePhysics) {
RestorePhysics(&physicsObj);
}
@@ -793,6 +800,9 @@ void idAI::Spawn(void) {
// init the move variables
StopMove(MOVE_STATUS_DONE);
// create the optional native state-machine object after idAI native fields are ready
InitNativeAIObject();
}
/*
@@ -1074,12 +1084,165 @@ void idAI::LinkScriptVariables(void) {
AI_PUSHED.LinkTo(scriptObject, "AI_PUSHED");
}
/*
=====================
NativeAIObjectNameMatches
=====================
*/
static bool NativeAIObjectNameMatches( const char* requestedName, const char* scriptObjectName, const char* cppObjectName ) {
if ( !requestedName || !requestedName[0] ) {
return false;
}
return ( !idStr::Icmp( requestedName, scriptObjectName ) || !idStr::Icmp( requestedName, cppObjectName ) );
}
#define CREATE_NATIVE_AI_OBJECT( scriptObjectName, cppObjectType ) \
if ( NativeAIObjectNameMatches( nativeObjectName, scriptObjectName, #cppObjectType ) ) { return new cppObjectType(); }
/*
=====================
idAI::CreateNativeAIObject
Creates the native replacement object named by the entityDef/spawnArg "nativeobject" key.
The key may use either the original DoomScript object name, such as "monster_demon_imp",
or the generated native C++ type name, such as "rvmMonsterDemonImp".
=====================
*/
rvmAIObject* idAI::CreateNativeAIObject( const char* nativeObjectName ) {
if ( !nativeObjectName || !nativeObjectName[0] ) {
return NULL;
}
CREATE_NATIVE_AI_OBJECT( "ai", rvmAIObject );
CREATE_NATIVE_AI_OBJECT( "character", rvmCharacter );
CREATE_NATIVE_AI_OBJECT( "ai_character_prone", rvmAICharacterProne );
CREATE_NATIVE_AI_OBJECT( "char_sentry", rvmCharSentry );
CREATE_NATIVE_AI_OBJECT( "follower", rvmFollower );
CREATE_NATIVE_AI_OBJECT( "ai_alphalabs2_scientist1", rvmAIAlphaLabs2Scientist1 );
CREATE_NATIVE_AI_OBJECT( "monster_base", rvmMonsterBase );
CREATE_NATIVE_AI_OBJECT( "monster_zombie_base", rvmMonsterZombieBase );
CREATE_NATIVE_AI_OBJECT( "monster_zombie", rvmMonsterZombie );
CREATE_NATIVE_AI_OBJECT( "monster_zombie_bernie", rvmMonsterZombieBernie );
CREATE_NATIVE_AI_OBJECT( "monster_zombie_morgue", rvmMonsterZombieMorgue );
CREATE_NATIVE_AI_OBJECT( "monster_zombie_sawyer", rvmMonsterZombieSawyer );
CREATE_NATIVE_AI_OBJECT( "monster_zombie_commando_tentacle", rvmMonsterZombieCommandoTentacle );
CREATE_NATIVE_AI_OBJECT( "monster_zombie_commando_cgun", rvmMonsterZombieCommandoCGun );
CREATE_NATIVE_AI_OBJECT( "monster_zombie_security_pistol", rvmMonsterZombieSecurityPistol );
CREATE_NATIVE_AI_OBJECT( "monster_demon_pinky", rvmMonsterDemonPinky );
CREATE_NATIVE_AI_OBJECT( "monster_demon_imp", rvmMonsterDemonImp );
CREATE_NATIVE_AI_OBJECT( "monster_demon_vulgar", rvmMonsterDemonVulgar );
CREATE_NATIVE_AI_OBJECT( "monster_demon_revenant", rvmMonsterDemonRevenant );
CREATE_NATIVE_AI_OBJECT( "monster_demon_hellknight", rvmMonsterDemonHellknight );
CREATE_NATIVE_AI_OBJECT( "monster_demon_maggot", rvmMonsterDemonMaggot );
CREATE_NATIVE_AI_OBJECT( "monster_demon_cherub", rvmMonsterDemonCherub );
CREATE_NATIVE_AI_OBJECT( "monster_demon_trite", rvmMonsterDemonTrite );
CREATE_NATIVE_AI_OBJECT( "monster_demon_wraith", rvmMonsterDemonWraith );
CREATE_NATIVE_AI_OBJECT( "monster_demon_mancubus", rvmMonsterDemonMancubus );
CREATE_NATIVE_AI_OBJECT( "monster_demon_archvile", rvmMonsterDemonArchvile );
CREATE_NATIVE_AI_OBJECT( "monster_flying_cacodemon", rvmMonsterFlyingCacodemon );
CREATE_NATIVE_AI_OBJECT( "monster_flying_lostsoul", rvmMonsterFlyingLostsoul );
CREATE_NATIVE_AI_OBJECT( "monster_turret", rvmMonsterTurret );
CREATE_NATIVE_AI_OBJECT( "monster_boss_cyberdemon", rvmMonsterBossCyberdemon );
CREATE_NATIVE_AI_OBJECT( "monster_boss_vagary", rvmMonsterBossVagary );
CREATE_NATIVE_AI_OBJECT( "monster_boss_sabaoth", rvmMonsterBossSabaoth );
CREATE_NATIVE_AI_OBJECT( "seeker_base", rvmSeekerBase );
CREATE_NATIVE_AI_OBJECT( "monster_boss_guardian_spawner", rvmMonsterBossGuardianSpawner );
CREATE_NATIVE_AI_OBJECT( "monster_boss_guardian", rvmMonsterBossGuardian );
CREATE_NATIVE_AI_OBJECT( "monster_boss_guardian_seeker", rvmMonsterBossGuardianSeeker );
return NULL;
}
#undef CREATE_NATIVE_AI_OBJECT
/*
=====================
idAI::ShutdownNativeAIObject
=====================
*/
void idAI::ShutdownNativeAIObject( void ) {
if ( nativeAIObject ) {
nativeAIObject->Destroy();
delete nativeAIObject;
nativeAIObject = NULL;
}
nativeAIObjectName.Clear();
}
/*
=====================
idAI::InitNativeAIObject
The entityDef owns selection through "nativeobject". Empty, "0", or "false" means
keep the old DoomScript VM path. "1" or "true" means use the existing "scriptobject"
name as the native object selector, which is convenient while converting decls.
=====================
*/
void idAI::InitNativeAIObject( void ) {
ShutdownNativeAIObject();
idStr requestedNativeObject;
spawnArgs.GetString( "nativeobject", "", requestedNativeObject );
if ( !requestedNativeObject.Length() || !idStr::Icmp( requestedNativeObject.c_str(), "0" ) || !idStr::Icmp( requestedNativeObject.c_str(), "false" ) ) {
return;
}
if ( !idStr::Icmp( requestedNativeObject.c_str(), "1" ) || !idStr::Icmp( requestedNativeObject.c_str(), "true" ) ) {
spawnArgs.GetString( "scriptobject", "", requestedNativeObject );
}
if ( !requestedNativeObject.Length() ) {
gameLocal.Warning( "%s has nativeobject set, but no native object or scriptobject name was provided", name.c_str() );
return;
}
nativeAIObject = CreateNativeAIObject( requestedNativeObject.c_str() );
if ( !nativeAIObject ) {
gameLocal.Warning( "%s has unknown nativeobject '%s'; falling back to DoomScript object '%s'", name.c_str(), requestedNativeObject.c_str(), spawnArgs.GetString( "scriptobject", "" ) );
return;
}
nativeAIObjectName = requestedNativeObject;
nativeAIObject->Init( this );
}
/*
=====================
idAI::GetNativeAIObject
=====================
*/
rvmAIObject* idAI::GetNativeAIObject( void ) const {
return nativeAIObject;
}
/*
=====================
idAI::GetNativeAIObjectName
=====================
*/
const char* idAI::GetNativeAIObjectName( void ) const {
return nativeAIObjectName.c_str();
}
/*
=====================
idAI::UpdateAIScript
=====================
*/
void idAI::UpdateAIScript(void) {
if (nativeAIObject) {
nativeAIObject->Update();
// clear the hit enemy flag so we catch the next time we hit someone
AI_HIT_ENEMY = false;
return;
}
UpdateScript();
// clear the hit enemy flag so we catch the next time we hit someone
@@ -3338,9 +3501,14 @@ void idAI::Killed(idEntity* inflictor, idEntity* attacker, int damage, const idV
restartParticles = false;
state = GetScriptFunction("state_Killed");
SetState(state);
SetWaitState("");
if (nativeAIObject) {
nativeAIObject->SetState("state_Killed");
}
else {
state = GetScriptFunction("state_Killed");
SetState(state);
SetWaitState("");
}
const idKeyValue* kv = spawnArgs.MatchPrefix("def_drops", NULL);
while (kv) {
+54 -1
View File
@@ -155,6 +155,7 @@ extern const idEventDef AI_TriggerParticles;
extern const idEventDef AI_RandomPath;
class idPathCorner;
class rvmAIObject;
typedef struct particleEmitter_s {
particleEmitter_s() {
@@ -199,6 +200,8 @@ public:
class idAI : public idActor {
public:
friend class rvmAIObject;
CLASS_PROTOTYPE(idAI);
idAI();
@@ -231,7 +234,7 @@ public:
// Finds the best collision free trajectory for a clip model.
static bool PredictTrajectory(const idVec3& firePos, const idVec3& target, float projectileSpeed, const idVec3& projGravity, const idClipModel* clip, int clipmask, float max_height, const idEntity* ignore, const idEntity* targetEntity, int drawtime, idVec3& aimDir);
protected:
public:
// navigation
idNAV* aas;
int travelFlags;
@@ -374,6 +377,10 @@ protected:
idScriptBool AI_HIT_ENEMY;
idScriptBool AI_PUSHED;
// native DoomScript replacement object. Created from the entityDef/spawnArg "nativeobject" key.
rvmAIObject* nativeAIObject;
idStr nativeAIObjectName;
//
// ai/ai.cpp
//
@@ -483,6 +490,12 @@ protected:
// AI script state management
void LinkScriptVariables(void);
void InitNativeAIObject(void);
void ShutdownNativeAIObject(void);
static rvmAIObject* CreateNativeAIObject(const char* nativeObjectName);
rvmAIObject* GetNativeAIObject(void) const;
const char* GetNativeAIObjectName(void) const;
void UpdateAIScript(void);
//
@@ -770,4 +783,44 @@ private:
};
#include "AI_base.h"
#include "AI_monster_base.h"
#include "AI_monster_zombie_base.h"
#include "AI_monster_zombie.h"
#include "AI_monster_zombie_bernie.h"
#include "AI_monster_zombie_morgue.h"
#include "AI_monster_zombie_sawyer.h"
#include "AI_monster_zombie_commando_tentacle.h"
#include "AI_monster_zombie_commando_cgun.h"
#include "AI_monster_zombie_security_pistol.h"
#include "AI_character.h"
#include "AI_character_prone.h"
#include "AI_follower.h"
#include "AI_character_sentry.h"
#include "AI_alphalabs2_scientist1.h"
#include "AI_monster_demon_pinky.h"
#include "AI_monster_demon_imp.h"
#include "AI_monster_demon_vulgar.h"
#include "AI_monster_demon_revenant.h"
#include "AI_monster_demon_hellknight.h"
#include "AI_monster_demon_maggot.h"
#include "AI_monster_demon_cherub.h"
#include "AI_monster_demon_trite.h"
#include "AI_monster_demon_wraith.h"
#include "AI_monster_demon_mancubus.h"
#include "AI_monster_demon_archvile.h"
#include "AI_monster_flying_cacodemon.h"
#include "AI_monster_flying_lostsoul.h"
#include "AI_monster_turret.h"
#include "AI_monster_boss_cyberdemon.h"
#include "AI_monster_boss_vagary.h"
#include "AI_monster_boss_sabaoth.h"
#include "AI_monster_boss_guardian.h"
#include "AI_monster_boss_guardian_seeker.h"
#endif /* !__AI_H__ */
File diff suppressed because it is too large Load Diff
+458 -8
View File
@@ -7,9 +7,9 @@
This file has been generated with the Type Info Generator v1.1 (c) 2004 id Software
1188 constants
133 enums
583 classes/structs/unions
1199 constants
135 enums
619 classes/structs/unions
38 templates
7 max inheritance level for 'idAI_Vagary'
@@ -1101,6 +1101,17 @@ static constantInfo_t constantInfo[] = {
{ "int", "SE_ENTER_OBSTACLE", "4" },
{ "int", "SE_FALL", "8" },
{ "int", "SE_LAND", "16" },
{ ": static const int", "rvmAIObject::AI_NATIVE_MAX_CHANNELS", "4" },
{ "int", "rvmCharacter::CHAR_TALK_TRIGGERED", "0" },
{ "int", "rvmCharacter::CHAR_TALK_PRIMARY", "1" },
{ "int", "rvmCharacter::CHAR_TALK_SECONDARY", "2" },
{ "int", "rvmCharSentry::RETREATING", "-1" },
{ "int", "rvmCharSentry::NOT_MOVING", "0" },
{ "int", "rvmCharSentry::APPROACHING", "1" },
{ "int", "rvmCharSentry::PLAYER_LOST", "0" },
{ "int", "rvmCharSentry::PLAYER_BEHIND_ME", "1" },
{ "int", "rvmCharSentry::PLAYER_OK", "2" },
{ "int", "rvmCharSentry::PLAYER_AHEAD_OF_ME", "3" },
{ "const char * const", "RESULT_STRING", "<RESULT>" },
{ "int", "OP_RETURN", "0" },
{ "int", "OP_UINC_F", "1" },
@@ -2600,7 +2611,25 @@ static enumValueInfo_t stopEvent_t_typeInfo[] = {
{ NULL, 0 }
};
static enumValueInfo_t enum_130_typeInfo[] = {
static enumValueInfo_t rvmCharacter_enum_130_typeInfo[] = {
{ "CHAR_TALK_TRIGGERED", 0 },
{ "CHAR_TALK_PRIMARY", 1 },
{ "CHAR_TALK_SECONDARY", 2 },
{ NULL, 0 }
};
static enumValueInfo_t rvmCharSentry_enum_131_typeInfo[] = {
{ "RETREATING", -1 },
{ "NOT_MOVING", 0 },
{ "APPROACHING", 1 },
{ "PLAYER_LOST", 0 },
{ "PLAYER_BEHIND_ME", 1 },
{ "PLAYER_OK", 2 },
{ "PLAYER_AHEAD_OF_ME", 3 },
{ NULL, 0 }
};
static enumValueInfo_t enum_132_typeInfo[] = {
{ "OP_RETURN", 0 },
{ "OP_UINC_F", 1 },
{ "OP_UINCP_F", 2 },
@@ -2876,7 +2905,9 @@ static enumTypeInfo_t enumTypeInfo[] = {
{ "talkState_t", talkState_t_typeInfo },
{ "moveStatus_t", moveStatus_t_typeInfo },
{ "stopEvent_t", stopEvent_t_typeInfo },
{ "enum_130", enum_130_typeInfo },
{ "rvmCharacter::enum_130", rvmCharacter_enum_130_typeInfo },
{ "rvmCharSentry::enum_131", rvmCharSentry_enum_131_typeInfo },
{ "enum_132", enum_132_typeInfo },
{ "botMoveFlags_t", botMoveFlags_t_typeInfo },
{ "botChat_t", botChat_t_typeInfo },
{ NULL, NULL }
@@ -6726,14 +6757,13 @@ static classVariableInfo_t idPhantomObjects_typeInfo[] = {
static classVariableInfo_t idAnimState_typeInfo[] = {
{ ": bool", "idleAnim", (intptr_t)(&((idAnimState *)0)->idleAnim), sizeof( ((idAnimState *)0)->idleAnim ) },
{ "idStr", "state", (intptr_t)(&((idAnimState *)0)->state), sizeof( ((idAnimState *)0)->state ) },
{ "int", "animBlendFrames", (intptr_t)(&((idAnimState *)0)->animBlendFrames), sizeof( ((idAnimState *)0)->animBlendFrames ) },
{ "int", "lastAnimBlendFrames", (intptr_t)(&((idAnimState *)0)->lastAnimBlendFrames), sizeof( ((idAnimState *)0)->lastAnimBlendFrames ) },
{ ": idActor *", "self", (intptr_t)(&((idAnimState *)0)->self), sizeof( ((idAnimState *)0)->self ) },
{ ": idEntity *", "self", (intptr_t)(&((idAnimState *)0)->self), sizeof( ((idAnimState *)0)->self ) },
{ "idAnimator *", "animator", (intptr_t)(&((idAnimState *)0)->animator), sizeof( ((idAnimState *)0)->animator ) },
{ "idThread *", "thread", (intptr_t)(&((idAnimState *)0)->thread), sizeof( ((idAnimState *)0)->thread ) },
{ "int", "channel", (intptr_t)(&((idAnimState *)0)->channel), sizeof( ((idAnimState *)0)->channel ) },
{ "bool", "disabled", (intptr_t)(&((idAnimState *)0)->disabled), sizeof( ((idAnimState *)0)->disabled ) },
{ "rvStateThread", "stateThread", (intptr_t)(&((idAnimState *)0)->stateThread), sizeof( ((idAnimState *)0)->stateThread ) },
{ NULL, 0 }
};
@@ -8065,6 +8095,8 @@ static classVariableInfo_t idAI_typeInfo[] = {
{ "idScriptBool", "AI_DEST_UNREACHABLE", (intptr_t)(&((idAI *)0)->AI_DEST_UNREACHABLE), sizeof( ((idAI *)0)->AI_DEST_UNREACHABLE ) },
{ "idScriptBool", "AI_HIT_ENEMY", (intptr_t)(&((idAI *)0)->AI_HIT_ENEMY), sizeof( ((idAI *)0)->AI_HIT_ENEMY ) },
{ "idScriptBool", "AI_PUSHED", (intptr_t)(&((idAI *)0)->AI_PUSHED), sizeof( ((idAI *)0)->AI_PUSHED ) },
{ "rvmAIObject *", "nativeAIObject", (intptr_t)(&((idAI *)0)->nativeAIObject), sizeof( ((idAI *)0)->nativeAIObject ) },
{ "idStr", "nativeAIObjectName", (intptr_t)(&((idAI *)0)->nativeAIObjectName), sizeof( ((idAI *)0)->nativeAIObjectName ) },
{ NULL, 0 }
};
@@ -8085,6 +8117,388 @@ static classVariableInfo_t idAI_Vagary_typeInfo[] = {
{ NULL, 0 }
};
static classVariableInfo_t rvmAIObject_typeInfo[] = {
{ "idAI *", "owner", (intptr_t)(&((rvmAIObject *)0)->owner), sizeof( ((rvmAIObject *)0)->owner ) },
{ "idStr", "currentState", (intptr_t)(&((rvmAIObject *)0)->currentState), sizeof( ((rvmAIObject *)0)->currentState ) },
{ "idStr", "currentAction", (intptr_t)(&((rvmAIObject *)0)->currentAction), sizeof( ((rvmAIObject *)0)->currentAction ) },
{ "idStr[4]", "currentAnimState", (intptr_t)(&((rvmAIObject *)0)->currentAnimState), sizeof( ((rvmAIObject *)0)->currentAnimState ) },
{ "idStr", "waitActionName", (intptr_t)(&((rvmAIObject *)0)->waitActionName), sizeof( ((rvmAIObject *)0)->waitActionName ) },
{ "stateParms_t", "stateParms", (intptr_t)(&((rvmAIObject *)0)->stateParms), sizeof( ((rvmAIObject *)0)->stateParms ) },
{ "stateParms_t", "actionParms", (intptr_t)(&((rvmAIObject *)0)->actionParms), sizeof( ((rvmAIObject *)0)->actionParms ) },
{ "stateParms_t[4]", "animParms", (intptr_t)(&((rvmAIObject *)0)->animParms), sizeof( ((rvmAIObject *)0)->animParms ) },
{ "float", "scratchEndTime", (intptr_t)(&((rvmAIObject *)0)->scratchEndTime), sizeof( ((rvmAIObject *)0)->scratchEndTime ) },
{ "float", "scratchMinTime", (intptr_t)(&((rvmAIObject *)0)->scratchMinTime), sizeof( ((rvmAIObject *)0)->scratchMinTime ) },
{ "float", "scratchNextTime", (intptr_t)(&((rvmAIObject *)0)->scratchNextTime), sizeof( ((rvmAIObject *)0)->scratchNextTime ) },
{ "float", "scratchCount", (intptr_t)(&((rvmAIObject *)0)->scratchCount), sizeof( ((rvmAIObject *)0)->scratchCount ) },
{ "float", "scratchFlags", (intptr_t)(&((rvmAIObject *)0)->scratchFlags), sizeof( ((rvmAIObject *)0)->scratchFlags ) },
{ "bool", "scratchBool", (intptr_t)(&((rvmAIObject *)0)->scratchBool), sizeof( ((rvmAIObject *)0)->scratchBool ) },
{ "idEntityPtr < idEntity >", "scratchEntity", (intptr_t)(&((rvmAIObject *)0)->scratchEntity), sizeof( ((rvmAIObject *)0)->scratchEntity ) },
{ "idStr", "scratchString", (intptr_t)(&((rvmAIObject *)0)->scratchString), sizeof( ((rvmAIObject *)0)->scratchString ) },
{ NULL, 0 }
};
static classVariableInfo_t rvmMonsterBase_typeInfo[] = {
{ ": float", "run_distance", (intptr_t)(&((rvmMonsterBase *)0)->run_distance), sizeof( ((rvmMonsterBase *)0)->run_distance ) },
{ "float", "walk_turn", (intptr_t)(&((rvmMonsterBase *)0)->walk_turn), sizeof( ((rvmMonsterBase *)0)->walk_turn ) },
{ "bool", "run", (intptr_t)(&((rvmMonsterBase *)0)->run), sizeof( ((rvmMonsterBase *)0)->run ) },
{ "bool", "ambush", (intptr_t)(&((rvmMonsterBase *)0)->ambush), sizeof( ((rvmMonsterBase *)0)->ambush ) },
{ "bool", "ignoreEnemies", (intptr_t)(&((rvmMonsterBase *)0)->ignoreEnemies), sizeof( ((rvmMonsterBase *)0)->ignoreEnemies ) },
{ "bool", "stay_on_attackpath", (intptr_t)(&((rvmMonsterBase *)0)->stay_on_attackpath), sizeof( ((rvmMonsterBase *)0)->stay_on_attackpath ) },
{ "bool", "idle_sight_fov", (intptr_t)(&((rvmMonsterBase *)0)->idle_sight_fov), sizeof( ((rvmMonsterBase *)0)->idle_sight_fov ) },
{ "float", "customBlendOut", (intptr_t)(&((rvmMonsterBase *)0)->customBlendOut), sizeof( ((rvmMonsterBase *)0)->customBlendOut ) },
{ "idEntityPtr < idEntity >", "current_path", (intptr_t)(&((rvmMonsterBase *)0)->current_path), sizeof( ((rvmMonsterBase *)0)->current_path ) },
{ "idEntityPtr < idEntity >", "next_path", (intptr_t)(&((rvmMonsterBase *)0)->next_path), sizeof( ((rvmMonsterBase *)0)->next_path ) },
{ "bool", "resurrect", (intptr_t)(&((rvmMonsterBase *)0)->resurrect), sizeof( ((rvmMonsterBase *)0)->resurrect ) },
{ "bool", "ignore_lostcombat", (intptr_t)(&((rvmMonsterBase *)0)->ignore_lostcombat), sizeof( ((rvmMonsterBase *)0)->ignore_lostcombat ) },
{ "bool", "blocked", (intptr_t)(&((rvmMonsterBase *)0)->blocked), sizeof( ((rvmMonsterBase *)0)->blocked ) },
{ "bool", "ignore_sight", (intptr_t)(&((rvmMonsterBase *)0)->ignore_sight), sizeof( ((rvmMonsterBase *)0)->ignore_sight ) },
{ NULL, 0 }
};
static classVariableInfo_t rvmMonsterZombieBase_typeInfo[] = {
{ NULL, 0 }
};
static classVariableInfo_t rvmMonsterZombie_typeInfo[] = {
{ ": float", "painNextTime", (intptr_t)(&((rvmMonsterZombie *)0)->painNextTime), sizeof( ((rvmMonsterZombie *)0)->painNextTime ) },
{ "bool", "can_run", (intptr_t)(&((rvmMonsterZombie *)0)->can_run), sizeof( ((rvmMonsterZombie *)0)->can_run ) },
{ NULL, 0 }
};
static classVariableInfo_t rvmMonsterZombieBernie_typeInfo[] = {
{ ": float", "painNextTime", (intptr_t)(&((rvmMonsterZombieBernie *)0)->painNextTime), sizeof( ((rvmMonsterZombieBernie *)0)->painNextTime ) },
{ NULL, 0 }
};
static classVariableInfo_t rvmMonsterZombieMorgue_typeInfo[] = {
{ ": float", "painNextTime", (intptr_t)(&((rvmMonsterZombieMorgue *)0)->painNextTime), sizeof( ((rvmMonsterZombieMorgue *)0)->painNextTime ) },
{ NULL, 0 }
};
static classVariableInfo_t rvmMonsterZombieSawyer_typeInfo[] = {
{ ": bool", "attack", (intptr_t)(&((rvmMonsterZombieSawyer *)0)->attack), sizeof( ((rvmMonsterZombieSawyer *)0)->attack ) },
{ "float", "painNextTime", (intptr_t)(&((rvmMonsterZombieSawyer *)0)->painNextTime), sizeof( ((rvmMonsterZombieSawyer *)0)->painNextTime ) },
{ "float", "nextHitTime", (intptr_t)(&((rvmMonsterZombieSawyer *)0)->nextHitTime), sizeof( ((rvmMonsterZombieSawyer *)0)->nextHitTime ) },
{ "int", "bloodSmokeFrames", (intptr_t)(&((rvmMonsterZombieSawyer *)0)->bloodSmokeFrames), sizeof( ((rvmMonsterZombieSawyer *)0)->bloodSmokeFrames ) },
{ NULL, 0 }
};
static classVariableInfo_t rvmMonsterZombieCommandoTentacle_typeInfo[] = {
{ ": float", "nextAttack", (intptr_t)(&((rvmMonsterZombieCommandoTentacle *)0)->nextAttack), sizeof( ((rvmMonsterZombieCommandoTentacle *)0)->nextAttack ) },
{ "float", "nextNoFOVAttack", (intptr_t)(&((rvmMonsterZombieCommandoTentacle *)0)->nextNoFOVAttack), sizeof( ((rvmMonsterZombieCommandoTentacle *)0)->nextNoFOVAttack ) },
{ "bool", "tentacleDamage", (intptr_t)(&((rvmMonsterZombieCommandoTentacle *)0)->tentacleDamage), sizeof( ((rvmMonsterZombieCommandoTentacle *)0)->tentacleDamage ) },
{ "float", "painNextTime", (intptr_t)(&((rvmMonsterZombieCommandoTentacle *)0)->painNextTime), sizeof( ((rvmMonsterZombieCommandoTentacle *)0)->painNextTime ) },
{ NULL, 0 }
};
static classVariableInfo_t rvmMonsterZombieCommandoCGun_typeInfo[] = {
{ ": bool", "fire", (intptr_t)(&((rvmMonsterZombieCommandoCGun *)0)->fire), sizeof( ((rvmMonsterZombieCommandoCGun *)0)->fire ) },
{ "bool", "crouch_fire", (intptr_t)(&((rvmMonsterZombieCommandoCGun *)0)->crouch_fire), sizeof( ((rvmMonsterZombieCommandoCGun *)0)->crouch_fire ) },
{ "bool", "step_left", (intptr_t)(&((rvmMonsterZombieCommandoCGun *)0)->step_left), sizeof( ((rvmMonsterZombieCommandoCGun *)0)->step_left ) },
{ "bool", "step_right", (intptr_t)(&((rvmMonsterZombieCommandoCGun *)0)->step_right), sizeof( ((rvmMonsterZombieCommandoCGun *)0)->step_right ) },
{ "bool", "run_attack", (intptr_t)(&((rvmMonsterZombieCommandoCGun *)0)->run_attack), sizeof( ((rvmMonsterZombieCommandoCGun *)0)->run_attack ) },
{ "float", "nextDodge", (intptr_t)(&((rvmMonsterZombieCommandoCGun *)0)->nextDodge), sizeof( ((rvmMonsterZombieCommandoCGun *)0)->nextDodge ) },
{ "float", "nextAttack", (intptr_t)(&((rvmMonsterZombieCommandoCGun *)0)->nextAttack), sizeof( ((rvmMonsterZombieCommandoCGun *)0)->nextAttack ) },
{ "float", "nextNoFOVAttack", (intptr_t)(&((rvmMonsterZombieCommandoCGun *)0)->nextNoFOVAttack), sizeof( ((rvmMonsterZombieCommandoCGun *)0)->nextNoFOVAttack ) },
{ "idEntityPtr < idEntity >", "combat_node", (intptr_t)(&((rvmMonsterZombieCommandoCGun *)0)->combat_node), sizeof( ((rvmMonsterZombieCommandoCGun *)0)->combat_node ) },
{ "float", "painNextTime", (intptr_t)(&((rvmMonsterZombieCommandoCGun *)0)->painNextTime), sizeof( ((rvmMonsterZombieCommandoCGun *)0)->painNextTime ) },
{ "float", "attackEndTime", (intptr_t)(&((rvmMonsterZombieCommandoCGun *)0)->attackEndTime), sizeof( ((rvmMonsterZombieCommandoCGun *)0)->attackEndTime ) },
{ "float", "loopEndTime", (intptr_t)(&((rvmMonsterZombieCommandoCGun *)0)->loopEndTime), sizeof( ((rvmMonsterZombieCommandoCGun *)0)->loopEndTime ) },
{ "float", "minShootTime", (intptr_t)(&((rvmMonsterZombieCommandoCGun *)0)->minShootTime), sizeof( ((rvmMonsterZombieCommandoCGun *)0)->minShootTime ) },
{ "bool", "firstShot", (intptr_t)(&((rvmMonsterZombieCommandoCGun *)0)->firstShot), sizeof( ((rvmMonsterZombieCommandoCGun *)0)->firstShot ) },
{ NULL, 0 }
};
static classVariableInfo_t rvmMonsterZombieSecurityPistol_typeInfo[] = {
{ ": bool", "fire", (intptr_t)(&((rvmMonsterZombieSecurityPistol *)0)->fire), sizeof( ((rvmMonsterZombieSecurityPistol *)0)->fire ) },
{ "bool", "crouch_fire", (intptr_t)(&((rvmMonsterZombieSecurityPistol *)0)->crouch_fire), sizeof( ((rvmMonsterZombieSecurityPistol *)0)->crouch_fire ) },
{ "bool", "step_left", (intptr_t)(&((rvmMonsterZombieSecurityPistol *)0)->step_left), sizeof( ((rvmMonsterZombieSecurityPistol *)0)->step_left ) },
{ "bool", "step_right", (intptr_t)(&((rvmMonsterZombieSecurityPistol *)0)->step_right), sizeof( ((rvmMonsterZombieSecurityPistol *)0)->step_right ) },
{ "bool", "run_attack", (intptr_t)(&((rvmMonsterZombieSecurityPistol *)0)->run_attack), sizeof( ((rvmMonsterZombieSecurityPistol *)0)->run_attack ) },
{ "float", "nextDodge", (intptr_t)(&((rvmMonsterZombieSecurityPistol *)0)->nextDodge), sizeof( ((rvmMonsterZombieSecurityPistol *)0)->nextDodge ) },
{ "float", "nextAttack", (intptr_t)(&((rvmMonsterZombieSecurityPistol *)0)->nextAttack), sizeof( ((rvmMonsterZombieSecurityPistol *)0)->nextAttack ) },
{ "float", "nextNoFOVAttack", (intptr_t)(&((rvmMonsterZombieSecurityPistol *)0)->nextNoFOVAttack), sizeof( ((rvmMonsterZombieSecurityPistol *)0)->nextNoFOVAttack ) },
{ "idEntityPtr < idEntity >", "combat_node", (intptr_t)(&((rvmMonsterZombieSecurityPistol *)0)->combat_node), sizeof( ((rvmMonsterZombieSecurityPistol *)0)->combat_node ) },
{ "float", "painNextTime", (intptr_t)(&((rvmMonsterZombieSecurityPistol *)0)->painNextTime), sizeof( ((rvmMonsterZombieSecurityPistol *)0)->painNextTime ) },
{ "float", "attackEndTime", (intptr_t)(&((rvmMonsterZombieSecurityPistol *)0)->attackEndTime), sizeof( ((rvmMonsterZombieSecurityPistol *)0)->attackEndTime ) },
{ "float", "loopEndTime", (intptr_t)(&((rvmMonsterZombieSecurityPistol *)0)->loopEndTime), sizeof( ((rvmMonsterZombieSecurityPistol *)0)->loopEndTime ) },
{ "float", "minShootTime", (intptr_t)(&((rvmMonsterZombieSecurityPistol *)0)->minShootTime), sizeof( ((rvmMonsterZombieSecurityPistol *)0)->minShootTime ) },
{ "bool", "firstShot", (intptr_t)(&((rvmMonsterZombieSecurityPistol *)0)->firstShot), sizeof( ((rvmMonsterZombieSecurityPistol *)0)->firstShot ) },
{ NULL, 0 }
};
static classVariableInfo_t rvmCharacter_typeInfo[] = {
{ "float", "talkMode", (intptr_t)(&((rvmCharacter *)0)->talkMode), sizeof( ((rvmCharacter *)0)->talkMode ) },
{ "int", "talkSecondaryIndex", (intptr_t)(&((rvmCharacter *)0)->talkSecondaryIndex), sizeof( ((rvmCharacter *)0)->talkSecondaryIndex ) },
{ "idStr", "customAnim", (intptr_t)(&((rvmCharacter *)0)->customAnim), sizeof( ((rvmCharacter *)0)->customAnim ) },
{ "float", "customBlendOut", (intptr_t)(&((rvmCharacter *)0)->customBlendOut), sizeof( ((rvmCharacter *)0)->customBlendOut ) },
{ "idStr", "walkAnim", (intptr_t)(&((rvmCharacter *)0)->walkAnim), sizeof( ((rvmCharacter *)0)->walkAnim ) },
{ "bool", "allowTurn", (intptr_t)(&((rvmCharacter *)0)->allowTurn), sizeof( ((rvmCharacter *)0)->allowTurn ) },
{ "bool", "run", (intptr_t)(&((rvmCharacter *)0)->run), sizeof( ((rvmCharacter *)0)->run ) },
{ "bool", "canTalk", (intptr_t)(&((rvmCharacter *)0)->canTalk), sizeof( ((rvmCharacter *)0)->canTalk ) },
{ "bool", "noCower", (intptr_t)(&((rvmCharacter *)0)->noCower), sizeof( ((rvmCharacter *)0)->noCower ) },
{ "bool", "noCowerSaved", (intptr_t)(&((rvmCharacter *)0)->noCowerSaved), sizeof( ((rvmCharacter *)0)->noCowerSaved ) },
{ "bool", "ignorePush", (intptr_t)(&((rvmCharacter *)0)->ignorePush), sizeof( ((rvmCharacter *)0)->ignorePush ) },
{ "bool", "skipOutOfPath", (intptr_t)(&((rvmCharacter *)0)->skipOutOfPath), sizeof( ((rvmCharacter *)0)->skipOutOfPath ) },
{ "bool", "followNodes", (intptr_t)(&((rvmCharacter *)0)->followNodes), sizeof( ((rvmCharacter *)0)->followNodes ) },
{ "bool", "dontPushOthers", (intptr_t)(&((rvmCharacter *)0)->dontPushOthers), sizeof( ((rvmCharacter *)0)->dontPushOthers ) },
{ "float", "lastPushTime", (intptr_t)(&((rvmCharacter *)0)->lastPushTime), sizeof( ((rvmCharacter *)0)->lastPushTime ) },
{ "float", "pushTime", (intptr_t)(&((rvmCharacter *)0)->pushTime), sizeof( ((rvmCharacter *)0)->pushTime ) },
{ "float", "talkEndTime", (intptr_t)(&((rvmCharacter *)0)->talkEndTime), sizeof( ((rvmCharacter *)0)->talkEndTime ) },
{ "float", "talkChannel", (intptr_t)(&((rvmCharacter *)0)->talkChannel), sizeof( ((rvmCharacter *)0)->talkChannel ) },
{ "float", "talkOriginalYaw", (intptr_t)(&((rvmCharacter *)0)->talkOriginalYaw), sizeof( ((rvmCharacter *)0)->talkOriginalYaw ) },
{ "idEntityPtr < idEntity >", "current_path", (intptr_t)(&((rvmCharacter *)0)->current_path), sizeof( ((rvmCharacter *)0)->current_path ) },
{ "idEntityPtr < idEntity >", "next_path", (intptr_t)(&((rvmCharacter *)0)->next_path), sizeof( ((rvmCharacter *)0)->next_path ) },
{ "idEntityPtr < idEntity >", "listening_to_character", (intptr_t)(&((rvmCharacter *)0)->listening_to_character), sizeof( ((rvmCharacter *)0)->listening_to_character ) },
{ "idEntityPtr < idEntity >", "next_listener", (intptr_t)(&((rvmCharacter *)0)->next_listener), sizeof( ((rvmCharacter *)0)->next_listener ) },
{ NULL, 0 }
};
static classVariableInfo_t rvmAICharacterProne_typeInfo[] = {
{ NULL, 0 }
};
static classVariableInfo_t rvmFollower_typeInfo[] = {
{ NULL, 0 }
};
static classVariableInfo_t rvmCharSentry_typeInfo[] = {
{ "bool", "lead_player", (intptr_t)(&((rvmCharSentry *)0)->lead_player), sizeof( ((rvmCharSentry *)0)->lead_player ) },
{ "bool", "hanging", (intptr_t)(&((rvmCharSentry *)0)->hanging), sizeof( ((rvmCharSentry *)0)->hanging ) },
{ "bool", "awake", (intptr_t)(&((rvmCharSentry *)0)->awake), sizeof( ((rvmCharSentry *)0)->awake ) },
{ "bool", "fire", (intptr_t)(&((rvmCharSentry *)0)->fire), sizeof( ((rvmCharSentry *)0)->fire ) },
{ "float", "playerMoveState", (intptr_t)(&((rvmCharSentry *)0)->playerMoveState), sizeof( ((rvmCharSentry *)0)->playerMoveState ) },
{ "idEntityPtr < idEntity >", "light", (intptr_t)(&((rvmCharSentry *)0)->light), sizeof( ((rvmCharSentry *)0)->light ) },
{ "bool", "light_on", (intptr_t)(&((rvmCharSentry *)0)->light_on), sizeof( ((rvmCharSentry *)0)->light_on ) },
{ "float", "nextPositionSearch", (intptr_t)(&((rvmCharSentry *)0)->nextPositionSearch), sizeof( ((rvmCharSentry *)0)->nextPositionSearch ) },
{ "idEntityPtr < idEntity >", "ignore_enemy", (intptr_t)(&((rvmCharSentry *)0)->ignore_enemy), sizeof( ((rvmCharSentry *)0)->ignore_enemy ) },
{ "float", "ignore_enemy_time", (intptr_t)(&((rvmCharSentry *)0)->ignore_enemy_time), sizeof( ((rvmCharSentry *)0)->ignore_enemy_time ) },
{ "idVec3", "lastValidPlayerPosition", (intptr_t)(&((rvmCharSentry *)0)->lastValidPlayerPosition), sizeof( ((rvmCharSentry *)0)->lastValidPlayerPosition ) },
{ "bool", "playerPositionThread", (intptr_t)(&((rvmCharSentry *)0)->playerPositionThread), sizeof( ((rvmCharSentry *)0)->playerPositionThread ) },
{ "float", "nextLookTime", (intptr_t)(&((rvmCharSentry *)0)->nextLookTime), sizeof( ((rvmCharSentry *)0)->nextLookTime ) },
{ "float", "leadTimeout", (intptr_t)(&((rvmCharSentry *)0)->leadTimeout), sizeof( ((rvmCharSentry *)0)->leadTimeout ) },
{ "int", "shotsFired", (intptr_t)(&((rvmCharSentry *)0)->shotsFired), sizeof( ((rvmCharSentry *)0)->shotsFired ) },
{ "float", "nextFireTime", (intptr_t)(&((rvmCharSentry *)0)->nextFireTime), sizeof( ((rvmCharSentry *)0)->nextFireTime ) },
{ NULL, 0 }
};
static classVariableInfo_t rvmAIAlphaLabs2Scientist1_typeInfo[] = {
{ NULL, 0 }
};
static classVariableInfo_t rvmMonsterDemonPinky_typeInfo[] = {
{ ": float", "nextDodge", (intptr_t)(&((rvmMonsterDemonPinky *)0)->nextDodge), sizeof( ((rvmMonsterDemonPinky *)0)->nextDodge ) },
{ "float", "nextRoar", (intptr_t)(&((rvmMonsterDemonPinky *)0)->nextRoar), sizeof( ((rvmMonsterDemonPinky *)0)->nextRoar ) },
{ "float", "painNextTime", (intptr_t)(&((rvmMonsterDemonPinky *)0)->painNextTime), sizeof( ((rvmMonsterDemonPinky *)0)->painNextTime ) },
{ "idEntityPtr < idEntity >", "combat_node", (intptr_t)(&((rvmMonsterDemonPinky *)0)->combat_node), sizeof( ((rvmMonsterDemonPinky *)0)->combat_node ) },
{ NULL, 0 }
};
static classVariableInfo_t rvmMonsterDemonImp_typeInfo[] = {
{ ": float", "nextDodge", (intptr_t)(&((rvmMonsterDemonImp *)0)->nextDodge), sizeof( ((rvmMonsterDemonImp *)0)->nextDodge ) },
{ "float", "nextAttack", (intptr_t)(&((rvmMonsterDemonImp *)0)->nextAttack), sizeof( ((rvmMonsterDemonImp *)0)->nextAttack ) },
{ "float", "nextNoFOVAttack", (intptr_t)(&((rvmMonsterDemonImp *)0)->nextNoFOVAttack), sizeof( ((rvmMonsterDemonImp *)0)->nextNoFOVAttack ) },
{ "float", "nextLeap", (intptr_t)(&((rvmMonsterDemonImp *)0)->nextLeap), sizeof( ((rvmMonsterDemonImp *)0)->nextLeap ) },
{ "float", "painNextTime", (intptr_t)(&((rvmMonsterDemonImp *)0)->painNextTime), sizeof( ((rvmMonsterDemonImp *)0)->painNextTime ) },
{ "idVec3", "jumpVelocity", (intptr_t)(&((rvmMonsterDemonImp *)0)->jumpVelocity), sizeof( ((rvmMonsterDemonImp *)0)->jumpVelocity ) },
{ "idStr", "range_attack_anim", (intptr_t)(&((rvmMonsterDemonImp *)0)->range_attack_anim), sizeof( ((rvmMonsterDemonImp *)0)->range_attack_anim ) },
{ "idEntityPtr < idEntity >", "combat_node", (intptr_t)(&((rvmMonsterDemonImp *)0)->combat_node), sizeof( ((rvmMonsterDemonImp *)0)->combat_node ) },
{ NULL, 0 }
};
static classVariableInfo_t rvmMonsterDemonVulgar_typeInfo[] = {
{ ": float", "nextDodge", (intptr_t)(&((rvmMonsterDemonVulgar *)0)->nextDodge), sizeof( ((rvmMonsterDemonVulgar *)0)->nextDodge ) },
{ "float", "nextAttack", (intptr_t)(&((rvmMonsterDemonVulgar *)0)->nextAttack), sizeof( ((rvmMonsterDemonVulgar *)0)->nextAttack ) },
{ "float", "nextNoFOVAttack", (intptr_t)(&((rvmMonsterDemonVulgar *)0)->nextNoFOVAttack), sizeof( ((rvmMonsterDemonVulgar *)0)->nextNoFOVAttack ) },
{ "float", "nextLeap", (intptr_t)(&((rvmMonsterDemonVulgar *)0)->nextLeap), sizeof( ((rvmMonsterDemonVulgar *)0)->nextLeap ) },
{ "float", "painNextTime", (intptr_t)(&((rvmMonsterDemonVulgar *)0)->painNextTime), sizeof( ((rvmMonsterDemonVulgar *)0)->painNextTime ) },
{ "idVec3", "jumpVelocity", (intptr_t)(&((rvmMonsterDemonVulgar *)0)->jumpVelocity), sizeof( ((rvmMonsterDemonVulgar *)0)->jumpVelocity ) },
{ "idStr", "range_attack_anim", (intptr_t)(&((rvmMonsterDemonVulgar *)0)->range_attack_anim), sizeof( ((rvmMonsterDemonVulgar *)0)->range_attack_anim ) },
{ "idEntityPtr < idEntity >", "combat_node", (intptr_t)(&((rvmMonsterDemonVulgar *)0)->combat_node), sizeof( ((rvmMonsterDemonVulgar *)0)->combat_node ) },
{ NULL, 0 }
};
static classVariableInfo_t rvmMonsterDemonRevenant_typeInfo[] = {
{ ": float", "nextDodge", (intptr_t)(&((rvmMonsterDemonRevenant *)0)->nextDodge), sizeof( ((rvmMonsterDemonRevenant *)0)->nextDodge ) },
{ "float", "nextAttack", (intptr_t)(&((rvmMonsterDemonRevenant *)0)->nextAttack), sizeof( ((rvmMonsterDemonRevenant *)0)->nextAttack ) },
{ "float", "nextNoFOVAttack", (intptr_t)(&((rvmMonsterDemonRevenant *)0)->nextNoFOVAttack), sizeof( ((rvmMonsterDemonRevenant *)0)->nextNoFOVAttack ) },
{ "float", "nextLeap", (intptr_t)(&((rvmMonsterDemonRevenant *)0)->nextLeap), sizeof( ((rvmMonsterDemonRevenant *)0)->nextLeap ) },
{ "float", "painNextTime", (intptr_t)(&((rvmMonsterDemonRevenant *)0)->painNextTime), sizeof( ((rvmMonsterDemonRevenant *)0)->painNextTime ) },
{ "idVec3", "jumpVelocity", (intptr_t)(&((rvmMonsterDemonRevenant *)0)->jumpVelocity), sizeof( ((rvmMonsterDemonRevenant *)0)->jumpVelocity ) },
{ "idStr", "range_attack_anim", (intptr_t)(&((rvmMonsterDemonRevenant *)0)->range_attack_anim), sizeof( ((rvmMonsterDemonRevenant *)0)->range_attack_anim ) },
{ "idEntityPtr < idEntity >", "combat_node", (intptr_t)(&((rvmMonsterDemonRevenant *)0)->combat_node), sizeof( ((rvmMonsterDemonRevenant *)0)->combat_node ) },
{ NULL, 0 }
};
static classVariableInfo_t rvmMonsterDemonHellknight_typeInfo[] = {
{ ": float", "nextDodge", (intptr_t)(&((rvmMonsterDemonHellknight *)0)->nextDodge), sizeof( ((rvmMonsterDemonHellknight *)0)->nextDodge ) },
{ "float", "nextAttack", (intptr_t)(&((rvmMonsterDemonHellknight *)0)->nextAttack), sizeof( ((rvmMonsterDemonHellknight *)0)->nextAttack ) },
{ "float", "nextNoFOVAttack", (intptr_t)(&((rvmMonsterDemonHellknight *)0)->nextNoFOVAttack), sizeof( ((rvmMonsterDemonHellknight *)0)->nextNoFOVAttack ) },
{ "float", "nextLeap", (intptr_t)(&((rvmMonsterDemonHellknight *)0)->nextLeap), sizeof( ((rvmMonsterDemonHellknight *)0)->nextLeap ) },
{ "float", "painNextTime", (intptr_t)(&((rvmMonsterDemonHellknight *)0)->painNextTime), sizeof( ((rvmMonsterDemonHellknight *)0)->painNextTime ) },
{ "idVec3", "jumpVelocity", (intptr_t)(&((rvmMonsterDemonHellknight *)0)->jumpVelocity), sizeof( ((rvmMonsterDemonHellknight *)0)->jumpVelocity ) },
{ "idStr", "range_attack_anim", (intptr_t)(&((rvmMonsterDemonHellknight *)0)->range_attack_anim), sizeof( ((rvmMonsterDemonHellknight *)0)->range_attack_anim ) },
{ "idEntityPtr < idEntity >", "combat_node", (intptr_t)(&((rvmMonsterDemonHellknight *)0)->combat_node), sizeof( ((rvmMonsterDemonHellknight *)0)->combat_node ) },
{ NULL, 0 }
};
static classVariableInfo_t rvmMonsterDemonMaggot_typeInfo[] = {
{ ": bool", "explode", (intptr_t)(&((rvmMonsterDemonMaggot *)0)->explode), sizeof( ((rvmMonsterDemonMaggot *)0)->explode ) },
{ "float", "nextDodge", (intptr_t)(&((rvmMonsterDemonMaggot *)0)->nextDodge), sizeof( ((rvmMonsterDemonMaggot *)0)->nextDodge ) },
{ "float", "nextLeap", (intptr_t)(&((rvmMonsterDemonMaggot *)0)->nextLeap), sizeof( ((rvmMonsterDemonMaggot *)0)->nextLeap ) },
{ "float", "painNextTime", (intptr_t)(&((rvmMonsterDemonMaggot *)0)->painNextTime), sizeof( ((rvmMonsterDemonMaggot *)0)->painNextTime ) },
{ "idVec3", "jumpVelocity", (intptr_t)(&((rvmMonsterDemonMaggot *)0)->jumpVelocity), sizeof( ((rvmMonsterDemonMaggot *)0)->jumpVelocity ) },
{ "idEntityPtr < idEntity >", "combat_node", (intptr_t)(&((rvmMonsterDemonMaggot *)0)->combat_node), sizeof( ((rvmMonsterDemonMaggot *)0)->combat_node ) },
{ NULL, 0 }
};
static classVariableInfo_t rvmMonsterDemonCherub_typeInfo[] = {
{ ": bool", "explode", (intptr_t)(&((rvmMonsterDemonCherub *)0)->explode), sizeof( ((rvmMonsterDemonCherub *)0)->explode ) },
{ "float", "nextDodge", (intptr_t)(&((rvmMonsterDemonCherub *)0)->nextDodge), sizeof( ((rvmMonsterDemonCherub *)0)->nextDodge ) },
{ "float", "nextLeap", (intptr_t)(&((rvmMonsterDemonCherub *)0)->nextLeap), sizeof( ((rvmMonsterDemonCherub *)0)->nextLeap ) },
{ "float", "painNextTime", (intptr_t)(&((rvmMonsterDemonCherub *)0)->painNextTime), sizeof( ((rvmMonsterDemonCherub *)0)->painNextTime ) },
{ "idVec3", "jumpVelocity", (intptr_t)(&((rvmMonsterDemonCherub *)0)->jumpVelocity), sizeof( ((rvmMonsterDemonCherub *)0)->jumpVelocity ) },
{ "idEntityPtr < idEntity >", "combat_node", (intptr_t)(&((rvmMonsterDemonCherub *)0)->combat_node), sizeof( ((rvmMonsterDemonCherub *)0)->combat_node ) },
{ NULL, 0 }
};
static classVariableInfo_t rvmMonsterDemonTrite_typeInfo[] = {
{ ": bool", "explode", (intptr_t)(&((rvmMonsterDemonTrite *)0)->explode), sizeof( ((rvmMonsterDemonTrite *)0)->explode ) },
{ "float", "nextDodge", (intptr_t)(&((rvmMonsterDemonTrite *)0)->nextDodge), sizeof( ((rvmMonsterDemonTrite *)0)->nextDodge ) },
{ "float", "nextLeap", (intptr_t)(&((rvmMonsterDemonTrite *)0)->nextLeap), sizeof( ((rvmMonsterDemonTrite *)0)->nextLeap ) },
{ "float", "painNextTime", (intptr_t)(&((rvmMonsterDemonTrite *)0)->painNextTime), sizeof( ((rvmMonsterDemonTrite *)0)->painNextTime ) },
{ "idVec3", "jumpVelocity", (intptr_t)(&((rvmMonsterDemonTrite *)0)->jumpVelocity), sizeof( ((rvmMonsterDemonTrite *)0)->jumpVelocity ) },
{ "idEntityPtr < idEntity >", "combat_node", (intptr_t)(&((rvmMonsterDemonTrite *)0)->combat_node), sizeof( ((rvmMonsterDemonTrite *)0)->combat_node ) },
{ NULL, 0 }
};
static classVariableInfo_t rvmMonsterDemonWraith_typeInfo[] = {
{ ": bool", "invisible", (intptr_t)(&((rvmMonsterDemonWraith *)0)->invisible), sizeof( ((rvmMonsterDemonWraith *)0)->invisible ) },
{ "float", "nextDodge", (intptr_t)(&((rvmMonsterDemonWraith *)0)->nextDodge), sizeof( ((rvmMonsterDemonWraith *)0)->nextDodge ) },
{ "float", "nextInvisible", (intptr_t)(&((rvmMonsterDemonWraith *)0)->nextInvisible), sizeof( ((rvmMonsterDemonWraith *)0)->nextInvisible ) },
{ "float", "painNextTime", (intptr_t)(&((rvmMonsterDemonWraith *)0)->painNextTime), sizeof( ((rvmMonsterDemonWraith *)0)->painNextTime ) },
{ "idEntityPtr < idEntity >", "combat_node", (intptr_t)(&((rvmMonsterDemonWraith *)0)->combat_node), sizeof( ((rvmMonsterDemonWraith *)0)->combat_node ) },
{ "idEntityPtr < idEntity >", "spawn_effect", (intptr_t)(&((rvmMonsterDemonWraith *)0)->spawn_effect), sizeof( ((rvmMonsterDemonWraith *)0)->spawn_effect ) },
{ NULL, 0 }
};
static classVariableInfo_t rvmMonsterDemonMancubus_typeInfo[] = {
{ ": float", "nextAttack", (intptr_t)(&((rvmMonsterDemonMancubus *)0)->nextAttack), sizeof( ((rvmMonsterDemonMancubus *)0)->nextAttack ) },
{ "float", "nextNoFOVAttack", (intptr_t)(&((rvmMonsterDemonMancubus *)0)->nextNoFOVAttack), sizeof( ((rvmMonsterDemonMancubus *)0)->nextNoFOVAttack ) },
{ "float", "fire", (intptr_t)(&((rvmMonsterDemonMancubus *)0)->fire), sizeof( ((rvmMonsterDemonMancubus *)0)->fire ) },
{ "float", "painNextTime", (intptr_t)(&((rvmMonsterDemonMancubus *)0)->painNextTime), sizeof( ((rvmMonsterDemonMancubus *)0)->painNextTime ) },
{ "idEntityPtr < idEntity >", "combat_node", (intptr_t)(&((rvmMonsterDemonMancubus *)0)->combat_node), sizeof( ((rvmMonsterDemonMancubus *)0)->combat_node ) },
{ NULL, 0 }
};
static classVariableInfo_t rvmMonsterDemonArchvile_typeInfo[] = {
{ ": float", "nextDodge", (intptr_t)(&((rvmMonsterDemonArchvile *)0)->nextDodge), sizeof( ((rvmMonsterDemonArchvile *)0)->nextDodge ) },
{ "float", "nextAttack", (intptr_t)(&((rvmMonsterDemonArchvile *)0)->nextAttack), sizeof( ((rvmMonsterDemonArchvile *)0)->nextAttack ) },
{ "float", "nextNoFOVAttack", (intptr_t)(&((rvmMonsterDemonArchvile *)0)->nextNoFOVAttack), sizeof( ((rvmMonsterDemonArchvile *)0)->nextNoFOVAttack ) },
{ "float", "painNextTime", (intptr_t)(&((rvmMonsterDemonArchvile *)0)->painNextTime), sizeof( ((rvmMonsterDemonArchvile *)0)->painNextTime ) },
{ "float", "keep_alive", (intptr_t)(&((rvmMonsterDemonArchvile *)0)->keep_alive), sizeof( ((rvmMonsterDemonArchvile *)0)->keep_alive ) },
{ "float", "num_start", (intptr_t)(&((rvmMonsterDemonArchvile *)0)->num_start), sizeof( ((rvmMonsterDemonArchvile *)0)->num_start ) },
{ "float", "summon_delay", (intptr_t)(&((rvmMonsterDemonArchvile *)0)->summon_delay), sizeof( ((rvmMonsterDemonArchvile *)0)->summon_delay ) },
{ "float", "summon_time", (intptr_t)(&((rvmMonsterDemonArchvile *)0)->summon_time), sizeof( ((rvmMonsterDemonArchvile *)0)->summon_time ) },
{ "idEntityPtr < idEntity >", "combat_node", (intptr_t)(&((rvmMonsterDemonArchvile *)0)->combat_node), sizeof( ((rvmMonsterDemonArchvile *)0)->combat_node ) },
{ "idEntityPtr < idEntity >", "resurrectionTarget", (intptr_t)(&((rvmMonsterDemonArchvile *)0)->resurrectionTarget), sizeof( ((rvmMonsterDemonArchvile *)0)->resurrectionTarget ) },
{ "idVec3", "flameWallOrigin", (intptr_t)(&((rvmMonsterDemonArchvile *)0)->flameWallOrigin), sizeof( ((rvmMonsterDemonArchvile *)0)->flameWallOrigin ) },
{ "idVec3", "incinerateOrigin", (intptr_t)(&((rvmMonsterDemonArchvile *)0)->incinerateOrigin), sizeof( ((rvmMonsterDemonArchvile *)0)->incinerateOrigin ) },
{ NULL, 0 }
};
static classVariableInfo_t rvmMonsterFlyingCacodemon_typeInfo[] = {
{ ": float", "nextAttack", (intptr_t)(&((rvmMonsterFlyingCacodemon *)0)->nextAttack), sizeof( ((rvmMonsterFlyingCacodemon *)0)->nextAttack ) },
{ "float", "nextNoFOVAttack", (intptr_t)(&((rvmMonsterFlyingCacodemon *)0)->nextNoFOVAttack), sizeof( ((rvmMonsterFlyingCacodemon *)0)->nextNoFOVAttack ) },
{ "float", "painNextTime", (intptr_t)(&((rvmMonsterFlyingCacodemon *)0)->painNextTime), sizeof( ((rvmMonsterFlyingCacodemon *)0)->painNextTime ) },
{ "idEntityPtr < idEntity >", "combat_node", (intptr_t)(&((rvmMonsterFlyingCacodemon *)0)->combat_node), sizeof( ((rvmMonsterFlyingCacodemon *)0)->combat_node ) },
{ NULL, 0 }
};
static classVariableInfo_t rvmMonsterFlyingLostsoul_typeInfo[] = {
{ ": float", "nextAttack", (intptr_t)(&((rvmMonsterFlyingLostsoul *)0)->nextAttack), sizeof( ((rvmMonsterFlyingLostsoul *)0)->nextAttack ) },
{ "float", "nextNoFOVAttack", (intptr_t)(&((rvmMonsterFlyingLostsoul *)0)->nextNoFOVAttack), sizeof( ((rvmMonsterFlyingLostsoul *)0)->nextNoFOVAttack ) },
{ "float", "noMeleeTime", (intptr_t)(&((rvmMonsterFlyingLostsoul *)0)->noMeleeTime), sizeof( ((rvmMonsterFlyingLostsoul *)0)->noMeleeTime ) },
{ "float", "fly_offset", (intptr_t)(&((rvmMonsterFlyingLostsoul *)0)->fly_offset), sizeof( ((rvmMonsterFlyingLostsoul *)0)->fly_offset ) },
{ "float", "painNextTime", (intptr_t)(&((rvmMonsterFlyingLostsoul *)0)->painNextTime), sizeof( ((rvmMonsterFlyingLostsoul *)0)->painNextTime ) },
{ "idVec3", "chargeVelocity", (intptr_t)(&((rvmMonsterFlyingLostsoul *)0)->chargeVelocity), sizeof( ((rvmMonsterFlyingLostsoul *)0)->chargeVelocity ) },
{ NULL, 0 }
};
static classVariableInfo_t rvmMonsterTurret_typeInfo[] = {
{ ": bool", "fire", (intptr_t)(&((rvmMonsterTurret *)0)->fire), sizeof( ((rvmMonsterTurret *)0)->fire ) },
{ "bool", "attack_monsters", (intptr_t)(&((rvmMonsterTurret *)0)->attack_monsters), sizeof( ((rvmMonsterTurret *)0)->attack_monsters ) },
{ "bool", "light_is_on", (intptr_t)(&((rvmMonsterTurret *)0)->light_is_on), sizeof( ((rvmMonsterTurret *)0)->light_is_on ) },
{ "float", "attackTime", (intptr_t)(&((rvmMonsterTurret *)0)->attackTime), sizeof( ((rvmMonsterTurret *)0)->attackTime ) },
{ "float", "nextFireTime", (intptr_t)(&((rvmMonsterTurret *)0)->nextFireTime), sizeof( ((rvmMonsterTurret *)0)->nextFireTime ) },
{ "float", "shutdownTime", (intptr_t)(&((rvmMonsterTurret *)0)->shutdownTime), sizeof( ((rvmMonsterTurret *)0)->shutdownTime ) },
{ "idEntityPtr < idEntity >", "light", (intptr_t)(&((rvmMonsterTurret *)0)->light), sizeof( ((rvmMonsterTurret *)0)->light ) },
{ NULL, 0 }
};
static classVariableInfo_t rvmMonsterBossCyberdemon_typeInfo[] = {
{ ": float", "nextAttack", (intptr_t)(&((rvmMonsterBossCyberdemon *)0)->nextAttack), sizeof( ((rvmMonsterBossCyberdemon *)0)->nextAttack ) },
{ "float", "nextNoFOVAttack", (intptr_t)(&((rvmMonsterBossCyberdemon *)0)->nextNoFOVAttack), sizeof( ((rvmMonsterBossCyberdemon *)0)->nextNoFOVAttack ) },
{ "float", "painNextTime", (intptr_t)(&((rvmMonsterBossCyberdemon *)0)->painNextTime), sizeof( ((rvmMonsterBossCyberdemon *)0)->painNextTime ) },
{ "idStr", "range_attack_anim", (intptr_t)(&((rvmMonsterBossCyberdemon *)0)->range_attack_anim), sizeof( ((rvmMonsterBossCyberdemon *)0)->range_attack_anim ) },
{ "idEntityPtr < idEntity >", "kick_entity", (intptr_t)(&((rvmMonsterBossCyberdemon *)0)->kick_entity), sizeof( ((rvmMonsterBossCyberdemon *)0)->kick_entity ) },
{ NULL, 0 }
};
static classVariableInfo_t rvmMonsterBossVagary_typeInfo[] = {
{ ": float", "nextDodge", (intptr_t)(&((rvmMonsterBossVagary *)0)->nextDodge), sizeof( ((rvmMonsterBossVagary *)0)->nextDodge ) },
{ "float", "nextAttack", (intptr_t)(&((rvmMonsterBossVagary *)0)->nextAttack), sizeof( ((rvmMonsterBossVagary *)0)->nextAttack ) },
{ "float", "nextNoFOVAttack", (intptr_t)(&((rvmMonsterBossVagary *)0)->nextNoFOVAttack), sizeof( ((rvmMonsterBossVagary *)0)->nextNoFOVAttack ) },
{ "float", "painNextTime", (intptr_t)(&((rvmMonsterBossVagary *)0)->painNextTime), sizeof( ((rvmMonsterBossVagary *)0)->painNextTime ) },
{ "idEntityPtr < idEntity >", "combat_node", (intptr_t)(&((rvmMonsterBossVagary *)0)->combat_node), sizeof( ((rvmMonsterBossVagary *)0)->combat_node ) },
{ "idEntityPtr < idEntity >", "throwEntity", (intptr_t)(&((rvmMonsterBossVagary *)0)->throwEntity), sizeof( ((rvmMonsterBossVagary *)0)->throwEntity ) },
{ NULL, 0 }
};
static classVariableInfo_t rvmMonsterBossSabaoth_typeInfo[] = {
{ ": float", "nextAttack", (intptr_t)(&((rvmMonsterBossSabaoth *)0)->nextAttack), sizeof( ((rvmMonsterBossSabaoth *)0)->nextAttack ) },
{ "float", "nextMeleeAttack", (intptr_t)(&((rvmMonsterBossSabaoth *)0)->nextMeleeAttack), sizeof( ((rvmMonsterBossSabaoth *)0)->nextMeleeAttack ) },
{ "float", "pathSpeed", (intptr_t)(&((rvmMonsterBossSabaoth *)0)->pathSpeed), sizeof( ((rvmMonsterBossSabaoth *)0)->pathSpeed ) },
{ "bool", "noSlowToStop", (intptr_t)(&((rvmMonsterBossSabaoth *)0)->noSlowToStop), sizeof( ((rvmMonsterBossSabaoth *)0)->noSlowToStop ) },
{ "idEntityPtr < idEntity >", "currentPath", (intptr_t)(&((rvmMonsterBossSabaoth *)0)->currentPath), sizeof( ((rvmMonsterBossSabaoth *)0)->currentPath ) },
{ "idEntityPtr < idEntity >", "nextPath", (intptr_t)(&((rvmMonsterBossSabaoth *)0)->nextPath), sizeof( ((rvmMonsterBossSabaoth *)0)->nextPath ) },
{ NULL, 0 }
};
static classVariableInfo_t rvmSeekerBase_typeInfo[] = {
{ NULL, 0 }
};
static classVariableInfo_t rvmMonsterBossGuardianSpawner_typeInfo[] = {
{ ": idEntityPtr < idEntity >", "guardian", (intptr_t)(&((rvmMonsterBossGuardianSpawner *)0)->guardian), sizeof( ((rvmMonsterBossGuardianSpawner *)0)->guardian ) },
{ "float", "inactive_time", (intptr_t)(&((rvmMonsterBossGuardianSpawner *)0)->inactive_time), sizeof( ((rvmMonsterBossGuardianSpawner *)0)->inactive_time ) },
{ "float", "active_time", (intptr_t)(&((rvmMonsterBossGuardianSpawner *)0)->active_time), sizeof( ((rvmMonsterBossGuardianSpawner *)0)->active_time ) },
{ "float", "pain_time", (intptr_t)(&((rvmMonsterBossGuardianSpawner *)0)->pain_time), sizeof( ((rvmMonsterBossGuardianSpawner *)0)->pain_time ) },
{ NULL, 0 }
};
static classVariableInfo_t rvmMonsterBossGuardian_typeInfo[] = {
{ ": float", "nextAttack", (intptr_t)(&((rvmMonsterBossGuardian *)0)->nextAttack), sizeof( ((rvmMonsterBossGuardian *)0)->nextAttack ) },
{ "float", "painNextTime", (intptr_t)(&((rvmMonsterBossGuardian *)0)->painNextTime), sizeof( ((rvmMonsterBossGuardian *)0)->painNextTime ) },
{ "bool", "in_melee", (intptr_t)(&((rvmMonsterBossGuardian *)0)->in_melee), sizeof( ((rvmMonsterBossGuardian *)0)->in_melee ) },
{ "bool", "rightfoot", (intptr_t)(&((rvmMonsterBossGuardian *)0)->rightfoot), sizeof( ((rvmMonsterBossGuardian *)0)->rightfoot ) },
{ "bool", "charge", (intptr_t)(&((rvmMonsterBossGuardian *)0)->charge), sizeof( ((rvmMonsterBossGuardian *)0)->charge ) },
{ "idEntityPtr < idEntity >", "seeker1", (intptr_t)(&((rvmMonsterBossGuardian *)0)->seeker1), sizeof( ((rvmMonsterBossGuardian *)0)->seeker1 ) },
{ "idEntityPtr < idEntity >", "seeker2", (intptr_t)(&((rvmMonsterBossGuardian *)0)->seeker2), sizeof( ((rvmMonsterBossGuardian *)0)->seeker2 ) },
{ "idEntityPtr < idEntity >", "seeker3", (intptr_t)(&((rvmMonsterBossGuardian *)0)->seeker3), sizeof( ((rvmMonsterBossGuardian *)0)->seeker3 ) },
{ "idEntityPtr < idEntity >", "spawner", (intptr_t)(&((rvmMonsterBossGuardian *)0)->spawner), sizeof( ((rvmMonsterBossGuardian *)0)->spawner ) },
{ NULL, 0 }
};
static classVariableInfo_t rvmMonsterBossGuardianSeeker_typeInfo[] = {
{ ": float", "painNextTime", (intptr_t)(&((rvmMonsterBossGuardianSeeker *)0)->painNextTime), sizeof( ((rvmMonsterBossGuardianSeeker *)0)->painNextTime ) },
{ "float", "nextEnemyCheck", (intptr_t)(&((rvmMonsterBossGuardianSeeker *)0)->nextEnemyCheck), sizeof( ((rvmMonsterBossGuardianSeeker *)0)->nextEnemyCheck ) },
{ "float", "getCloserEndTime", (intptr_t)(&((rvmMonsterBossGuardianSeeker *)0)->getCloserEndTime), sizeof( ((rvmMonsterBossGuardianSeeker *)0)->getCloserEndTime ) },
{ "float", "retreatEndTime", (intptr_t)(&((rvmMonsterBossGuardianSeeker *)0)->retreatEndTime), sizeof( ((rvmMonsterBossGuardianSeeker *)0)->retreatEndTime ) },
{ "idEntityPtr < idEntity >", "guardian", (intptr_t)(&((rvmMonsterBossGuardianSeeker *)0)->guardian), sizeof( ((rvmMonsterBossGuardianSeeker *)0)->guardian ) },
{ NULL, 0 }
};
static classVariableInfo_t idTestModel_typeInfo[] = {
{ ": idEntityPtr < idEntity >", "head", (intptr_t)(&((idTestModel *)0)->head), sizeof( ((idTestModel *)0)->head ) },
{ "idAnimator *", "headAnimator", (intptr_t)(&((idTestModel *)0)->headAnimator), sizeof( ((idTestModel *)0)->headAnimator ) },
@@ -9120,6 +9534,42 @@ static classTypeInfo_t classTypeInfo[] = {
{ "idAI", "idActor", sizeof(idAI), idAI_typeInfo },
{ "idCombatNode", "idEntity", sizeof(idCombatNode), idCombatNode_typeInfo },
{ "idAI_Vagary", "idAI", sizeof(idAI_Vagary), idAI_Vagary_typeInfo },
{ "rvmAIObject", "idClass", sizeof(rvmAIObject), rvmAIObject_typeInfo },
{ "rvmMonsterBase", "rvmAIObject", sizeof(rvmMonsterBase), rvmMonsterBase_typeInfo },
{ "rvmMonsterZombieBase", "rvmMonsterBase", sizeof(rvmMonsterZombieBase), rvmMonsterZombieBase_typeInfo },
{ "rvmMonsterZombie", "rvmMonsterZombieBase", sizeof(rvmMonsterZombie), rvmMonsterZombie_typeInfo },
{ "rvmMonsterZombieBernie", "rvmMonsterZombieBase", sizeof(rvmMonsterZombieBernie), rvmMonsterZombieBernie_typeInfo },
{ "rvmMonsterZombieMorgue", "rvmMonsterZombieBase", sizeof(rvmMonsterZombieMorgue), rvmMonsterZombieMorgue_typeInfo },
{ "rvmMonsterZombieSawyer", "rvmMonsterZombieBase", sizeof(rvmMonsterZombieSawyer), rvmMonsterZombieSawyer_typeInfo },
{ "rvmMonsterZombieCommandoTentacle", "rvmMonsterBase", sizeof(rvmMonsterZombieCommandoTentacle), rvmMonsterZombieCommandoTentacle_typeInfo },
{ "rvmMonsterZombieCommandoCGun", "rvmMonsterBase", sizeof(rvmMonsterZombieCommandoCGun), rvmMonsterZombieCommandoCGun_typeInfo },
{ "rvmMonsterZombieSecurityPistol", "rvmMonsterZombieBase", sizeof(rvmMonsterZombieSecurityPistol), rvmMonsterZombieSecurityPistol_typeInfo },
{ "rvmCharacter", "rvmAIObject", sizeof(rvmCharacter), rvmCharacter_typeInfo },
{ "rvmAICharacterProne", "rvmAIObject", sizeof(rvmAICharacterProne), rvmAICharacterProne_typeInfo },
{ "rvmFollower", "rvmAIObject", sizeof(rvmFollower), rvmFollower_typeInfo },
{ "rvmCharSentry", "rvmCharacter", sizeof(rvmCharSentry), rvmCharSentry_typeInfo },
{ "rvmAIAlphaLabs2Scientist1", "rvmAIObject", sizeof(rvmAIAlphaLabs2Scientist1), rvmAIAlphaLabs2Scientist1_typeInfo },
{ "rvmMonsterDemonPinky", "rvmMonsterBase", sizeof(rvmMonsterDemonPinky), rvmMonsterDemonPinky_typeInfo },
{ "rvmMonsterDemonImp", "rvmMonsterBase", sizeof(rvmMonsterDemonImp), rvmMonsterDemonImp_typeInfo },
{ "rvmMonsterDemonVulgar", "rvmMonsterBase", sizeof(rvmMonsterDemonVulgar), rvmMonsterDemonVulgar_typeInfo },
{ "rvmMonsterDemonRevenant", "rvmMonsterBase", sizeof(rvmMonsterDemonRevenant), rvmMonsterDemonRevenant_typeInfo },
{ "rvmMonsterDemonHellknight", "rvmMonsterBase", sizeof(rvmMonsterDemonHellknight), rvmMonsterDemonHellknight_typeInfo },
{ "rvmMonsterDemonMaggot", "rvmMonsterBase", sizeof(rvmMonsterDemonMaggot), rvmMonsterDemonMaggot_typeInfo },
{ "rvmMonsterDemonCherub", "rvmMonsterBase", sizeof(rvmMonsterDemonCherub), rvmMonsterDemonCherub_typeInfo },
{ "rvmMonsterDemonTrite", "rvmMonsterBase", sizeof(rvmMonsterDemonTrite), rvmMonsterDemonTrite_typeInfo },
{ "rvmMonsterDemonWraith", "rvmMonsterBase", sizeof(rvmMonsterDemonWraith), rvmMonsterDemonWraith_typeInfo },
{ "rvmMonsterDemonMancubus", "rvmMonsterBase", sizeof(rvmMonsterDemonMancubus), rvmMonsterDemonMancubus_typeInfo },
{ "rvmMonsterDemonArchvile", "rvmMonsterBase", sizeof(rvmMonsterDemonArchvile), rvmMonsterDemonArchvile_typeInfo },
{ "rvmMonsterFlyingCacodemon", "rvmMonsterBase", sizeof(rvmMonsterFlyingCacodemon), rvmMonsterFlyingCacodemon_typeInfo },
{ "rvmMonsterFlyingLostsoul", "rvmMonsterBase", sizeof(rvmMonsterFlyingLostsoul), rvmMonsterFlyingLostsoul_typeInfo },
{ "rvmMonsterTurret", "rvmMonsterBase", sizeof(rvmMonsterTurret), rvmMonsterTurret_typeInfo },
{ "rvmMonsterBossCyberdemon", "rvmMonsterBase", sizeof(rvmMonsterBossCyberdemon), rvmMonsterBossCyberdemon_typeInfo },
{ "rvmMonsterBossVagary", "rvmMonsterBase", sizeof(rvmMonsterBossVagary), rvmMonsterBossVagary_typeInfo },
{ "rvmMonsterBossSabaoth", "rvmMonsterBase", sizeof(rvmMonsterBossSabaoth), rvmMonsterBossSabaoth_typeInfo },
{ "rvmSeekerBase", "rvmMonsterBase", sizeof(rvmSeekerBase), rvmSeekerBase_typeInfo },
{ "rvmMonsterBossGuardianSpawner", "rvmMonsterBase", sizeof(rvmMonsterBossGuardianSpawner), rvmMonsterBossGuardianSpawner_typeInfo },
{ "rvmMonsterBossGuardian", "rvmMonsterBase", sizeof(rvmMonsterBossGuardian), rvmMonsterBossGuardian_typeInfo },
{ "rvmMonsterBossGuardianSeeker", "rvmSeekerBase", sizeof(rvmMonsterBossGuardianSeeker), rvmMonsterBossGuardianSeeker_typeInfo },
{ "idTestModel", "idAnimatedEntity", sizeof(idTestModel), idTestModel_typeInfo },
{ "opcode_t", "", sizeof(opcode_t), opcode_t_typeInfo },
{ "idCompiler", "", sizeof(idCompiler), idCompiler_typeInfo },
+2
View File
@@ -128,6 +128,8 @@ public:
void Save( idSaveGame* saveFile ) const;
void Restore( idRestoreGame* saveFile, idClass* owner );
idStr CurrentState(void) const { if (IsIdle()) { return ""; } return GetState()->state; }
protected:
struct flags