summaryrefslogtreecommitdiffstats
path: root/src/peds
diff options
context:
space:
mode:
Diffstat (limited to 'src/peds')
-rw-r--r--src/peds/Gangs.cpp35
-rw-r--r--src/peds/Gangs.h18
-rw-r--r--src/peds/Ped.cpp563
-rw-r--r--src/peds/Ped.h157
-rw-r--r--src/peds/PedAI.cpp47
-rw-r--r--src/peds/PedFight.cpp138
-rw-r--r--src/peds/PedType.h8
-rw-r--r--src/peds/PlayerPed.cpp3
-rw-r--r--src/peds/Population.cpp160
9 files changed, 918 insertions, 211 deletions
diff --git a/src/peds/Gangs.cpp b/src/peds/Gangs.cpp
index 240f6b37..5cec5e12 100644
--- a/src/peds/Gangs.cpp
+++ b/src/peds/Gangs.cpp
@@ -21,23 +21,24 @@ CGangInfo::CGangInfo() :
void CGangs::Initialise(void)
{
- SetGangPedModels(GANG_CUBAN, MI_CBA, MI_CBB);
- SetGangPedModels(GANG_HAITIAN, MI_HNA, MI_HNB);
- SetGangPedModels(GANG_STREET, MI_SGA, MI_SGB);
- SetGangPedModels(GANG_DIAZ, MI_CLA, MI_CLB);
- SetGangPedModels(GANG_SECURITY, MI_GDA, MI_GDB);
- SetGangPedModels(GANG_BIKER, MI_BKA, MI_BKB);
- SetGangPedModels(GANG_PLAYER, MI_PGA, MI_PGB);
- SetGangPedModels(GANG_GOLFER, MI_WFOGO, MI_WMOGO);
- SetGangVehicleModel(GANG_CUBAN, MI_CUBAN);
- SetGangVehicleModel(GANG_HAITIAN, MI_VOODOO);
- SetGangVehicleModel(GANG_STREET, MI_GANGBUR);
- SetGangVehicleModel(GANG_DIAZ, -1);
- SetGangVehicleModel(GANG_SECURITY, -1);
- SetGangVehicleModel(GANG_BIKER, MI_ANGEL);
- SetGangVehicleModel(GANG_PLAYER, -1);
- SetGangVehicleModel(GANG_GOLFER, MI_CADDY);
- SetGangWeapons(GANG_GOLFER, WEAPONTYPE_GOLFCLUB, WEAPONTYPE_GOLFCLUB);
+ SetGangPedModels(GANG_MAFIA, MI_GANG01, MI_GANG02);
+ SetGangPedModels(GANG_TRIAD, MI_GANG03, MI_GANG04);
+ SetGangPedModels(GANG_DIABLOS, MI_GANG05, MI_GANG06);
+ SetGangPedModels(GANG_YAKUZA, MI_GANG07, MI_GANG08);
+ SetGangPedModels(GANG_YARDIE, MI_GANG09, MI_GANG10);
+ SetGangPedModels(GANG_COLUMB, MI_GANG11, MI_GANG12);
+ SetGangPedModels(GANG_HOODS, MI_GANG13, MI_GANG14);
+ SetGangPedModels(GANG_FORELLI, MI_GANG15, MI_GANG16);
+ SetGangPedModels(GANG_SINDACCO, MI_GANG17, MI_GANG18);
+ SetGangVehicleModel(GANG_MAFIA, MI_MAFIA);
+ SetGangVehicleModel(GANG_TRIAD, MI_BELLYUP);
+ SetGangVehicleModel(GANG_DIABLOS, MI_DIABLOS);
+ SetGangVehicleModel(GANG_YAKUZA, MI_YAKUZA);
+ SetGangVehicleModel(GANG_YARDIE, MI_YARDIE);
+ SetGangVehicleModel(GANG_COLUMB, MI_COLUMB);
+ SetGangVehicleModel(GANG_HOODS, MI_HOODS);
+ SetGangVehicleModel(GANG_FORELLI, MI_FORELLI_CAR);
+ SetGangVehicleModel(GANG_SINDACCO, MI_SINDACCO_CAR);
#ifdef FIX_BUGS
for (int i = 0; i < NUM_GANGS; i++)
SetGangPedModelOverride(i, -1);
diff --git a/src/peds/Gangs.h b/src/peds/Gangs.h
index c6381343..acb2fb99 100644
--- a/src/peds/Gangs.h
+++ b/src/peds/Gangs.h
@@ -17,15 +17,15 @@ struct CGangInfo
VALIDATE_SIZE(CGangInfo, 0x10);
enum {
- GANG_CUBAN = 0,
- GANG_HAITIAN,
- GANG_STREET,
- GANG_DIAZ,
- GANG_SECURITY,
- GANG_BIKER,
- GANG_PLAYER,
- GANG_GOLFER,
- GANG_9,
+ GANG_MAFIA = 0,
+ GANG_TRIAD,
+ GANG_DIABLOS,
+ GANG_YAKUZA,
+ GANG_YARDIE,
+ GANG_COLUMB,
+ GANG_HOODS,
+ GANG_FORELLI,
+ GANG_SINDACCO,
NUM_GANGS
};
diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp
index e07b5dd4..1a8c4e35 100644
--- a/src/peds/Ped.cpp
+++ b/src/peds/Ped.cpp
@@ -8107,6 +8107,62 @@ CPed::ClearWaitState(void)
if (assoc)
assoc->blendDelta = -8.0f;
break;
+ case WAITSTATE_MULTIPLAYER_CUTSCENE_MPNOTE:
+ case WAITSTATE_MULTIPLAYER_CUTSCENE_MPNOTE_LOOP:
+ case WAITSTATE_CS_MISC_IDLE_NO:
+ case WAITSTATE_CS_MISC_IDLE_YES:
+ case WAITSTATE_CS_MISC_IDLE_CHAT2:
+ case WAITSTATE_CS_MISC_IDLE_COUGH:
+ case WAITSTATE_CS_MISC_IDLE_GIGGLE_FEMALE:
+ case WAITSTATE_CS_MISC_IDLE_TOUGH_CHAT:
+ case WAITSTATE_DONH2_CAMERA:
+ case WAITSTATE_JDT2_ANXIOUS_TALK:
+ case WAITSTATE_JDT2_SHRUG:
+ case WAITSTATE_JDT4_DILDO_TALK:
+ case WAITSTATE_JDT5_CALM_DOWN:
+ case WAITSTATE_JDT5_POINT:
+ case WAITSTATE_JDT6_PICKUP:
+ case WAITSTATE_MAR1_SKIRT:
+ case WAITSTATE_MAR2_CELL_ANSWER:
+ case WAITSTATE_MAR2_CELL_END:
+ case WAITSTATE_MAR2_CELL_TALK:
+ case WAITSTATE_MAR2_FOOT_TAP:
+ case WAITSTATE_MAR3_HOOCHY:
+ case WAITSTATE_MAR3_NOTE_IDLE:
+ case WAITSTATE_MAR3_NOTE_PICKUP:
+ case WAITSTATE_SAL1_BIREFCASE_DOWN:
+ case WAITSTATE_SAL2_IDLE_SEATED:
+ case WAITSTATE_SAL2_SEAT_TO_STAND:
+ case WAITSTATE_SAL3_SEATED_TALK:
+ case WAITSTATE_SAL3_SEATED_IDLE:
+ case WAITSTATE_SAL4_DUST_DOWN:
+ case WAITSTATE_SAL4_GIRL_RUN:
+ case WAITSTATE_SAL6_ANGRY_SEATED:
+ case WAITSTATE_SAL6_IDLE_SEATED:
+ case WAITSTATE_SAL7_LOOKOUT:
+ case WAITSTATE_VIC2_POINT_ANGRY:
+ case WAITSTATE_VIC3_WAFT:
+ case WAITSTATE_VIC3_PICKUP_ROLL:
+ case WAITSTATE_VIC4_CARRY_BOX:
+ case WAITSTATE_VIC4_CELL_LOOK:
+ case WAITSTATE_VIC4_CRATE_IDLE:
+ case WAITSTATE_VIC6_CELL_ANGRY:
+ case WAITSTATE_TOURIST3:
+ case WAITSTATE_TOURIST2:
+ case WAITSTATE_TOURIST1:
+ case WAITSTATE_MAC2_PLEAD:
+ case WAITSTATE_JDT6_KNOCK:
+ case WAITSTATE_SAL3_SIT_DOWN:
+ case WAITSTATE_VIC7_PROD_WITH_FOOT:
+ assoc = RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_IDLE);
+ if (assoc)
+ assoc->Remove();
+ break;
+ case WAITSTATE_DONH3_HAPPY:
+ assoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_DONH3_HAPPY);
+ if (assoc)
+ assoc->blendDelta = -1.0f;
+ break;
default:
break;
}
@@ -8114,10 +8170,10 @@ CPed::ClearWaitState(void)
}
void
-CPed::SetWaitState(eWaitState state, void *time)
+CPed::SetWaitState(eWaitState state, void *time, bool repeat)
{
AnimationId waitAnim = ANIM_STD_NUM;
- CAnimBlendAssociation *animAssoc;
+ CAnimBlendAssociation *animAssoc = nil;
if (!IsPedInControl())
return;
@@ -8296,7 +8352,7 @@ CPed::SetWaitState(eWaitState state, void *time)
SetFall(-1, ANIM_STD_HIGHIMPACT_FRONT, true);
break;
case WAITSTATE_BOMBER:
- CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_DETONATE, 4.0f);
+ animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_DETONATE, 4.0f);
m_nWaitTimer = CTimer::GetTimeInMilliseconds() + *(int*)time;
break;
case WAITSTATE_GROUND_ATTACK:
@@ -8315,7 +8371,7 @@ CPed::SetWaitState(eWaitState state, void *time)
break;
}
case WAITSTATE_LANCESITTING:
- CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_LANCE, ANIM_SUNBATHE_IDLE, 4.0f);
+ animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_LANCE, ANIM_SUNBATHE_IDLE, 4.0f);
break;
case WAITSTATE_PLAYANIM_HANDSUP_SIMPLE:
animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_HANDSUP, 4.0f);
@@ -8324,12 +8380,193 @@ CPed::SetWaitState(eWaitState state, void *time)
animAssoc->SetDeleteCallback(FinishedWaitCB, this);
m_nWaitTimer = CTimer::GetTimeInMilliseconds() + *(int*)time;
break;
+ case WAITSTATE_MULTIPLAYER_CUTSCENE_MPNOTE:
+ animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_MPNOTE, ANIM_MULTIPLAYER_CUTSCENE_MPNOTE, 1.0f);
+ animAssoc->speed = 1.0f;
+ break;
+ case WAITSTATE_MULTIPLAYER_CUTSCENE_MPNOTE_LOOP:
+ animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_MPNOTE, ANIM_MULTIPLAYER_CUTSCENE_MPNOTE_LOOP, 1.0f);
+ animAssoc->speed = 1.0f;
+ break;
+ case WAITSTATE_CS_MISC_IDLE_NO:
+ case WAITSTATE_CS_MISC_IDLE_YES:
+ case WAITSTATE_CS_MISC_IDLE_CHAT2:
+ case WAITSTATE_CS_MISC_IDLE_COUGH:
+ case WAITSTATE_CS_MISC_IDLE_GIGGLE_FEMALE:
+ case WAITSTATE_CS_MISC_IDLE_TOUGH_CHAT:
+ animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_CSMISC,
+ (AnimationId)(ANIM_CS_MISC_IDLE_LOOK + (int)(state - WAITSTATE_CS_MISC_IDLE_LOOK)), 1.0f);
+ animAssoc->speed = 1.0f;
+ break;
+ case WAITSTATE_DONH2_CAMERA:
+ animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_DONH2, ANIM_DONH2_CAMERA, 1.0f);
+ animAssoc->speed = 1.0f;
+ break;
+ case WAITSTATE_DONH3_HAPPY:
+ animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_DONH3, ANIM_DONH3_HAPPY, 1.0f);
+ animAssoc->speed = 1.0f;
+ break;
+ case WAITSTATE_JDT2_ANXIOUS_TALK:
+ animAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_JDT2, ANIM_JDT2_ANXIOUS_TALK);
+ animAssoc->speed = 1.0f;
+ break;
+ case WAITSTATE_JDT2_SHRUG:
+ animAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_JDT2, ANIM_JDT2_SHRUG);
+ animAssoc->speed = 1.0f;
+ break;
+ case WAITSTATE_JDT4_DILDO_TALK:
+ animAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_JDT4, ANIM_JDT4_DILDO_TALK);
+ animAssoc->speed = 1.0f;
+ break;
+ case WAITSTATE_JDT5_CALM_DOWN:
+ animAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_JDT5, ANIM_JDT5_CALM_DOWN);
+ animAssoc->speed = 1.0f;
+ break;
+ case WAITSTATE_JDT5_POINT:
+ animAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_JDT5, ANIM_JDT5_POINT);
+ animAssoc->speed = 1.0f;
+ break;
+ case WAITSTATE_JDT6_PICKUP:
+ animAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_JDT6, ANIM_JDT6_PICKUP);
+ animAssoc->speed = 1.0f;
+ break;
+ case WAITSTATE_MAR1_SKIRT:
+ animAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_MAR1, ANIM_MAR1_SKIRT);
+ animAssoc->speed = 1.0f;
+ break;
+ case WAITSTATE_MAR2_CELL_ANSWER:
+ animAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_MAR2, ANIM_MAR2_CELL_ANSWER);
+ animAssoc->speed = 1.0f;
+ break;
+ case WAITSTATE_MAR2_CELL_END:
+ animAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_MAR2, ANIM_MAR2_CELL_END);
+ animAssoc->speed = 1.0f;
+ break;
+ case WAITSTATE_MAR2_CELL_TALK:
+ animAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_MAR2, ANIM_MAR2_CELL_TALK);
+ animAssoc->speed = 1.0f;
+ break;
+ case WAITSTATE_MAR2_FOOT_TAP:
+ animAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_MAR2, ANIM_MAR2_FOOT_TAP);
+ animAssoc->speed = 1.0f;
+ break;
+ case WAITSTATE_MAR3_HOOCHY:
+ animAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_MAR3, ANIM_MAR3_HOOCHY);
+ animAssoc->speed = 1.0f;
+ break;
+ case WAITSTATE_MAR3_NOTE_IDLE:
+ animAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_MAR3, ANIM_MAR3_NOTE_IDLE);
+ animAssoc->speed = 1.0f;
+ break;
+ case WAITSTATE_MAR3_NOTE_PICKUP:
+ animAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_MAR3, ANIM_MAR3_NOTE_PICKUP);
+ animAssoc->speed = 1.0f;
+ break;
+ case WAITSTATE_SAL1_BIREFCASE_DOWN:
+ animAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_SAL1, ANIM_SAL1_BIREFCASE_DOWN);
+ animAssoc->speed = 1.0f;
+ break;
+ case WAITSTATE_SAL2_IDLE_SEATED:
+ animAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_SAL2, ANIM_SAL2_IDLE_SEATED);
+ animAssoc->speed = 1.0f;
+ break;
+ case WAITSTATE_SAL2_SEAT_TO_STAND:
+ animAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_SAL2, ANIM_SAL2_SEAT_TO_STAND);
+ animAssoc->speed = 1.0f;
+ break;
+ case WAITSTATE_SAL3_SEATED_TALK:
+ animAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_SAL3, ANIM_SAL3_SEATED_TALK);
+ animAssoc->speed = 1.0f;
+ break;
+ case WAITSTATE_SAL3_SEATED_IDLE:
+ animAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_SAL3, ANIM_SAL3_SEATED_IDLE);
+ animAssoc->speed = 1.0f;
+ break;
+ case WAITSTATE_SAL4_DUST_DOWN:
+ animAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_SAL4, ANIM_SAL4_DUST_DOWN);
+ animAssoc->speed = 1.0f;
+ break;
+ case WAITSTATE_SAL4_GIRL_RUN:
+ animAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_SAL4, ANIM_SAL4_GIRL_RUN);
+ animAssoc->speed = 1.0f;
+ break;
+ case WAITSTATE_SAL6_ANGRY_SEATED:
+ animAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_SAL6, ANIM_SAL6_ANGRY_SEATED);
+ animAssoc->speed = 1.0f;
+ break;
+ case WAITSTATE_SAL6_IDLE_SEATED:
+ animAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_SAL6, ANIM_SAL6_IDLE_SEATED);
+ animAssoc->speed = 1.0f;
+ break;
+ case WAITSTATE_SAL7_LOOKOUT:
+ animAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_SAL7, ANIM_SAL7_LOOKOUT);
+ animAssoc->speed = 1.0f;
+ break;
+ case WAITSTATE_VIC2_POINT_ANGRY:
+ animAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_VIC2, ANIM_VIC2_POINT_ANGRY);
+ animAssoc->speed = 1.0f;
+ break;
+ case WAITSTATE_VIC3_WAFT:
+ animAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_VIC3, ANIM_VIC3_WAFT);
+ animAssoc->speed = 1.0f;
+ break;
+ case WAITSTATE_VIC3_PICKUP_ROLL:
+ animAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_VIC3, ANIM_VIC3_PICKUP_ROLL);
+ animAssoc->speed = 1.0f;
+ break;
+ case WAITSTATE_VIC4_CARRY_BOX:
+ animAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_VIC4, ANIM_VIC4_CARRY_BOX);
+ animAssoc->speed = 1.0f;
+ break;
+ case WAITSTATE_VIC4_CELL_LOOK:
+ animAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_VIC4, ANIM_VIC4_CELL_LOOK);
+ animAssoc->speed = 1.0f;
+ break;
+ case WAITSTATE_VIC4_CRATE_IDLE:
+ animAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_VIC4, ANIM_VIC4_CRATE_IDLE);
+ animAssoc->speed = 1.0f;
+ break;
+ case WAITSTATE_VIC6_CELL_ANGRY:
+ animAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_VIC6, ANIM_VIC6_CELL_ANGRY);
+ animAssoc->speed = 1.0f;
+ break;
+ case WAITSTATE_TOURIST3:
+ animAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_TOURIST, ANIM_TOURIST3);
+ animAssoc->speed = 1.0f;
+ break;
+ case WAITSTATE_TOURIST2:
+ animAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_TOURIST, ANIM_TOURIST2);
+ animAssoc->speed = 1.0f;
+ break;
+ case WAITSTATE_TOURIST1:
+ animAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_TOURIST, ANIM_TOURIST1);
+ animAssoc->speed = 1.0f;
+ break;
+ case WAITSTATE_MAC2_PLEAD:
+ animAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_MAC2, ANIM_MAC2_PLEAD);
+ animAssoc->speed = 1.0f;
+ break;
+ case WAITSTATE_JDT6_KNOCK:
+ animAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_JDT6, ANIM_JDT6_KNOCK);
+ animAssoc->speed = 1.0f;
+ break;
+ case WAITSTATE_SAL3_SIT_DOWN:
+ animAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_SAL3, ANIM_SAL3_SIT_DOWN);
+ animAssoc->speed = 1.0f;
+ break;
+ case WAITSTATE_VIC7_PROD_WITH_FOOT:
+ animAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_VIC7, ANIM_VIC7_PROD_WITH_FOOT);
+ animAssoc->speed = 1.0f;
+ break;
default:
ClearWaitState();
RestoreHeadingRate();
return;
}
+ bool rep = animAssoc ? repeat : false;
m_nWaitState = state;
+ if (rep)
+ animAssoc->flags |= ASSOC_REPEAT;
}
void
@@ -9287,7 +9524,7 @@ CPed::SetRadioStation(void)
if (IsPlayer() || !m_pMyVehicle || m_pMyVehicle->pDriver != this)
return;
- if (GetModelIndex() != MI_PGA && GetModelIndex() != MI_PGB) {
+ if (GetModelIndex() != MI_GANG13 && GetModelIndex() != MI_GANG14) {
if (m_pMyVehicle->m_nRadioStation != modelInfo->radio1 && m_pMyVehicle->m_nRadioStation != modelInfo->radio2) {
if (CGeneral::GetRandomTrueFalse())
m_pMyVehicle->m_nRadioStation = modelInfo->radio1;
@@ -9300,8 +9537,10 @@ CPed::SetRadioStation(void)
}
void
-CPed::WarpPedIntoCar(CVehicle *car)
+CPed::WarpPedIntoCar(CVehicle *car) // LCS TODO: remove passenger logic
{
+ if (GetPedState() == PED_FACE_PHONE)
+ QuitEnteringCar();
bInVehicle = true;
m_pMyVehicle = car;
m_pMyVehicle->RegisterReference((CEntity **) &m_pMyVehicle);
@@ -9366,6 +9605,77 @@ CPed::WarpPedIntoCar(CVehicle *car)
bChangedSeat = true;
}
+void
+CPed::WarpPedIntoCarAsPassenger(CVehicle* pVehicle, int32 position)
+{
+ if (GetPedState() == PED_FACE_PHONE)
+ QuitEnteringCar();
+ bInVehicle = true;
+ m_pMyVehicle = pVehicle;
+ m_pMyVehicle->RegisterReference((CEntity**)&m_pMyVehicle);
+ m_carInObjective = pVehicle;
+ m_carInObjective->RegisterReference((CEntity**)&m_carInObjective);
+ SetPedState(PED_DRIVING); // TODO: this is PED_PASSENGER, but it needs to have some logic applied first
+ bUsesCollision = false;
+ bIsInTheAir = false;
+ bVehExitWillBeInstant = true;
+ if (pVehicle->IsBike() && !pVehicle->pPassengers[0]) {
+ pVehicle->pPassengers[0] = this;
+ pVehicle->pPassengers[0]->RegisterReference((CEntity**)&pVehicle->pPassengers[0]);
+ }
+ if (position >= 0) {
+ if (!pVehicle->pPassengers[position]) {
+ pVehicle->pPassengers[position] = this;
+ pVehicle->pPassengers[position]->RegisterReference((CEntity**)&pVehicle->pPassengers[position]);
+ }
+ }
+ else {
+ for (int i = 0; i < 4; i++) {
+ if (!pVehicle->pPassengers[i]) {
+ pVehicle->pPassengers[i] = this;
+ pVehicle->pPassengers[i]->RegisterReference((CEntity**)&pVehicle->pPassengers[i]);
+ break;
+ }
+ }
+ }
+
+ if (IsPlayer()) {
+ pVehicle->SetStatus(STATUS_PLAYER);
+ AudioManager.PlayerJustGotInCar();
+ CCarCtrl::RegisterVehicleOfInterest(pVehicle);
+ }
+ else {
+ pVehicle->SetStatus(STATUS_PHYSICS);
+ }
+
+ CWorld::Remove(this);
+ SetPosition(pVehicle->GetPosition());
+ CWorld::Add(this);
+
+ if (pVehicle->bIsAmbulanceOnDuty) {
+ pVehicle->bIsAmbulanceOnDuty = false;
+ --CCarCtrl::NumAmbulancesOnDuty;
+ }
+ if (pVehicle->bIsFireTruckOnDuty) {
+ pVehicle->bIsFireTruckOnDuty = false;
+ --CCarCtrl::NumFiretrucksOnDuty;
+ }
+ if (!pVehicle->bEngineOn) {
+ pVehicle->bEngineOn = true;
+ DMAudio.PlayOneShot(pVehicle->m_audioEntityId, SOUND_CAR_ENGINE_START, 1.0f);
+ }
+
+ RpAnimBlendClumpSetBlendDeltas(GetClump(), ASSOC_PARTIAL, -1000.0f);
+
+ AddInCarAnims(pVehicle, pVehicle->pDriver == this);
+ RemoveWeaponWhenEnteringVehicle();
+
+ if (pVehicle->bIsBus)
+ bRenderPedInCar = false;
+
+ bChangedSeat = true;
+}
+
bool
CPed::HasAttractor(void)
{
@@ -9552,6 +9862,247 @@ CPed::Say(uint16 audio, int32 time)
}
}
+void
+CPed::LoadNonStandardPedAnim(eWaitState waitState)
+{
+ switch(waitState) {
+ case WAITSTATE_MULTIPLAYER_CUTSCENE_MPNOTE:
+ case WAITSTATE_MULTIPLAYER_CUTSCENE_MPNOTE_LOOP:
+ CStreaming::RequestAnim(CAnimManager::GetAnimationBlockIndex("MPNote"), STREAMFLAGS_DEPENDENCY | STREAMFLAGS_SCRIPTOWNED);
+ break;
+ case WAITSTATE_CS_MISC_IDLE_LOOK:
+ case WAITSTATE_CS_MISC_IDLE_NO:
+ case WAITSTATE_CS_MISC_IDLE_YES:
+ case WAITSTATE_CS_MISC_IDLE_CHAT2:
+ case WAITSTATE_CS_MISC_IDLE_COUGH:
+ case WAITSTATE_CS_MISC_IDLE_GIGGLE_FEMALE:
+ case WAITSTATE_CS_MISC_IDLE_TOUGH_CHAT:
+ case WAITSTATE_CS_MISC_IDLE_CELL_TALK:
+ CStreaming::RequestAnim(CAnimManager::GetAnimationBlockIndex("cs_misc"), STREAMFLAGS_DEPENDENCY | STREAMFLAGS_SCRIPTOWNED);
+ break;
+ case WAITSTATE_DONH2_CAMERA:
+ CStreaming::RequestAnim(CAnimManager::GetAnimationBlockIndex("donh2"), STREAMFLAGS_DEPENDENCY | STREAMFLAGS_SCRIPTOWNED);
+ break;
+ case WAITSTATE_DONH3_HAPPY:
+ CStreaming::RequestAnim(CAnimManager::GetAnimationBlockIndex("donh3"), STREAMFLAGS_DEPENDENCY | STREAMFLAGS_SCRIPTOWNED);
+ break;
+ case WAITSTATE_JDT2_ANXIOUS_TALK:
+ case WAITSTATE_JDT2_SHRUG:
+ CStreaming::RequestAnim(CAnimManager::GetAnimationBlockIndex("jdt2"), STREAMFLAGS_DEPENDENCY | STREAMFLAGS_SCRIPTOWNED);
+ break;
+ case WAITSTATE_JDT4_DILDO_TALK:
+ CStreaming::RequestAnim(CAnimManager::GetAnimationBlockIndex("jdt4"), STREAMFLAGS_DEPENDENCY | STREAMFLAGS_SCRIPTOWNED);
+ break;
+ case WAITSTATE_JDT5_CALM_DOWN:
+ case WAITSTATE_JDT5_POINT:
+ CStreaming::RequestAnim(CAnimManager::GetAnimationBlockIndex("jdt5"), STREAMFLAGS_DEPENDENCY | STREAMFLAGS_SCRIPTOWNED);
+ break;
+ case WAITSTATE_JDT6_PICKUP:
+ case WAITSTATE_JDT6_KNOCK:
+ CStreaming::RequestAnim(CAnimManager::GetAnimationBlockIndex("jdt6"), STREAMFLAGS_DEPENDENCY | STREAMFLAGS_SCRIPTOWNED);
+ break;
+ case WAITSTATE_MAR1_SKIRT:
+ CStreaming::RequestAnim(CAnimManager::GetAnimationBlockIndex("mar1"), STREAMFLAGS_DEPENDENCY | STREAMFLAGS_SCRIPTOWNED);
+ break;
+ case WAITSTATE_MAR2_CELL_ANSWER:
+ case WAITSTATE_MAR2_CELL_END:
+ case WAITSTATE_MAR2_CELL_TALK:
+ case WAITSTATE_MAR2_FOOT_TAP:
+ CStreaming::RequestAnim(CAnimManager::GetAnimationBlockIndex("mar2"), STREAMFLAGS_DEPENDENCY | STREAMFLAGS_SCRIPTOWNED);
+ break;
+ case WAITSTATE_MAR3_HOOCHY:
+ case WAITSTATE_MAR3_NOTE_IDLE:
+ case WAITSTATE_MAR3_NOTE_PICKUP:
+ CStreaming::RequestAnim(CAnimManager::GetAnimationBlockIndex("mar3"), STREAMFLAGS_DEPENDENCY | STREAMFLAGS_SCRIPTOWNED);
+ break;
+ case WAITSTATE_SAL1_BIREFCASE_DOWN:
+ CStreaming::RequestAnim(CAnimManager::GetAnimationBlockIndex("sal1"), STREAMFLAGS_DEPENDENCY | STREAMFLAGS_SCRIPTOWNED);
+ break;
+ case WAITSTATE_SAL2_IDLE_SEATED:
+ case WAITSTATE_SAL2_SEAT_TO_STAND:
+ CStreaming::RequestAnim(CAnimManager::GetAnimationBlockIndex("sal2"), STREAMFLAGS_DEPENDENCY | STREAMFLAGS_SCRIPTOWNED);
+ break;
+ case WAITSTATE_SAL3_SEATED_TALK:
+ case WAITSTATE_SAL3_SEATED_IDLE:
+ case WAITSTATE_SAL3_SIT_DOWN:
+ CStreaming::RequestAnim(CAnimManager::GetAnimationBlockIndex("sal3"), STREAMFLAGS_DEPENDENCY | STREAMFLAGS_SCRIPTOWNED);
+ break;
+ case WAITSTATE_SAL4_DUST_DOWN:
+ case WAITSTATE_SAL4_GIRL_RUN:
+ CStreaming::RequestAnim(CAnimManager::GetAnimationBlockIndex("sal4"), STREAMFLAGS_DEPENDENCY | STREAMFLAGS_SCRIPTOWNED);
+ break;
+ case WAITSTATE_SAL6_ANGRY_SEATED:
+ case WAITSTATE_SAL6_IDLE_SEATED:
+ CStreaming::RequestAnim(CAnimManager::GetAnimationBlockIndex("sal6"), STREAMFLAGS_DEPENDENCY | STREAMFLAGS_SCRIPTOWNED);
+ break;
+ case WAITSTATE_SAL7_LOOKOUT:
+ CStreaming::RequestAnim(CAnimManager::GetAnimationBlockIndex("sal7"), STREAMFLAGS_DEPENDENCY | STREAMFLAGS_SCRIPTOWNED);
+ break;
+ case WAITSTATE_VIC2_POINT_ANGRY:
+ CStreaming::RequestAnim(CAnimManager::GetAnimationBlockIndex("vic2"), STREAMFLAGS_DEPENDENCY | STREAMFLAGS_SCRIPTOWNED);
+ break;
+ case WAITSTATE_VIC3_WAFT:
+ case WAITSTATE_VIC3_PICKUP_ROLL:
+ CStreaming::RequestAnim(CAnimManager::GetAnimationBlockIndex("vic3"), STREAMFLAGS_DEPENDENCY | STREAMFLAGS_SCRIPTOWNED);
+ break;
+ case WAITSTATE_VIC4_CARRY_BOX:
+ case WAITSTATE_VIC4_CELL_LOOK:
+ case WAITSTATE_VIC4_CRATE_IDLE:
+ CStreaming::RequestAnim(CAnimManager::GetAnimationBlockIndex("vic4"), STREAMFLAGS_DEPENDENCY | STREAMFLAGS_SCRIPTOWNED);
+ break;
+ case WAITSTATE_VIC6_CELL_ANGRY:
+ CStreaming::RequestAnim(CAnimManager::GetAnimationBlockIndex("vic6"), STREAMFLAGS_DEPENDENCY | STREAMFLAGS_SCRIPTOWNED);
+ break;
+ case WAITSTATE_TOURIST3:
+ case WAITSTATE_TOURIST2:
+ case WAITSTATE_TOURIST1:
+ CStreaming::RequestAnim(CAnimManager::GetAnimationBlockIndex("tourist"), STREAMFLAGS_DEPENDENCY | STREAMFLAGS_SCRIPTOWNED);
+ break;
+ case WAITSTATE_MAC2_PLEAD:
+ CStreaming::RequestAnim(CAnimManager::GetAnimationBlockIndex("mac2"), STREAMFLAGS_DEPENDENCY | STREAMFLAGS_SCRIPTOWNED);
+ break;
+ case WAITSTATE_VIC7_PROD_WITH_FOOT:
+ CStreaming::RequestAnim(CAnimManager::GetAnimationBlockIndex("vic7"), STREAMFLAGS_DEPENDENCY | STREAMFLAGS_SCRIPTOWNED);
+ break;
+ default:
+ CStreaming::RequestAnim(0, STREAMFLAGS_DEPENDENCY | STREAMFLAGS_SCRIPTOWNED);
+ break;
+ }
+ CStreaming::LoadAllRequestedModels(false);
+}
+
+void
+CPed::UnloadNonStandardPedAnim(eWaitState waitState)
+{
+ switch(waitState) {
+ case WAITSTATE_MULTIPLAYER_CUTSCENE_MPNOTE:
+ case WAITSTATE_MULTIPLAYER_CUTSCENE_MPNOTE_LOOP:
+ if(CAnimManager::GetAnimationBlock("MPNote"))
+ CStreaming::RemoveAnim(CAnimManager::GetAnimationBlockIndex("MPNote"));
+ break;
+ case WAITSTATE_CS_MISC_IDLE_LOOK:
+ case WAITSTATE_CS_MISC_IDLE_NO:
+ case WAITSTATE_CS_MISC_IDLE_YES:
+ case WAITSTATE_CS_MISC_IDLE_CHAT2:
+ case WAITSTATE_CS_MISC_IDLE_COUGH:
+ case WAITSTATE_CS_MISC_IDLE_GIGGLE_FEMALE:
+ case WAITSTATE_CS_MISC_IDLE_TOUGH_CHAT:
+ case WAITSTATE_CS_MISC_IDLE_CELL_TALK:
+ if(CAnimManager::GetAnimationBlock("cs_misc"))
+ CStreaming::RemoveAnim(CAnimManager::GetAnimationBlockIndex("cs_misc"));
+ break;
+ case WAITSTATE_DONH2_CAMERA:
+ if(CAnimManager::GetAnimationBlock("donh2"))
+ CStreaming::RemoveAnim(CAnimManager::GetAnimationBlockIndex("donh2"));
+ break;
+ case WAITSTATE_DONH3_HAPPY:
+ if(CAnimManager::GetAnimationBlock("donh3"))
+ CStreaming::RemoveAnim(CAnimManager::GetAnimationBlockIndex("donh3"));
+ break;
+ case WAITSTATE_JDT2_ANXIOUS_TALK:
+ case WAITSTATE_JDT2_SHRUG:
+ if(CAnimManager::GetAnimationBlock("cs_misc"))
+ CStreaming::RemoveAnim(CAnimManager::GetAnimationBlockIndex("cs_misc"));
+ break;
+ case WAITSTATE_JDT4_DILDO_TALK:
+ if(CAnimManager::GetAnimationBlock("jdt4"))
+ CStreaming::RemoveAnim(CAnimManager::GetAnimationBlockIndex("jdt4"));
+ break;
+ case WAITSTATE_JDT5_CALM_DOWN:
+ case WAITSTATE_JDT5_POINT:
+ if(CAnimManager::GetAnimationBlock("jdt5"))
+ CStreaming::RemoveAnim(CAnimManager::GetAnimationBlockIndex("jdt5"));
+ break;
+ case WAITSTATE_JDT6_PICKUP:
+ case WAITSTATE_JDT6_KNOCK:
+ if(CAnimManager::GetAnimationBlock("jdt6"))
+ CStreaming::RemoveAnim(CAnimManager::GetAnimationBlockIndex("jdt6"));
+ break;
+ case WAITSTATE_MAR1_SKIRT:
+ if(CAnimManager::GetAnimationBlock("mar1"))
+ CStreaming::RemoveAnim(CAnimManager::GetAnimationBlockIndex("mar1"));
+ break;
+ case WAITSTATE_MAR2_CELL_ANSWER:
+ case WAITSTATE_MAR2_CELL_END:
+ case WAITSTATE_MAR2_CELL_TALK:
+ case WAITSTATE_MAR2_FOOT_TAP:
+ if(CAnimManager::GetAnimationBlock("mar2"))
+ CStreaming::RemoveAnim(CAnimManager::GetAnimationBlockIndex("mar2"));
+ break;
+ case WAITSTATE_MAR3_HOOCHY:
+ case WAITSTATE_MAR3_NOTE_IDLE:
+ case WAITSTATE_MAR3_NOTE_PICKUP:
+ if(CAnimManager::GetAnimationBlock("mar3"))
+ CStreaming::RemoveAnim(CAnimManager::GetAnimationBlockIndex("mar3"));
+ break;
+ case WAITSTATE_SAL1_BIREFCASE_DOWN:
+ if(CAnimManager::GetAnimationBlock("sal1"))
+ CStreaming::RemoveAnim(CAnimManager::GetAnimationBlockIndex("sal1"));
+ break;
+ case WAITSTATE_SAL2_IDLE_SEATED:
+ case WAITSTATE_SAL2_SEAT_TO_STAND:
+ if(CAnimManager::GetAnimationBlock("sal2"))
+ CStreaming::RemoveAnim(CAnimManager::GetAnimationBlockIndex("sal2"));
+ break;
+ case WAITSTATE_SAL3_SEATED_TALK:
+ case WAITSTATE_SAL3_SEATED_IDLE:
+ case WAITSTATE_SAL3_SIT_DOWN:
+ if(CAnimManager::GetAnimationBlock("sal3"))
+ CStreaming::RemoveAnim(CAnimManager::GetAnimationBlockIndex("sal3"));
+ break;
+ case WAITSTATE_SAL4_DUST_DOWN:
+ case WAITSTATE_SAL4_GIRL_RUN:
+ if(CAnimManager::GetAnimationBlock("sal4"))
+ CStreaming::RemoveAnim(CAnimManager::GetAnimationBlockIndex("sal4"));
+ break;
+ case WAITSTATE_SAL6_ANGRY_SEATED:
+ case WAITSTATE_SAL6_IDLE_SEATED:
+ if(CAnimManager::GetAnimationBlock("sal6"))
+ CStreaming::RemoveAnim(CAnimManager::GetAnimationBlockIndex("sal6"));
+ break;
+ case WAITSTATE_SAL7_LOOKOUT:
+ if(CAnimManager::GetAnimationBlock("sal7"))
+ CStreaming::RemoveAnim(CAnimManager::GetAnimationBlockIndex("sal7"));
+ break;
+ case WAITSTATE_VIC2_POINT_ANGRY:
+ if(CAnimManager::GetAnimationBlock("vic2"))
+ CStreaming::RemoveAnim(CAnimManager::GetAnimationBlockIndex("vic2"));
+ break;
+ case WAITSTATE_VIC3_WAFT:
+ case WAITSTATE_VIC3_PICKUP_ROLL:
+ if(CAnimManager::GetAnimationBlock("vic3"))
+ CStreaming::RemoveAnim(CAnimManager::GetAnimationBlockIndex("vic3"));
+ break;
+ case WAITSTATE_VIC4_CARRY_BOX:
+ case WAITSTATE_VIC4_CELL_LOOK:
+ case WAITSTATE_VIC4_CRATE_IDLE:
+ if(CAnimManager::GetAnimationBlock("vic4"))
+ CStreaming::RemoveAnim(CAnimManager::GetAnimationBlockIndex("vic4"));
+ break;
+ case WAITSTATE_VIC6_CELL_ANGRY:
+ if(CAnimManager::GetAnimationBlock("vic6"))
+ CStreaming::RemoveAnim(CAnimManager::GetAnimationBlockIndex("vic6"));
+ break;
+ case WAITSTATE_TOURIST3:
+ case WAITSTATE_TOURIST2:
+ case WAITSTATE_TOURIST1:
+ if(CAnimManager::GetAnimationBlock("tourist"))
+ CStreaming::RemoveAnim(CAnimManager::GetAnimationBlockIndex("tourist"));
+ break;
+ case WAITSTATE_MAC2_PLEAD:
+ if(CAnimManager::GetAnimationBlock("mac2"))
+ CStreaming::RemoveAnim(CAnimManager::GetAnimationBlockIndex("mac2"));
+ break;
+ case WAITSTATE_VIC7_PROD_WITH_FOOT:
+ if(CAnimManager::GetAnimationBlock("vic7"))
+ CStreaming::RemoveAnim(CAnimManager::GetAnimationBlockIndex("vic7"));
+ break;
+ default:
+ break;
+ }
+}
+
+
#ifdef COMPATIBLE_SAVES
#define CopyFromBuf(buf, data) memcpy(&data, buf, sizeof(data)); SkipSaveBuf(buf, sizeof(data));
#define CopyToBuf(buf, data) memcpy(buf, &data, sizeof(data)); SkipSaveBuf(buf, sizeof(data));
diff --git a/src/peds/Ped.h b/src/peds/Ped.h
index c5c6cf49..107ad1a2 100644
--- a/src/peds/Ped.h
+++ b/src/peds/Ped.h
@@ -100,9 +100,31 @@ enum PedFightMoves
{
FIGHTMOVE_NULL,
// Attacker
- FIGHTMOVE_STDPUNCH,
+// FIGHTMOVE_STDPUNCH,
FIGHTMOVE_IDLE,
FIGHTMOVE_SHUFFLE_F,
+ // Combos
+ FIGHTMOVE_COMBO_A1,
+ FIGHTMOVE_COMBO_A2,
+ FIGHTMOVE_COMBO_A3,
+ FIGHTMOVE_COMBO_B1,
+ FIGHTMOVE_COMBO_B2,
+ FIGHTMOVE_COMBO_B3,
+ // Melee
+ FIGHTMOVE_MELEE1,
+ FIGHTMOVE_MELEE2,
+ FIGHTMOVE_MELEE3,
+ // Special
+ FIGHTMOVE_GROUNDKICK,
+ // Opponent
+ FIGHTMOVE_HITFRONT,
+ FIGHTMOVE_HITBACK,
+ FIGHTMOVE_HITRIGHT,
+ FIGHTMOVE_HITLEFT,
+ FIGHTMOVE_HITONFLOOR,
+ FIGHTMOVE_HITBEHIND,
+ FIGHTMOVE_IDLE2NORM,
+/*
FIGHTMOVE_KNEE,
FIGHTMOVE_PUNCHHOOK,
FIGHTMOVE_PUNCHJAB,
@@ -134,7 +156,16 @@ enum PedFightMoves
FIGHTMOVE_MELEE2,
FIGHTMOVE_MELEE3,
FIGHTMOVE_IDLE2NORM,
- NUM_FIGHTMOVES
+*/
+
+ NUM_FIGHTMOVES,
+
+ // LCS replacements for the old names:
+ // NB: this may be totally bogus, i just need it to compile
+ FIGHTMOVE_PUNCH = FIGHTMOVE_COMBO_A2,
+ FIGHTMOVE_FWDRIGHT = FIGHTMOVE_COMBO_B1,
+ FIGHTMOVE_LONGKICK = FIGHTMOVE_COMBO_B2,
+ FIGHTMOVE_ROUNDHOUSE = FIGHTMOVE_COMBO_B3,
};
enum ePedPieceTypes
@@ -185,6 +216,56 @@ enum eWaitState {
WAITSTATE_GROUND_ATTACK,
WAITSTATE_LANCESITTING,
WAITSTATE_PLAYANIM_HANDSUP_SIMPLE,
+ WAITSTATE_MULTIPLAYER_CUTSCENE_MPNOTE,
+ WAITSTATE_MULTIPLAYER_CUTSCENE_MPNOTE_LOOP,
+ WAITSTATE_CS_MISC_IDLE_LOOK,
+ WAITSTATE_CS_MISC_IDLE_NO,
+ WAITSTATE_CS_MISC_IDLE_YES,
+ WAITSTATE_CS_MISC_IDLE_CHAT2,
+ WAITSTATE_CS_MISC_IDLE_COUGH,
+ WAITSTATE_CS_MISC_IDLE_GIGGLE_FEMALE,
+ WAITSTATE_CS_MISC_IDLE_TOUGH_CHAT,
+ WAITSTATE_CS_MISC_IDLE_CELL_TALK,
+ WAITSTATE_DONH2_CAMERA,
+ WAITSTATE_DONH3_HAPPY,
+ WAITSTATE_JDT2_ANXIOUS_TALK,
+ WAITSTATE_JDT2_SHRUG,
+ WAITSTATE_JDT4_DILDO_TALK,
+ WAITSTATE_JDT5_CALM_DOWN,
+ WAITSTATE_JDT5_POINT,
+ WAITSTATE_JDT6_PICKUP,
+ WAITSTATE_MAR1_SKIRT,
+ WAITSTATE_MAR2_CELL_ANSWER,
+ WAITSTATE_MAR2_CELL_END,
+ WAITSTATE_MAR2_CELL_TALK,
+ WAITSTATE_MAR2_FOOT_TAP,
+ WAITSTATE_MAR3_HOOCHY,
+ WAITSTATE_MAR3_NOTE_IDLE,
+ WAITSTATE_MAR3_NOTE_PICKUP,
+ WAITSTATE_SAL1_BIREFCASE_DOWN,
+ WAITSTATE_SAL2_IDLE_SEATED,
+ WAITSTATE_SAL2_SEAT_TO_STAND,
+ WAITSTATE_SAL3_SEATED_TALK,
+ WAITSTATE_SAL3_SEATED_IDLE,
+ WAITSTATE_SAL4_DUST_DOWN,
+ WAITSTATE_SAL4_GIRL_RUN,
+ WAITSTATE_SAL6_ANGRY_SEATED,
+ WAITSTATE_SAL6_IDLE_SEATED,
+ WAITSTATE_SAL7_LOOKOUT,
+ WAITSTATE_VIC2_POINT_ANGRY,
+ WAITSTATE_VIC3_WAFT,
+ WAITSTATE_VIC3_PICKUP_ROLL,
+ WAITSTATE_VIC4_CARRY_BOX,
+ WAITSTATE_VIC4_CELL_LOOK,
+ WAITSTATE_VIC4_CRATE_IDLE,
+ WAITSTATE_VIC6_CELL_ANGRY,
+ WAITSTATE_TOURIST3,
+ WAITSTATE_TOURIST2,
+ WAITSTATE_TOURIST1,
+ WAITSTATE_MAC2_PLEAD,
+ WAITSTATE_JDT6_KNOCK,
+ WAITSTATE_SAL3_SIT_DOWN,
+ WAITSTATE_VIC7_PROD_WITH_FOOT
};
enum eObjective {
@@ -375,7 +456,7 @@ public:
float m_fCollisionSpeed;
// cf. https://github.com/DK22Pac/plugin-sdk/blob/master/plugin_sa/game_sa/CPed.h from R*
- uint32 bIsStanding : 1;
+ uint32 bIsStanding : 1; // 0x194 on PS2, 0x1A4 on android
uint32 bWasStanding : 1;
uint32 bIsAttacking : 1; // doesn't reset after fist fight
uint32 bIsPointingGunAt : 1;
@@ -468,7 +549,7 @@ public:
uint32 bIsDrowning : 1;
uint32 bDrownsInWater : 1;
uint32 bWaitForLeaderToComeCloser : 1;
- uint32 bHeldHostageInCar : 1;
+ uint32 bHeldHostageInCar : 1; // one flag was added somewhere after this one (TODO: figure out where and which)
uint32 bIsPlayerFriend : 1;
uint32 bHeadStuckInCollision : 1;
uint32 bDeadPedInFrontOfCar : 1;
@@ -481,7 +562,7 @@ public:
uint32 bMakeFleeScream : 1;
uint32 bPushedAlongByCar : 1;
uint32 bRemoveMeWhenIGotIntoCar : 1;
- uint32 bIgnoreThreatsBehindObjects : 1;
+ uint32 bIgnoreThreatsBehindObjects : 1; // one flag was added somewhere before this one (TODO: figure out where and which)
uint32 bNeverEverTargetThisPed : 1;
uint32 bCrouchWhenScared : 1;
@@ -490,18 +571,42 @@ public:
uint32 bCollectBusFare : 1;
uint32 bBoughtIceCream : 1;
uint32 bDonePositionOutOfCollision : 1;
- uint32 bCanAttackPlayerWithCops : 1;
+
+ uint32 bCanAttackPlayerWithCops : 1; // 1A1_1 on PS2
+ uint32 bOnlyAllowedToSitBehind : 1;
+ uint32 bOnlyAllowedToSitInFront : 1;
+ uint32 b1A1_8 : 1;
+ uint32 b1A1_10 : 1;
+ uint32 bOverrideMoveAnim : 1;
#ifdef KANGAROO_CHEAT
// our own flags
uint32 m_ped_flagI80 : 1; // KANGAROO_CHEAT define makes use of this as cheat toggle
#endif
- uint8 m_gangFlags;
- uint8 m_unused15D; // these 3 can't be padding but had to actually have been members ...
- uint8 m_unused15E;
- uint8 m_unused15F;
- uint8 CharCreatedBy;
+ uint16 m_gangFlags; // <- this one is uint16
+
+ uint8 bDropsWeaponsOnDeath : 1;
+ uint8 b1A4_2 : 1;
+ uint8 bAttacksPlayerWithCops : 1;
+ uint8 b1A4_8 : 1;
+ uint8 b1A4_10 : 1;
+ uint8 b1A4_20 : 1;
+ uint8 b1A4_40 : 1;
+ uint8 b1A4_80 : 1;
+
+ uint8 bCanBeTargettedByLeader : 1;
+ uint8 b1A5_2 : 1;
+ uint8 b1A5_4 : 1;
+ uint8 b1A5_8 : 1;
+ uint8 b1A5_10 : 1;
+ uint8 b1A5_20 : 1;
+ uint8 b1A5_40 : 1;
+ uint8 b1A5_80 : 1;
+
+ uint8 unk_1A6; // <- init with 100 in constructor
+
+ uint8 CharCreatedBy; // 1AC
eObjective m_objective;
eObjective m_prevObjective;
CPed *m_pedInObjective;
@@ -550,6 +655,8 @@ public:
float m_fHealth;
float m_fArmour;
uint32 m_nExtendedRangeTimer;
+ uint32 m_nScriptShootTimer;
+ uint32 m_nScriptAttackTimer;
int16 m_routeLastPoint;
uint16 m_routeStartPoint;
int16 m_routePointsPassed;
@@ -649,6 +756,7 @@ public:
uint32 m_lastComment;
CVector m_vecSpotToGuard;
float m_radiusToGuard;
+ float m_fMaxHealth;
static void *operator new(size_t) throw();
static void *operator new(size_t, int) throw();
@@ -718,6 +826,7 @@ public:
void SetObjective(eObjective);
void SetObjective(eObjective, int16, int16);
void SetObjective(eObjective, CVector);
+ void SetObjective(eObjective, CVector, float);
void SetObjective(eObjective, float, const CVector&);
void ClearChat(void);
void InformMyGangOfAttack(CEntity*);
@@ -767,7 +876,7 @@ public:
void SetEvasiveDive(CPhysical*, uint8);
void SetAttack(CEntity*);
void StartFightAttack(uint8);
- void SetWaitState(eWaitState, void*);
+ void SetWaitState(eWaitState, void*, bool repeat = false);
bool FightStrike(CVector&, bool);
void FightHitPed(CPed*, CVector&, CVector&, int16);
int32 ChooseAttackPlayer(uint8, bool);
@@ -850,6 +959,7 @@ public:
void SetSolicit(uint32 time);
void ScanForInterestingStuff(void);
void WarpPedIntoCar(CVehicle*);
+ void WarpPedIntoCarAsPassenger(CVehicle*, int32);
void SetCarJack(CVehicle*);
bool WarpPedToNearLeaderOffScreen(void);
void Solicit(void);
@@ -1004,6 +1114,16 @@ public:
{
return m_pMyVehicle != nil && ((CEntity*)m_pMyVehicle)->GetStatus() != STATUS_WRECKED;
}
+ bool CanStartMission() // used in CAN_PLAYER_START_MISSION and can looks like inlined function
+ {
+ if (m_nPedState >= PED_WANDER_RANGE && m_nPedState < PED_STATES_NO_AI && m_nPedState != PED_ANSWER_MOBILE)
+ return false;
+ if (m_nPedState >= PED_JUMP && m_nPedState < PED_STATES_NO_ST)
+ return false;
+ if (m_nPedState >= PED_ENTER_TRAIN && m_nPedState < PED_DEPLOY_STINGER)
+ return false;
+ return !bIsInTheAir && !bIsLanding && m_fHealth > 0.0f;
+ }
// My names. Inlined in VC
AnimationId GetFireAnimNotDucking(CWeaponInfo* weapon) {
@@ -1022,7 +1142,7 @@ public:
static AnimationId GetFireAnimGround(CWeaponInfo* weapon, bool kickFloorIfNone = true) {
if (weapon->IsFlagSet(WEAPONFLAG_GROUND_2ND))
- return ANIM_WEAPON_CROUCHFIRE;
+ return ANIM_ATTACK_2;
else if (weapon->IsFlagSet(WEAPONFLAG_GROUND_3RD))
return ANIM_WEAPON_FIRE_3RD;
else if (kickFloorIfNone)
@@ -1035,26 +1155,26 @@ public:
if (weapon->IsFlagSet(WEAPONFLAG_ANIMDETONATE))
return ANIM_STD_DETONATE;
else
- return ANIM_WEAPON_FIRE;
+ return ANIM_ATTACK_1;
}
static AnimationId GetCrouchReloadAnim(CWeaponInfo* weapon) {
if (weapon->IsFlagSet(WEAPONFLAG_RELOAD))
- return ANIM_WEAPON_CROUCHRELOAD;
+ return ANIM_ATTACK_EXTRA2;
else
return (AnimationId)0;
}
static AnimationId GetCrouchFireAnim(CWeaponInfo* weapon) {
if (weapon->IsFlagSet(WEAPONFLAG_CROUCHFIRE))
- return ANIM_WEAPON_CROUCHFIRE;
+ return ANIM_ATTACK_2;
else
return (AnimationId)0;
}
static AnimationId GetReloadAnim(CWeaponInfo* weapon) {
if (weapon->IsFlagSet(WEAPONFLAG_RELOAD))
- return ANIM_WEAPON_RELOAD;
+ return ANIM_ATTACK_EXTRA1;
else
return (AnimationId)0;
}
@@ -1155,6 +1275,9 @@ public:
static bool bPedCheat3;
static CVector2D ms_vec2DFleePosition;
+ static void LoadNonStandardPedAnim(eWaitState waitState);
+ static void UnloadNonStandardPedAnim(eWaitState waitState);
+
#ifndef MASTER
// Mobile things
void DebugDrawPedDestination(CPed *, int, int);
diff --git a/src/peds/PedAI.cpp b/src/peds/PedAI.cpp
index e204dad9..73522fe3 100644
--- a/src/peds/PedAI.cpp
+++ b/src/peds/PedAI.cpp
@@ -362,6 +362,51 @@ CPed::SetObjective(eObjective newObj, void *entity)
}
}
+void
+CPed::SetObjective(eObjective newObj, CVector dest, float safeDist)
+{
+ if (DyingOrDead())
+ return;
+
+ if (m_prevObjective != OBJECTIVE_NONE && m_prevObjective == newObj)
+ return;
+
+ if (m_objective == newObj) {
+ if (newObj == OBJECTIVE_GOTO_AREA_ANY_MEANS || newObj == OBJECTIVE_GOTO_AREA_ON_FOOT || newObj == OBJECTIVE_RUN_TO_AREA || newObj == OBJECTIVE_SPRINT_TO_AREA) {
+ if (m_nextRoutePointPos == dest && m_distanceToCountSeekDone == safeDist)
+ return;
+ }
+ else if (newObj == OBJECTIVE_GUARD_SPOT) {
+ if (m_vecSpotToGuard == dest && m_radiusToGuard == safeDist)
+ return;
+ }
+ }
+
+ ClearPointGunAt();
+ SetObjectiveTimer(0);
+ bObjectiveCompleted = false;
+ if (IsTemporaryObjective(m_objective)) {
+ m_prevObjective = newObj;
+ }
+ else {
+ if (m_objective != newObj)
+ SetStoredObjective();
+
+ m_objective = newObj;
+ }
+
+ if (newObj == OBJECTIVE_GUARD_SPOT) {
+ m_vecSpotToGuard = dest;
+ m_radiusToGuard = safeDist;
+ }
+ else if (newObj == OBJECTIVE_GOTO_AREA_ANY_MEANS || newObj == OBJECTIVE_GOTO_AREA_ON_FOOT || newObj == OBJECTIVE_RUN_TO_AREA || newObj == OBJECTIVE_SPRINT_TO_AREA) {
+ m_pNextPathNode = nil;
+ m_nextRoutePointPos = dest;
+ m_vecSeekPos = m_nextRoutePointPos;
+ bUsePedNodeSeek = true;
+ }
+}
+
// Only used in 01E1: SET_CHAR_OBJ_FOLLOW_ROUTE opcode
// IDA fails very badly in here, puts a fake loop and ignores SetFollowRoute call...
void
@@ -6454,7 +6499,7 @@ CPed::KillCharOnFootArmed(CVector &ourPos, CVector &targetPos, CVector &distWith
}
}
if (m_pedInObjective->IsPlayer() && m_nPedType != PEDTYPE_COP
- && CharCreatedBy != MISSION_CHAR && FindPlayerPed()->m_pWanted->m_CurrentCops != 0) {
+ && CharCreatedBy != MISSION_CHAR && FindPlayerPed()->m_pWanted->m_CurrentCops != 0/* TODO: && !bAttacksPlayerWithCops*/) {
SetObjective(OBJECTIVE_FLEE_ON_FOOT_TILL_SAFE);
return CANT_ATTACK;
diff --git a/src/peds/PedFight.cpp b/src/peds/PedFight.cpp
index 8e377c81..7ec8b7dd 100644
--- a/src/peds/PedFight.cpp
+++ b/src/peds/PedFight.cpp
@@ -31,6 +31,7 @@ RpClump* flyingClumpTemp;
FightMove tFightMoves[NUM_FIGHTMOVES] =
{
+/*
{ ANIM_STD_NUM, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, HITLEVEL_NULL, 0, 0 },
{ ANIM_STD_PUNCH, 0.2f, 8.f/30.f, 0.0f, 0.3f, 1.0f, HITLEVEL_HIGH, 1, 0 },
{ ANIM_STD_FIGHT_IDLE, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, HITLEVEL_NULL, 0, 0 },
@@ -63,6 +64,7 @@ FightMove tFightMoves[NUM_FIGHTMOVES] =
{ ANIM_ATTACK_2, 4.f/30.f, 7.f/30.f, 10.f/30.f, 0.4f, 1.0f, HITLEVEL_HIGH, 1, 0 },
{ ANIM_ATTACK_3, 4.f / 30.f, 7.f / 30.f, 10.f / 30.f, 0.4f, 1.0f, HITLEVEL_HIGH, 1, 0 },
{ ANIM_STD_FIGHT_2IDLE, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, HITLEVEL_NULL, 0, 0 }
+*/
};
static PedOnGroundState
@@ -182,14 +184,14 @@ CPed::SetPointGunAt(CEntity *to)
if (bCrouchWhenShooting && bIsDucking && GetCrouchFireAnim(curWeapon)) {
aimAssoc = RpAnimBlendClumpGetAssociation(GetClump(), GetCrouchFireAnim(curWeapon));
} else {
- aimAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_WEAPON_FIRE);
+ aimAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_ATTACK_1);
}
if (!aimAssoc || aimAssoc->blendDelta < 0.0f) {
if (bCrouchWhenShooting && bIsDucking && GetCrouchFireAnim(curWeapon)) {
aimAssoc = CAnimManager::BlendAnimation(GetClump(), curWeapon->m_AnimToPlay, GetCrouchFireAnim(curWeapon), 4.0f);
} else {
- aimAssoc = CAnimManager::AddAnimation(GetClump(), curWeapon->m_AnimToPlay, ANIM_WEAPON_FIRE);
+ aimAssoc = CAnimManager::AddAnimation(GetClump(), curWeapon->m_AnimToPlay, ANIM_ATTACK_1);
}
aimAssoc->blendAmount = 0.0f;
@@ -204,7 +206,7 @@ CPed::PointGunAt(void)
{
CWeaponInfo *weaponInfo = CWeaponInfo::GetWeaponInfo(GetWeapon()->m_eWeaponType);
float animLoopStart = weaponInfo->m_fAnimLoopStart;
- CAnimBlendAssociation *weaponAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_WEAPON_FIRE);
+ CAnimBlendAssociation *weaponAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_ATTACK_1);
if (!weaponAssoc || weaponAssoc->blendDelta < 0.0f) {
if (weaponInfo->IsFlagSet(WEAPONFLAG_CROUCHFIRE)) {
weaponAssoc = RpAnimBlendClumpGetAssociation(GetClump(), GetCrouchFireAnim(weaponInfo));
@@ -240,7 +242,7 @@ CPed::ClearPointGunAt(void)
RestorePreviousState();
}
weaponInfo = CWeaponInfo::GetWeaponInfo(GetWeapon()->m_eWeaponType);
- animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_WEAPON_FIRE);
+ animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_ATTACK_1);
if (!animAssoc || animAssoc->blendDelta < 0.0f) {
if (weaponInfo->IsFlagSet(WEAPONFLAG_CROUCHFIRE)) {
animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), GetCrouchFireAnim(weaponInfo));
@@ -996,7 +998,7 @@ CPed::Attack(void)
weaponAnimAssoc->SetFinishCallback(FinishedAttackCB, this);
} else if (GetSecondFireAnim(ourWeapon)) {
if (weaponAnimAssoc->animId == GetSecondFireAnim(ourWeapon)) {
- weaponAnimAssoc = CAnimManager::BlendAnimation(GetClump(), ourWeapon->m_AnimToPlay, ANIM_WEAPON_FIRE, 8.0f);
+ weaponAnimAssoc = CAnimManager::BlendAnimation(GetClump(), ourWeapon->m_AnimToPlay, ANIM_ATTACK_1, 8.0f);
} else {
weaponAnimAssoc = CAnimManager::BlendAnimation(GetClump(), ourWeapon->m_AnimToPlay, GetSecondFireAnim(ourWeapon), 8.0f);
}
@@ -1102,10 +1104,7 @@ CPed::StartFightAttack(uint8 buttonPressure)
break;
}
} else {
- if (m_curFightMove == FIGHTMOVE_BACKKICK)
- animAssoc->speed = 1.15f;
- else
- animAssoc->speed = 0.8f;
+ animAssoc->speed = 0.8f;
}
if (IsPlayer())
animAssoc->SetCurrentTime(0.08f);
@@ -1213,12 +1212,14 @@ CPed::StartFightDefend(uint8 direction, uint8 hitLevel, uint8 unk)
default:
if (hitLevel == HITLEVEL_LOW) {
hitAnim = ANIM_STD_KO_SHOT_STOMACH;
+/* LCS: removed
} else if (CGeneral::GetRandomNumber() & 1) {
fall = false;
hitAnim = ANIM_STD_HIT_WALK;
} else if (CGeneral::GetRandomNumber() & 1) {
fall = false;
hitAnim = ANIM_STD_HIT_HEAD;
+*/
} else {
hitAnim = ANIM_STD_KO_SHOT_FACE;
}
@@ -1253,7 +1254,7 @@ CPed::StartFightDefend(uint8 direction, uint8 hitLevel, uint8 unk)
Say(SOUND_PED_DEFEND);
return;
}
- m_curFightMove = FIGHTMOVE_HITBODY;
+ m_curFightMove = FIGHTMOVE_HITFRONT; // LCS
break;
case HITLEVEL_HIGH:
switch (direction) {
@@ -1267,10 +1268,12 @@ CPed::StartFightDefend(uint8 direction, uint8 hitLevel, uint8 unk)
m_curFightMove = FIGHTMOVE_HITRIGHT;
break;
default:
- if (unk <= 5)
- m_curFightMove = FIGHTMOVE_HITHEAD;
- else
- m_curFightMove = FIGHTMOVE_HITBIGSTEP;
+ // LCS: removed
+ //if (unk <= 5)
+ // m_curFightMove = FIGHTMOVE_HITHEAD;
+ //else
+ // m_curFightMove = FIGHTMOVE_HITBIGSTEP;
+ m_curFightMove = FIGHTMOVE_HITFRONT;
break;
}
break;
@@ -1286,10 +1289,12 @@ CPed::StartFightDefend(uint8 direction, uint8 hitLevel, uint8 unk)
m_curFightMove = FIGHTMOVE_HITRIGHT;
break;
default:
- if (unk <= 5)
- m_curFightMove = FIGHTMOVE_HITCHEST;
- else
- m_curFightMove = FIGHTMOVE_HITBIGSTEP;
+ // LCS: removed
+ //if (unk <= 5)
+ // m_curFightMove = FIGHTMOVE_HITCHEST;
+ //else
+ // m_curFightMove = FIGHTMOVE_HITBIGSTEP;
+ m_curFightMove = FIGHTMOVE_HITFRONT;
break;
}
break;
@@ -1442,30 +1447,30 @@ CPed::Fight(void)
CVector touchingNodePos(0.0f, 0.0f, 0.0f);
switch (m_curFightMove) {
- case FIGHTMOVE_KNEE:
- TransformToNode(touchingNodePos, PED_LOWERLEGR);
- break;
- case FIGHTMOVE_PUNCHHOOK:
- case FIGHTMOVE_PUNCHJAB:
- TransformToNode(touchingNodePos, PED_HANDL);
- break;
+ // case FIGHTMOVE_KNEE:
+ // TransformToNode(touchingNodePos, PED_LOWERLEGR);
+ // break;
+ // case FIGHTMOVE_PUNCHHOOK:
+ // case FIGHTMOVE_PUNCHJAB:
+ // TransformToNode(touchingNodePos, PED_HANDL);
+ // break;
case FIGHTMOVE_LONGKICK:
case FIGHTMOVE_ROUNDHOUSE:
- case FIGHTMOVE_FWDLEFT:
- case FIGHTMOVE_BACKRIGHT:
+ // case FIGHTMOVE_FWDLEFT:
+ // case FIGHTMOVE_BACKRIGHT:
case FIGHTMOVE_GROUNDKICK:
TransformToNode(touchingNodePos, PED_FOOTR);
break;
case FIGHTMOVE_FWDRIGHT:
TransformToNode(touchingNodePos, PED_HEAD);
break;
- case FIGHTMOVE_BACKKICK:
- case FIGHTMOVE_BACKFLIP:
- TransformToNode(touchingNodePos, PED_FOOTL);
- break;
- case FIGHTMOVE_BACKLEFT:
- TransformToNode(touchingNodePos, PED_UPPERARML);
- break;
+ // case FIGHTMOVE_BACKKICK:
+ // case FIGHTMOVE_BACKFLIP:
+ // TransformToNode(touchingNodePos, PED_FOOTL);
+ // break;
+ // case FIGHTMOVE_BACKLEFT:
+ // TransformToNode(touchingNodePos, PED_UPPERARML);
+ // break;
default:
TransformToNode(touchingNodePos, PED_HANDR);
break;
@@ -1517,10 +1522,7 @@ CPed::Fight(void)
tFightMoves[m_curFightMove].animId, 8.0f);
if (weaponInfo->m_AnimToPlay != ASSOCGRP_KNIFE || m_curFightMove < FIGHTMOVE_MELEE1) {
- if (m_curFightMove == FIGHTMOVE_BACKKICK)
- animAssoc->speed = 1.15f;
- else
- animAssoc->speed = 0.8f;
+ animAssoc->speed = 0.8f;
} else {
switch (GetWeapon()->m_eWeaponType) {
case WEAPONTYPE_SCREWDRIVER:
@@ -1660,8 +1662,9 @@ CPed::ChooseAttackAI(uint8 buttonPressure, bool fightWithWeapon)
return FIGHTMOVE_IDLE;
}
}
- if (dist < 0.95f && canKneeHead)
- return FIGHTMOVE_KNEE;
+ // LCS: removed
+ //if (dist < 0.95f && canKneeHead)
+ // return FIGHTMOVE_KNEE;
if (dist < 1.4f)
return FIGHTMOVE_PUNCH;
if (dist < 2.f && canKick) {
@@ -1779,9 +1782,11 @@ CPed::ChooseAttackPlayer(uint8 buttonPressure, bool fightWithWeapon)
switch (dir) {
case 0: // forward
if (fightWithWeapon) {
- if (distToVictim < 0.95f - 0.2f && m_nPedState == PED_FIGHT) {
- choosenMove = FIGHTMOVE_KNEE;
- } else {
+ // LCS: removed
+ //if (distToVictim < 0.95f - 0.2f && m_nPedState == PED_FIGHT) {
+ // choosenMove = FIGHTMOVE_KNEE;
+ //} else
+ {
if (GetWeapon()->m_eWeaponType == WEAPONTYPE_CLEAVER) {
if (distToVictim < 0.85f * weaponInfo->m_fRange)
choosenMove = FIGHTMOVE_MELEE1;
@@ -1804,18 +1809,20 @@ CPed::ChooseAttackPlayer(uint8 buttonPressure, bool fightWithWeapon)
}
}
}
- } else if (distToVictim < 0.95f && m_nPedState == PED_FIGHT) {
- choosenMove = FIGHTMOVE_KNEE;
+ // LCS: removed
+ //} else if (distToVictim < 0.95f && m_nPedState == PED_FIGHT) {
+ // choosenMove = FIGHTMOVE_KNEE;
} else if (distToVictim < 1.4f) {
- if (m_curFightMove == FIGHTMOVE_PUNCHJAB) {
+ // LCS: removed
+ /*if (m_curFightMove == FIGHTMOVE_PUNCHJAB) {
choosenMove = FIGHTMOVE_PUNCH;
- } else if (m_curFightMove != FIGHTMOVE_PUNCH || randVal != 1) {
- if (randVal == 2)
+ } else*/ if (m_curFightMove != FIGHTMOVE_PUNCH || randVal != 1) {
+ //if (randVal == 2)
choosenMove = FIGHTMOVE_PUNCH;
- else
- choosenMove = FIGHTMOVE_PUNCHJAB;
+ //else
+ // choosenMove = FIGHTMOVE_PUNCHJAB;
} else {
choosenMove = FIGHTMOVE_LONGKICK;
}
@@ -1823,6 +1830,7 @@ CPed::ChooseAttackPlayer(uint8 buttonPressure, bool fightWithWeapon)
choosenMove = FIGHTMOVE_LONGKICK;
}
break;
+/* LCS: removed
case 1:
choosenMove = FIGHTMOVE_FWDLEFT;
break;
@@ -1835,6 +1843,7 @@ CPed::ChooseAttackPlayer(uint8 buttonPressure, bool fightWithWeapon)
case 4:
choosenMove = FIGHTMOVE_BACKRIGHT;
break;
+*/
default:
choosenMove = FIGHTMOVE_FWDRIGHT;
break;
@@ -1900,20 +1909,22 @@ CPed::ChooseAttackPlayer(uint8 buttonPressure, bool fightWithWeapon)
#else
switch (CGeneral::GetRandomNumberInRange(0,3)) {
#endif
- case 0:
- choosenMove = FIGHTMOVE_PUNCHJAB;
- break;
+ // LCS: hack hack
+ // case 0:
+ // choosenMove = FIGHTMOVE_PUNCHJAB;
+ // break;
+ default:
case 1:
choosenMove = FIGHTMOVE_PUNCH;
break;
case 2:
choosenMove = FIGHTMOVE_LONGKICK;
break;
- case 3:
- choosenMove = FIGHTMOVE_KNEE;
- break;
- default:
- break;
+ // case 3:
+ // choosenMove = FIGHTMOVE_KNEE;
+ // break;
+ // default:
+ // break;
}
}
return choosenMove;
@@ -1956,6 +1967,7 @@ CPed::EndFight(uint8 endType)
void
CPed::PlayHitSound(CPed *hitTo)
{
+#if 0 // LCS: temporarily removed
// That was very complicated to reverse for me...
// First index is our fight move ID (from 1 to 17, total 17), second is the one of we fight with (from 18 to 27, total 10).
enum {
@@ -2026,6 +2038,7 @@ CPed::PlayHitSound(CPed *hitTo)
if (soundId != NO_SND)
DMAudio.PlayOneShot(m_audioEntityId, soundId, (weapon << 8) | ENTITY_TYPE_PED);
+#endif
}
bool
@@ -2157,8 +2170,9 @@ CPed::FightHitPed(CPed *victim, CVector &touchPoint, CVector &dir, int16 piece)
bool brassKnucklePunch = false;
if (GetWeapon()->m_eWeaponType == WEAPONTYPE_BRASSKNUCKLE) {
- if (m_curFightMove == FIGHTMOVE_PUNCHHOOK || m_curFightMove == FIGHTMOVE_PUNCHJAB || m_curFightMove == FIGHTMOVE_BACKLEFT ||
- m_curFightMove == FIGHTMOVE_STDPUNCH || m_curFightMove == FIGHTMOVE_PUNCH) {
+ // LCS: removed
+ if (/*m_curFightMove == FIGHTMOVE_PUNCHHOOK || m_curFightMove == FIGHTMOVE_PUNCHJAB || m_curFightMove == FIGHTMOVE_BACKLEFT ||
+ m_curFightMove == FIGHTMOVE_STDPUNCH ||*/ m_curFightMove == FIGHTMOVE_PUNCH) {
brassKnucklePunch = true;
damageMult *= 1.5f;
}
@@ -4146,7 +4160,7 @@ CPed::RemoveWeaponAnims(int unused, float animDelta)
CAnimBlendAssociation *weaponAssoc;
//CWeaponInfo::GetWeaponInfo(unused);
- weaponAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_WEAPON_FIRE);
+ weaponAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_ATTACK_1);
if (weaponAssoc) {
weaponAssoc->blendDelta = animDelta;
weaponAssoc->flags |= ASSOC_DELETEFADEDOUT;
@@ -4161,7 +4175,7 @@ CPed::RemoveWeaponAnims(int unused, float animDelta)
weaponAssoc->blendDelta = animDelta;
weaponAssoc->flags |= ASSOC_DELETEFADEDOUT;
}
- weaponAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_WEAPON_RELOAD);
+ weaponAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_ATTACK_EXTRA1);
if (weaponAssoc) {
weaponAssoc->blendDelta = animDelta;
weaponAssoc->flags |= ASSOC_DELETEFADEDOUT;
diff --git a/src/peds/PedType.h b/src/peds/PedType.h
index a4698bbb..776dd14d 100644
--- a/src/peds/PedType.h
+++ b/src/peds/PedType.h
@@ -95,6 +95,9 @@ VALIDATE_SIZE(CPedType, 0x20);
enum ePedStats
{
+ PEDSTAT_COWARD,
+ PEDSTAT_SHOPPER,
+ PEDSTAT_OLDSHOPPER,
PEDSTAT_PLAYER,
PEDSTAT_COP,
PEDSTAT_MEDIC,
@@ -106,6 +109,8 @@ enum ePedStats
PEDSTAT_GANG5,
PEDSTAT_GANG6,
PEDSTAT_GANG7,
+ PEDSTAT_GANG8,
+ PEDSTAT_GANG9,
PEDSTAT_STREET_GUY,
PEDSTAT_SUIT_GUY,
PEDSTAT_SENSIBLE_GUY,
@@ -128,13 +133,10 @@ enum ePedStats
PEDSTAT_PSYCHO,
PEDSTAT_STEWARD,
PEDSTAT_SPORTSFAN,
- PEDSTAT_SHOPPER,
- PEDSTAT_OLDSHOPPER,
PEDSTAT_BEACH_GUY,
PEDSTAT_BEACH_GIRL,
PEDSTAT_SKATER,
PEDSTAT_STD_MISSION,
- PEDSTAT_COWARD,
NUM_PEDSTATS
};
diff --git a/src/peds/PlayerPed.cpp b/src/peds/PlayerPed.cpp
index 9f75b155..c82fe850 100644
--- a/src/peds/PlayerPed.cpp
+++ b/src/peds/PlayerPed.cpp
@@ -1139,7 +1139,8 @@ void
CPlayerPed::ProcessAnimGroups(void)
{
AssocGroupId groupToSet;
-#ifdef PC_PLAYER_CONTROLS
+//#ifdef PC_PLAYER_CONTROLS
+#if 0 // chainsaw anims missing in LCS
if ((m_fWalkAngle <= -DEGTORAD(50.0f) || m_fWalkAngle >= DEGTORAD(50.0f))
&& TheCamera.Cams[TheCamera.ActiveCam].Using3rdPersonMouseCam()
&& CanStrafeOrMouseControl()) {
diff --git a/src/peds/Population.cpp b/src/peds/Population.cpp
index 384cef99..0f68c679 100644
--- a/src/peds/Population.cpp
+++ b/src/peds/Population.cpp
@@ -1207,10 +1207,11 @@ CPopulation::IsSkateable(CVector const& pos)
return foundCol.surfaceB == SURFACE_TARMAC || foundCol.surfaceB == SURFACE_PAVEMENT;
}
+//--LCS: done
bool
CPopulation::CanJeerAtStripper(int32 model)
{
- return model == MI_WMOBE || model == MI_WMYBE || model == MI_WMOST || model == MI_BMYBB;
+ return false;
}
void
@@ -1242,46 +1243,38 @@ bool
CPopulation::IsMale(int32 model)
{
switch (model) {
- case MI_HMYST:
- case MI_HMOST:
- case MI_HMYRI:
- case MI_HMORI:
- case MI_HMYBE:
- case MI_HMOBE:
- case MI_HMOTR:
- case MI_HMYAP:
- case MI_HMOCA:
- case MI_BMODK:
- case MI_BMYKR:
- case MI_BMYST:
- case MI_BMOST:
- case MI_BMYRI:
- case MI_BMYBE:
- case MI_BMOBE:
- case MI_BMYBU:
- case MI_BMOTR:
- case MI_BMYPI:
- case MI_BMYBB:
- case MI_WMYCR:
- case MI_WMYST:
- case MI_WMOST:
- case MI_WMYRI:
- case MI_WMORI:
- case MI_WMYBE:
- case MI_WMOBE:
- case MI_WMYCW:
- case MI_WMYGO:
- case MI_WMOGO:
- case MI_WMYLG:
- case MI_WMYBU:
- case MI_WMOBU:
- case MI_WMOTR:
- case MI_WMYPI:
- case MI_WMOCA:
- case MI_WMYJG:
- case MI_WMYSK:
-
- // BUG? Why no JMOTO?
+ // TODO(LCS): do this right
+ case MI_TAXI_D:
+ case MI_PIMP:
+ case MI_CRIMINAL01:
+ case MI_CRIMINAL02:
+ case MI_MALE02:
+ case MI_MALE03:
+ case MI_P_MAN1:
+ case MI_P_MAN2:
+ case MI_CT_MAN1:
+ case MI_CT_MAN2:
+ case MI_LI_MAN1:
+ case MI_LI_MAN2:
+ case MI_DOCKER1:
+ case MI_DOCKER2:
+ case MI_SCUM_MAN:
+ case MI_WORKER1:
+ case MI_WORKER2:
+ case MI_B_MAN1:
+ case MI_B_MAN2:
+ case MI_B_MAN3:
+ case MI_MOD_MAN:
+ case MI_ST_MAN:
+ case MI_FAN_MAN1:
+ case MI_FAN_MAN2:
+ case MI_HOS_MAN:
+ case MI_CONST1:
+ case MI_CONST2:
+ case MI_STUD_MAN:
+ case MI_CAS_MAN:
+ case MI_CAMP_MAN:
+ case MI_HITMAN:
return true;
default:
return false;
@@ -1292,41 +1285,34 @@ bool
CPopulation::IsFemale(int32 model)
{
switch (model) {
- case MI_HFYST:
- case MI_HFOST:
- case MI_HFYRI:
- case MI_HFORI:
- case MI_HFYBE:
- case MI_HFOBE:
- case MI_HFYBU:
- case MI_HFYMD:
- case MI_HFYCG:
- case MI_HFYPR:
- case MI_HFOTR:
- case MI_BFYST:
- case MI_BFOST:
- case MI_BFYRI:
- case MI_BFORI:
- case MI_BFYBE:
- case MI_BFOBE:
- case MI_BFYPR:
- case MI_BFOTR:
- case MI_WFYST:
- case MI_WFOST:
- case MI_WFYRI:
- case MI_WFORI:
- case MI_WFYBE:
- case MI_WFOBE:
- case MI_WFOGO:
- case MI_WFYLG:
- case MI_WFYBU:
- case MI_WFYPR:
- case MI_WFOTR:
- case MI_WFYJG:
- case MI_WFYSK:
- case MI_WFYSH:
- case MI_WFOSH:
- case MI_JFOTO:
+ // TODO(LCS): do this right
+ case MI_FEMALE01:
+ case MI_FEMALE02:
+ case MI_FEMALE03:
+ case MI_FATFEMALE01:
+ case MI_FATFEMALE02:
+ case MI_PROSTITUTE:
+ case MI_PROSTITUTE2:
+ case MI_P_WOM1:
+ case MI_P_WOM2:
+ case MI_CT_WOM1:
+ case MI_CT_WOM2:
+ case MI_LI_WOM1:
+ case MI_LI_WOM2:
+ case MI_SCUM_WOM:
+ case MI_B_WOM1:
+ case MI_B_WOM2:
+ case MI_B_WOM3:
+ case MI_MOD_WOM:
+ case MI_ST_WOM:
+ case MI_FAN_WOM:
+ case MI_HOS_WOM:
+ case MI_SHOPPER1:
+ case MI_SHOPPER2:
+ case MI_SHOPPER3:
+ case MI_STUD_WOM:
+ case MI_CAS_WOM:
+ case MI_CAMP_WOM:
return true;
default:
return false;
@@ -1336,23 +1322,7 @@ CPopulation::IsFemale(int32 model)
bool
CPopulation::IsSunbather(int32 model)
{
- switch (model) {
- case MI_HFYBE:
- case MI_HFOBE:
- case MI_HMYBE:
- case MI_HMOBE:
- case MI_BFYBE:
- case MI_BMYBE:
- case MI_BFOBE:
- case MI_BMOBE:
- case MI_WFYBE:
- case MI_WMYBE:
- case MI_WFOBE:
- case MI_WMOBE:
- return true;
- default:
- return false;
- }
+ return false;
}
int32
@@ -1364,13 +1334,13 @@ CPopulation::ComputeRandomisedGangSize(void)
bool
CPopulation::CanSolicitPlayerInCar(int32 model)
{
- return model == MI_HFYPR || model == MI_BFYPR || model == MI_WFYPR;
+ return model == MI_PROSTITUTE || model == MI_PROSTITUTE2;
}
bool
CPopulation::CanSolicitPlayerOnFoot(int32 model)
{
- return model == MI_HFYMD || model == MI_HFYCG || model == MI_BFOTR || model == MI_BMOTR || model == MI_WFOTR || model == MI_WMOTR;
+ return model == MI_B_WOM3 || model == MI_FEMALE01 || model == MI_FEMALE02 || model == MI_FEMALE03;
}
bool