mirror of
https://github.com/ptitSeb/Serious-Engine
synced 2024-11-22 18:30:27 +01:00
275 lines
11 KiB
C++
275 lines
11 KiB
C++
/*
|
|
* This file is generated by Entity Class Compiler, (c) CroTeam 1997-98
|
|
*/
|
|
|
|
#line 4 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
|
|
#include "StdH.h"
|
|
#include "Models/Enemies/Mental/Mental.h"
|
|
#include "Models/CutSequences/CrateRider/Crate.h"
|
|
|
|
#include <EntitiesMP/CrateRider.h>
|
|
#include <EntitiesMP/CrateRider_tables.h>
|
|
#line 13 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
|
|
// info structure
|
|
static EntityInfo eiCrate = {
|
|
EIBT_FLESH, 500.0f,
|
|
0.0f, 1.5f, 0.0f, // source (eyes)
|
|
0.0f, 1.0f, 0.0f, // target (body)
|
|
};
|
|
|
|
#define GREET_SENSE_RANGE 10.0f
|
|
#define GREET_SENSE_DELAY 10.0f
|
|
|
|
|
|
void CCrateRider::SetDefaultProperties(void) {
|
|
m_fnmHeadTex1 = CTString("");
|
|
m_fnmHeadTex2 = CTString("");
|
|
m_fnmDriveSnd = CTString("");
|
|
CEnemyBase::SetDefaultProperties();
|
|
}
|
|
|
|
#line 58 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
void * CCrateRider::GetEntityInfo(void)
|
|
#line 59 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
{
|
|
#line 60 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
return & eiCrate ;
|
|
#line 61 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
}
|
|
|
|
#line 63 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
void CCrateRider::Precache(void)
|
|
#line 64 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
{
|
|
#line 65 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
CEnemyBase :: Precache ();
|
|
#line 67 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
PrecacheClass (CLASS_DEBRIS );
|
|
#line 69 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
m_apt1 . Precache (m_fnmHeadTex1 );
|
|
#line 70 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
m_apt2 . Precache (m_fnmHeadTex2 );
|
|
#line 71 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
m_aps . Precache (m_fnmDriveSnd );
|
|
#line 72 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
}
|
|
|
|
#line 75 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
INDEX CCrateRider::AnimForDamage(FLOAT fDamage) {
|
|
#line 76 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
INDEX iAnim ;
|
|
#line 77 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
iAnim = 0;
|
|
#line 78 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
StartModelAnim (iAnim , 0);
|
|
#line 79 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
return iAnim ;
|
|
#line 80 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
}
|
|
|
|
#line 83 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
INDEX CCrateRider::AnimForDeath(void) {
|
|
#line 84 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
INDEX iAnim ;
|
|
#line 85 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
iAnim = 0;
|
|
#line 86 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
StartModelAnim (iAnim , 0);
|
|
#line 87 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
return iAnim ;
|
|
#line 88 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
}
|
|
|
|
#line 90 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
void CCrateRider::DeathNotify(void) {
|
|
#line 92 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
en_fDensity = 500.0f;
|
|
#line 93 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
}
|
|
|
|
#line 96 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
void CCrateRider::StandingAnim(void) {
|
|
#line 97 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
StartModelAnim (CRATE_ANIM_DEFAULT , AOF_LOOPING | AOF_NORESTART | AOF_SMOOTHCHANGE );
|
|
#line 99 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
CModelObject * pmo0 = & (GetModelObject () -> GetAttachmentModel (0) -> amo_moModelObject );
|
|
#line 100 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
pmo0 -> PlayAnim (MENTAL_ANIM_CRATEANIMLEFTSEATING , AOF_LOOPING | AOF_NORESTART | AOF_SMOOTHCHANGE );
|
|
#line 101 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
CModelObject * pmo1 = & (GetModelObject () -> GetAttachmentModel (1) -> amo_moModelObject );
|
|
#line 102 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
pmo1 -> PlayAnim (MENTAL_ANIM_CRATEANIMRIGHTSEATING , AOF_LOOPING | AOF_NORESTART | AOF_SMOOTHCHANGE );
|
|
#line 104 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
m_soSound . Stop ();
|
|
#line 105 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
}
|
|
|
|
#line 106 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
void CCrateRider::WalkingAnim(void) {
|
|
#line 107 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
RunningAnim ();
|
|
#line 108 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
StartModelAnim (CRATE_ANIM_DRIVE , AOF_LOOPING | AOF_NORESTART );
|
|
#line 109 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
}
|
|
|
|
#line 110 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
void CCrateRider::RunningAnim(void)
|
|
#line 111 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
{
|
|
#line 112 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
if(m_fnmDriveSnd != ""){
|
|
#line 113 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
PlaySound (m_soSound , m_fnmDriveSnd , SOF_3D );
|
|
#line 114 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
}
|
|
#line 115 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
CModelObject * pmo0 = & (GetModelObject () -> GetAttachmentModel (0) -> amo_moModelObject );
|
|
#line 116 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
pmo0 -> PlayAnim (MENTAL_ANIM_CRATEANIMLEFT , AOF_LOOPING | AOF_NORESTART );
|
|
#line 117 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
CModelObject * pmo1 = & (GetModelObject () -> GetAttachmentModel (1) -> amo_moModelObject );
|
|
#line 118 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
pmo1 -> PlayAnim (MENTAL_ANIM_CRATEANIMRIGHT , AOF_LOOPING | AOF_NORESTART );
|
|
#line 120 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
StartModelAnim (CRATE_ANIM_DRIVE , AOF_LOOPING | AOF_NORESTART );
|
|
#line 121 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
}
|
|
|
|
#line 122 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
void CCrateRider::RotatingAnim(void) {
|
|
#line 123 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
RunningAnim ();
|
|
#line 124 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
}
|
|
|
|
#line 127 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
void CCrateRider::IdleSound(void) {
|
|
#line 129 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
}
|
|
|
|
#line 131 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
void CCrateRider::SightSound(void) {
|
|
#line 133 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
}
|
|
|
|
#line 134 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
void CCrateRider::WoundSound(void) {
|
|
#line 136 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
}
|
|
|
|
#line 137 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
void CCrateRider::DeathSound(void) {
|
|
#line 139 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
}
|
|
|
|
#line 141 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
void CCrateRider::AddRider(INDEX i,const CTFileName & fnmHead)
|
|
#line 142 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
{
|
|
#line 143 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
AddAttachment (i , MODEL_MENTAL , TEXTURE_MENTAL );
|
|
#line 144 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
CModelObject * pmoMain = & (GetModelObject () -> GetAttachmentModel (i ) -> amo_moModelObject );
|
|
#line 146 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
pmoMain -> PlayAnim (i == 0 ? MENTAL_ANIM_CRATEANIMLEFT : MENTAL_ANIM_CRATEANIMRIGHT , AOF_LOOPING );
|
|
#line 147 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
AddAttachmentToModel (this , * pmoMain , 0 , MODEL_HEAD , TEXTURE_MENTAL , 0 , 0 , 0);
|
|
#line 148 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
CModelObject * pmoHead = & (pmoMain -> GetAttachmentModel (0) -> amo_moModelObject );
|
|
#line 149 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
if(fnmHead != ""){
|
|
#line 151 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
try {
|
|
#line 152 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
pmoHead -> mo_toTexture . SetData_t (fnmHead );
|
|
#line 154 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
}catch (char * strError ){
|
|
#line 156 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
CPrintF ("%s\n" , strError );
|
|
#line 157 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
}
|
|
#line 158 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
}
|
|
#line 159 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
}
|
|
BOOL CCrateRider::
|
|
#line 166 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
Main(const CEntityEvent &__eeInput) {
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT STATE_CCrateRider_Main
|
|
ASSERTMSG(__eeInput.ee_slEvent==EVENTCODE_EVoid, "CCrateRider::Main expects 'EVoid' as input!"); const EVoid &e = (const EVoid &)__eeInput;
|
|
#line 168 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
InitAsModel ();
|
|
#line 169 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
SetPhysicsFlags (EPF_MODEL_WALKING | EPF_HASLUNGS );
|
|
#line 170 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
SetCollisionFlags (ECF_MODEL );
|
|
#line 171 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
SetFlags (GetFlags () | ENF_ALIVE );
|
|
#line 172 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
SetHealth (1.0f);
|
|
#line 173 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
m_fMaxHealth = 1.0f;
|
|
#line 174 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
en_tmMaxHoldBreath = 5.0f;
|
|
#line 175 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
en_fDensity = 2000.0f;
|
|
#line 176 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
m_fBlowUpSize = 2.0f;
|
|
#line 179 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
SetModel (MODEL_CRATE );
|
|
#line 180 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
SetModelMainTexture (TEXTURE_CRATE );
|
|
#line 181 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
AddRider (0 , m_fnmHeadTex1 );
|
|
#line 182 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
AddRider (1 , m_fnmHeadTex2 );
|
|
#line 185 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
m_fWalkSpeed =
|
|
#line 186 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
m_fAttackRunSpeed =
|
|
#line 187 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
m_fCloseRunSpeed = 1.0f;
|
|
#line 188 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
m_aWalkRotateSpeed = AngleDeg (30.0f);
|
|
#line 189 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
m_aAttackRotateSpeed = AngleDeg (30);
|
|
#line 190 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
m_aCloseRotateSpeed = AngleDeg (30);
|
|
#line 192 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
m_fAttackDistance = 50.0f;
|
|
#line 193 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
m_fCloseDistance = 0.0f;
|
|
#line 194 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
m_fStopDistance = 5.0f;
|
|
#line 195 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
m_fAttackFireTime = 2.0f;
|
|
#line 196 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
m_fCloseFireTime = 1.0f;
|
|
#line 197 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
m_fIgnoreRange = 200.0f;
|
|
#line 199 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
m_fBlowUpAmount = 0.0f;
|
|
#line 200 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
m_fBodyParts = 4;
|
|
#line 201 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
m_fDamageWounded = 1.0f;
|
|
#line 202 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
m_iScore = 0;
|
|
#line 203 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
m_bBlind = TRUE ;
|
|
#line 204 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
m_bRobotBlowup = TRUE ;
|
|
#line 208 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
const FLOAT fSize = 0.6f;
|
|
#line 209 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
GetModelObject () -> StretchModel (FLOAT3D (fSize , fSize , fSize ));
|
|
#line 210 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
ModelChangeNotify ();
|
|
#line 211 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
StandingAnim ();
|
|
#line 214 "D:/SE1_GPL/Sources/EntitiesMP/CrateRider.es"
|
|
Jump(STATE_CURRENT, STATE_CEnemyBase_MainLoop, FALSE, EVoid());return TRUE; ASSERT(FALSE); return TRUE;}; |