mirror of
https://github.com/ptitSeb/Serious-Engine
synced 2024-11-22 10:20:26 +01:00
524 lines
21 KiB
C++
524 lines
21 KiB
C++
/*
|
|
* This file is generated by Entity Class Compiler, (c) CroTeam 1997-98
|
|
*/
|
|
|
|
#line 4 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
|
|
#include "StdH.h"
|
|
#include "Models/Enemies/Fish/Fish.h"
|
|
|
|
#include <EntitiesMP/Fish.h>
|
|
#include <EntitiesMP/Fish_tables.h>
|
|
#line 11 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
|
|
static EntityInfo eiFish = {
|
|
EIBT_FLESH, 100.0f,
|
|
0.0f, 0.0f, 0.0f,
|
|
0.0f, 0.0f, 0.0f,
|
|
};
|
|
|
|
#define DISTANCE_ELECTRICITY 8.0f
|
|
|
|
void CFish::SetDefaultProperties(void) {
|
|
m_bAttackingByElectricity = FALSE ;
|
|
m_tmElectricityTimeStart = 0.0f;
|
|
CEnemyDive::SetDefaultProperties();
|
|
}
|
|
CTString CFish::GetPlayerKillDescription(const CTString & strPlayerName,const EDeath & eDeath)
|
|
#line 49 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
{
|
|
#line 50 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
CTString str ;
|
|
#line 51 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
str . PrintF (TRANS ("%s was electrocuted by a fish") , strPlayerName );
|
|
#line 52 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
return str ;
|
|
#line 53 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
}
|
|
const CTFileName & CFish::GetComputerMessageName(void)const {
|
|
#line 55 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
static DECLARE_CTFILENAME (fnm , "Data\\Messages\\Enemies\\Fish.txt");
|
|
#line 56 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
return fnm ;
|
|
#line 57 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
}
|
|
|
|
#line 58 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
void CFish::Precache(void) {
|
|
#line 59 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
CEnemyBase :: Precache ();
|
|
#line 60 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
PrecacheModel (MODEL_GLOW );
|
|
#line 61 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
PrecacheTexture (TEXTURE_GLOW );
|
|
#line 62 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
PrecacheSound (SOUND_IDLE );
|
|
#line 63 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
PrecacheSound (SOUND_SIGHT );
|
|
#line 64 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
PrecacheSound (SOUND_WOUND );
|
|
#line 65 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
PrecacheSound (SOUND_DEATH );
|
|
#line 66 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
PrecacheSound (SOUND_WOUNDAIR );
|
|
#line 67 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
PrecacheSound (SOUND_DEATHAIR );
|
|
#line 68 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
PrecacheSound (SOUND_ATTACK );
|
|
#line 69 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
}
|
|
|
|
#line 72 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
void * CFish::GetEntityInfo(void)
|
|
#line 73 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
{
|
|
#line 74 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
return & eiFish ;
|
|
#line 75 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
}
|
|
|
|
#line 78 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
void CFish::ReceiveDamage(CEntity * penInflictor,enum DamageType dmtType,
|
|
#line 79 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
FLOAT fDamageAmmount,const FLOAT3D & vHitPoint,const FLOAT3D & vDirection)
|
|
#line 80 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
{
|
|
#line 81 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
if(dmtType == DMT_DROWNING ){
|
|
#line 83 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
fDamageAmmount /= 2.0f;
|
|
#line 84 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
}
|
|
#line 86 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
if(! IsOfClass (penInflictor , "Fish")){
|
|
#line 87 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
CEnemyDive :: ReceiveDamage (penInflictor , dmtType , fDamageAmmount , vHitPoint , vDirection );
|
|
#line 88 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
}
|
|
#line 89 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
}
|
|
|
|
#line 93 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
INDEX CFish::AnimForDamage(FLOAT fDamage)
|
|
#line 94 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
{
|
|
#line 95 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
m_bAttackingByElectricity = FALSE ;
|
|
#line 96 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
INDEX iAnim = FISH_ANIM_WOUND ;
|
|
#line 97 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
StartModelAnim (iAnim , 0);
|
|
#line 98 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
return iAnim ;
|
|
#line 99 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
}
|
|
|
|
#line 102 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
INDEX CFish::AnimForDeath(void) {
|
|
#line 103 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
if(! m_bInLiquid ){
|
|
#line 104 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
return AnimForDamage (10.0f);
|
|
#line 105 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
}
|
|
#line 106 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
INDEX iAnim ;
|
|
#line 107 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
switch(IRnd () % 3){
|
|
#line 108 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
default : iAnim = FISH_ANIM_DEATH ;break ;
|
|
#line 109 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
case 0: iAnim = FISH_ANIM_DEATH ;break ;
|
|
#line 110 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
case 1: iAnim = FISH_ANIM_DEATH02 ;break ;
|
|
#line 111 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
case 2: iAnim = FISH_ANIM_DEATH03 ;break ;
|
|
#line 112 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
}
|
|
#line 113 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
StartModelAnim (iAnim , 0);
|
|
#line 114 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
return iAnim ;
|
|
#line 115 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
}
|
|
|
|
#line 117 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
void CFish::DeathNotify(void)
|
|
#line 118 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
{
|
|
#line 119 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
m_bAttackingByElectricity = FALSE ;
|
|
#line 120 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
en_fDensity = 500.0f;
|
|
#line 121 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
}
|
|
|
|
#line 123 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
void CFish::RenderParticles(void)
|
|
#line 124 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
{
|
|
#line 125 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
if(m_bAttackingByElectricity && m_penEnemy != NULL )
|
|
#line 126 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
{
|
|
#line 128 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
FLOAT3D vSource = GetPlacement () . pl_PositionVector ;
|
|
#line 129 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
FLOAT3D vTarget = m_penEnemy -> GetPlacement () . pl_PositionVector ;
|
|
#line 130 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
FLOAT3D vDirection = (vTarget - vSource ) . Normalize ();
|
|
#line 131 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
Particles_Ghostbuster (vSource , vTarget , 32 , 1.0f);
|
|
#line 134 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
for(INDEX i = 0;i < 4;i ++)
|
|
#line 135 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
{
|
|
#line 136 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
FLOAT3D vDirection = vSource ;
|
|
#line 137 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
vDirection (1) += ((FLOAT (rand ()) / RAND_MAX ) - 0.5f) * DISTANCE_ELECTRICITY / 1.0f;
|
|
#line 138 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
vDirection (2) += ((FLOAT (rand ()) / RAND_MAX ) - 0.5f) * DISTANCE_ELECTRICITY / 1.0f;
|
|
#line 139 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
vDirection (3) += ((FLOAT (rand ()) / RAND_MAX ) - 0.5f) * DISTANCE_ELECTRICITY / 1.0f;
|
|
#line 140 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
Particles_Ghostbuster (vSource , vDirection , 32 , 1.0f);
|
|
#line 141 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
}
|
|
#line 142 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
}
|
|
#line 143 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
CEnemyBase :: RenderParticles ();
|
|
#line 144 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
}
|
|
|
|
#line 146 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
void CFish::StandingAnim(void)
|
|
#line 147 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
{
|
|
#line 148 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
StartModelAnim (FISH_ANIM_IDLE , AOF_LOOPING | AOF_NORESTART );
|
|
#line 149 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
}
|
|
|
|
#line 150 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
void CFish::WalkingAnim(void)
|
|
#line 151 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
{
|
|
#line 152 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
if(m_bInLiquid ){
|
|
#line 153 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
StartModelAnim (FISH_ANIM_SWIM , AOF_LOOPING | AOF_NORESTART );
|
|
#line 154 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
}else {
|
|
#line 155 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
StartModelAnim (FISH_ANIM_WOUND , AOF_LOOPING | AOF_NORESTART );
|
|
#line 156 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
}
|
|
#line 157 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
}
|
|
|
|
#line 158 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
void CFish::RunningAnim(void)
|
|
#line 159 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
{
|
|
#line 160 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
WalkingAnim ();
|
|
#line 161 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
}
|
|
|
|
#line 162 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
void CFish::RotatingAnim(void)
|
|
#line 163 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
{
|
|
#line 164 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
WalkingAnim ();
|
|
#line 165 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
}
|
|
|
|
#line 168 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
void CFish::IdleSound(void)
|
|
#line 169 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
{
|
|
#line 170 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
PlaySound (m_soSound , SOUND_IDLE , SOF_3D | SOF_NOFILTER );
|
|
#line 171 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
}
|
|
|
|
#line 172 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
void CFish::SightSound(void)
|
|
#line 173 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
{
|
|
#line 174 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
PlaySound (m_soSound , SOUND_SIGHT , SOF_3D | SOF_NOFILTER );
|
|
#line 175 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
}
|
|
|
|
#line 176 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
void CFish::WoundSound(void)
|
|
#line 177 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
{
|
|
#line 178 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
if(m_bInLiquid ){
|
|
#line 179 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
PlaySound (m_soSound , SOUND_WOUND , SOF_3D | SOF_NOFILTER );
|
|
#line 180 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
}else {
|
|
#line 181 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
PlaySound (m_soSound , SOUND_WOUNDAIR , SOF_3D | SOF_NOFILTER );
|
|
#line 182 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
}
|
|
#line 183 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
}
|
|
|
|
#line 184 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
void CFish::DeathSound(void)
|
|
#line 185 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
{
|
|
#line 186 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
if(m_bInLiquid ){
|
|
#line 187 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
PlaySound (m_soSound , SOUND_DEATH , SOF_3D | SOF_NOFILTER );
|
|
#line 188 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
}else {
|
|
#line 189 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
PlaySound (m_soSound , SOUND_DEATHAIR , SOF_3D | SOF_NOFILTER );
|
|
#line 190 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
}
|
|
#line 191 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
}
|
|
|
|
#line 193 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
BOOL CFish::AdjustShadingParameters(FLOAT3D & vLightDirection,COLOR & colLight,COLOR & colAmbient)
|
|
#line 194 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
{
|
|
#line 195 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
FLOAT fTimePassed = _pTimer -> GetLerpedCurrentTick () - m_tmElectricityTimeStart ;
|
|
#line 196 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
if(m_bAttackingByElectricity && (fTimePassed > 0))
|
|
#line 197 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
{
|
|
#line 198 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
FLOAT fDieFactor = 1.0f;
|
|
#line 199 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
if(fTimePassed > 0.25f)
|
|
#line 200 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
{
|
|
#line 202 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
fDieFactor = 1.0 - (ClampUp (fTimePassed - 0.25f , 0.5f) / 0.5f);
|
|
#line 203 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
}
|
|
#line 205 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
FLOAT fR = 0.7f + 0.1f * (FLOAT (rand ()) / RAND_MAX );
|
|
#line 206 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
FLOAT fG = 0.7f + 0.2f * (FLOAT (rand ()) / RAND_MAX );
|
|
#line 207 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
FLOAT fB = 0.7f + 0.3f * (FLOAT (rand ()) / RAND_MAX );
|
|
#line 208 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
colAmbient = RGBToColor (fR * 128 * fDieFactor , fG * 128 * fDieFactor , fB * 128 * fDieFactor );
|
|
#line 209 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
colLight = C_WHITE ;
|
|
#line 210 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
return CEnemyBase :: AdjustShadingParameters (vLightDirection , colLight , colAmbient );
|
|
#line 211 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
}
|
|
#line 212 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
return CEnemyBase :: AdjustShadingParameters (vLightDirection , colLight , colAmbient );
|
|
#line 213 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
}
|
|
BOOL CFish::
|
|
#line 219 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
DiveHit(const CEntityEvent &__eeInput) {
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT STATE_CFish_DiveHit
|
|
ASSERTMSG(__eeInput.ee_slEvent==EVENTCODE_EVoid, "CFish::DiveHit expects 'EVoid' as input!"); const EVoid &e = (const EVoid &)__eeInput;
|
|
#line 221 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
if(CalcDist (m_penEnemy ) > DISTANCE_ELECTRICITY )
|
|
#line 222 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
{
|
|
#line 224 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
m_fShootTime = _pTimer -> CurrentTick () + 0.25f;
|
|
#line 225 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
Return(STATE_CURRENT,EReturn ());
|
|
#line 225 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
return TRUE;
|
|
#line 226 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
}
|
|
#line 229 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
SetTimerAfter(0.6f);
|
|
Jump(STATE_CURRENT, 0x01510001, FALSE, EBegin());return TRUE;}BOOL CFish::H0x01510001_DiveHit_01(const CEntityEvent &__eeInput) {
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x01510001
|
|
switch(__eeInput.ee_slEvent) {case EVENTCODE_EBegin: return TRUE;case EVENTCODE_ETimer: Jump(STATE_CURRENT,0x01510002, FALSE, EInternal()); return TRUE;default: return FALSE; }}BOOL CFish::H0x01510002_DiveHit_02(const CEntityEvent &__eeInput){
|
|
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x01510002
|
|
;
|
|
#line 231 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
m_bAttackingByElectricity = TRUE ;
|
|
#line 232 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
m_tmElectricityTimeStart = _pTimer -> CurrentTick ();
|
|
#line 234 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
AddAttachmentToModel (this , * GetModelObject () , FISH_ATTACHMENT_GLOW , MODEL_GLOW , TEXTURE_GLOW , 0 , 0 , 0);
|
|
#line 235 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
CModelObject & moGlow = GetModelObject () -> GetAttachmentModel (FISH_ATTACHMENT_GLOW ) -> amo_moModelObject ;
|
|
#line 236 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
moGlow . StretchModel (FLOAT3D (4.0f , 4.0f , 4.0f));
|
|
#line 239 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
StartModelAnim (FISH_ANIM_ATTACK , 0);
|
|
#line 240 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
PlaySound (m_soSound , SOUND_ATTACK , SOF_3D | SOF_NOFILTER );
|
|
#line 241 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
if(CalcDist (m_penEnemy ) < DISTANCE_ELECTRICITY )
|
|
#line 242 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
{
|
|
#line 244 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
InflictRangeDamage (this , DMT_CLOSERANGE , 15.0f , GetPlacement () . pl_PositionVector , 1.0f , DISTANCE_ELECTRICITY );
|
|
#line 246 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
FLOAT3D vSpeed ;
|
|
#line 247 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
GetHeadingDirection (0.0f , vSpeed );
|
|
#line 248 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
vSpeed = vSpeed * 30.0f;
|
|
#line 249 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
KickEntity (m_penEnemy , vSpeed );
|
|
#line 250 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
}
|
|
#line 251 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
SetTimerAfter(0.5f);
|
|
Jump(STATE_CURRENT, 0x01510003, FALSE, EBegin());return TRUE;}BOOL CFish::H0x01510003_DiveHit_03(const CEntityEvent &__eeInput) {
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x01510003
|
|
switch(__eeInput.ee_slEvent) {case EVENTCODE_EBegin: return TRUE;case EVENTCODE_ETimer: Jump(STATE_CURRENT,0x01510004, FALSE, EInternal()); return TRUE;default: return FALSE; }}BOOL CFish::H0x01510004_DiveHit_04(const CEntityEvent &__eeInput){
|
|
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x01510004
|
|
;
|
|
#line 253 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
m_bAttackingByElectricity = FALSE ;
|
|
#line 254 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
GetModelObject () -> RemoveAttachmentModel (FISH_ATTACHMENT_GLOW );
|
|
#line 256 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
StandingAnim ();
|
|
#line 257 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
SetTimerAfter(0.2f + FRnd () / 3);
|
|
Jump(STATE_CURRENT, 0x01510005, FALSE, EBegin());return TRUE;}BOOL CFish::H0x01510005_DiveHit_05(const CEntityEvent &__eeInput) {
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x01510005
|
|
switch(__eeInput.ee_slEvent) {case EVENTCODE_EBegin: return TRUE;case EVENTCODE_ETimer: Jump(STATE_CURRENT,0x01510006, FALSE, EInternal()); return TRUE;default: return FALSE; }}BOOL CFish::H0x01510006_DiveHit_06(const CEntityEvent &__eeInput){
|
|
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x01510006
|
|
;
|
|
#line 258 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
Return(STATE_CURRENT,EReturn ());
|
|
#line 258 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
return TRUE; ASSERT(FALSE); return TRUE;};BOOL CFish::
|
|
#line 261 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
Hit(const CEntityEvent &__eeInput) {
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT STATE_CFish_Hit
|
|
ASSERTMSG(__eeInput.ee_slEvent==EVENTCODE_EVoid, "CFish::Hit expects 'EVoid' as input!"); const EVoid &e = (const EVoid &)__eeInput;
|
|
#line 263 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
Jump(STATE_CURRENT, STATE_CFish_DiveHit, TRUE, EVoid());return TRUE; ASSERT(FALSE); return TRUE;};BOOL CFish::
|
|
#line 269 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
Main(const CEntityEvent &__eeInput) {
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT STATE_CFish_Main
|
|
ASSERTMSG(__eeInput.ee_slEvent==EVENTCODE_EVoid, "CFish::Main expects 'EVoid' as input!"); const EVoid &e = (const EVoid &)__eeInput;
|
|
#line 271 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
InitAsModel ();
|
|
#line 273 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
SetPhysicsFlags ((EPF_MODEL_WALKING | EPF_HASGILLS ) & ~ EPF_ONBLOCK_CLIMBORSLIDE | EPF_ONBLOCK_SLIDE );
|
|
#line 274 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
SetCollisionFlags (ECF_MODEL );
|
|
#line 275 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
SetFlags (GetFlags () | ENF_ALIVE );
|
|
#line 276 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
SetHealth (30.0f);
|
|
#line 277 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
m_fMaxHealth = 30.0f;
|
|
#line 278 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
en_tmMaxHoldBreath = 15.0f;
|
|
#line 279 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
en_fDensity = 1000.0f;
|
|
#line 280 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
m_EedtType = EDT_GROUND_DIVE ;
|
|
#line 283 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
SetModel (MODEL_FISH );
|
|
#line 284 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
SetModelMainTexture (TEXTURE_FISH );
|
|
#line 285 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
SetModelSpecularTexture (TEXTURE_SPECULAR );
|
|
#line 287 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
m_fDiveWalkSpeed = 15.0f;
|
|
#line 288 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
m_fDiveAttackRunSpeed = 20.0f;
|
|
#line 289 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
m_fDiveCloseRunSpeed = 25.0f;
|
|
#line 291 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
m_fWalkSpeed = 15.0f;
|
|
#line 292 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
m_aWalkRotateSpeed = 900.0f;
|
|
#line 293 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
m_fAttackRunSpeed = 10.0f;
|
|
#line 294 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
m_fCloseRunSpeed = 12.0f;
|
|
#line 296 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
m_aDiveWalkRotateSpeed = 360.0f;
|
|
#line 297 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
m_aDiveAttackRotateSpeed = 1800.0f;
|
|
#line 298 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
m_aDiveCloseRotateSpeed = 3600.0f;
|
|
#line 300 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
m_fDiveIgnoreRange = 200.0f;
|
|
#line 301 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
m_fDiveAttackDistance = 100.0f;
|
|
#line 302 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
m_fDiveCloseDistance = 15.0f;
|
|
#line 303 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
m_fDiveStopDistance = 2.0f;
|
|
#line 305 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
m_fDiveAttackFireTime = 0.0f;
|
|
#line 306 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
m_fDiveCloseFireTime = 0.0f;
|
|
#line 308 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
m_fBlowUpAmount = 80.0f;
|
|
#line 309 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
m_fBodyParts = 2;
|
|
#line 310 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
m_fDamageWounded = 1.0f;
|
|
#line 311 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
m_iScore = 500;
|
|
#line 313 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
{
|
|
#line 315 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
m_aWalkRotateSpeed = 360.0f;
|
|
#line 316 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
m_aAttackRotateSpeed = 1800.0f;
|
|
#line 317 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
m_aCloseRotateSpeed = 3600.0f;
|
|
#line 319 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
m_fIgnoreRange = 200.0f;
|
|
#line 320 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
m_fAttackDistance = 100.0f;
|
|
#line 321 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
m_fCloseDistance = 15.0f;
|
|
#line 322 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
m_fStopDistance = 2.0f;
|
|
#line 324 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
m_fAttackFireTime = 0.0f;
|
|
#line 325 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
m_fCloseFireTime = 0.0f;
|
|
#line 326 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
}
|
|
#line 328 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
GetModelObject () -> StretchModel (FLOAT3D (1.0f , 1.0f , 1.0f));
|
|
#line 329 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
ModelChangeNotify ();
|
|
#line 331 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
en_fAcceleration = 200.0f;
|
|
#line 332 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
en_fDeceleration = 200.0f;
|
|
#line 335 "D:/SE1_GPL/Sources/EntitiesMP/Fish.es"
|
|
Jump(STATE_CURRENT, STATE_CEnemyDive_MainLoop, FALSE, EVoid());return TRUE; ASSERT(FALSE); return TRUE;}; |