Serious-Engine/Sources/EntitiesMP/Santa.cpp
2016-03-11 15:57:17 +02:00

349 lines
13 KiB
C++

/*
* This file is generated by Entity Class Compiler, (c) CroTeam 1997-98
*/
#line 4 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
#include "StdH.h"
#include "ModelsMP/Player/SeriousSam/Player.h"
#include "ModelsMP/Player/SeriousSam/Body.h"
#include "ModelsMP/Player/SeriousSam/Head.h"
#include <EntitiesMP/Santa.h>
#include <EntitiesMP/Santa_tables.h>
#line 13 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
// info structure
static EntityInfo eiSanta = {
EIBT_AIR, 100.0f,
0, 1.6f, 0, // source (eyes)
0.0f, 1.0f, 0.0f, // target (body)
};
void CSanta::SetDefaultProperties(void) {
m_tmLastSpawnTime = -10000.0f;
m_tmMinSpawnInterval = 1.0f;
m_fSantaHealth = 100.0f;
m_soRunning.SetOwner(this);
m_soRunning.Stop_internal();
m_bRunSoundPlaying = FALSE ;
m_penTemplate0 = NULL;
m_penTemplate1 = NULL;
m_penTemplate2 = NULL;
m_penTemplate3 = NULL;
m_penTemplate4 = NULL;
CEnemyBase::SetDefaultProperties();
}
#line 49 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
void CSanta::Precache(void) {
#line 50 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
CEnemyBase :: Precache ();
#line 51 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
PrecacheSound (SOUND_RUN );
#line 52 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
PrecacheSound (SOUND_WOUND );
#line 53 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
PrecacheSound (SOUND_DEATH );
#line 54 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
}
const CTFileName & CSanta::GetComputerMessageName(void)const {
#line 58 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
static CTFileName fnm ;
#line 59 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
return fnm ;
#line 60 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
}
#line 63 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
void * CSanta::GetEntityInfo(void) {
#line 64 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
return & eiSanta ;
#line 65 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
}
#line 68 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
void CSanta::ActivateRunningSound(void)
#line 69 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
{
#line 70 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
if(! m_bRunSoundPlaying ){
#line 71 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
PlaySound (m_soRunning , SOUND_RUN , SOF_3D | SOF_LOOP );
#line 72 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
m_bRunSoundPlaying = TRUE ;
#line 73 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
}
#line 74 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
}
#line 75 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
void CSanta::DeactivateRunningSound(void)
#line 76 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
{
#line 77 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
m_soRunning . Stop ();
#line 78 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
m_bRunSoundPlaying = FALSE ;
#line 79 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
}
#line 82 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
BOOL CSanta::HandleEvent(const CEntityEvent & ee)
#line 83 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
{
#line 85 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
if(ee . ee_slEvent == EVENTCODE_ETouch || ee . ee_slEvent == EVENTCODE_EDamage ){
#line 86 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
return TRUE ;
#line 87 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
}
#line 89 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
return CEnemyBase :: HandleEvent (ee );
#line 90 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
}
#line 93 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
void CSanta::ReceiveDamage(CEntity * penInflictor,enum DamageType dmtType,
#line 94 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
FLOAT fDamageAmmount,const FLOAT3D & vHitPoint,const FLOAT3D & vDirection)
#line 95 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
{
#line 97 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
CMovableModelEntity :: ReceiveDamage (penInflictor , dmtType , fDamageAmmount , vHitPoint , vDirection );
#line 100 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
if(_pTimer -> CurrentTick () - m_tmLastSpawnTime < m_tmMinSpawnInterval ){
#line 102 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
return ;
#line 103 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
}
#line 106 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
WoundSound ();
#line 109 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
m_tmLastSpawnTime = _pTimer -> CurrentTick ();
#line 111 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
INDEX ctTemplates = 0;
#line 112 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
if(m_penTemplate0 != NULL ){ctTemplates ++;}
#line 113 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
if(m_penTemplate1 != NULL ){ctTemplates ++;}
#line 114 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
if(m_penTemplate2 != NULL ){ctTemplates ++;}
#line 115 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
if(m_penTemplate3 != NULL ){ctTemplates ++;}
#line 116 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
if(m_penTemplate4 != NULL ){ctTemplates ++;}
#line 117 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
if(ctTemplates == 0){
#line 118 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
return ;
#line 119 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
}
#line 120 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
INDEX iTemplate = IRnd () % ctTemplates ;
#line 121 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
CEntity * penItem = (& m_penTemplate0 ) [ iTemplate ];
#line 124 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
if(penItem == NULL || (penItem -> GetFlags () & ENF_DELETED )){
#line 126 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
return ;
#line 127 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
}
#line 129 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
CEntity * penSpawned = GetWorld () -> CopyEntityInWorld (* penItem ,
#line 130 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
CPlacement3D (FLOAT3D (- 32000.0f + FRnd () * 200.0f , - 32000.0f + FRnd () * 200.0f , 0) , ANGLE3D (0 , 0 , 0)));
#line 133 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
CPlacement3D pl = GetPlacement ();
#line 134 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
pl . pl_PositionVector += GetRotationMatrix () . GetColumn (2) * 1.5f;
#line 135 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
penSpawned -> Teleport (pl , FALSE );
#line 136 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
}
#line 138 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
void CSanta::LeaveStain(BOOL bGrow)
#line 139 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
{
#line 140 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
}
#line 143 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
INDEX CSanta::AnimForDamage(FLOAT fDamage) {
#line 145 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
return 0;
#line 146 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
}
#line 149 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
INDEX CSanta::AnimForDeath(void) {
#line 151 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
return 0;
#line 152 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
}
#line 154 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
void CSanta::DeathNotify(void) {
#line 155 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
SwitchToEditorModel ();
#line 157 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
SetCollisionFlags (ECF_MODEL );
#line 158 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
DeactivateRunningSound ();
#line 159 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
}
#line 161 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
CModelObject * CSanta::GetBody(void)
#line 162 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
{
#line 163 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
return & GetModelObject () -> GetAttachmentModel (PLAYER_ATTACHMENT_TORSO ) -> amo_moModelObject ;
#line 164 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
}
#line 167 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
void CSanta::StandingAnim(void) {
#line 170 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
}
#line 171 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
void CSanta::WalkingAnim(void) {
#line 172 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
ActivateRunningSound ();
#line 175 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
}
#line 176 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
void CSanta::RunningAnim(void) {
#line 177 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
ActivateRunningSound ();
#line 180 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
}
#line 181 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
void CSanta::RotatingAnim(void) {
#line 182 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
ActivateRunningSound ();
#line 185 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
}
#line 188 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
void CSanta::IdleSound(void) {
#line 190 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
}
#line 191 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
void CSanta::SightSound(void) {
#line 193 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
}
#line 194 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
void CSanta::WoundSound(void) {
#line 195 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
PlaySound (m_soSound , SOUND_WOUND , SOF_3D );
#line 196 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
}
#line 197 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
void CSanta::DeathSound(void) {
#line 198 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
PlaySound (m_soSound , SOUND_DEATH , SOF_3D );
#line 199 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
}
#line 203 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
void CSanta::EnemyPostInit(void)
#line 204 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
{
#line 206 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
m_soSound . Set3DParameters (160.0f , 50.0f , 1.0f , 1.0f);
#line 207 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
}
BOOL CSanta::
#line 214 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
Fire(const CEntityEvent &__eeInput) {
#undef STATE_CURRENT
#define STATE_CURRENT STATE_CSanta_Fire
ASSERTMSG(__eeInput.ee_slEvent==EVENTCODE_EVoid, "CSanta::Fire expects 'EVoid' as input!"); const EVoid &e = (const EVoid &)__eeInput;
#line 215 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
Return(STATE_CURRENT,EReturn ());
#line 215 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
return TRUE; ASSERT(FALSE); return TRUE;};BOOL CSanta::
#line 219 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
Hit(const CEntityEvent &__eeInput) {
#undef STATE_CURRENT
#define STATE_CURRENT STATE_CSanta_Hit
ASSERTMSG(__eeInput.ee_slEvent==EVENTCODE_EVoid, "CSanta::Hit expects 'EVoid' as input!"); const EVoid &e = (const EVoid &)__eeInput;
#line 220 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
Return(STATE_CURRENT,EReturn ());
#line 220 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
return TRUE; ASSERT(FALSE); return TRUE;};BOOL CSanta::
#line 226 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
Main(const CEntityEvent &__eeInput) {
#undef STATE_CURRENT
#define STATE_CURRENT STATE_CSanta_Main
ASSERTMSG(__eeInput.ee_slEvent==EVENTCODE_EVoid, "CSanta::Main expects 'EVoid' as input!"); const EVoid &e = (const EVoid &)__eeInput;
#line 229 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
InitAsModel ();
#line 230 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
SetPhysicsFlags (EPF_MODEL_WALKING | EPF_HASLUNGS );
#line 231 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
SetCollisionFlags (ECF_MODEL );
#line 232 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
SetFlags (GetFlags () | ENF_ALIVE );
#line 233 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
en_tmMaxHoldBreath = 25.0f;
#line 234 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
en_fDensity = 3000.0f;
#line 237 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
CTString strDummy ;
#line 238 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
extern BOOL SetPlayerAppearance_internal (CModelObject * pmo , const CTFileName & fnmAMC , CTString & strName , BOOL bPreview );
#line 239 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
SetPlayerAppearance_internal (GetModelObject () , CTFILENAME ("ModelsMP\\CutSequences\\Santa\\Santa.amc") , strDummy , FALSE );
#line 241 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
SetHealth (m_fSantaHealth );
#line 242 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
m_fMaxHealth = m_fSantaHealth ;
#line 244 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
m_fDamageWounded = 1E10f;
#line 245 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
m_fBlowUpAmount = 1E10f;
#line 246 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
m_fBodyParts = 30;
#line 248 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
m_fAttackDistance = 150.0f;
#line 249 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
m_fCloseDistance = 5.0f;
#line 250 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
m_fStopDistance = 4.5f;
#line 251 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
m_fAttackFireTime = 0.5f;
#line 252 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
m_fCloseFireTime = 1.0f;
#line 253 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
m_fIgnoreRange = 300.0f;
#line 254 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
m_iScore = 1000;
#line 256 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
m_fWalkSpeed = (FRnd () + 1.5f) * 1.5f;
#line 257 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
m_aWalkRotateSpeed = AngleDeg (FRnd () * 20.0f + 550.0f);
#line 258 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
m_fAttackRunSpeed = FRnd () * 1.5f + 4.5f;
#line 259 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
m_aAttackRotateSpeed = AngleDeg (FRnd () * 50.0f + 275.0f);
#line 260 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
m_fCloseRunSpeed = FRnd () * 1.5f + 4.5f;
#line 261 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
m_aCloseRotateSpeed = AngleDeg (FRnd () * 50.0f + 275.0f);
#line 264 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
CEnemyBase :: SizeModel ();
#line 265 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
m_soRunning . Set3DParameters (500.0f , 50.0f , 1.0f , 1.0f);
#line 266 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
m_bRunSoundPlaying = FALSE ;
#line 268 "D:/SE1_GPL/Sources/EntitiesMP/Santa.es"
Jump(STATE_CURRENT, STATE_CEnemyBase_MainLoop, FALSE, EVoid());return TRUE; ASSERT(FALSE); return TRUE;};