mirror of
https://github.com/ptitSeb/Serious-Engine
synced 2024-11-26 04:05:53 +01:00
497 lines
21 KiB
C++
497 lines
21 KiB
C++
/*
|
|
* This file is generated by Entity Class Compiler, (c) CroTeam 1997-98
|
|
*/
|
|
|
|
#line 4 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
|
|
#include "StdH.h"
|
|
|
|
#include <EntitiesMP/Ship.h>
|
|
#include <EntitiesMP/Ship_tables.h>
|
|
CEntityEvent *EHarbor::MakeCopy(void) { CEntityEvent *peeCopy = new EHarbor(*this); return peeCopy;}
|
|
EHarbor::EHarbor() : CEntityEvent(EVENTCODE_EHarbor) {;
|
|
};
|
|
#line 13 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
|
|
|
|
// adjust angular velocity
|
|
ANGLE AdjustRotationSpeed(ANGLE aDiference, ANGLE aMaxSpeed)
|
|
{
|
|
aDiference = NormalizeAngle(aDiference);
|
|
aDiference = Clamp(aDiference, -aMaxSpeed, +aMaxSpeed);
|
|
return aDiference;
|
|
}
|
|
|
|
|
|
void CShip::SetDefaultProperties(void) {
|
|
m_strName = "Ship";
|
|
m_strDescription = "";
|
|
m_penTarget = NULL;
|
|
m_fSpeed = 10.0f;
|
|
m_fRotation = 30.0f;
|
|
m_fRockingV = 10.0f;
|
|
m_fRockingA = 10.0f;
|
|
m_fAcceleration = 10.0f;
|
|
m_bMoving = TRUE ;
|
|
m_fRockSign = 1.0f;
|
|
m_fLastTargetDistance = UpperLimit(0.0f);
|
|
m_penSail = NULL;
|
|
m_iSailUpAnim = 0;
|
|
m_iSailDownAnim = 0;
|
|
m_iSailSailAnim = 0;
|
|
m_iSailWaveingAnim = 0;
|
|
m_fOriginalRockingV = 0.0f;
|
|
m_fOriginalRockingA = 0.0f;
|
|
m_fNextRockingV = 0.0f;
|
|
m_fNextRockingA = 0.0f;
|
|
m_tmRockingChange = 1;
|
|
m_tmRockingChangeStart = -1;
|
|
CMovableBrushEntity::SetDefaultProperties();
|
|
}
|
|
|
|
#line 60 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
BOOL CShip::MovesByTargetedRoute(CTString & strTargetProperty)const {
|
|
#line 61 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
strTargetProperty = "Target";
|
|
#line 62 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
return TRUE ;
|
|
#line 63 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
}
|
|
|
|
#line 65 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
BOOL CShip::DropsMarker(CTFileName & fnmMarkerClass,CTString & strTargetProperty)const {
|
|
#line 66 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
fnmMarkerClass = CTFILENAME ("Classes\\ShipMarker.ecl");
|
|
#line 67 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
strTargetProperty = "Target";
|
|
#line 68 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
return TRUE ;
|
|
#line 69 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
}
|
|
|
|
#line 70 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
const CTString & CShip::GetDescription(void)const {
|
|
#line 71 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
((CTString &) m_strDescription ) . PrintF ("-><none>");
|
|
#line 72 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
if(m_penTarget != NULL ){
|
|
#line 73 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
((CTString &) m_strDescription ) . PrintF ("->%s" , m_penTarget -> GetName ());
|
|
#line 74 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
}
|
|
#line 75 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
return m_strDescription ;
|
|
#line 76 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
}
|
|
|
|
#line 78 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
CAnimData * CShip::GetAnimData(SLONG slPropertyOffset)
|
|
#line 79 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
{
|
|
#line 80 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
if((slPropertyOffset == offsetof (CShip , m_iSailUpAnim )
|
|
#line 81 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
|| slPropertyOffset == offsetof (CShip , m_iSailDownAnim )
|
|
#line 82 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
|| slPropertyOffset == offsetof (CShip , m_iSailSailAnim )
|
|
#line 83 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
|| slPropertyOffset == offsetof (CShip , m_iSailWaveingAnim ))
|
|
#line 84 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
&& m_penSail != NULL ){
|
|
#line 85 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
return m_penSail -> GetModelObject () -> GetData ();
|
|
#line 86 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
}else {
|
|
#line 87 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
return CEntity :: GetAnimData (slPropertyOffset );
|
|
#line 88 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
}
|
|
#line 89 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
}
|
|
|
|
#line 92 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
void CShip::SetMovingSpeeds(void)
|
|
#line 93 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
{
|
|
#line 95 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
if(! m_bMoving || m_penTarget == NULL ){
|
|
#line 97 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
SetDesiredRotation (ANGLE3D (0 , 0 , GetRockingSpeed ()));
|
|
#line 98 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
return ;
|
|
#line 99 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
}
|
|
#line 101 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
CShipMarker * penTarget = (CShipMarker *) (CEntity *) m_penTarget ;
|
|
#line 102 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
const CPlacement3D & plThis = GetPlacement ();
|
|
#line 105 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
const FLOAT3D & vTarget = penTarget -> GetPlacement () . pl_PositionVector ;
|
|
#line 106 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
const FLOAT3D & vNow = plThis . pl_PositionVector ;
|
|
#line 107 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
FLOAT3D vDirection = vTarget - vNow ;
|
|
#line 108 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
FLOAT fTargetDistance = vDirection . Length ();
|
|
#line 110 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
if(fTargetDistance < m_fSpeed * 5 * _pTimer -> TickQuantum ){
|
|
#line 112 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
NextMarker ();
|
|
#line 113 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
return ;
|
|
#line 114 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
}
|
|
#line 116 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
vDirection /= fTargetDistance ;
|
|
#line 117 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
ANGLE3D aAngle ;
|
|
#line 118 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
DirectionVectorToAngles (vDirection , aAngle );
|
|
#line 119 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
aAngle -= plThis . pl_OrientationAngle ;
|
|
#line 120 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
aAngle (1) = AdjustRotationSpeed (aAngle (1) , m_fRotation );
|
|
#line 121 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
aAngle (2) = 0;
|
|
#line 122 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
aAngle (3) = GetRockingSpeed ();
|
|
#line 124 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
SetDesiredRotation (aAngle );
|
|
#line 127 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
SetDesiredTranslation (FLOAT3D (0 , 0 , - m_fSpeed ));
|
|
#line 129 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
en_fAcceleration = m_fAcceleration ;
|
|
#line 130 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
en_fDeceleration = m_fAcceleration ;
|
|
#line 131 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
}
|
|
|
|
#line 134 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
ANGLE CShip::GetRockingSpeed(void)
|
|
#line 135 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
{
|
|
#line 137 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
TIME tmSinceChangeStarted = _pTimer -> CurrentTick () - m_tmRockingChangeStart ;
|
|
#line 138 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
if(tmSinceChangeStarted < m_tmRockingChange ){
|
|
#line 140 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
FLOAT fFactor = tmSinceChangeStarted / m_tmRockingChange ;
|
|
#line 141 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
m_fRockingV = Lerp (m_fOriginalRockingV , m_fNextRockingV , fFactor );
|
|
#line 142 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
m_fRockingA = Lerp (m_fOriginalRockingA , m_fNextRockingA , fFactor );
|
|
#line 143 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
}
|
|
#line 145 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
if(m_fRockingV == 0){
|
|
#line 146 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
return 0;
|
|
#line 147 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
}
|
|
#line 149 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
ANGLE aAngle = GetPlacement () . pl_OrientationAngle (3);
|
|
#line 150 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
ANGLE aRotation = Sqrt (m_fRockingA * m_fRockingA - aAngle * aAngle ) * m_fRockingV ;
|
|
#line 151 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
if(aRotation < 2 && aAngle * m_fRockSign > 0){
|
|
#line 152 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
m_fRockSign = - m_fRockSign ;
|
|
#line 153 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
};
|
|
#line 155 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
if(aRotation < 2){
|
|
#line 156 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
aRotation = 2;
|
|
#line 157 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
}
|
|
#line 158 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
aRotation *= m_fRockSign ;
|
|
#line 160 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
return aRotation ;
|
|
#line 161 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
}
|
|
|
|
#line 164 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
void CShip::NextMarker(void)
|
|
#line 165 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
{
|
|
#line 167 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
CShipMarker * penTarget = (CShipMarker *) (CEntity *) m_penTarget ;
|
|
#line 168 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
CShipMarker * penNextTarget = (CShipMarker *) (CEntity *) penTarget -> m_penTarget ;
|
|
#line 171 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
if(penTarget -> m_bHarbor ){
|
|
#line 173 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
StopSailing ();
|
|
#line 175 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
SendEvent (EHarbor ());
|
|
#line 176 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
}
|
|
#line 179 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
if(penNextTarget == NULL ){
|
|
#line 181 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
StopSailing ();
|
|
#line 182 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
return ;
|
|
#line 183 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
}
|
|
#line 186 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
FLOAT fSpeed = penTarget -> m_fSpeed ;
|
|
#line 187 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
if(fSpeed >= 0){
|
|
#line 188 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
m_fSpeed = fSpeed ;
|
|
#line 189 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
}
|
|
#line 190 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
FLOAT fRotation = penTarget -> m_fRotation ;
|
|
#line 191 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
if(fRotation >= 0){
|
|
#line 192 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
m_fRotation = fRotation ;
|
|
#line 193 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
}
|
|
#line 194 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
FLOAT fAcceleration = penTarget -> m_fAcceleration ;
|
|
#line 195 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
if(fAcceleration >= 0){
|
|
#line 196 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
m_fAcceleration = fAcceleration ;
|
|
#line 197 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
}
|
|
#line 199 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
m_fOriginalRockingV = m_fRockingV ;
|
|
#line 200 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
m_fOriginalRockingA = m_fRockingA ;
|
|
#line 202 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
FLOAT fRockingV = penTarget -> m_fRockingV ;
|
|
#line 203 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
if(fRockingV >= 0){
|
|
#line 204 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
m_fNextRockingV = fRockingV ;
|
|
#line 205 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
}else {
|
|
#line 206 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
m_fNextRockingV = m_fRockingV ;
|
|
#line 207 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
}
|
|
#line 208 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
FLOAT fRockingA = penTarget -> m_fRockingA ;
|
|
#line 209 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
if(fRockingA >= 0){
|
|
#line 210 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
m_fNextRockingA = fRockingA ;
|
|
#line 211 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
}else {
|
|
#line 212 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
m_fNextRockingA = m_fRockingA ;
|
|
#line 213 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
}
|
|
#line 214 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
m_tmRockingChange = penTarget -> m_tmRockingChange ;
|
|
#line 215 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
m_tmRockingChangeStart = _pTimer -> CurrentTick ();
|
|
#line 218 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
m_penTarget = penNextTarget ;
|
|
#line 219 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
SetMovingSpeeds ();
|
|
#line 220 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
}
|
|
|
|
#line 222 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
void CShip::StartSailing()
|
|
#line 223 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
{
|
|
#line 224 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
m_bMoving = TRUE ;
|
|
#line 226 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
SetMovingSpeeds ();
|
|
#line 227 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
}
|
|
|
|
#line 229 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
void CShip::StopSailing(void)
|
|
#line 230 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
{
|
|
#line 231 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
m_bMoving = FALSE ;
|
|
#line 232 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
SetDesiredRotation (ANGLE3D (0 , 0 , GetDesiredRotation () (3)));
|
|
#line 233 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
SetDesiredTranslation (FLOAT3D (0 , 0 , 0));
|
|
#line 234 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
}
|
|
|
|
#line 237 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
void CShip::PreMoving(void) {
|
|
#line 239 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
SetMovingSpeeds ();
|
|
#line 240 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
CMovableBrushEntity :: PreMoving ();
|
|
#line 241 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
}
|
|
BOOL CShip::
|
|
#line 244 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
Sail(const CEntityEvent &__eeInput) {
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT STATE_CShip_Sail
|
|
ASSERTMSG(__eeInput.ee_slEvent==EVENTCODE_EVoid, "CShip::Sail expects 'EVoid' as input!"); const EVoid &e = (const EVoid &)__eeInput;
|
|
#line 246 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
m_penSail -> GetModelObject () -> PlayAnim (m_iSailDownAnim , 0);
|
|
#line 247 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
SetTimerAfter(m_penSail -> GetModelObject () -> GetAnimLength (m_iSailDownAnim ));
|
|
Jump(STATE_CURRENT, 0x00670002, FALSE, EBegin());return TRUE;}BOOL CShip::H0x00670002_Sail_01(const CEntityEvent &__eeInput) {
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x00670002
|
|
switch(__eeInput.ee_slEvent) {case EVENTCODE_EBegin: return TRUE;case EVENTCODE_ETimer: Jump(STATE_CURRENT,0x00670003, FALSE, EInternal()); return TRUE;default: return FALSE; }}BOOL CShip::H0x00670003_Sail_02(const CEntityEvent &__eeInput){
|
|
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x00670003
|
|
;
|
|
#line 249 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
m_penSail -> GetModelObject () -> PlayAnim (m_iSailWaveingAnim , AOF_LOOPING );
|
|
#line 252 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
SetTimerAt(THINKTIME_NEVER);
|
|
Jump(STATE_CURRENT, 0x00670004, FALSE, EBegin());return TRUE;}BOOL CShip::H0x00670004_Sail_03(const CEntityEvent &__eeInput) {
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x00670004
|
|
switch(__eeInput.ee_slEvent){case(EVENTCODE_EBegin):{const EBegin&e= (EBegin&)__eeInput;
|
|
return TRUE;}ASSERT(FALSE);break;case(EVENTCODE_ETouch):{const ETouch&eTouch= (ETouch&)__eeInput;
|
|
|
|
#line 255 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
if(IsDerivedFromClass (eTouch . penOther , "PlayerEntity")){
|
|
#line 256 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
UnsetTimer();Jump(STATE_CURRENT,0x00670005, FALSE, EInternal());return TRUE;
|
|
#line 257 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
}
|
|
#line 258 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
}ASSERT(FALSE);break;case(EVENTCODE_EStart):{const EStart&e= (EStart&)__eeInput;
|
|
|
|
#line 260 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
UnsetTimer();Jump(STATE_CURRENT,0x00670005, FALSE, EInternal());return TRUE;
|
|
#line 261 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
}ASSERT(FALSE);break;default: return FALSE; break;
|
|
#line 262 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
}return TRUE;}BOOL CShip::H0x00670005_Sail_04(const CEntityEvent &__eeInput){
|
|
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x00670005
|
|
|
|
#line 265 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
m_penSail -> GetModelObject () -> PlayAnim (m_iSailSailAnim , 0);
|
|
#line 268 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
StartSailing ();
|
|
#line 270 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
SetTimerAt(THINKTIME_NEVER);
|
|
Jump(STATE_CURRENT, 0x00670006, FALSE, EBegin());return TRUE;}BOOL CShip::H0x00670006_Sail_05(const CEntityEvent &__eeInput) {
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x00670006
|
|
switch(__eeInput.ee_slEvent){case(EVENTCODE_EBegin):{const EBegin&e= (EBegin&)__eeInput;
|
|
return TRUE;}ASSERT(FALSE);break;case(EVENTCODE_EHarbor):{const EHarbor&e= (EHarbor&)__eeInput;
|
|
UnsetTimer();Jump(STATE_CURRENT,0x00670007, FALSE, EInternal());return TRUE;}ASSERT(FALSE);break;default: return FALSE; break;
|
|
#line 273 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
}return TRUE;}BOOL CShip::H0x00670007_Sail_06(const CEntityEvent &__eeInput){
|
|
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x00670007
|
|
|
|
#line 276 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
Jump(STATE_CURRENT, STATE_CShip_Harbor, TRUE, EVoid());return TRUE; ASSERT(FALSE); return TRUE;};BOOL CShip::
|
|
#line 278 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
Harbor(const CEntityEvent &__eeInput) {
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT STATE_CShip_Harbor
|
|
ASSERTMSG(__eeInput.ee_slEvent==EVENTCODE_EVoid, "CShip::Harbor expects 'EVoid' as input!"); const EVoid &e = (const EVoid &)__eeInput;
|
|
#line 280 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
m_penSail -> GetModelObject () -> PlayAnim (m_iSailUpAnim , 0);
|
|
#line 283 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
SetTimerAt(THINKTIME_NEVER);
|
|
Jump(STATE_CURRENT, 0x00670009, FALSE, EBegin());return TRUE;}BOOL CShip::H0x00670009_Harbor_01(const CEntityEvent &__eeInput) {
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x00670009
|
|
switch(__eeInput.ee_slEvent){case(EVENTCODE_EBegin):{const EBegin&e= (EBegin&)__eeInput;
|
|
return TRUE;}ASSERT(FALSE);break;case(EVENTCODE_ETrigger):{const ETrigger&e= (ETrigger&)__eeInput;
|
|
UnsetTimer();Jump(STATE_CURRENT,0x0067000a, FALSE, EInternal());return TRUE;}ASSERT(FALSE);break;default: return FALSE; break;
|
|
#line 286 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
}return TRUE;}BOOL CShip::H0x0067000a_Harbor_02(const CEntityEvent &__eeInput){
|
|
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x0067000a
|
|
|
|
#line 288 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
Jump(STATE_CURRENT, STATE_CShip_Sail, TRUE, EVoid());return TRUE; ASSERT(FALSE); return TRUE;};BOOL CShip::
|
|
#line 292 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
Main(const CEntityEvent &__eeInput) {
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT STATE_CShip_Main
|
|
ASSERTMSG(__eeInput.ee_slEvent==EVENTCODE_EVoid, "CShip::Main expects 'EVoid' as input!"); const EVoid &e = (const EVoid &)__eeInput;
|
|
#line 294 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
InitAsBrush ();
|
|
#line 295 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
SetPhysicsFlags (EPF_BRUSH_MOVING & ~ (EPF_ABSOLUTETRANSLATE | EPF_NOACCELERATION ));
|
|
#line 296 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
SetCollisionFlags (ECF_BRUSH );
|
|
#line 299 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
ForceFullStop ();
|
|
#line 302 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
if(m_penTarget != NULL && ! IsOfClass (m_penTarget , "Ship Marker")){
|
|
#line 303 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
WarningMessage ("Target '%s' is not of ShipMarker class!" , m_penTarget -> GetName ());
|
|
#line 304 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
m_penTarget = NULL ;
|
|
#line 305 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
}
|
|
#line 307 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
if(m_penSail != NULL && m_penSail -> GetRenderType () != RT_MODEL ){
|
|
#line 308 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
WarningMessage ("Sail '%s' is not a model!" , m_penSail -> GetName ());
|
|
#line 309 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
m_penSail = NULL ;
|
|
#line 310 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
}
|
|
#line 313 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
SetTimerAfter(0.1f);
|
|
Jump(STATE_CURRENT, 0x0067000b, FALSE, EBegin());return TRUE;}BOOL CShip::H0x0067000b_Main_01(const CEntityEvent &__eeInput) {
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x0067000b
|
|
switch(__eeInput.ee_slEvent) {case EVENTCODE_EBegin: return TRUE;case EVENTCODE_ETimer: Jump(STATE_CURRENT,0x0067000c, FALSE, EInternal()); return TRUE;default: return FALSE; }}BOOL CShip::H0x0067000c_Main_02(const CEntityEvent &__eeInput){
|
|
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x0067000c
|
|
;
|
|
#line 316 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
if(m_penSail == NULL ){
|
|
#line 318 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
WarningMessage ("Ship will not work without a valid sail!");
|
|
#line 319 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
Return(STATE_CURRENT,EVoid());
|
|
#line 319 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
return TRUE;
|
|
#line 320 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
}
|
|
#line 323 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
SetTimerAt(THINKTIME_NEVER);
|
|
Jump(STATE_CURRENT, 0x0067000d, FALSE, EBegin());return TRUE;}BOOL CShip::H0x0067000d_Main_03(const CEntityEvent &__eeInput) {
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x0067000d
|
|
switch(__eeInput.ee_slEvent){case(EVENTCODE_EBegin):{const EBegin&e= (EBegin&)__eeInput;
|
|
|
|
#line 327 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
Call(STATE_CURRENT, STATE_CShip_Sail, TRUE, EVoid());return TRUE;
|
|
#line 328 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
}ASSERT(FALSE);break;case(EVENTCODE_EBlock):{const EBlock&eBlock= (EBlock&)__eeInput;
|
|
|
|
#line 333 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
InflictDirectDamage (eBlock . penOther , this , DMT_BRUSH , 10.0f ,
|
|
#line 334 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
FLOAT3D (0.0f , 0.0f , 0.0f) , (FLOAT3D &) eBlock . plCollision );
|
|
#line 335 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
return TRUE;
|
|
#line 336 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
}ASSERT(FALSE);break;default: return FALSE; break;
|
|
#line 337 "D:/SE1_GPL/Sources/EntitiesMP/Ship.es"
|
|
}return TRUE;}BOOL CShip::H0x0067000e_Main_04(const CEntityEvent &__eeInput){
|
|
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x0067000e
|
|
ASSERT(FALSE); return TRUE;}; |