mirror of
https://github.com/halpz/re3.git
synced 2025-07-22 18:29:47 +00:00
some CAutomobile
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@ -69,7 +69,6 @@ enum {
|
||||
class CAutomobile : public CVehicle
|
||||
{
|
||||
public:
|
||||
// 0x288
|
||||
CDamageManager Damage;
|
||||
CDoor Doors[6];
|
||||
RwFrame *m_aCarNodes[NUM_CAR_NODES];
|
||||
@ -83,10 +82,8 @@ public:
|
||||
float m_aWheelRotation[4];
|
||||
float m_aWheelPosition[4];
|
||||
float m_aWheelSpeed[4];
|
||||
float m_fRotorSpeed;
|
||||
uint8 field_4D8;
|
||||
uint8 bTaxiLight : 1;
|
||||
//uint8 bHadDriver : 1; // for bombs
|
||||
uint8 bFixedColour : 1;
|
||||
uint8 bBigWheels : 1;
|
||||
uint8 bWaterTight : 1; // no damage for non-player peds
|
||||
@ -111,6 +108,7 @@ public:
|
||||
float m_weaponDoorTimerRight;
|
||||
float m_fCarGunLR;
|
||||
float m_fCarGunUD;
|
||||
float m_fHeliOrientation;
|
||||
float m_fPropellerRotation;
|
||||
uint8 stuff4[4];
|
||||
uint8 m_nWheelsOnGround;
|
||||
@ -144,6 +142,9 @@ public:
|
||||
bool IsDoorFullyOpen(eDoors door);
|
||||
bool IsDoorClosed(eDoors door);
|
||||
bool IsDoorMissing(eDoors door);
|
||||
bool IsDoorReady(uint32 door);
|
||||
bool IsDoorMissing(uint32 door);
|
||||
bool IsOpenTopCar(void);
|
||||
void RemoveRefsToVehicle(CEntity *ent);
|
||||
void BlowUpCar(CEntity *ent);
|
||||
bool SetUpWheelColModel(CColModel *colModel);
|
||||
@ -158,6 +159,7 @@ public:
|
||||
void VehicleDamage(float impulse, uint16 damagedPiece);
|
||||
void ProcessBuoyancy(void);
|
||||
void DoDriveByShootings(void);
|
||||
void DoHoverSuspensionRatios(void);
|
||||
int32 RcbanditCheckHitWheels(void);
|
||||
int32 RcbanditCheck1CarWheels(CPtrList &list);
|
||||
void PlaceOnRoadProperly(void);
|
||||
@ -181,6 +183,8 @@ public:
|
||||
void SetDoorDamage(int32 component, eDoors door, bool noFlyingComponents = false);
|
||||
|
||||
void TellHeliToGoToCoors(float x, float y, float z, uint8 speed);
|
||||
void SetHeliOrientation(float orient) { m_fHeliOrientation = orient; }
|
||||
void ClearHeliOrientation(void) { m_fHeliOrientation = -1.0f; }
|
||||
|
||||
void Fix(void);
|
||||
void SetComponentVisibility(RwFrame *frame, uint32 flags);
|
||||
@ -190,6 +194,11 @@ public:
|
||||
void HideAllComps(void);
|
||||
void ShowAllComps(void);
|
||||
void ReduceHornCounter(void);
|
||||
|
||||
void PopBoot(void);
|
||||
void PopBootUsingPhysics(void);
|
||||
void CloseAllDoors(void);
|
||||
|
||||
#ifdef COMPATIBLE_SAVES
|
||||
virtual void Save(uint8*& buf);
|
||||
virtual void Load(uint8*& buf);
|
||||
|
@ -10,14 +10,20 @@ float G_aComponentDamage[] = { 2.5f, 1.25f, 3.2f, 1.4f, 2.5f, 2.8f, 0.5f };
|
||||
CDamageManager::CDamageManager(void)
|
||||
{
|
||||
ResetDamageStatus();
|
||||
m_fWheelDamageEffect = 0.75f;
|
||||
field_24 = 1;
|
||||
m_fWheelDamageEffect = 0.5f;
|
||||
field_18 = 1;
|
||||
}
|
||||
|
||||
void
|
||||
CDamageManager::ResetDamageStatus(void)
|
||||
{
|
||||
memset(this, 0, sizeof(*this));
|
||||
int i;
|
||||
m_fWheelDamageEffect = 0.0f;
|
||||
m_engineStatus = 0;
|
||||
for(i = 0; i < ARRAY_SIZE(m_wheelStatus); i++) m_wheelStatus[i] = 0;
|
||||
for(i = 0; i < ARRAY_SIZE(m_doorStatus); i++) m_doorStatus[i] = 0;
|
||||
m_lightStatus = 0;
|
||||
m_panelStatus = 0;
|
||||
}
|
||||
|
||||
void
|
||||
@ -28,12 +34,8 @@ CDamageManager::FuckCarCompletely(void)
|
||||
m_wheelStatus[0] = WHEEL_STATUS_MISSING;
|
||||
// wheels 1-3 not reset?
|
||||
|
||||
m_doorStatus[0] = DOOR_STATUS_MISSING;
|
||||
m_doorStatus[1] = DOOR_STATUS_MISSING;
|
||||
m_doorStatus[2] = DOOR_STATUS_MISSING;
|
||||
m_doorStatus[3] = DOOR_STATUS_MISSING;
|
||||
m_doorStatus[4] = DOOR_STATUS_MISSING;
|
||||
m_doorStatus[5] = DOOR_STATUS_MISSING;
|
||||
for(i = 0; i < ARRAY_SIZE(m_doorStatus); i++)
|
||||
m_doorStatus[i] = DOOR_STATUS_MISSING;
|
||||
|
||||
for(i = 0; i < 3; i++){
|
||||
#ifdef FIX_BUGS
|
||||
@ -59,6 +61,8 @@ CDamageManager::ApplyDamage(tComponent component, float damage, float unused)
|
||||
|
||||
GetComponentGroup(component, &group, &subComp);
|
||||
damage *= G_aComponentDamage[group];
|
||||
if(component == COMPONENT_PANEL_WINDSCREEN)
|
||||
damage *= 0.6f;
|
||||
if(damage > 150.0f){
|
||||
switch(group){
|
||||
case COMPGROUP_WHEEL:
|
||||
@ -222,10 +226,6 @@ CDamageManager::GetEngineStatus(void)
|
||||
bool
|
||||
CDamageManager::ProgressEngineDamage(void)
|
||||
{
|
||||
int status = GetEngineStatus();
|
||||
int newstatus = status + 32 + (CGeneral::GetRandomNumber() & 0x1F);
|
||||
if(status < ENGINE_STATUS_ON_FIRE && newstatus > ENGINE_STATUS_ON_FIRE-1)
|
||||
newstatus = ENGINE_STATUS_ON_FIRE-1;
|
||||
SetEngineStatus(newstatus);
|
||||
return true;
|
||||
// gone in VC
|
||||
return false;
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ public:
|
||||
uint8 m_doorStatus[6];
|
||||
uint32 m_lightStatus;
|
||||
uint32 m_panelStatus;
|
||||
uint32 field_24;
|
||||
uint8 field_18;
|
||||
|
||||
CDamageManager(void);
|
||||
|
||||
|
@ -707,12 +707,12 @@ CVehicle::BladeColSectorList(CPtrList &list, CColModel &rotorColModel, CMatrix &
|
||||
// Apply Collision
|
||||
if(IsCar()){
|
||||
CAutomobile *heli = (CAutomobile*)this;
|
||||
if(heli->m_fRotorSpeed > 0.15f){
|
||||
if(heli->m_aWheelSpeed[1] > 0.15f){
|
||||
ApplyCollision(CWorld::m_aTempColPts[i], impulse);
|
||||
ApplyTurnForce(m_fTurnMass*ROTOR_COL_TURNMULT*tangentSpeed, colpos - center);
|
||||
heli->m_fRotorSpeed = 0.15f;
|
||||
}else if(heli->m_fRotorSpeed < 0.075f && heli->m_fRotorSpeed > 0.0f)
|
||||
heli->m_fRotorSpeed *= -1.0f;
|
||||
heli->m_aWheelSpeed[1] = 0.15f;
|
||||
}else if(heli->m_aWheelSpeed[1] < 0.075f && heli->m_aWheelSpeed[1] > 0.0f)
|
||||
heli->m_aWheelSpeed[1] *= -1.0f;
|
||||
}
|
||||
|
||||
float damageImpulse = damageMult * Max(impulse, ROTOR_DEFAULT_DAMAGE*m_fMass/3000.0f);
|
||||
@ -1395,7 +1395,7 @@ CVehicle::ShufflePassengersToMakeSpace(void)
|
||||
return false;
|
||||
if (pPassengers[1] &&
|
||||
!(m_nGettingInFlags & CAR_DOOR_FLAG_LR) &&
|
||||
IsRoomForPedToLeaveCar(COMPONENT_DOOR_REAR_LEFT, nil)) {
|
||||
IsRoomForPedToLeaveCar(CAR_DOOR_LR, nil)) {
|
||||
if (!pPassengers[2] && !(m_nGettingInFlags & CAR_DOOR_FLAG_RR)) {
|
||||
pPassengers[2] = pPassengers[1];
|
||||
pPassengers[1] = nil;
|
||||
@ -1412,7 +1412,7 @@ CVehicle::ShufflePassengersToMakeSpace(void)
|
||||
}
|
||||
if (pPassengers[2] &&
|
||||
!(m_nGettingInFlags & CAR_DOOR_FLAG_RR) &&
|
||||
IsRoomForPedToLeaveCar(COMPONENT_DOOR_REAR_RIGHT, nil)) {
|
||||
IsRoomForPedToLeaveCar(CAR_DOOR_RR, nil)) {
|
||||
if (!pPassengers[1] && !(m_nGettingInFlags & CAR_DOOR_FLAG_LR)) {
|
||||
pPassengers[1] = pPassengers[2];
|
||||
pPassengers[2] = nil;
|
||||
@ -1429,7 +1429,7 @@ CVehicle::ShufflePassengersToMakeSpace(void)
|
||||
}
|
||||
if (pPassengers[0] &&
|
||||
!(m_nGettingInFlags & CAR_DOOR_FLAG_RF) &&
|
||||
IsRoomForPedToLeaveCar(COMPONENT_DOOR_FRONT_RIGHT, nil)) {
|
||||
IsRoomForPedToLeaveCar(CAR_DOOR_RF, nil)) {
|
||||
if (!pPassengers[1] && !(m_nGettingInFlags & CAR_DOOR_FLAG_LR)) {
|
||||
pPassengers[1] = pPassengers[0];
|
||||
pPassengers[0] = nil;
|
||||
@ -1581,9 +1581,8 @@ CVehicle::CarHasRoof(void)
|
||||
{
|
||||
if((pHandling->Flags & HANDLING_HAS_NO_ROOF) == 0)
|
||||
return true;
|
||||
if(m_aExtras[0] && m_aExtras[1])
|
||||
return false;
|
||||
return true;
|
||||
// component 0 is assumed to be a roof
|
||||
return m_aExtras[0] == 0 || m_aExtras[1] == 0;
|
||||
}
|
||||
|
||||
bool
|
||||
@ -1977,7 +1976,7 @@ CVehicle::ProcessCarAlarm(void)
|
||||
{
|
||||
uint32 step;
|
||||
|
||||
if(m_nAlarmState == 0 || m_nAlarmState == -1)
|
||||
if(!IsAlarmOn())
|
||||
return;
|
||||
|
||||
step = CTimer::GetTimeStepInMilliseconds();
|
||||
@ -2267,6 +2266,32 @@ CVehicle::DoSunGlare(void)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
CVehicle::KillPedsInVehicle(void)
|
||||
{
|
||||
int i;
|
||||
if(pDriver){
|
||||
CDarkel::RegisterKillByPlayer(pDriver, WEAPONTYPE_EXPLOSION);
|
||||
if(pDriver->GetPedState() == PED_DRIVING){
|
||||
pDriver->SetDead();
|
||||
if(!pDriver->IsPlayer())
|
||||
pDriver->FlagToDestroyWhenNextProcessed();
|
||||
}else
|
||||
pDriver->SetDie(ANIM_KO_SHOT_FRONT1, 4.0f, 0.0f);
|
||||
}
|
||||
for(i = 0; i < m_nNumMaxPassengers; i++){
|
||||
if(pPassengers[i]){
|
||||
CDarkel::RegisterKillByPlayer(pPassengers[i], WEAPONTYPE_EXPLOSION);
|
||||
if(pPassengers[i]->GetPedState() == PED_DRIVING){
|
||||
pPassengers[i]->SetDead();
|
||||
if(!pPassengers[i]->IsPlayer())
|
||||
pPassengers[i]->FlagToDestroyWhenNextProcessed();
|
||||
}else
|
||||
pPassengers[i]->SetDie(ANIM_KO_SHOT_FRONT1, 4.0f, 0.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
DestroyVehicleAndDriverAndPassengers(CVehicle* pVehicle)
|
||||
{
|
||||
|
@ -276,7 +276,7 @@ public:
|
||||
virtual void BlowUpCar(CEntity *ent) {}
|
||||
virtual bool SetUpWheelColModel(CColModel *colModel) { return false; }
|
||||
virtual void BurstTyre(uint8 tyre, bool applyForces) {}
|
||||
virtual bool IsRoomForPedToLeaveCar(uint32 component, CVector *forcedDoorPos) { return false;}
|
||||
virtual bool IsRoomForPedToLeaveCar(uint32 component, CVector *forcedDoorPos) { return false; }
|
||||
virtual bool IsClearToDriveAway(void);
|
||||
virtual float GetHeightAboveRoad(void);
|
||||
virtual void PlayCarHorn(void) {}
|
||||
@ -340,6 +340,7 @@ public:
|
||||
void FireFixedMachineGuns(void);
|
||||
void ActivateBomb(void);
|
||||
void ActivateBombWhenEntered(void);
|
||||
void KillPedsInVehicle(void);
|
||||
|
||||
void SetComponentAtomicAlpha(RpAtomic *atomic, int32 alpha);
|
||||
void UpdateClumpAlpha(void);
|
||||
|
Reference in New Issue
Block a user