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

258 lines
11 KiB
C++

/*
* This file is generated by Entity Class Compiler, (c) CroTeam 1997-98
*/
#line 4 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
#include "StdH.h"
#include <EntitiesMP/Water.h>
#include <EntitiesMP/Water_tables.h>
CEntityEvent *EWater::MakeCopy(void) { CEntityEvent *peeCopy = new EWater(*this); return peeCopy;}
EWater::EWater() : CEntityEvent(EVENTCODE_EWater) {;
ClearToDefault(penLauncher);
ClearToDefault(EwsSize);
};
#line 24 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
#define FLY_TIME 5.0f
void CWater::SetDefaultProperties(void) {
m_penLauncher = NULL;
m_EwsSize = WTS_SMALL ;
m_fDamageAmount = 0.0f;
m_fIgnoreTime = 0.0f;
m_fPushAwayFactor = 0.0f;
CMovableModelEntity::SetDefaultProperties();
}
#line 62 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
void CWater::Read_t(CTStream * istr)
#line 63 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
{
#line 64 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
CRationalEntity :: Read_t (istr );
#line 65 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
SetupLightSource ();
#line 66 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
}
#line 69 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
CLightSource * CWater::GetLightSource(void)
#line 70 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
{
#line 71 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
if(! IsPredictor ()){
#line 72 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
return & m_lsLightSource ;
#line 73 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
}else {
#line 74 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
return NULL ;
#line 75 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
}
#line 76 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
}
#line 79 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
void CWater::SetupLightSource(void)
#line 80 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
{
#line 82 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
CLightSource lsNew ;
#line 83 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
lsNew . ls_ulFlags = LSF_NONPERSISTENT | LSF_DYNAMIC ;
#line 84 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
lsNew . ls_colColor = C_lBLUE ;
#line 85 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
lsNew . ls_rFallOff = 1.0f;
#line 86 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
lsNew . ls_rHotSpot = 0.2f;
#line 87 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
lsNew . ls_plftLensFlare = NULL ;
#line 88 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
lsNew . ls_ubPolygonalMask = 0;
#line 89 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
lsNew . ls_paoLightAnimation = NULL ;
#line 91 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
m_lsLightSource . ls_penEntity = this ;
#line 92 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
m_lsLightSource . SetLightSource (lsNew );
#line 93 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
}
#line 96 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
void CWater::RenderParticles(void) {
#line 97 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
}
#line 101 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
void CWater::WaterTouch(CEntityPointer penHit) {
#line 103 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
FLOAT3D vDirection ;
#line 104 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
AnglesToDirectionVector (GetPlacement () . pl_OrientationAngle , vDirection );
#line 105 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
InflictDirectDamage (penHit , m_penLauncher , DMT_PROJECTILE , m_fDamageAmount ,
#line 106 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
GetPlacement () . pl_PositionVector , vDirection );
#line 108 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
FLOAT3D vSpeed ;
#line 109 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
GetHeadingDirection (0.0f , vSpeed );
#line 110 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
vSpeed = vSpeed * m_fPushAwayFactor ;
#line 111 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
KickEntity (penHit , vSpeed );
#line 112 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
}
BOOL CWater::
#line 121 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
WaterFly(const CEntityEvent &__eeInput) {
#undef STATE_CURRENT
#define STATE_CURRENT STATE_CWater_WaterFly
ASSERTMSG(__eeInput.ee_slEvent==EVENTCODE_EVoid, "CWater::WaterFly expects 'EVoid' as input!"); const EVoid &e = (const EVoid &)__eeInput;
#line 123 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
SetTimerAfter(FLY_TIME );
Jump(STATE_CURRENT, 0x01fc0002, FALSE, EBegin());return TRUE;}BOOL CWater::H0x01fc0002_WaterFly_01(const CEntityEvent &__eeInput) {
#undef STATE_CURRENT
#define STATE_CURRENT 0x01fc0002
switch(__eeInput.ee_slEvent){case(EVENTCODE_EBegin):{const EBegin&e= (EBegin&)__eeInput;
return TRUE;}ASSERT(FALSE);break;case(EVENTCODE_EPass):{const EPass&epass= (EPass&)__eeInput;
#line 126 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
BOOL bHit ;
#line 128 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
bHit = epass . penOther != m_penLauncher || _pTimer -> CurrentTick () > m_fIgnoreTime ;
#line 130 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
bHit &= ! (IsOfClass (epass . penOther , "Water"));
#line 131 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
if(bHit ){
#line 132 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
WaterTouch (epass . penOther );
#line 133 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
UnsetTimer();Jump(STATE_CURRENT,0x01fc0003, FALSE, EInternal());return TRUE;
#line 134 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
}
#line 135 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
return TRUE;
#line 136 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
}ASSERT(FALSE);break;case(EVENTCODE_ETouch):{const ETouch&etouch= (ETouch&)__eeInput;
#line 139 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
m_fIgnoreTime = 0.0f;
#line 141 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
BOOL bHit ;
#line 142 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
bHit = ! (etouch . penOther -> GetRenderType () & RT_BRUSH );
#line 144 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
bHit &= ! (IsOfClass (etouch . penOther , "Water"));
#line 145 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
if(bHit ){
#line 146 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
WaterTouch (etouch . penOther );
#line 147 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
UnsetTimer();Jump(STATE_CURRENT,0x01fc0003, FALSE, EInternal());return TRUE;
#line 148 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
}
#line 150 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
if(en_vCurrentTranslationAbsolute . Length () < 0.25f * en_vDesiredTranslationRelative . Length ()){
#line 151 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
UnsetTimer();Jump(STATE_CURRENT,0x01fc0003, FALSE, EInternal());return TRUE;
#line 152 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
}
#line 153 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
return TRUE;
#line 154 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
}ASSERT(FALSE);break;case(EVENTCODE_EDeath):{const EDeath&e= (EDeath&)__eeInput;
UnsetTimer();Jump(STATE_CURRENT,0x01fc0003, FALSE, EInternal());return TRUE;}ASSERT(FALSE);break;case(EVENTCODE_ETimer):{const ETimer&e= (ETimer&)__eeInput;
UnsetTimer();Jump(STATE_CURRENT,0x01fc0003, FALSE, EInternal());return TRUE;}ASSERT(FALSE);break;default: return FALSE; break;
#line 157 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
}return TRUE;}BOOL CWater::H0x01fc0003_WaterFly_02(const CEntityEvent &__eeInput){
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
#undef STATE_CURRENT
#define STATE_CURRENT 0x01fc0003
#line 158 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
Return(STATE_CURRENT,EEnd ());
#line 158 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
return TRUE; ASSERT(FALSE); return TRUE;};BOOL CWater::
#line 163 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
Main(const CEntityEvent &__eeInput) {
#undef STATE_CURRENT
#define STATE_CURRENT STATE_CWater_Main
ASSERTMSG(__eeInput.ee_slEvent==EVENTCODE_EWater, "CWater::Main expects 'EWater' as input!"); const EWater &ew = (const EWater &)__eeInput;
#line 165 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
ASSERT (ew . penLauncher != NULL );
#line 166 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
m_penLauncher = ew . penLauncher ;
#line 167 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
m_EwsSize = ew . EwsSize ;
#line 170 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
InitAsModel ();
#line 171 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
SetPhysicsFlags (EPF_ONBLOCK_SLIDE | EPF_PUSHABLE | EPF_MOVABLE );
#line 172 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
SetCollisionFlags (ECF_PROJECTILE_MAGIC );
#line 173 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
SetComponents (this , * GetModelObject () , MODEL_WATER , TEXTURE_WATER , 0 , TEX_SPEC_STRONG , 0);
#line 176 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
switch(m_EwsSize ){
#line 177 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
case WTS_SMALL :
#line 178 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
m_fDamageAmount = 10.0f;
#line 179 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
m_fPushAwayFactor = 10.0f;
#line 180 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
LaunchAsPropelledProjectile (FLOAT3D (0.0f , 0.0f , - 30.0f) , (CMovableEntity *) (CEntity *) m_penLauncher );
#line 181 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
break ;
#line 182 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
case WTS_BIG :
#line 183 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
m_fDamageAmount = 20.0f;
#line 184 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
m_fPushAwayFactor = 20.0f;
#line 185 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
GetModelObject () -> StretchModel (FLOAT3D (4.0f , 4.0f , 4.0f));
#line 186 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
LaunchAsPropelledProjectile (FLOAT3D (0.0f , 0.0f , - 50.0f) , (CMovableEntity *) (CEntity *) m_penLauncher );
#line 187 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
break ;
#line 188 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
case WTS_LARGE :
#line 189 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
m_fDamageAmount = 40.0f;
#line 190 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
m_fPushAwayFactor = 40.0f;
#line 191 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
GetModelObject () -> StretchModel (FLOAT3D (16.0f , 16.0f , 16.0f));
#line 192 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
LaunchAsPropelledProjectile (FLOAT3D (0.0f , 0.0f , - 80.0f) , (CMovableEntity *) (CEntity *) m_penLauncher );
#line 193 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
break ;
#line 194 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
}
#line 195 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
ModelChangeNotify ();
#line 198 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
SetupLightSource ();
#line 201 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
m_fIgnoreTime = _pTimer -> CurrentTick () + 1.0f;
#line 204 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
STATE_CWater_WaterFly, TRUE;
Jump(STATE_CURRENT, 0x01fc0004, FALSE, EBegin());return TRUE;}BOOL CWater::H0x01fc0004_Main_01(const CEntityEvent &__eeInput) {
#undef STATE_CURRENT
#define STATE_CURRENT 0x01fc0004
switch(__eeInput.ee_slEvent) {case EVENTCODE_EBegin: Call(STATE_CURRENT, STATE_CWater_WaterFly, TRUE, EVoid());return TRUE;case EVENTCODE_EEnd: Jump(STATE_CURRENT,0x01fc0005, FALSE, __eeInput); return TRUE;default: return FALSE; }}BOOL CWater::H0x01fc0005_Main_02(const CEntityEvent &__eeInput){
#undef STATE_CURRENT
#define STATE_CURRENT 0x01fc0005
const EEnd&__e= (EEnd&)__eeInput;
;
#line 207 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
Destroy ();
#line 209 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
Return(STATE_CURRENT,EVoid());
#line 209 "D:/SE1_GPL/Sources/EntitiesMP/Water.es"
return TRUE; ASSERT(FALSE); return TRUE;};