diff options
Diffstat (limited to 'src/peds')
-rw-r--r-- | src/peds/Gangs.cpp | 35 | ||||
-rw-r--r-- | src/peds/Gangs.h | 18 | ||||
-rw-r--r-- | src/peds/Ped.cpp | 77 | ||||
-rw-r--r-- | src/peds/Ped.h | 92 | ||||
-rw-r--r-- | src/peds/PedAI.cpp | 47 | ||||
-rw-r--r-- | src/peds/PedFight.cpp | 124 | ||||
-rw-r--r-- | src/peds/PedType.h | 8 | ||||
-rw-r--r-- | src/peds/PlayerPed.cpp | 3 | ||||
-rw-r--r-- | src/peds/Population.cpp | 160 |
9 files changed, 370 insertions, 194 deletions
diff --git a/src/peds/Gangs.cpp b/src/peds/Gangs.cpp index 2d6d1137..e6de0770 100644 --- a/src/peds/Gangs.cpp +++ b/src/peds/Gangs.cpp @@ -20,23 +20,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 6a3df18b..1009a9b4 100644 --- a/src/peds/Ped.cpp +++ b/src/peds/Ped.cpp @@ -9263,7 +9263,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; @@ -9276,8 +9276,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); @@ -9342,6 +9344,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) { diff --git a/src/peds/Ped.h b/src/peds/Ped.h index 8b091d15..f3271861 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 @@ -375,7 +406,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 +499,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 +512,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 +521,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 +605,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 +706,7 @@ public: uint32 m_lastComment; CVector m_vecSpotToGuard; float m_radiusToGuard; + float m_fMaxHealth; static void *operator new(size_t); static void *operator new(size_t, int); @@ -718,6 +776,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*); @@ -850,6 +909,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 +1064,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) { diff --git a/src/peds/PedAI.cpp b/src/peds/PedAI.cpp index a0769b9c..d0f155c5 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 @@ -6365,7 +6410,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 e8fee649..6c691d2d 100644 --- a/src/peds/PedFight.cpp +++ b/src/peds/PedFight.cpp @@ -31,6 +31,7 @@ RpClump* flyingClumpTemp; FightMove tFightMoves[NUM_FIGHTMOVES] = { +/* { NUM_STD_ANIMS, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, HITLEVEL_NULL, 0, 0 }, { ANIM_PUNCH_R, 0.2f, 8.f/30.f, 0.0f, 0.3f, 1.0f, HITLEVEL_HIGH, 1, 0 }, { ANIM_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_WEAPON_CROUCHFIRE, 4.f/30.f, 7.f/30.f, 10.f/30.f, 0.4f, 1.0f, HITLEVEL_HIGH, 1, 0 }, { ANIM_WEAPON_SPECIAL, 4.f / 30.f, 7.f / 30.f, 10.f / 30.f, 0.4f, 1.0f, HITLEVEL_HIGH, 1, 0 }, { ANIM_FIGHT2_IDLE, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, HITLEVEL_NULL, 0, 0 } +*/ }; static PedOnGroundState @@ -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_KO_SHOT_STOM; +/* LCS: removed } else if (CGeneral::GetRandomNumber() & 1) { fall = false; hitAnim = ANIM_HIT_WALK; } else if (CGeneral::GetRandomNumber() & 1) { fall = false; hitAnim = ANIM_HIT_HEAD; +*/ } else { hitAnim = ANIM_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; } 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 fd0bf643..7308b3fb 100644 --- a/src/peds/PlayerPed.cpp +++ b/src/peds/PlayerPed.cpp @@ -1138,7 +1138,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 5603e2c6..0119b475 100644 --- a/src/peds/Population.cpp +++ b/src/peds/Population.cpp @@ -1205,10 +1205,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 @@ -1240,46 +1241,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; @@ -1290,41 +1283,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; @@ -1334,23 +1320,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 @@ -1362,13 +1332,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 |