Serious-Engine/Sources/EntitiesMP/TouchField.cpp

246 lines
11 KiB
C++
Raw Normal View History

2016-03-11 14:57:17 +01:00
/*
* This file is generated by Entity Class Compiler, (c) CroTeam 1997-98
*/
#line 4 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
#include "StdH.h"
#include "EntitiesMP/Projectile.h"
#include <EntitiesMP/TouchField.h>
#include <EntitiesMP/TouchField_tables.h>
#line 9 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
BOOL ConsiderAll(CEntity*pen)
{
return TRUE;
}
BOOL ConsiderPlayers(CEntity*pen)
{
return IsDerivedFromClass(pen, "Player");
}
void CTouchField::SetDefaultProperties(void) {
m_strName = "Touch Field";
m_penEnter = NULL;
m_eetEnter = EET_TRIGGER ;
m_penExit = NULL;
m_eetExit = EET_TRIGGER ;
m_bActive = TRUE ;
m_bPlayersOnly = TRUE ;
m_tmExitCheck = 0.0f;
m_bBlockNonPlayers = FALSE ;
m_penLastIn = NULL;
CRationalEntity::SetDefaultProperties();
}
#line 51 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
void CTouchField::SetupFieldSettings(void)
#line 52 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
{
#line 53 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
m_fsField . fs_toTexture . SetData (GetTextureDataForComponent (TEXTURE_FIELD ));
#line 54 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
m_fsField . fs_colColor = C_WHITE | CT_OPAQUE ;
#line 55 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
}
#line 57 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
CFieldSettings * CTouchField::GetFieldSettings(void) {
#line 58 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
if(m_fsField . fs_toTexture . GetData () == NULL ){
#line 59 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
SetupFieldSettings ();
#line 60 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
}
#line 61 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
return & m_fsField ;
#line 62 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
}
#line 66 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
SLONG CTouchField::GetUsedMemory(void)
#line 67 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
{
#line 69 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
SLONG slUsedMemory = sizeof (CTouchField ) - sizeof (CRationalEntity ) + CRationalEntity :: GetUsedMemory ();
#line 71 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
slUsedMemory += m_strName . Length ();
#line 72 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
return slUsedMemory ;
#line 73 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
}
BOOL CTouchField::
#line 79 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
WaitingEntry(const CEntityEvent &__eeInput) {
#undef STATE_CURRENT
#define STATE_CURRENT STATE_CTouchField_WaitingEntry
ASSERTMSG(__eeInput.ee_slEvent==EVENTCODE_EVoid, "CTouchField::WaitingEntry expects 'EVoid' as input!"); const EVoid &e = (const EVoid &)__eeInput;
#line 80 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
m_bActive = TRUE ;
#line 81 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
SetTimerAt(THINKTIME_NEVER);
Jump(STATE_CURRENT, 0x00ce0001, FALSE, EBegin());return TRUE;}BOOL CTouchField::H0x00ce0001_WaitingEntry_01(const CEntityEvent &__eeInput) {
#undef STATE_CURRENT
#define STATE_CURRENT 0x00ce0001
switch(__eeInput.ee_slEvent){case(EVENTCODE_EBegin):{const EBegin&e= (EBegin&)__eeInput;
return TRUE;}ASSERT(FALSE);break;case(EVENTCODE_EDeactivate):{const EDeactivate&e= (EDeactivate&)__eeInput;
Jump(STATE_CURRENT, STATE_CTouchField_Frozen, TRUE, EVoid());return TRUE;}ASSERT(FALSE);break;case(EVENTCODE_EPass):{const EPass&ep= (EPass&)__eeInput;
#line 88 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
if(m_bBlockNonPlayers && IsOfClass (ep . penOther , "Projectile"))
#line 89 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
{
#line 90 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
if(! IsOfClass (((CProjectile *) & * ep . penOther ) -> m_penLauncher , "Player")){
#line 91 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
EPass epass ;
#line 92 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
epass . penOther = this ;
#line 93 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
ep . penOther -> SendEvent (epass );
#line 94 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
}
#line 95 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
}
#line 98 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
if(m_bPlayersOnly && ! IsDerivedFromClass (ep . penOther , "Player")){
#line 100 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
return TRUE;
#line 101 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
}
#line 104 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
SendToTarget (m_penEnter , m_eetEnter , ep . penOther );
#line 106 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
if(m_tmExitCheck > 0){
#line 108 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
m_penLastIn = ep . penOther ;
#line 110 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
Jump(STATE_CURRENT, STATE_CTouchField_WaitingExit, TRUE, EVoid());return TRUE;
#line 111 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
}
#line 112 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
return TRUE;
#line 113 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
}ASSERT(FALSE);break;default: return FALSE; break;
#line 114 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
}return TRUE;}BOOL CTouchField::H0x00ce0002_WaitingEntry_02(const CEntityEvent &__eeInput){
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
#undef STATE_CURRENT
#define STATE_CURRENT 0x00ce0002
ASSERT(FALSE); return TRUE;};BOOL CTouchField::
#line 118 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
WaitingExit(const CEntityEvent &__eeInput) {
#undef STATE_CURRENT
#define STATE_CURRENT STATE_CTouchField_WaitingExit
ASSERTMSG(__eeInput.ee_slEvent==EVENTCODE_EVoid, "CTouchField::WaitingExit expects 'EVoid' as input!"); const EVoid &e = (const EVoid &)__eeInput;
#line 119 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
Jump(STATE_CURRENT,0x00ce0006, FALSE, EInternal());return TRUE;}BOOL CTouchField::H0x00ce0006_WaitingExit_03(const CEntityEvent &__eeInput){
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
#undef STATE_CURRENT
#define STATE_CURRENT 0x00ce0006
if(!(TRUE )){ Jump(STATE_CURRENT,0x00ce0007, FALSE, EInternal());return TRUE;}
#line 121 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
SetTimerAfter(m_tmExitCheck );
Jump(STATE_CURRENT, 0x00ce0004, FALSE, EBegin());return TRUE;}BOOL CTouchField::H0x00ce0004_WaitingExit_01(const CEntityEvent &__eeInput) {
#undef STATE_CURRENT
#define STATE_CURRENT 0x00ce0004
switch(__eeInput.ee_slEvent){case(EVENTCODE_EBegin):{const EBegin&e= (EBegin&)__eeInput;
return TRUE;}ASSERT(FALSE);break;case(EVENTCODE_EDeactivate):{const EDeactivate&e= (EDeactivate&)__eeInput;
Jump(STATE_CURRENT, STATE_CTouchField_Frozen, TRUE, EVoid());return TRUE;}ASSERT(FALSE);break;case(EVENTCODE_ETimer):{const ETimer&e= (ETimer&)__eeInput;
#line 126 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
CEntity * penNewIn ;
#line 127 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
if(m_bPlayersOnly ){
#line 128 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
penNewIn = TouchingEntity (ConsiderPlayers , m_penLastIn );
#line 129 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
}else {
#line 130 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
penNewIn = TouchingEntity (ConsiderAll , m_penLastIn );
#line 131 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
}
#line 133 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
if(penNewIn == NULL ){
#line 135 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
SendToTarget (m_penExit , m_eetExit , m_penLastIn );
#line 137 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
Jump(STATE_CURRENT, STATE_CTouchField_WaitingEntry, TRUE, EVoid());return TRUE;
#line 138 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
}
#line 139 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
m_penLastIn = penNewIn ;
#line 140 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
UnsetTimer();Jump(STATE_CURRENT,0x00ce0005, FALSE, EInternal());return TRUE;
#line 141 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
}ASSERT(FALSE);break;default: return FALSE; break;
#line 142 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
}return TRUE;}BOOL CTouchField::H0x00ce0005_WaitingExit_02(const CEntityEvent &__eeInput){
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
#undef STATE_CURRENT
#define STATE_CURRENT 0x00ce0005
Jump(STATE_CURRENT,0x00ce0006, FALSE, EInternal());return TRUE;
#line 143 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
}BOOL CTouchField::H0x00ce0007_WaitingExit_04(const CEntityEvent &__eeInput) {
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
#undef STATE_CURRENT
#define STATE_CURRENT 0x00ce0007
ASSERT(FALSE); return TRUE;};BOOL CTouchField::
#line 147 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
Frozen(const CEntityEvent &__eeInput) {
#undef STATE_CURRENT
#define STATE_CURRENT STATE_CTouchField_Frozen
ASSERTMSG(__eeInput.ee_slEvent==EVENTCODE_EVoid, "CTouchField::Frozen expects 'EVoid' as input!"); const EVoid &e = (const EVoid &)__eeInput;
#line 148 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
m_bActive = FALSE ;
#line 149 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
SetTimerAt(THINKTIME_NEVER);
Jump(STATE_CURRENT, 0x00ce0009, FALSE, EBegin());return TRUE;}BOOL CTouchField::H0x00ce0009_Frozen_01(const CEntityEvent &__eeInput) {
#undef STATE_CURRENT
#define STATE_CURRENT 0x00ce0009
switch(__eeInput.ee_slEvent){case(EVENTCODE_EBegin):{const EBegin&e= (EBegin&)__eeInput;
return TRUE;}ASSERT(FALSE);break;case(EVENTCODE_EActivate):{const EActivate&e= (EActivate&)__eeInput;
Jump(STATE_CURRENT, STATE_CTouchField_WaitingEntry, TRUE, EVoid());return TRUE;}ASSERT(FALSE);break;default: return FALSE; break;
#line 152 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
}return TRUE;}BOOL CTouchField::H0x00ce000a_Frozen_02(const CEntityEvent &__eeInput){
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
#undef STATE_CURRENT
#define STATE_CURRENT 0x00ce000a
ASSERT(FALSE); return TRUE;};BOOL CTouchField::
#line 156 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
Main(const CEntityEvent &__eeInput) {
#undef STATE_CURRENT
#define STATE_CURRENT STATE_CTouchField_Main
ASSERTMSG(__eeInput.ee_slEvent==EVENTCODE_EVoid, "CTouchField::Main expects 'EVoid' as input!"); const EVoid &e = (const EVoid &)__eeInput;
#line 157 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
InitAsFieldBrush ();
#line 158 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
SetPhysicsFlags (EPF_BRUSH_FIXED );
#line 159 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
if(! m_bBlockNonPlayers ){
#line 160 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
SetCollisionFlags (((ECBI_MODEL ) << ECB_TEST ) | ((ECBI_BRUSH ) << ECB_IS ) | ((ECBI_MODEL ) << ECB_PASS ));
#line 161 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
}else {
#line 162 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
SetCollisionFlags (((ECBI_MODEL | ECBI_PLAYER | ECBI_PROJECTILE_SOLID | ECBI_PROJECTILE_MAGIC ) << ECB_TEST )
#line 163 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
| ((ECBI_BRUSH ) << ECB_IS ) | ((ECBI_PLAYER | ECBI_PROJECTILE_SOLID | ECBI_PROJECTILE_MAGIC ) << ECB_PASS ));
#line 164 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
}
#line 166 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
if(m_bActive ){
#line 167 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
Jump(STATE_CURRENT, STATE_CTouchField_WaitingEntry, TRUE, EVoid());return TRUE;
#line 168 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
}else {
#line 169 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
Jump(STATE_CURRENT, STATE_CTouchField_Frozen, TRUE, EVoid());return TRUE;
#line 170 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
}
#line 172 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
Return(STATE_CURRENT,EVoid());
#line 172 "D:/SE1_GPL/Sources/EntitiesMP/TouchField.es"
return TRUE; ASSERT(FALSE); return TRUE;};