mirror of
https://github.com/ptitSeb/Serious-Engine
synced 2024-11-22 10:20:26 +01:00
208 lines
9.7 KiB
C++
208 lines
9.7 KiB
C++
/*
|
|
* This file is generated by Entity Class Compiler, (c) CroTeam 1997-98
|
|
*/
|
|
|
|
#line 4 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
|
|
#include "StdH.h"
|
|
|
|
#define ECF_SPAWNERPROJECTILE ( \
|
|
((ECBI_BRUSH)<<ECB_TEST) |\
|
|
((ECBI_MODEL|ECBI_CORPSE|ECBI_ITEM|ECBI_PROJECTILE_MAGIC|ECBI_PROJECTILE_SOLID)<<ECB_PASS) |\
|
|
((ECBI_MODEL)<<ECB_IS))
|
|
#define EPF_SPAWNERPROJECTILE ( \
|
|
EPF_ONBLOCK_STOP|EPF_ORIENTEDBYGRAVITY|\
|
|
EPF_TRANSLATEDBYGRAVITY|EPF_MOVABLE)
|
|
|
|
|
|
#include <EntitiesMP/SpawnerProjectile.h>
|
|
#include <EntitiesMP/SpawnerProjectile_tables.h>
|
|
CEntityEvent *ESpawnerProjectile::MakeCopy(void) { CEntityEvent *peeCopy = new ESpawnerProjectile(*this); return peeCopy;}
|
|
ESpawnerProjectile::ESpawnerProjectile() : CEntityEvent(EVENTCODE_ESpawnerProjectile) {;
|
|
ClearToDefault(penOwner);
|
|
ClearToDefault(penTemplate);
|
|
};
|
|
#line 28 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
|
|
void CSpawnerProjectile_OnPrecache(CDLLEntityClass *pdec, INDEX iUser)
|
|
{
|
|
pdec->PrecacheClass(CLASS_BASIC_EFFECT, BET_CANNON);
|
|
pdec->PrecacheModel(MODEL_INVISIBLE);
|
|
};
|
|
|
|
void CSpawnerProjectile::SetDefaultProperties(void) {
|
|
m_penOwner = NULL;
|
|
m_penTemplate = NULL;
|
|
m_fSize = 0.0f;
|
|
m_fTimeAdjust = 0.0f;
|
|
m_bExploding = FALSE ;
|
|
m_fExplosionDuration = 0.25f;
|
|
m_tmExplosionBegin = 0.0f;
|
|
m_tmSpawn = 0.0f;
|
|
CMovableModelEntity::SetDefaultProperties();
|
|
}
|
|
|
|
#line 58 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
void CSpawnerProjectile::SpawnEntity()
|
|
#line 59 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
{
|
|
#line 60 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
CEntity * pen = NULL ;
|
|
#line 62 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
pen = GetWorld () -> CopyEntityInWorld (* m_penTemplate ,
|
|
#line 63 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
CPlacement3D (FLOAT3D (- 32000.0f + FRnd () * 200.0f , - 32000.0f + FRnd () * 200.0f , 0) , ANGLE3D (0 , 0 , 0)));
|
|
#line 66 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
pen -> End ();
|
|
#line 68 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
CEnemyBase * peb = ((CEnemyBase *) pen );
|
|
#line 69 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
peb -> m_bTemplate = FALSE ;
|
|
#line 70 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
pen -> Initialize ();
|
|
#line 73 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
FLOAT fEntityR = 0;
|
|
#line 74 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
if(pen -> en_pciCollisionInfo != NULL ){
|
|
#line 75 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
fEntityR = pen -> en_pciCollisionInfo -> GetMaxFloorRadius ();
|
|
#line 76 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
}
|
|
#line 79 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
pen -> Teleport (GetPlacement () , FALSE );
|
|
#line 82 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
CEnemyBase & penMonster = (CEnemyBase &) * pen ;
|
|
#line 84 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
if(penMonster . m_penTacticsHolder != NULL ){
|
|
#line 85 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
if(IsOfClass (penMonster . m_penTacticsHolder , "TacticsHolder")){
|
|
#line 86 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
penMonster . StartTacticsNow ();
|
|
#line 87 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
}
|
|
#line 88 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
}
|
|
#line 90 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
}
|
|
|
|
#line 92 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
void CSpawnerProjectile::Explode(void)
|
|
#line 93 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
{
|
|
#line 95 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
CPlacement3D plExplosion = GetPlacement ();
|
|
#line 96 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
CEntityPointer penExplosion = CreateEntity (plExplosion , CLASS_BASIC_EFFECT );
|
|
#line 97 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
ESpawnEffect eSpawnEffect ;
|
|
#line 98 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
eSpawnEffect . colMuliplier = C_WHITE | CT_OPAQUE ;
|
|
#line 99 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
eSpawnEffect . betType = BET_BOMB ;
|
|
#line 100 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
eSpawnEffect . vStretch = FLOAT3D (1.0f , 1.0f , 1.0f);
|
|
#line 101 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
penExplosion -> Initialize (eSpawnEffect );
|
|
#line 104 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
eSpawnEffect . betType = BET_EXPLOSION_DEBRIS ;
|
|
#line 105 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
CEntityPointer penExplosionDebris = CreateEntity (plExplosion , CLASS_BASIC_EFFECT );
|
|
#line 106 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
penExplosionDebris -> Initialize (eSpawnEffect );
|
|
#line 109 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
eSpawnEffect . betType = BET_EXPLOSION_SMOKE ;
|
|
#line 110 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
CEntityPointer penExplosionSmoke = CreateEntity (plExplosion , CLASS_BASIC_EFFECT );
|
|
#line 111 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
penExplosionSmoke -> Initialize (eSpawnEffect );
|
|
#line 122 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
}
|
|
|
|
#line 124 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
void CSpawnerProjectile::RenderParticles(void) {
|
|
#line 125 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
Particles_AfterBurner (this , m_tmSpawn , 1.0f , 1);
|
|
#line 126 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
if(m_bExploding )
|
|
#line 127 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
{
|
|
#line 129 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
}
|
|
#line 130 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
}
|
|
BOOL CSpawnerProjectile::
|
|
#line 138 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
Main(const CEntityEvent &__eeInput) {
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT STATE_CSpawnerProjectile_Main
|
|
ASSERTMSG(__eeInput.ee_slEvent==EVENTCODE_ESpawnerProjectile, "CSpawnerProjectile::Main expects 'ESpawnerProjectile' as input!"); const ESpawnerProjectile &esp = (const ESpawnerProjectile &)__eeInput;
|
|
#line 140 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
ASSERT (esp . penOwner != NULL );
|
|
#line 141 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
ASSERT (esp . penTemplate != NULL );
|
|
#line 142 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
ASSERT (IsDerivedFromClass (esp . penTemplate , "Enemy Base"));
|
|
#line 143 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
m_penOwner = esp . penOwner ;
|
|
#line 144 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
m_penTemplate = esp . penTemplate ;
|
|
#line 146 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
m_fTimeAdjust = FRnd () * 5.0f;
|
|
#line 147 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
EntityInfo * pei = (EntityInfo *) (m_penTemplate -> GetEntityInfo ());
|
|
#line 148 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
m_fSize = pei -> vSourceCenter [ 1 ] * 0.2f;
|
|
#line 150 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
m_tmSpawn = _pTimer -> CurrentTick ();
|
|
#line 153 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
InitAsModel ();
|
|
#line 154 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
SetPhysicsFlags (EPF_SPAWNERPROJECTILE );
|
|
#line 155 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
SetCollisionFlags (ECF_SPAWNERPROJECTILE );
|
|
#line 156 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
SetFlags (GetFlags () | ENF_SEETHROUGH );
|
|
#line 157 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
SetModel (MODEL_INVISIBLE );
|
|
#line 159 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
Particles_AfterBurner_Prepare (this );
|
|
#line 162 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
SetTimerAt(THINKTIME_NEVER);
|
|
Jump(STATE_CURRENT, 0x01fb0001, FALSE, EBegin());return TRUE;}BOOL CSpawnerProjectile::H0x01fb0001_Main_01(const CEntityEvent &__eeInput) {
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x01fb0001
|
|
switch(__eeInput.ee_slEvent){case(EVENTCODE_EBegin):{const EBegin&e= (EBegin&)__eeInput;
|
|
return TRUE;}ASSERT(FALSE);break;case(EVENTCODE_ETouch):{const ETouch&et= (ETouch&)__eeInput;
|
|
UnsetTimer();Jump(STATE_CURRENT,0x01fb0002, FALSE, EInternal());return TRUE;}ASSERT(FALSE);break;default:{return TRUE;}ASSERT(FALSE);break;
|
|
#line 166 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
}return TRUE;}BOOL CSpawnerProjectile::H0x01fb0002_Main_02(const CEntityEvent &__eeInput){
|
|
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x01fb0002
|
|
|
|
#line 168 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
m_bExploding = TRUE ;
|
|
#line 169 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
m_tmExplosionBegin = _pTimer -> CurrentTick ();
|
|
#line 172 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
SpawnEntity ();
|
|
#line 174 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
Explode ();
|
|
#line 176 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
SwitchToEditorModel ();
|
|
#line 177 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
SetTimerAfter(4.0f);
|
|
Jump(STATE_CURRENT, 0x01fb0003, FALSE, EBegin());return TRUE;}BOOL CSpawnerProjectile::H0x01fb0003_Main_03(const CEntityEvent &__eeInput) {
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x01fb0003
|
|
switch(__eeInput.ee_slEvent) {case EVENTCODE_EBegin: return TRUE;case EVENTCODE_ETimer: Jump(STATE_CURRENT,0x01fb0004, FALSE, EInternal()); return TRUE;default: return FALSE; }}BOOL CSpawnerProjectile::H0x01fb0004_Main_04(const CEntityEvent &__eeInput){
|
|
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x01fb0004
|
|
;
|
|
#line 178 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
Destroy ();
|
|
#line 180 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
Return(STATE_CURRENT,EVoid());
|
|
#line 180 "D:/SE1_GPL/Sources/EntitiesMP/SpawnerProjectile.es"
|
|
return TRUE; ASSERT(FALSE); return TRUE;}; |