mirror of
https://github.com/jmarshall23/DoomRTX.git
synced 2026-08-20 04:30:12 +02:00
Initial Prey Game integration support.
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
//**************************************************************************
|
||||
//**
|
||||
//** PREY_SPIRITSECRET.CPP
|
||||
//**
|
||||
//** Game code for the spirit secret entities
|
||||
//** Spirit secret entities are entities that are only visible
|
||||
//** and blockable in normal mode.
|
||||
//**************************************************************************
|
||||
|
||||
// HEADER FILES ------------------------------------------------------------
|
||||
|
||||
#include "precompiled.h"
|
||||
#pragma hdrstop
|
||||
|
||||
#include "prey_local.h"
|
||||
|
||||
// MACROS ------------------------------------------------------------------
|
||||
|
||||
// TYPES -------------------------------------------------------------------
|
||||
|
||||
// CLASS DECLARATIONS ------------------------------------------------------
|
||||
|
||||
CLASS_DECLARATION( idEntity, hhSpiritSecret )
|
||||
EVENT( EV_Activate, hhSpiritSecret::Event_Activate )
|
||||
END_CLASS
|
||||
|
||||
// EXTERNAL FUNCTION PROTOTYPES --------------------------------------------
|
||||
|
||||
// PRIVATE FUNCTION PROTOTYPES ---------------------------------------------
|
||||
|
||||
// EXTERNAL DATA DECLARATIONS ----------------------------------------------
|
||||
|
||||
// PUBLIC DATA DEFINITIONS -------------------------------------------------
|
||||
|
||||
// PRIVATE DATA DEFINITIONS ------------------------------------------------
|
||||
|
||||
// CODE --------------------------------------------------------------------
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// hhSpiritSecret::Spawn
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
void hhSpiritSecret::Spawn(void) {
|
||||
fl.takedamage = false;
|
||||
|
||||
if ( !spawnArgs.GetInt( "start_off" ) ) {
|
||||
GetPhysics()->SetContents( CONTENTS_FORCEFIELD | CONTENTS_SHOOTABLE );
|
||||
} else { // Start the secret off
|
||||
GetPhysics()->SetContents( 0 );
|
||||
Hide();
|
||||
}
|
||||
|
||||
SetShaderParm( SHADERPARM_MODE, gameLocal.random.CRandomFloat() );
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// hhSpiritSecret::Event_Activate
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
void hhSpiritSecret::Event_Activate( idEntity *activator ) {
|
||||
if ( IsHidden() ) {
|
||||
Show();
|
||||
GetPhysics()->SetContents( CONTENTS_FORCEFIELD | CONTENTS_SHOOTABLE );
|
||||
} else {
|
||||
Hide();
|
||||
GetPhysics()->SetContents( 0 );
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user