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

631 lines
29 KiB
C++

/*
* This file is generated by Entity Class Compiler, (c) CroTeam 1997-98
*/
#line 4 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
#include "StdH.h"
#include "ModelsMP/Enemies/ChainSawFreak/Freak.h"
#include "ModelsMP/Enemies/ChainSawFreak/Saw.h"
#include <EntitiesMP/ChainsawFreak.h>
#include <EntitiesMP/ChainsawFreak_tables.h>
#line 13 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
#define FREAK_SIZE 1.05f
// info structure
static EntityInfo eiChainsawFreak = {
EIBT_FLESH, 350.0f,
0.0f, 2.5f*FREAK_SIZE, 0.0f, // source (eyes)
0.0f, 1.5f*FREAK_SIZE, 0.0f, // target (body)
};
#define HIT_DISTANCE 4.0f
void CChainsawFreak::SetDefaultProperties(void) {
m_bRunAttack = FALSE ;
m_bSawHit = FALSE ;
m_penLastTouched = NULL;
m_soFeet.SetOwner(this);
m_soFeet.Stop_internal();
m_bRunSoundPlaying = FALSE ;
m_iRunType = 0;
m_bAttacking = FALSE ;
m_fSightSoundBegin = 0.0f;
CEnemyRunInto::SetDefaultProperties();
}
CTString CChainsawFreak::GetPlayerKillDescription(const CTString & strPlayerName,const EDeath & eDeath)
#line 62 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
{
#line 63 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
CTString str ;
#line 64 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
str . PrintF (TRANS ("Chainsaw freak dismembered %s") , strPlayerName );
#line 65 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
return str ;
#line 66 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
}
#line 68 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
void CChainsawFreak::Precache(void) {
#line 69 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
CEnemyBase :: Precache ();
#line 70 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
PrecacheSound (SOUND_IDLE );
#line 71 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
PrecacheSound (SOUND_RUN );
#line 73 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
PrecacheSound (SOUND_ATTACK );
#line 74 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
PrecacheSound (SOUND_WOUND );
#line 75 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
PrecacheSound (SOUND_DEATH );
#line 76 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
PrecacheSound (SOUND_SIGHT );
#line 77 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
}
#line 80 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
void * CChainsawFreak::GetEntityInfo(void) {
#line 81 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
return & eiChainsawFreak ;
#line 82 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
}
#line 84 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
FLOAT CChainsawFreak::GetCrushHealth(void)
#line 85 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
{
#line 86 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
return 60.0f;
#line 87 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
}
const CTFileName & CChainsawFreak::GetComputerMessageName(void)const {
#line 90 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
static DECLARE_CTFILENAME (fnm , "DataMP\\Messages\\Enemies\\ChainsawFreak.txt");
#line 91 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
return fnm ;
#line 92 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
}
#line 101 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
void CChainsawFreak::ReceiveDamage(CEntity * penInflictor,enum DamageType dmtType,
#line 102 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
FLOAT fDamageAmmount,const FLOAT3D & vHitPoint,const FLOAT3D & vDirection)
#line 103 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
{
#line 105 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
if(! IsOfClass (penInflictor , "ChainsawFreak")){
#line 106 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
CEnemyBase :: ReceiveDamage (penInflictor , dmtType , fDamageAmmount , vHitPoint , vDirection );
#line 107 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
}
#line 108 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
}
#line 110 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
void CChainsawFreak::AdjustDifficulty(void)
#line 111 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
{
#line 113 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
}
#line 116 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
INDEX CChainsawFreak::AnimForDeath(void) {
#line 117 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
INDEX iAnim ;
#line 118 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
if(en_vCurrentTranslationAbsolute . Length () > 5.0f){
#line 119 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
iAnim = FREAK_ANIM_DEATHRUN ;
#line 120 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
}else {
#line 121 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
iAnim = FREAK_ANIM_DEATHSTAND ;
#line 122 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
}
#line 123 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
ChangeCollisionBoxIndexWhenPossible (FREAK_COLLISION_BOX_DEATHRUN );
#line 124 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
StartModelAnim (iAnim , 0);
#line 125 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
m_bAttacking = FALSE ;
#line 126 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
DeactivateRunningSound ();
#line 127 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
return iAnim ;
#line 128 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
}
#line 130 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
FLOAT CChainsawFreak::WaitForDust(FLOAT3D & vStretch) {
#line 131 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
if(GetModelObject () -> GetAnim () == FREAK_ANIM_DEATHRUN )
#line 132 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
{
#line 133 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
vStretch = FLOAT3D (1 , 1 , 2) * 1.0f;
#line 134 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
return 0.65f;
#line 135 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
}
#line 136 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
else if(GetModelObject () -> GetAnim () == FREAK_ANIM_DEATHSTAND )
#line 137 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
{
#line 138 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
vStretch = FLOAT3D (1 , 1 , 2) * 1.5f;
#line 139 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
return 0.72f;
#line 140 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
}
#line 141 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
return - 1.0f;
#line 142 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
}
#line 144 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
void CChainsawFreak::DeathNotify() {
#line 145 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
ChangeCollisionBoxIndexWhenPossible (FREAK_COLLISION_BOX_DEATH );
#line 146 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
SetCollisionFlags (ECF_MODEL );
#line 147 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
}
#line 150 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
void CChainsawFreak::StandingAnim(void) {
#line 151 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
StartModelAnim (FREAK_ANIM_IDLE , AOF_LOOPING | AOF_NORESTART );
#line 153 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
}
#line 154 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
void CChainsawFreak::WalkingAnim(void) {
#line 155 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
StartModelAnim (FREAK_ANIM_WALK , AOF_LOOPING | AOF_NORESTART );
#line 157 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
}
#line 158 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
void CChainsawFreak::RunningAnim(void) {
#line 159 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
switch(m_iRunType )
#line 160 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
{
#line 161 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
case 0:
#line 162 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
StartModelAnim (FREAK_ANIM_ATTACKRUN , AOF_LOOPING | AOF_NORESTART );
#line 163 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
break ;
#line 164 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
case 1:
#line 165 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
StartModelAnim (FREAK_ANIM_ATTACKRUNFAR , AOF_LOOPING | AOF_NORESTART );
#line 166 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
break ;
#line 167 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
case 2:
#line 168 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
StartModelAnim (FREAK_ANIM_ATTACKCHARGE , AOF_LOOPING | AOF_NORESTART );
#line 169 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
break ;
#line 170 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
default :
#line 171 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
ASSERTALWAYS ("Unknown Chainsaw freak run type!");
#line 172 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
}
#line 174 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
}
#line 175 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
void CChainsawFreak::ChargeAnim(void) {
#line 176 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
StartModelAnim (FREAK_ANIM_RUNSLASHING , AOF_LOOPING | AOF_NORESTART );
#line 177 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
}
#line 178 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
void CChainsawFreak::RotatingAnim(void) {
#line 179 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
m_iRunType = IRnd () % 3;
#line 180 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
StartModelAnim (FREAK_ANIM_ATTACKSTART , AOF_LOOPING | AOF_NORESTART );
#line 181 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
}
#line 184 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
void CChainsawFreak::IdleSound(void) {
#line 185 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
PlaySound (m_soSound , SOUND_IDLE , SOF_3D );
#line 186 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
}
#line 190 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
void CChainsawFreak::WoundSound(void) {
#line 191 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
PlaySound (m_soSound , SOUND_WOUND , SOF_3D );
#line 192 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
}
#line 193 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
void CChainsawFreak::DeathSound(void) {
#line 194 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
PlaySound (m_soSound , SOUND_DEATH , SOF_3D );
#line 195 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
}
#line 198 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
void CChainsawFreak::ActivateRunningSound(void)
#line 199 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
{
#line 200 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
if(! m_bRunSoundPlaying ){
#line 201 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
PlaySound (m_soFeet , SOUND_RUN , SOF_3D | SOF_LOOP );
#line 202 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
m_bRunSoundPlaying = TRUE ;
#line 203 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
}
#line 204 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
}
#line 205 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
void CChainsawFreak::DeactivateRunningSound(void)
#line 206 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
{
#line 207 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
m_soFeet . Stop ();
#line 208 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
m_bRunSoundPlaying = FALSE ;
#line 209 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
}
#line 216 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
void CChainsawFreak::LiveEntityTouched(ETouch etouch) {
#line 217 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
if(m_penLastTouched != etouch . penOther || _pTimer -> CurrentTick () >= m_fLastTouchedTime + 0.25f){
#line 219 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
FLOAT3D vDirection = en_vCurrentTranslationAbsolute ;
#line 220 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
vDirection . Normalize ();
#line 221 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
ANGLE aHitAngle = FLOAT3D (etouch . plCollision ) % vDirection ;
#line 223 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
if(aHitAngle < 0.0f){
#line 225 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
if(! IsOfSameClass (this , etouch . penOther )){
#line 226 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
IncreaseKickedMass (etouch . penOther );
#line 227 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
}
#line 228 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
PlaySound (m_soSound , SOUND_ATTACK , SOF_3D );
#line 230 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
m_penLastTouched = etouch . penOther ;
#line 231 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
m_fLastTouchedTime = _pTimer -> CurrentTick ();
#line 233 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
FLOAT3D vDirection = m_penEnemy -> GetPlacement () . pl_PositionVector - GetPlacement () . pl_PositionVector ;
#line 234 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
vDirection . Normalize ();
#line 235 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
InflictDirectDamage (etouch . penOther , this , DMT_CHAINSAW , - aHitAngle * 40.0f ,
#line 236 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
FLOAT3D (0 , 0 , 0) , vDirection );
#line 238 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
FLOAT3D vSpeed = - FLOAT3D (etouch . plCollision );
#line 239 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
vSpeed = vSpeed * 10.0f;
#line 240 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
const FLOATmatrix3D & m = GetRotationMatrix ();
#line 241 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
FLOAT3D vSpeedRel = vSpeed * ! m ;
#line 242 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
if(vSpeedRel (1) < - 0.1f){
#line 243 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
vSpeedRel (1) -= 5.0f;
#line 244 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
}else {
#line 245 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
vSpeedRel (1) += 5.0f;
#line 246 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
}
#line 247 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
vSpeedRel (2) = 5.0f;
#line 249 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
vSpeed = vSpeedRel * m ;
#line 250 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
KickEntity (etouch . penOther , vSpeed );
#line 251 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
}
#line 252 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
}
#line 253 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
}
#line 256 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
BOOL CChainsawFreak::HigherMass(void) {
#line 257 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
return (m_fMassKicked > 500.0f);
#line 258 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
}
#line 261 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
void CChainsawFreak::EnemyPostInit(void)
#line 262 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
{
#line 264 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
m_soFeet . Set3DParameters (500.0f , 50.0f , 1.0f , 1.0f);
#line 265 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
m_bRunSoundPlaying = FALSE ;
#line 266 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
m_soSound . Set3DParameters (160.0f , 50.0f , 1.0f , 1.0f);
#line 267 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
}
#line 269 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
void CChainsawFreak::PreMoving() {
#line 270 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
if(! m_bRunSoundPlaying && _pTimer -> CurrentTick () > m_fSightSoundBegin + 2.0f && m_bAttacking )
#line 271 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
{
#line 272 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
ActivateRunningSound ();
#line 273 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
}
#line 274 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
CEnemyBase :: PreMoving ();
#line 275 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
}
BOOL CChainsawFreak::
#line 282 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
Hit(const CEntityEvent &__eeInput) {
#undef STATE_CURRENT
#define STATE_CURRENT STATE_CChainsawFreak_Hit
ASSERTMSG(__eeInput.ee_slEvent==EVENTCODE_EVoid, "CChainsawFreak::Hit expects 'EVoid' as input!"); const EVoid &e = (const EVoid &)__eeInput;
#line 283 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
if(!(CalcDist (m_penEnemy ) < HIT_DISTANCE )){ Jump(STATE_CURRENT,0x01560009, FALSE, EInternal());return TRUE;}
#line 285 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
StartModelAnim (FREAK_ANIM_ATTACKSLASH , 0);
#line 287 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
FLOAT3D vDir = (m_penEnemy -> GetPlacement () . pl_PositionVector -
#line 288 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
GetPlacement () . pl_PositionVector ) . Normalize ();
#line 289 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
vDir *= ! GetRotationMatrix ();
#line 290 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
vDir *= m_fCloseRunSpeed * 1.5f;
#line 291 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
vDir (2) = 1.0f;
#line 293 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
GiveImpulseTranslationRelative (vDir );
#line 296 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
m_bSawHit = FALSE ;
#line 297 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
SetTimerAfter(0.4f);
Jump(STATE_CURRENT, 0x01560001, FALSE, EBegin());return TRUE;}BOOL CChainsawFreak::H0x01560001_Hit_01(const CEntityEvent &__eeInput) {
#undef STATE_CURRENT
#define STATE_CURRENT 0x01560001
switch(__eeInput.ee_slEvent) {case EVENTCODE_EBegin: return TRUE;case EVENTCODE_ETimer: Jump(STATE_CURRENT,0x01560002, FALSE, EInternal()); return TRUE;default: return FALSE; }}BOOL CChainsawFreak::H0x01560002_Hit_02(const CEntityEvent &__eeInput){
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
#undef STATE_CURRENT
#define STATE_CURRENT 0x01560002
;
#line 298 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
PlaySound (m_soSound , SOUND_ATTACK , SOF_3D );
#line 299 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
if(CalcDist (m_penEnemy ) < HIT_DISTANCE ){m_bSawHit = TRUE ;}
#line 300 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
SetTimerAfter(0.1f);
Jump(STATE_CURRENT, 0x01560003, FALSE, EBegin());return TRUE;}BOOL CChainsawFreak::H0x01560003_Hit_03(const CEntityEvent &__eeInput) {
#undef STATE_CURRENT
#define STATE_CURRENT 0x01560003
switch(__eeInput.ee_slEvent) {case EVENTCODE_EBegin: return TRUE;case EVENTCODE_ETimer: Jump(STATE_CURRENT,0x01560004, FALSE, EInternal()); return TRUE;default: return FALSE; }}BOOL CChainsawFreak::H0x01560004_Hit_04(const CEntityEvent &__eeInput){
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
#undef STATE_CURRENT
#define STATE_CURRENT 0x01560004
;
#line 301 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
if(CalcDist (m_penEnemy ) < HIT_DISTANCE ){m_bSawHit = TRUE ;}
#line 302 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
SetTimerAfter(0.1f);
Jump(STATE_CURRENT, 0x01560005, FALSE, EBegin());return TRUE;}BOOL CChainsawFreak::H0x01560005_Hit_05(const CEntityEvent &__eeInput) {
#undef STATE_CURRENT
#define STATE_CURRENT 0x01560005
switch(__eeInput.ee_slEvent) {case EVENTCODE_EBegin: return TRUE;case EVENTCODE_ETimer: Jump(STATE_CURRENT,0x01560006, FALSE, EInternal()); return TRUE;default: return FALSE; }}BOOL CChainsawFreak::H0x01560006_Hit_06(const CEntityEvent &__eeInput){
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
#undef STATE_CURRENT
#define STATE_CURRENT 0x01560006
;
#line 303 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
if(CalcDist (m_penEnemy ) < HIT_DISTANCE ){m_bSawHit = TRUE ;}
#line 304 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
if(m_bSawHit ){
#line 305 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
FLOAT3D vDirection = m_penEnemy -> GetPlacement () . pl_PositionVector - GetPlacement () . pl_PositionVector ;
#line 306 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
vDirection . Normalize ();
#line 307 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
InflictDirectDamage (m_penEnemy , this , DMT_CHAINSAW , 20.0f , FLOAT3D (0 , 0 , 0) , vDirection );
#line 309 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
vDirection = vDirection * 10.0f;
#line 311 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
FLOATmatrix3D mDirection ;
#line 312 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
MakeRotationMatrixFast (mDirection , ANGLE3D (0.0f , 30.0f , 0.0f));
#line 313 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
vDirection = vDirection * mDirection ;
#line 314 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
KickEntity (m_penEnemy , vDirection );
#line 315 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
}
#line 316 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
SetTimerAfter(0.6f);
Jump(STATE_CURRENT, 0x01560007, FALSE, EBegin());return TRUE;}BOOL CChainsawFreak::H0x01560007_Hit_07(const CEntityEvent &__eeInput) {
#undef STATE_CURRENT
#define STATE_CURRENT 0x01560007
switch(__eeInput.ee_slEvent) {case EVENTCODE_EBegin: return TRUE;case EVENTCODE_ETimer: Jump(STATE_CURRENT,0x01560008, FALSE, EInternal()); return TRUE;default: return FALSE; }}BOOL CChainsawFreak::H0x01560008_Hit_08(const CEntityEvent &__eeInput){
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
#undef STATE_CURRENT
#define STATE_CURRENT 0x01560008
;Jump(STATE_CURRENT,0x01560009, FALSE, EInternal());return TRUE;}BOOL CChainsawFreak::H0x01560009_Hit_09(const CEntityEvent &__eeInput){
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
#undef STATE_CURRENT
#define STATE_CURRENT 0x01560009
#line 320 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
m_fShootTime = _pTimer -> CurrentTick () + 0.5f;
#line 321 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
Return(STATE_CURRENT,EReturn ());
#line 321 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
return TRUE; ASSERT(FALSE); return TRUE;};BOOL CChainsawFreak::
#line 324 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
AttackEnemy(const CEntityEvent &__eeInput) {
#undef STATE_CURRENT
#define STATE_CURRENT STATE_CChainsawFreak_AttackEnemy
ASSERTMSG(__eeInput.ee_slEvent==EVENTCODE_EVoid, "CChainsawFreak::AttackEnemy expects 'EVoid' as input!"); const EVoid &e = (const EVoid &)__eeInput;
#line 325 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
m_bAttacking = TRUE ;
#line 326 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
PlaySound (m_soSound , SOUND_SIGHT , SOF_3D | SOF_SMOOTHCHANGE );
#line 327 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
m_fSightSoundBegin = _pTimer -> CurrentTick ();
#line 328 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
Jump(STATE_CURRENT, STATE_CEnemyBase_AttackEnemy, FALSE, EVoid());return TRUE; ASSERT(FALSE); return TRUE;};BOOL CChainsawFreak::
#line 331 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
BeIdle(const CEntityEvent &__eeInput) {
#undef STATE_CURRENT
#define STATE_CURRENT STATE_CChainsawFreak_BeIdle
ASSERTMSG(__eeInput.ee_slEvent==EVENTCODE_EVoid, "CChainsawFreak::BeIdle expects 'EVoid' as input!"); const EVoid &e = (const EVoid &)__eeInput;
#line 332 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
m_bAttacking = FALSE ;
#line 333 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
DeactivateRunningSound ();
#line 334 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
Jump(STATE_CURRENT, STATE_CEnemyBase_BeIdle, FALSE, EVoid());return TRUE; ASSERT(FALSE); return TRUE;};BOOL CChainsawFreak::
#line 338 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
PostRunAwayFromEnemy(const CEntityEvent &__eeInput) {
#undef STATE_CURRENT
#define STATE_CURRENT STATE_CChainsawFreak_PostRunAwayFromEnemy
ASSERTMSG(__eeInput.ee_slEvent==EVENTCODE_EVoid, "CChainsawFreak::PostRunAwayFromEnemy expects 'EVoid' as input!"); const EVoid &e = (const EVoid &)__eeInput;
#line 339 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
StartModelAnim (FREAK_ANIM_ATTACKRUNFAR , 0);
#line 340 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
SetTimerAfter(0.25f);
Jump(STATE_CURRENT, 0x0156000d, FALSE, EBegin());return TRUE;}BOOL CChainsawFreak::H0x0156000d_PostRunAwayFromEnemy_01(const CEntityEvent &__eeInput) {
#undef STATE_CURRENT
#define STATE_CURRENT 0x0156000d
switch(__eeInput.ee_slEvent) {case EVENTCODE_EBegin: return TRUE;case EVENTCODE_ETimer: Jump(STATE_CURRENT,0x0156000e, FALSE, EInternal()); return TRUE;default: return FALSE; }}BOOL CChainsawFreak::H0x0156000e_PostRunAwayFromEnemy_02(const CEntityEvent &__eeInput){
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
#undef STATE_CURRENT
#define STATE_CURRENT 0x0156000e
;
#line 341 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
SetDesiredTranslation (FLOAT3D (0 , 0 , 0));
#line 342 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
StartModelAnim (FREAK_ANIM_IDLE , 0);
#line 343 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
SetTimerAfter(0.25f);
Jump(STATE_CURRENT, 0x0156000f, FALSE, EBegin());return TRUE;}BOOL CChainsawFreak::H0x0156000f_PostRunAwayFromEnemy_03(const CEntityEvent &__eeInput) {
#undef STATE_CURRENT
#define STATE_CURRENT 0x0156000f
switch(__eeInput.ee_slEvent) {case EVENTCODE_EBegin: return TRUE;case EVENTCODE_ETimer: Jump(STATE_CURRENT,0x01560010, FALSE, EInternal()); return TRUE;default: return FALSE; }}BOOL CChainsawFreak::H0x01560010_PostRunAwayFromEnemy_04(const CEntityEvent &__eeInput){
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
#undef STATE_CURRENT
#define STATE_CURRENT 0x01560010
;
#line 344 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
Return(STATE_CURRENT,EReturn ());
#line 344 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
return TRUE; ASSERT(FALSE); return TRUE;};BOOL CChainsawFreak::
#line 350 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
Main(const CEntityEvent &__eeInput) {
#undef STATE_CURRENT
#define STATE_CURRENT STATE_CChainsawFreak_Main
ASSERTMSG(__eeInput.ee_slEvent==EVENTCODE_EVoid, "CChainsawFreak::Main expects 'EVoid' as input!"); const EVoid &e = (const EVoid &)__eeInput;
#line 352 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
InitAsModel ();
#line 353 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
SetPhysicsFlags (EPF_MODEL_WALKING );
#line 354 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
SetCollisionFlags (ECF_MODEL );
#line 355 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
SetFlags (GetFlags () | ENF_ALIVE );
#line 356 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
SetHealth (175.0f);
#line 357 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
m_fMaxHealth = 175.0f;
#line 358 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
en_fDensity = 2000.0f;
#line 360 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
SetModel (MODEL_FREAK );
#line 361 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
SetModelMainTexture (TEXTURE_FREAK );
#line 362 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
AddAttachment (FREAK_ATTACHMENT_CHAINSAW , MODEL_CHAINSAW , TEXTURE_CHAINSAW );
#line 363 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
StandingAnim ();
#line 365 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
m_fWalkSpeed = FRnd () + 2.5f;
#line 366 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
m_aWalkRotateSpeed = AngleDeg (FRnd () * 25.0f + 45.0f);
#line 367 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
m_fAttackRunSpeed = FRnd () * 2.0f + 13.0f;
#line 368 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
m_fAttackRotateRunInto = AngleDeg (FRnd () * 30 + 50.0f);
#line 369 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
m_aAttackRotateSpeed = m_fAttackRotateRunInto ;
#line 370 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
m_fCloseRunSpeed = FRnd () + 10.5f;
#line 371 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
m_aCloseRotateSpeed = AngleDeg (FRnd () * 50 + 250.0f);
#line 373 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
m_fAttackDistance = 50.0f;
#line 374 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
m_fCloseDistance = 7.0f;
#line 375 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
m_fStopDistance = 0.0f;
#line 376 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
m_fAttackFireTime = 0.05f;
#line 377 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
m_fCloseFireTime = 1.0f;
#line 378 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
m_fIgnoreRange = 150.0f;
#line 380 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
m_fBlowUpAmount = 1E10f;
#line 381 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
m_fBodyParts = 6;
#line 382 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
m_fDamageWounded = 100000.0f;
#line 383 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
m_iScore = 1500;
#line 384 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
if(m_fStepHeight == - 1){
#line 385 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
m_fStepHeight = 4.0f;
#line 386 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
}
#line 387 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
m_fStopApproachDistance = 0.0f;
#line 388 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
ASSERT (m_fStopApproachDistance < m_fCloseDistance );
#line 389 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
m_bUseChargeAnimation = TRUE ;
#line 390 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
m_fChargeDistance = 20.0f;
#line 391 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
m_fInertionRunTime = 0.15f;
#line 392 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
m_iRunType = IRnd () % 3;
#line 394 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
GetModelObject () -> StretchModel (FLOAT3D (FREAK_SIZE , FREAK_SIZE , FREAK_SIZE ));
#line 395 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
ModelChangeNotify ();
#line 397 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
m_bAttacking = FALSE ;
#line 400 "D:/SE1_GPL/Sources/EntitiesMP/ChainsawFreak.es"
Jump(STATE_CURRENT, STATE_CEnemyRunInto_MainLoop, FALSE, EVoid());return TRUE; ASSERT(FALSE); return TRUE;};