mirror of
https://github.com/halpz/re3.git
synced 2025-06-30 09:36:21 +00:00
implemented CHeli
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@ -2,15 +2,98 @@
|
||||
|
||||
#include "Vehicle.h"
|
||||
|
||||
class CObject;
|
||||
|
||||
enum eHeliNodes
|
||||
{
|
||||
HELI_CHASSIS = 1,
|
||||
HELI_TOPROTOR,
|
||||
HELI_BACKROTOR,
|
||||
HELI_TAIL,
|
||||
HELI_TOPKNOT,
|
||||
HELI_SKID_LEFT,
|
||||
HELI_SKID_RIGHT,
|
||||
NUM_HELI_NODES
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
HELI_RANDOM0,
|
||||
HELI_RANDOM1,
|
||||
HELI_SCRIPT,
|
||||
HELI_CATALINA,
|
||||
NUM_HELIS
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
HELI_TYPE_RANDOM,
|
||||
HELI_TYPE_SCRIPT,
|
||||
HELI_TYPE_CATALINA,
|
||||
};
|
||||
|
||||
|
||||
class CHeli : public CVehicle
|
||||
{
|
||||
public:
|
||||
// 0x288
|
||||
uint8 stuff[180];
|
||||
RwFrame *m_aHeliNodes[NUM_HELI_NODES];
|
||||
int8 m_heliStatus;
|
||||
float m_fSearchLightX;
|
||||
float m_fSearchLightY;
|
||||
uint32 m_nExplosionTimer;
|
||||
float m_fRotation;
|
||||
float m_fAngularSpeed;
|
||||
float m_fTargetZ;
|
||||
float m_fSearchLightIntensity;
|
||||
int8 m_nHeliId;
|
||||
int8 m_heliType;
|
||||
int8 m_pathState;
|
||||
float m_aSearchLightHistoryX[6];
|
||||
float m_aSearchLightHistoryY[6];
|
||||
uint32 m_nSearchLightTimer;
|
||||
uint32 m_nShootTimer;
|
||||
uint32 m_nLastShotTime;
|
||||
uint32 m_nBulletDamage;
|
||||
float m_fRotorRotation;
|
||||
float m_fHeliDustZ[8];
|
||||
uint32 m_nPoliceShoutTimer;
|
||||
float m_fTargetOffset;
|
||||
bool m_bTestRight;
|
||||
|
||||
CHeli(int, uint8);
|
||||
static CHeli **pHelis; //[NUM_HELIS]
|
||||
static int16 &NumRandomHelis;
|
||||
static uint32 &TestForNewRandomHelisTimer;
|
||||
static int16 NumScriptHelis; // unused
|
||||
static bool &CatalinaHeliOn;
|
||||
static bool &CatalinaHasBeenShotDown;
|
||||
static bool &ScriptHeliOn;
|
||||
|
||||
CHeli(int32 id, uint8 CreatedBy);
|
||||
CHeli* ctor(int, uint8);
|
||||
|
||||
// from CEntity
|
||||
void SetModelIndex(uint32 id);
|
||||
void ProcessControl(void);
|
||||
void PreRender(void);
|
||||
void Render(void);
|
||||
|
||||
void PreRenderAlways(void);
|
||||
CObject *SpawnFlyingComponent(int32 component);
|
||||
|
||||
static void InitHelis(void);
|
||||
static void UpdateHelis(void);
|
||||
static void SpecialHeliPreRender(void);
|
||||
static bool TestRocketCollision(CVector *coors);
|
||||
static bool TestBulletCollision(CVector *line0, CVector *line1, CVector *bulletPos, int32 damage);
|
||||
|
||||
static void StartCatalinaFlyBy(void);
|
||||
static void RemoveCatalinaHeli(void);
|
||||
static CHeli *FindPointerToCatalinasHeli(void);
|
||||
static void CatalinaTakeOff(void);
|
||||
static void MakeCatalinaHeliFlyAway(void);
|
||||
static bool HasCatalinaBeenShotDown(void);
|
||||
|
||||
static void ActivateHeli(bool activate);
|
||||
};
|
||||
static_assert(sizeof(CHeli) == 0x33C, "CHeli: error");
|
||||
|
@ -137,15 +137,16 @@ CPlane::ProcessControl(void)
|
||||
colors[6] = CRGBA(0, 0, 0, 255);
|
||||
colors[7] = CRGBA(224, 230, 238, 255);
|
||||
|
||||
CVector dir;
|
||||
for(i = 0; i < 40; i++){
|
||||
int rotSpeed = CGeneral::GetRandomNumberInRange(30.0f, 20.0f);
|
||||
dir.x = CGeneral::GetRandomNumberInRange(-2.0f, 2.0f);
|
||||
dir.y = CGeneral::GetRandomNumberInRange(-2.0f, 2.0f);
|
||||
dir.z = CGeneral::GetRandomNumberInRange(0.0f, 2.0f);
|
||||
int rotSpeed = CGeneral::GetRandomNumberInRange(10, 30);
|
||||
if(CGeneral::GetRandomNumber() & 1)
|
||||
rotSpeed = -rotSpeed;
|
||||
int f = ++nFrameGen & 3;
|
||||
CParticle::AddParticle(PARTICLE_HELI_DEBRIS, GetMatrix() * CVector(0.0f, 0.0f, 0.0f),
|
||||
CVector(CGeneral::GetRandomNumberInRange(-2.0f, 2.0f),
|
||||
CGeneral::GetRandomNumberInRange(-2.0f, 2.0f),
|
||||
CGeneral::GetRandomNumberInRange(0.0f, 2.0f)),
|
||||
CParticle::AddParticle(PARTICLE_HELI_DEBRIS, GetMatrix() * CVector(0.0f, 0.0f, 0.0f), dir,
|
||||
nil, CGeneral::GetRandomNumberInRange(0.1f, 1.0f),
|
||||
colors[nFrameGen], rotSpeed, 0, f, 0);
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ CTrain::SetModelIndex(uint32 id)
|
||||
int i;
|
||||
|
||||
CVehicle::SetModelIndex(id);
|
||||
for(i = 0; i < 3; i++)
|
||||
for(i = 0; i < NUM_TRAIN_NODES; i++)
|
||||
m_aTrainNodes[i] = nil;
|
||||
CClumpModelInfo::FillFrameArray(GetClump(), m_aTrainNodes);
|
||||
}
|
||||
|
@ -20,7 +20,8 @@ enum
|
||||
enum eTrainNodes
|
||||
{
|
||||
TRAIN_DOOR_LHS = 1,
|
||||
TRAIN_DOOR_RHS
|
||||
TRAIN_DOOR_RHS,
|
||||
NUM_TRAIN_NODES
|
||||
};
|
||||
|
||||
enum eTrainPositions
|
||||
@ -66,7 +67,7 @@ public:
|
||||
uint32 m_nDoorTimer;
|
||||
int16 m_nDoorState;
|
||||
CTrainDoor Doors[2];
|
||||
RwFrame *m_aTrainNodes[3];
|
||||
RwFrame *m_aTrainNodes[NUM_TRAIN_NODES];
|
||||
|
||||
// unused
|
||||
static CVector aStationCoors[3];
|
||||
|
@ -30,6 +30,9 @@ void *CVehicle::operator new(size_t sz, int handle) { return CPools::GetVehicleP
|
||||
void CVehicle::operator delete(void *p, size_t sz) { CPools::GetVehiclePool()->Delete((CVehicle*)p); }
|
||||
void CVehicle::operator delete(void *p, int handle) { CPools::GetVehiclePool()->Delete((CVehicle*)p); }
|
||||
|
||||
// or Weapon.cpp?
|
||||
WRAPPER void FireOneInstantHitRound(CVector *shotSource, CVector *shotTarget, int32 damage) { EAXJMP(0x563B00); }
|
||||
|
||||
CVehicle::CVehicle(uint8 CreatedBy)
|
||||
{
|
||||
int i;
|
||||
|
@ -106,6 +106,9 @@ enum eFlightModel
|
||||
FLIGHT_MODEL_SEAPLANE
|
||||
};
|
||||
|
||||
// Or Weapon.h?
|
||||
void FireOneInstantHitRound(CVector *shotSource, CVector *shotTarget, int32 damage);
|
||||
|
||||
class CVehicle : public CPhysical
|
||||
{
|
||||
public:
|
||||
|
Reference in New Issue
Block a user