mirror of
https://github.com/ptitSeb/Serious-Engine
synced 2024-11-26 04:05:53 +01:00
207 lines
8.7 KiB
C++
207 lines
8.7 KiB
C++
/*
|
|
* This file is generated by Entity Class Compiler, (c) CroTeam 1997-98
|
|
*/
|
|
|
|
#line 4 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
|
|
#include "StdH.h"
|
|
|
|
#include <EntitiesMP/Counter.h>
|
|
#include <EntitiesMP/Counter_tables.h>
|
|
void CCounter::SetDefaultProperties(void) {
|
|
m_fCountdownSpeed = 12.0f;
|
|
m_penTarget = NULL;
|
|
m_fNumber = 0.0f;
|
|
m_tmStart = -1.0f;
|
|
m_strName = "";
|
|
m_soSound.SetOwner(this);
|
|
m_soSound.Stop_internal();
|
|
m_iCountFrom = 1023;
|
|
m_pen0 = NULL;
|
|
m_pen1 = NULL;
|
|
m_pen2 = NULL;
|
|
m_pen3 = NULL;
|
|
m_pen4 = NULL;
|
|
m_pen5 = NULL;
|
|
m_pen6 = NULL;
|
|
m_pen7 = NULL;
|
|
m_pen8 = NULL;
|
|
m_pen9 = NULL;
|
|
CRationalEntity::SetDefaultProperties();
|
|
}
|
|
|
|
#line 40 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
void CCounter::Precache(void)
|
|
#line 41 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
{
|
|
#line 42 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
PrecacheSound (SOUND_TICK );
|
|
#line 43 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
CRationalEntity :: Precache ();
|
|
#line 44 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
}
|
|
|
|
#line 46 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
void CCounter::DisplayNumber(void)
|
|
#line 47 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
{
|
|
#line 48 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
for(INDEX iDigit = 0;iDigit < 10;iDigit ++)
|
|
#line 49 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
{
|
|
#line 50 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
CModelHolder2 * pmh = (CModelHolder2 *) & * (& m_pen0 ) [ iDigit ];
|
|
#line 51 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
if(pmh != NULL && pmh -> GetModelObject () != NULL &&
|
|
#line 52 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
pmh -> GetModelObject () -> mo_toTexture . GetData () != NULL )
|
|
#line 53 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
{
|
|
#line 55 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
INDEX iOldAnim = pmh -> GetModelObject () -> mo_toTexture . GetAnim ();
|
|
#line 56 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
INDEX iAnim = (INDEX (m_fNumber ) & (1 << iDigit )) >> iDigit ;
|
|
#line 57 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
pmh -> GetModelObject () -> mo_toTexture . PlayAnim (iAnim , 0);
|
|
#line 60 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
m_soSound . Set3DParameters (200.0f , 100.0f , 1.0f ,
|
|
#line 61 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
Clamp (1.0f + (m_iCountFrom - m_fNumber ) / m_iCountFrom * 2.0f , 1.0f , 3.0f));
|
|
#line 62 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
if(iDigit == 0 && iOldAnim != iAnim && ! m_soSound . IsPlaying ())
|
|
#line 63 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
{
|
|
#line 64 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
PlaySound (m_soSound , SOUND_TICK , SOF_3D | SOF_VOLUMETRIC );
|
|
#line 65 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
}
|
|
#line 66 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
}
|
|
#line 67 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
}
|
|
#line 68 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
}
|
|
BOOL CCounter::
|
|
#line 71 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
CountDown(const CEntityEvent &__eeInput) {
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT STATE_CCounter_CountDown
|
|
ASSERTMSG(__eeInput.ee_slEvent==EVENTCODE_EVoid, "CCounter::CountDown expects 'EVoid' as input!"); const EVoid &e = (const EVoid &)__eeInput;
|
|
#line 73 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
Jump(STATE_CURRENT,0x00e80003, FALSE, EInternal());return TRUE;}BOOL CCounter::H0x00e80003_CountDown_03(const CEntityEvent &__eeInput)
|
|
#line 74 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
{
|
|
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x00e80003
|
|
if(!(TRUE )){ Jump(STATE_CURRENT,0x00e80004, FALSE, EInternal());return TRUE;}
|
|
#line 75 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
SetTimerAfter(_pTimer -> TickQuantum );
|
|
Jump(STATE_CURRENT, 0x00e80001, FALSE, EBegin());return TRUE;}BOOL CCounter::H0x00e80001_CountDown_01(const CEntityEvent &__eeInput) {
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x00e80001
|
|
switch(__eeInput.ee_slEvent) {case EVENTCODE_EBegin: return TRUE;case EVENTCODE_ETimer: Jump(STATE_CURRENT,0x00e80002, FALSE, EInternal()); return TRUE;default: return FALSE; }}BOOL CCounter::H0x00e80002_CountDown_02(const CEntityEvent &__eeInput){
|
|
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x00e80002
|
|
;
|
|
#line 76 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
FLOAT tmNow = _pTimer -> CurrentTick ();
|
|
#line 77 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
FLOAT tmDelta = tmNow - m_tmStart ;
|
|
#line 78 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
FLOAT fSub = Clamp (tmDelta / m_fCountdownSpeed , 0.01f , 1.0f);
|
|
#line 79 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
m_fNumber = Clamp (m_fNumber - fSub , 0.0f , FLOAT (m_iCountFrom ));
|
|
#line 80 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
DisplayNumber ();
|
|
#line 81 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
if(m_fNumber == 0)
|
|
#line 82 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
{
|
|
#line 83 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
Return(STATE_CURRENT,EReturn ());
|
|
#line 83 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
return TRUE;
|
|
#line 84 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
}Jump(STATE_CURRENT,0x00e80003, FALSE, EInternal());return TRUE;
|
|
#line 85 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
}BOOL CCounter::H0x00e80004_CountDown_04(const CEntityEvent &__eeInput) {
|
|
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x00e80004
|
|
ASSERT(FALSE); return TRUE;};BOOL CCounter::
|
|
#line 91 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
Main(const CEntityEvent &__eeInput) {
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT STATE_CCounter_Main
|
|
ASSERTMSG(__eeInput.ee_slEvent==EVENTCODE_EVoid, "CCounter::Main expects 'EVoid' as input!"); const EVoid &e = (const EVoid &)__eeInput;
|
|
#line 93 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
InitAsEditorModel ();
|
|
#line 94 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
SetPhysicsFlags (EPF_MODEL_IMMATERIAL );
|
|
#line 95 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
SetCollisionFlags (ECF_IMMATERIAL );
|
|
#line 98 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
SetModel (MODEL_MARKER );
|
|
#line 99 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
SetModelMainTexture (TEXTURE_MARKER );
|
|
#line 101 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
SetTimerAfter(0.1f);
|
|
Jump(STATE_CURRENT, 0x00e80005, FALSE, EBegin());return TRUE;}BOOL CCounter::H0x00e80005_Main_01(const CEntityEvent &__eeInput) {
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x00e80005
|
|
switch(__eeInput.ee_slEvent) {case EVENTCODE_EBegin: return TRUE;case EVENTCODE_ETimer: Jump(STATE_CURRENT,0x00e80006, FALSE, EInternal()); return TRUE;default: return FALSE; }}BOOL CCounter::H0x00e80006_Main_02(const CEntityEvent &__eeInput){
|
|
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x00e80006
|
|
;
|
|
#line 102 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
m_fNumber = m_iCountFrom ;
|
|
#line 103 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
DisplayNumber ();
|
|
#line 105 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
SetTimerAt(THINKTIME_NEVER);
|
|
Jump(STATE_CURRENT, 0x00e80007, FALSE, EBegin());return TRUE;}BOOL CCounter::H0x00e80007_Main_03(const CEntityEvent &__eeInput) {
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x00e80007
|
|
switch(__eeInput.ee_slEvent){case(EVENTCODE_EBegin):{const EBegin&e= (EBegin&)__eeInput;
|
|
|
|
#line 107 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
return TRUE;
|
|
#line 108 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
}ASSERT(FALSE);break;case(EVENTCODE_ETrigger):{const ETrigger&eTrigger= (ETrigger&)__eeInput;
|
|
|
|
#line 110 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
m_fNumber = m_iCountFrom ;
|
|
#line 111 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
DisplayNumber ();
|
|
#line 112 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
m_tmStart = _pTimer -> CurrentTick ();
|
|
#line 113 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
Call(STATE_CURRENT, STATE_CCounter_CountDown, TRUE, EVoid());return TRUE;
|
|
#line 114 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
}ASSERT(FALSE);break;case(EVENTCODE_EReturn):{const EReturn&e= (EReturn&)__eeInput;
|
|
|
|
#line 116 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
if(m_penTarget != NULL )
|
|
#line 117 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
{
|
|
#line 118 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
SendToTarget (m_penTarget , EET_TRIGGER );
|
|
#line 119 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
}
|
|
#line 120 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
UnsetTimer();Jump(STATE_CURRENT,0x00e80008, FALSE, EInternal());return TRUE;
|
|
#line 121 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
}ASSERT(FALSE);break;default: return FALSE; break;
|
|
#line 122 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
}return TRUE;}BOOL CCounter::H0x00e80008_Main_04(const CEntityEvent &__eeInput){
|
|
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x00e80008
|
|
|
|
#line 124 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
Return(STATE_CURRENT,EVoid());
|
|
#line 124 "D:/SE1_GPL/Sources/EntitiesMP/Counter.es"
|
|
return TRUE; ASSERT(FALSE); return TRUE;}; |