mirror of
https://github.com/ptitSeb/Serious-Engine
synced 2024-11-22 10:20:26 +01:00
583 lines
27 KiB
C++
583 lines
27 KiB
C++
/*
|
|
* This file is generated by Entity Class Compiler, (c) CroTeam 1997-98
|
|
*/
|
|
|
|
#line 4 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
|
|
#include "StdH.h"
|
|
|
|
#include <EntitiesMP/Shooter.h>
|
|
#include <EntitiesMP/Shooter_tables.h>
|
|
void CShooter::SetDefaultProperties(void) {
|
|
m_fShootingPeriod = 1.0f;
|
|
m_sftType = SFT_WOODEN_DART ;
|
|
m_fHealth = 0.0f;
|
|
m_fCannonBallSize = 1.0f;
|
|
m_fCannonBallPower = 10.0f;
|
|
m_iModelPreFireAnimation = 0;
|
|
m_iTexturePreFireAnimation = 0;
|
|
m_iModelPostFireAnimation = 0;
|
|
m_iTexturePostFireAnimation = 0;
|
|
m_fFlameBurstDuration = 1.0f;
|
|
m_fRndBeginWait = 0.0f;
|
|
m_penSoundLaunch = NULL;
|
|
m_soLaunch.SetOwner(this);
|
|
m_soLaunch.Stop_internal();
|
|
m_penFlame = NULL;
|
|
m_bFiring = FALSE ;
|
|
m_bIndestructable = FALSE ;
|
|
m_tmFlameStart = 0.0f;
|
|
CModelHolder2::SetDefaultProperties();
|
|
}
|
|
|
|
#line 59 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
void CShooter::Precache(void) {
|
|
#line 60 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
CModelHolder2 :: Precache ();
|
|
#line 61 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
PrecacheClass (CLASS_PROJECTILE , PRT_SHOOTER_WOODEN_DART );
|
|
#line 62 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
PrecacheClass (CLASS_PROJECTILE , PRT_SHOOTER_FIREBALL );
|
|
#line 63 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
PrecacheClass (CLASS_CANNONBALL );
|
|
#line 64 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
}
|
|
|
|
#line 66 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
void CShooter::ReceiveDamage(CEntity * penInflictor,enum DamageType dmtType,
|
|
#line 67 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
FLOAT fDamageAmmount,const FLOAT3D & vHitPoint,const FLOAT3D & vDirection)
|
|
#line 68 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
{
|
|
#line 70 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
if(! m_bIndestructable && ! IsOfClass (penInflictor , "Shooter")){
|
|
#line 71 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
if(m_tmSpraySpawned <= _pTimer -> CurrentTick () - _pTimer -> TickQuantum * 8
|
|
#line 72 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
&& m_penDestruction != NULL ){
|
|
#line 74 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
CModelDestruction * penDestruction = GetDestruction ();
|
|
#line 77 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
CPlacement3D plSpray = CPlacement3D (vHitPoint , ANGLE3D (0 , 0 , 0));
|
|
#line 78 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
m_penSpray = CreateEntity (plSpray , CLASS_BLOOD_SPRAY );
|
|
#line 79 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
m_penSpray -> SetParent (this );
|
|
#line 80 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
ESpawnSpray eSpawnSpray ;
|
|
#line 81 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
eSpawnSpray . colBurnColor = C_WHITE | CT_OPAQUE ;
|
|
#line 84 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
if(fDamageAmmount > 50.0f){
|
|
#line 85 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
eSpawnSpray . fDamagePower = 3.0f;
|
|
#line 86 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
}else if(fDamageAmmount > 25.0f){
|
|
#line 87 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
eSpawnSpray . fDamagePower = 2.0f;
|
|
#line 88 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
}else {
|
|
#line 89 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
eSpawnSpray . fDamagePower = 1.0f;
|
|
#line 90 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
}
|
|
#line 93 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
eSpawnSpray . sptType = penDestruction -> m_sptType ;
|
|
#line 94 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
eSpawnSpray . fSizeMultiplier = 1.0f;
|
|
#line 97 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
FLOAT3D vDn (- en_mRotation (1 , 2) , - en_mRotation (2 , 2) , - en_mRotation (3 , 2));
|
|
#line 100 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
FLOAT3D vHitPointRelative = vHitPoint - GetPlacement () . pl_PositionVector ;
|
|
#line 101 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
FLOAT3D vReflectingNormal ;
|
|
#line 102 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
GetNormalComponent (vHitPointRelative , vDn , vReflectingNormal );
|
|
#line 103 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
vReflectingNormal . Normalize ();
|
|
#line 105 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
vReflectingNormal (1) /= 5.0f;
|
|
#line 107 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
FLOAT3D vProjectedComponent = vReflectingNormal * (vDirection % vReflectingNormal );
|
|
#line 108 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
FLOAT3D vSpilDirection = vDirection - vProjectedComponent * 2.0f - vDn * 0.5f;
|
|
#line 110 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
eSpawnSpray . vDirection = vSpilDirection ;
|
|
#line 111 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
eSpawnSpray . penOwner = this ;
|
|
#line 114 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
m_penSpray -> Initialize (eSpawnSpray );
|
|
#line 115 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
m_tmSpraySpawned = _pTimer -> CurrentTick ();
|
|
#line 116 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
}
|
|
#line 118 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
CRationalEntity :: ReceiveDamage (penInflictor , dmtType , fDamageAmmount , vHitPoint , vDirection );
|
|
#line 119 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
}
|
|
#line 120 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
}
|
|
|
|
#line 123 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
void CShooter::RenderParticles(void)
|
|
#line 124 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
{
|
|
#line 126 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
if(m_sftType == SFT_FIRE ){
|
|
#line 127 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
}
|
|
#line 128 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
CModelHolder2 :: RenderParticles ();
|
|
#line 129 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
}
|
|
|
|
#line 132 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
CAnimData * CShooter::GetAnimData(SLONG slPropertyOffset)
|
|
#line 133 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
{
|
|
#line 134 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
if(slPropertyOffset == offsetof (CShooter , m_iModelPreFireAnimation ) ||
|
|
#line 135 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
slPropertyOffset == offsetof (CShooter , m_iModelPostFireAnimation )){
|
|
#line 136 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
return GetModelObject () -> GetData ();
|
|
#line 137 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
}else if(slPropertyOffset == offsetof (CShooter , m_iTexturePreFireAnimation ) ||
|
|
#line 138 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
slPropertyOffset == offsetof (CShooter , m_iTexturePostFireAnimation )){
|
|
#line 139 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
return GetModelObject () -> mo_toTexture . GetData ();
|
|
#line 140 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
}else {
|
|
#line 141 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
return CModelHolder2 :: GetAnimData (slPropertyOffset );
|
|
#line 142 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
}
|
|
#line 143 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
}
|
|
|
|
#line 146 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
CEntity * CShooter::ShootProjectile(enum ProjectileType pt,FLOAT3D & vOffset,ANGLE3D & aOffset) {
|
|
#line 148 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
CPlacement3D pl ;
|
|
#line 149 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
pl = GetPlacement ();
|
|
#line 150 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
CEntityPointer penProjectile = CreateEntity (pl , CLASS_PROJECTILE );
|
|
#line 151 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
ELaunchProjectile eLaunch ;
|
|
#line 152 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
eLaunch . penLauncher = this ;
|
|
#line 153 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
eLaunch . prtType = pt ;
|
|
#line 154 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
penProjectile -> Initialize (eLaunch );
|
|
#line 156 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
return penProjectile ;
|
|
#line 157 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
}
|
|
|
|
#line 160 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
void CShooter::FireFlame(void) {
|
|
#line 162 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
CPlacement3D plFlame ;
|
|
#line 163 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
plFlame = GetPlacement ();
|
|
#line 165 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
FLOAT3D vNormDir ;
|
|
#line 166 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
AnglesToDirectionVector (plFlame . pl_OrientationAngle , vNormDir );
|
|
#line 167 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
plFlame . pl_PositionVector += vNormDir * 0.1f;
|
|
#line 170 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
CEntityPointer penFlame = CreateEntity (plFlame , CLASS_PROJECTILE );
|
|
#line 172 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
ELaunchProjectile eLaunch ;
|
|
#line 173 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
eLaunch . penLauncher = this ;
|
|
#line 174 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
eLaunch . prtType = PRT_SHOOTER_FLAME ;
|
|
#line 175 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
penFlame -> Initialize (eLaunch );
|
|
#line 177 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
if(m_penFlame != NULL && ! (m_penFlame -> GetFlags () & ENF_DELETED )){
|
|
#line 178 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
((CProjectile &) * m_penFlame ) . m_penParticles = penFlame ;
|
|
#line 179 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
}
|
|
#line 181 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
((CProjectile &) * penFlame ) . m_penParticles = this ;
|
|
#line 183 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
m_penFlame = penFlame ;
|
|
#line 184 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
}
|
|
|
|
#line 186 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
void CShooter::StopFlame(void) {
|
|
#line 187 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
((CProjectile &) * m_penFlame ) . m_penParticles = NULL ;
|
|
#line 189 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
}
|
|
|
|
#line 191 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
void CShooter::PlayFireSound(void) {
|
|
#line 193 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
if(m_penSoundLaunch != NULL ){
|
|
#line 194 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
CSoundHolder & sh = (CSoundHolder &) * m_penSoundLaunch ;
|
|
#line 195 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
m_soLaunch . Set3DParameters (FLOAT (sh . m_rFallOffRange ) , FLOAT (sh . m_rHotSpotRange ) , sh . m_fVolume , 1.0f);
|
|
#line 196 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
PlaySound (m_soLaunch , sh . m_fnSound , sh . m_iPlayType );
|
|
#line 197 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
}
|
|
#line 198 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
}
|
|
|
|
#line 200 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
void CShooter::ShootCannonball()
|
|
#line 201 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
{
|
|
#line 203 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
CPlacement3D plBall = GetPlacement ();
|
|
#line 205 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
CEntityPointer penBall = CreateEntity (plBall , CLASS_CANNONBALL );
|
|
#line 207 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
ELaunchCannonBall eLaunch ;
|
|
#line 208 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
eLaunch . penLauncher = this ;
|
|
#line 209 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
eLaunch . fLaunchPower = 10.0f + m_fCannonBallPower ;
|
|
#line 210 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
eLaunch . cbtType = CBT_IRON ;
|
|
#line 211 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
eLaunch . fSize = m_fCannonBallSize ;
|
|
#line 212 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
penBall -> Initialize (eLaunch );
|
|
#line 213 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
}
|
|
|
|
#line 215 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
void CShooter::ShootFireball()
|
|
#line 216 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
{
|
|
#line 218 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
CPlacement3D plBall = GetPlacement ();
|
|
#line 220 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
CEntityPointer penBall = CreateEntity (plBall , CLASS_CANNONBALL );
|
|
#line 222 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
ELaunchCannonBall eLaunch ;
|
|
#line 223 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
eLaunch . penLauncher = this ;
|
|
#line 224 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
eLaunch . fLaunchPower = 10.0f + m_fCannonBallPower ;
|
|
#line 225 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
eLaunch . cbtType = CBT_IRON ;
|
|
#line 226 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
eLaunch . fSize = m_fCannonBallSize ;
|
|
#line 227 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
penBall -> Initialize (eLaunch );
|
|
#line 228 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
}
|
|
BOOL CShooter::
|
|
#line 232 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
FireOnce(const CEntityEvent &__eeInput) {
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT STATE_CShooter_FireOnce
|
|
ASSERTMSG(__eeInput.ee_slEvent==EVENTCODE_EVoid, "CShooter::FireOnce expects 'EVoid' as input!"); const EVoid &e = (const EVoid &)__eeInput;
|
|
#line 234 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
if(m_sftType == SFT_FIRE ){Jump(STATE_CURRENT, STATE_CShooter_FlameBurst, TRUE, EVoid());return TRUE;}
|
|
#line 236 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
PlayFireSound ();
|
|
#line 238 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
GetModelObject () -> PlayAnim (m_iModelPreFireAnimation , 0);
|
|
#line 239 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
GetModelObject () -> mo_toTexture . PlayAnim (m_iTexturePreFireAnimation , 0);
|
|
#line 240 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
SetTimerAfter(GetModelObject () -> GetAnimLength (m_iModelPreFireAnimation ));
|
|
Jump(STATE_CURRENT, 0x01590001, FALSE, EBegin());return TRUE;}BOOL CShooter::H0x01590001_FireOnce_01(const CEntityEvent &__eeInput) {
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x01590001
|
|
switch(__eeInput.ee_slEvent) {case EVENTCODE_EBegin: return TRUE;case EVENTCODE_ETimer: Jump(STATE_CURRENT,0x01590002, FALSE, EInternal()); return TRUE;default: return FALSE; }}BOOL CShooter::H0x01590002_FireOnce_02(const CEntityEvent &__eeInput){
|
|
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x01590002
|
|
;
|
|
#line 242 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
switch(m_sftType ){
|
|
#line 243 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
case SFT_WOODEN_DART :
|
|
#line 244 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
ShootProjectile (PRT_SHOOTER_WOODEN_DART , FLOAT3D (0.0f , 0.0f , 0.0f) , ANGLE3D (0.0f , 0.0f , 0.0f));
|
|
#line 245 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
break ;
|
|
#line 246 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
case SFT_GAS :
|
|
#line 247 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
break ;
|
|
#line 248 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
case SFT_IRONBALL :
|
|
#line 249 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
ShootCannonball ();
|
|
#line 250 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
break ;
|
|
#line 251 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
case SFT_FIREBALL :
|
|
#line 252 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
ShootProjectile (PRT_SHOOTER_FIREBALL , FLOAT3D (0.0f , 0.0f , 0.0f) , ANGLE3D (0.0f , 0.0f , 0.0f));
|
|
#line 253 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
break ;
|
|
#line 254 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
}
|
|
#line 256 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
GetModelObject () -> PlayAnim (m_iModelPostFireAnimation , 0);
|
|
#line 257 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
GetModelObject () -> mo_toTexture . PlayAnim (m_iTexturePostFireAnimation , 0);
|
|
#line 258 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
SetTimerAfter(GetModelObject () -> GetAnimLength (m_iModelPostFireAnimation ));
|
|
Jump(STATE_CURRENT, 0x01590003, FALSE, EBegin());return TRUE;}BOOL CShooter::H0x01590003_FireOnce_03(const CEntityEvent &__eeInput) {
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x01590003
|
|
switch(__eeInput.ee_slEvent) {case EVENTCODE_EBegin: return TRUE;case EVENTCODE_ETimer: Jump(STATE_CURRENT,0x01590004, FALSE, EInternal()); return TRUE;default: return FALSE; }}BOOL CShooter::H0x01590004_FireOnce_04(const CEntityEvent &__eeInput){
|
|
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x01590004
|
|
;
|
|
#line 260 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
Return(STATE_CURRENT,EEnd ());
|
|
#line 260 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
return TRUE; ASSERT(FALSE); return TRUE;};BOOL CShooter::
|
|
#line 263 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
FireContinuous(const CEntityEvent &__eeInput) {
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT STATE_CShooter_FireContinuous
|
|
ASSERTMSG(__eeInput.ee_slEvent==EVENTCODE_EVoid, "CShooter::FireContinuous expects 'EVoid' as input!"); const EVoid &e = (const EVoid &)__eeInput;
|
|
#line 266 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
if(!(m_fRndBeginWait > 0.0f)){ Jump(STATE_CURRENT,0x01590008, FALSE, EInternal());return TRUE;}
|
|
#line 268 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
FLOAT fRndWait = FRnd () * m_fRndBeginWait + 0.05;
|
|
#line 269 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
SetTimerAfter(fRndWait );
|
|
Jump(STATE_CURRENT, 0x01590006, FALSE, EBegin());return TRUE;}BOOL CShooter::H0x01590006_FireContinuous_01(const CEntityEvent &__eeInput) {
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x01590006
|
|
switch(__eeInput.ee_slEvent) {case EVENTCODE_EBegin: return TRUE;case EVENTCODE_ETimer: Jump(STATE_CURRENT,0x01590007, FALSE, EInternal()); return TRUE;default: return FALSE; }}BOOL CShooter::H0x01590007_FireContinuous_02(const CEntityEvent &__eeInput){
|
|
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x01590007
|
|
;Jump(STATE_CURRENT,0x01590008, FALSE, EInternal());return TRUE;}BOOL CShooter::H0x01590008_FireContinuous_03(const CEntityEvent &__eeInput){
|
|
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x01590008
|
|
|
|
#line 272 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
Jump(STATE_CURRENT,0x0159000d, FALSE, EInternal());return TRUE;}BOOL CShooter::H0x0159000d_FireContinuous_08(const CEntityEvent &__eeInput){
|
|
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x0159000d
|
|
if(!(m_bFiring )){ Jump(STATE_CURRENT,0x0159000e, FALSE, EInternal());return TRUE;}
|
|
#line 273 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
STATE_CShooter_FireOnce, TRUE;
|
|
Jump(STATE_CURRENT, 0x01590009, FALSE, EBegin());return TRUE;}BOOL CShooter::H0x01590009_FireContinuous_04(const CEntityEvent &__eeInput) {
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x01590009
|
|
switch(__eeInput.ee_slEvent) {case EVENTCODE_EBegin: Call(STATE_CURRENT, STATE_CShooter_FireOnce, TRUE, EVoid());return TRUE;case EVENTCODE_EEnd: Jump(STATE_CURRENT,0x0159000a, FALSE, __eeInput); return TRUE;default: return FALSE; }}BOOL CShooter::H0x0159000a_FireContinuous_05(const CEntityEvent &__eeInput){
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x0159000a
|
|
const EEnd&__e= (EEnd&)__eeInput;
|
|
;
|
|
#line 274 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
SetTimerAfter(m_fShootingPeriod );
|
|
Jump(STATE_CURRENT, 0x0159000b, FALSE, EBegin());return TRUE;}BOOL CShooter::H0x0159000b_FireContinuous_06(const CEntityEvent &__eeInput) {
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x0159000b
|
|
switch(__eeInput.ee_slEvent) {case EVENTCODE_EBegin: return TRUE;case EVENTCODE_ETimer: Jump(STATE_CURRENT,0x0159000c, FALSE, EInternal()); return TRUE;default: return FALSE; }}BOOL CShooter::H0x0159000c_FireContinuous_07(const CEntityEvent &__eeInput){
|
|
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x0159000c
|
|
;Jump(STATE_CURRENT,0x0159000d, FALSE, EInternal());return TRUE;
|
|
#line 275 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
}BOOL CShooter::H0x0159000e_FireContinuous_09(const CEntityEvent &__eeInput) {
|
|
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x0159000e
|
|
|
|
#line 276 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
Return(STATE_CURRENT,EReturn ());
|
|
#line 276 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
return TRUE; ASSERT(FALSE); return TRUE;};BOOL CShooter::
|
|
#line 279 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
FlameBurst(const CEntityEvent &__eeInput) {
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT STATE_CShooter_FlameBurst
|
|
ASSERTMSG(__eeInput.ee_slEvent==EVENTCODE_EVoid, "CShooter::FlameBurst expects 'EVoid' as input!"); const EVoid &e = (const EVoid &)__eeInput;
|
|
#line 280 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
PlayFireSound ();
|
|
#line 281 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
m_penFlame = NULL ;
|
|
#line 282 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
m_tmFlameStart = _pTimer -> CurrentTick ();
|
|
#line 283 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
Jump(STATE_CURRENT,0x01590012, FALSE, EInternal());return TRUE;}BOOL CShooter::H0x01590012_FlameBurst_03(const CEntityEvent &__eeInput)
|
|
#line 284 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
{
|
|
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x01590012
|
|
if(!(_pTimer -> CurrentTick () < m_tmFlameStart + m_fFlameBurstDuration )){ Jump(STATE_CURRENT,0x01590013, FALSE, EInternal());return TRUE;}
|
|
#line 286 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
SetTimerAfter(0.05f);
|
|
Jump(STATE_CURRENT, 0x01590010, FALSE, EBegin());return TRUE;}BOOL CShooter::H0x01590010_FlameBurst_01(const CEntityEvent &__eeInput) {
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x01590010
|
|
switch(__eeInput.ee_slEvent) {case EVENTCODE_EBegin: return TRUE;case EVENTCODE_ETimer: Jump(STATE_CURRENT,0x01590011, FALSE, EInternal()); return TRUE;default: return FALSE; }}BOOL CShooter::H0x01590011_FlameBurst_02(const CEntityEvent &__eeInput){
|
|
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x01590011
|
|
;
|
|
#line 287 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
FireFlame ();Jump(STATE_CURRENT,0x01590012, FALSE, EInternal());return TRUE;
|
|
#line 288 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
}BOOL CShooter::H0x01590013_FlameBurst_04(const CEntityEvent &__eeInput) {
|
|
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x01590013
|
|
|
|
#line 289 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
StopFlame ();
|
|
#line 290 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
Return(STATE_CURRENT,EEnd ());
|
|
#line 290 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
return TRUE; ASSERT(FALSE); return TRUE;};BOOL CShooter::
|
|
#line 293 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
MainLoop(const CEntityEvent &__eeInput) {
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT STATE_CShooter_MainLoop
|
|
ASSERTMSG(__eeInput.ee_slEvent==EVENTCODE_EVoid, "CShooter::MainLoop expects 'EVoid' as input!"); const EVoid &e = (const EVoid &)__eeInput;
|
|
#line 295 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
SetTimerAt(THINKTIME_NEVER);
|
|
Jump(STATE_CURRENT, 0x01590015, FALSE, EBegin());return TRUE;}BOOL CShooter::H0x01590015_MainLoop_01(const CEntityEvent &__eeInput) {
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x01590015
|
|
switch(__eeInput.ee_slEvent){case(EVENTCODE_EBegin):{const EBegin&e= (EBegin&)__eeInput;
|
|
|
|
#line 297 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
return TRUE;
|
|
#line 298 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
}ASSERT(FALSE);break;case(EVENTCODE_ETrigger):{const ETrigger&e= (ETrigger&)__eeInput;
|
|
|
|
#line 300 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
if(! m_bFiring ){
|
|
#line 301 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
Call(STATE_CURRENT, STATE_CShooter_FireOnce, TRUE, EVoid());return TRUE;
|
|
#line 302 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
}else {
|
|
#line 303 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
return TRUE;
|
|
#line 304 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
}
|
|
#line 305 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
}ASSERT(FALSE);break;case(EVENTCODE_EActivate):{const EActivate&e= (EActivate&)__eeInput;
|
|
|
|
#line 307 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
m_bFiring = TRUE ;
|
|
#line 308 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
Call(STATE_CURRENT, STATE_CShooter_FireContinuous, TRUE, EVoid());return TRUE;
|
|
#line 309 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
}ASSERT(FALSE);break;case(EVENTCODE_EDeactivate):{const EDeactivate&e= (EDeactivate&)__eeInput;
|
|
|
|
#line 311 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
m_bFiring = FALSE ;
|
|
#line 312 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
return TRUE;
|
|
#line 313 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
}ASSERT(FALSE);break;case(EVENTCODE_EDeath):{const EDeath&e= (EDeath&)__eeInput;
|
|
|
|
#line 315 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
if(m_penDestruction != NULL ){
|
|
#line 316 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
Jump(STATE_CURRENT, STATE_CModelHolder2_Die, FALSE, EVoid());return TRUE;
|
|
#line 317 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
}else {
|
|
#line 318 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
Destroy ();
|
|
#line 319 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
Return(STATE_CURRENT,EVoid());
|
|
#line 319 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
return TRUE;
|
|
#line 320 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
}
|
|
#line 321 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
}ASSERT(FALSE);break;case(EVENTCODE_EReturn):{const EReturn&e= (EReturn&)__eeInput;
|
|
|
|
#line 323 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
return TRUE;
|
|
#line 324 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
}ASSERT(FALSE);break;default: return FALSE; break;
|
|
#line 325 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
}return TRUE;}BOOL CShooter::H0x01590016_MainLoop_02(const CEntityEvent &__eeInput){
|
|
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x01590016
|
|
ASSERT(FALSE); return TRUE;};BOOL CShooter::
|
|
#line 328 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
Main(const CEntityEvent &__eeInput) {
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT STATE_CShooter_Main
|
|
ASSERTMSG(__eeInput.ee_slEvent==EVENTCODE_EVoid, "CShooter::Main expects 'EVoid' as input!"); const EVoid &e = (const EVoid &)__eeInput;
|
|
#line 330 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
CModelHolder2 :: InitModelHolder ();
|
|
#line 332 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
if(m_fHealth > 0.0f){
|
|
#line 333 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
SetHealth (m_fHealth );
|
|
#line 334 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
m_bIndestructable = FALSE ;
|
|
#line 335 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
}else {
|
|
#line 336 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
SetHealth (10000.0f);
|
|
#line 337 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
m_bIndestructable = TRUE ;
|
|
#line 338 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
}
|
|
#line 340 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
ClampUp (m_fCannonBallSize , 10.0f);
|
|
#line 341 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
ClampDn (m_fCannonBallSize , 0.1f);
|
|
#line 342 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
ClampUp (m_fCannonBallPower , 100.0f);
|
|
#line 343 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
ClampDn (m_fCannonBallPower , 0.0f);
|
|
#line 345 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
if(m_penSoundLaunch != NULL && ! IsOfClass (m_penSoundLaunch , "SoundHolder")){
|
|
#line 346 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
WarningMessage ("Entity '%s' is not of class SoundHolder!" , m_penSoundLaunch );
|
|
#line 347 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
m_penSoundLaunch = NULL ;
|
|
#line 348 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
}
|
|
#line 349 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
if(m_penDestruction != NULL && ! IsOfClass (m_penDestruction , "ModelDestruction")){
|
|
#line 350 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
WarningMessage ("Entity '%s' is not of class ModelDestruction!" , m_penDestruction );
|
|
#line 351 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
m_penDestruction = NULL ;
|
|
#line 352 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
}
|
|
#line 354 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
SetTimerAfter(_pTimer -> TickQuantum );
|
|
Jump(STATE_CURRENT, 0x01590017, FALSE, EBegin());return TRUE;}BOOL CShooter::H0x01590017_Main_01(const CEntityEvent &__eeInput) {
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x01590017
|
|
switch(__eeInput.ee_slEvent) {case EVENTCODE_EBegin: return TRUE;case EVENTCODE_ETimer: Jump(STATE_CURRENT,0x01590018, FALSE, EInternal()); return TRUE;default: return FALSE; }}BOOL CShooter::H0x01590018_Main_02(const CEntityEvent &__eeInput){
|
|
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x01590018
|
|
;
|
|
#line 356 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
Jump(STATE_CURRENT, STATE_CShooter_MainLoop, TRUE, EVoid());return TRUE;
|
|
#line 358 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
Return(STATE_CURRENT,EVoid());
|
|
#line 358 "D:/SE1_GPL/Sources/EntitiesMP/Shooter.es"
|
|
return TRUE; ASSERT(FALSE); return TRUE;}; |