mirror of
https://git.rip/DMCA_FUCKER/re3.git
synced 2025-01-11 11:24:09 +00:00
sync with upstream
This commit is contained in:
commit
3cc20d7962
Binary file not shown.
|
@ -84,7 +84,8 @@ public:
|
||||||
|
|
||||||
void SetRun(void) { flags |= ASSOC_RUNNING; }
|
void SetRun(void) { flags |= ASSOC_RUNNING; }
|
||||||
|
|
||||||
inline float GetTimeLeft() { return hierarchy->totalLength - currentTime; }
|
float GetTimeLeft() { return hierarchy->totalLength - currentTime; }
|
||||||
|
float GetProgress() { return currentTime / hierarchy->totalLength; }
|
||||||
|
|
||||||
static CAnimBlendAssociation *FromLink(CAnimBlendLink *l) {
|
static CAnimBlendAssociation *FromLink(CAnimBlendLink *l) {
|
||||||
return (CAnimBlendAssociation*)((uint8*)l - offsetof(CAnimBlendAssociation, link));
|
return (CAnimBlendAssociation*)((uint8*)l - offsetof(CAnimBlendAssociation, link));
|
||||||
|
|
|
@ -134,13 +134,13 @@ AnimAssocDesc aStdAnimDescs[] = {
|
||||||
{ ANIM_DRIVE_LOW_R, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
|
{ ANIM_DRIVE_LOW_R, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
|
||||||
{ ANIM_DRIVEBY_L, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
|
{ ANIM_DRIVEBY_L, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
|
||||||
{ ANIM_DRIVEBY_R, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
|
{ ANIM_DRIVEBY_R, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
|
||||||
{ ANIM_DRIVEBY_L_L, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
|
{ ANIM_DRIVEBY_LOW_L, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
|
||||||
{ ANIM_DRIVEBY_L_R, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
|
{ ANIM_DRIVEBY_LOW_R, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
|
||||||
{ ANIM_CAR_LB, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
|
{ ANIM_CAR_LB, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
|
||||||
{ ANIM_DRIVE_BOAT, ASSOC_DELETEFADEDOUT | ASSOC_DRIVING },
|
{ ANIM_DRIVE_BOAT, ASSOC_DELETEFADEDOUT | ASSOC_DRIVING },
|
||||||
{ ANIM_DRIVE_BOAT_L, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
|
{ ANIM_DRIVE_BOAT_L, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
|
||||||
{ ANIM_DRIVE_BOAT_R, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
|
{ ANIM_DRIVE_BOAT_R, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
|
||||||
{ ANIM_DRIVE_BOAT_BACK, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
|
{ ANIM_BOAT_LB, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
|
||||||
{ ANIM_BIKE_PICKUP_R, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
{ ANIM_BIKE_PICKUP_R, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||||
{ ANIM_BIKE_PICKUP_L, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
{ ANIM_BIKE_PICKUP_L, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||||
{ ANIM_BIKE_PULLUP_R, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
{ ANIM_BIKE_PULLUP_R, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||||
|
@ -899,70 +899,71 @@ char const* aChainsawStrafeRightAnimations[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#define awc(a) ARRAY_SIZE(a), a
|
||||||
const AnimAssocDefinition CAnimManager::ms_aAnimAssocDefinitions[NUM_ANIM_ASSOC_GROUPS] = {
|
const AnimAssocDefinition CAnimManager::ms_aAnimAssocDefinitions[NUM_ANIM_ASSOC_GROUPS] = {
|
||||||
{ "man", "ped", MI_COP, 173, aStdAnimations, aStdAnimDescs },
|
{ "man", "ped", MI_COP, awc(aStdAnimations), aStdAnimDescs },
|
||||||
{ "van", "van", MI_COP, 8, aVanAnimations, aVanAnimDescs },
|
{ "van", "van", MI_COP, awc(aVanAnimations), aVanAnimDescs },
|
||||||
{ "coach", "coach", MI_COP, 5, aCoachAnimations, aCoachAnimDescs },
|
{ "coach", "coach", MI_COP, awc(aCoachAnimations), aCoachAnimDescs },
|
||||||
{ "bikes", "bikes", MI_COP, 18, aBikesAnimations, aBikeAnimDescs },
|
{ "bikes", "bikes", MI_COP, awc(aBikesAnimations), aBikeAnimDescs },
|
||||||
{ "bikev", "bikev", MI_COP, 18, aBikevAnimations, aBikeAnimDescs },
|
{ "bikev", "bikev", MI_COP, awc(aBikevAnimations), aBikeAnimDescs },
|
||||||
{ "bikeh", "bikeh", MI_COP, 18, aBikehAnimations, aBikeAnimDescs },
|
{ "bikeh", "bikeh", MI_COP, awc(aBikehAnimations), aBikeAnimDescs },
|
||||||
{ "biked", "biked", MI_COP, 18, aBikedAnimations, aBikeAnimDescs },
|
{ "biked", "biked", MI_COP, awc(aBikedAnimations), aBikeAnimDescs },
|
||||||
{ "unarmed", "ped", MI_COP, 3, aUnarmedAnimations, aMeleeAnimDescs },
|
{ "unarmed", "ped", MI_COP, awc(aUnarmedAnimations), aMeleeAnimDescs },
|
||||||
{ "screwdrv", "ped", MI_COP, 5, aScrewdriverAnimations, aMeleeAnimDescs },
|
{ "screwdrv", "ped", MI_COP, awc(aScrewdriverAnimations), aMeleeAnimDescs },
|
||||||
{ "knife", "knife", MI_COP, 5, aKnifeAnimations, aMeleeAnimDescs },
|
{ "knife", "knife", MI_COP, awc(aKnifeAnimations), aMeleeAnimDescs },
|
||||||
{ "baseball", "baseball", MI_COP, 5, aBaseballbatAnimations, aSwingAnimDescs },
|
{ "baseball", "baseball", MI_COP, awc(aBaseballbatAnimations), aSwingAnimDescs },
|
||||||
{ "golfclub", "baseball", MI_COP, 5, aGolfclubAnimations, aSwingAnimDescs },
|
{ "golfclub", "baseball", MI_COP, awc(aGolfclubAnimations), aSwingAnimDescs },
|
||||||
{ "chainsaw", "chainsaw", MI_COP, 3, aChainsawAnimations, aMeleeAnimDescs },
|
{ "chainsaw", "chainsaw", MI_COP, awc(aChainsawAnimations), aMeleeAnimDescs },
|
||||||
{ "python", "python", MI_COP, 4, aPythonAnimations, aWeaponAnimDescs },
|
{ "python", "python", MI_COP, awc(aPythonAnimations), aWeaponAnimDescs },
|
||||||
{ "colt45", "colt45", MI_COP, 5, aColtAnimations, aWeaponAnimDescs },
|
{ "colt45", "colt45", MI_COP, awc(aColtAnimations), aWeaponAnimDescs },
|
||||||
{ "shotgun", "shotgun", MI_COP, 2, aShotgunAnimations, aWeaponAnimDescs },
|
{ "shotgun", "shotgun", MI_COP, awc(aShotgunAnimations), aWeaponAnimDescs },
|
||||||
{ "buddy", "buddy", MI_COP, 2, aBuddyAnimations, aWeaponAnimDescs },
|
{ "buddy", "buddy", MI_COP, awc(aBuddyAnimations), aWeaponAnimDescs },
|
||||||
{ "tec", "tec", MI_COP, 4, aTecAnimations, aWeaponAnimDescs },
|
{ "tec", "tec", MI_COP, awc(aTecAnimations), aWeaponAnimDescs },
|
||||||
{ "uzi", "uzi", MI_COP, 4, aUziAnimations, aWeaponAnimDescs },
|
{ "uzi", "uzi", MI_COP, awc(aUziAnimations), aWeaponAnimDescs },
|
||||||
{ "rifle", "rifle", MI_COP, 4, aRifleAnimations, aWeaponAnimDescs },
|
{ "rifle", "rifle", MI_COP, awc(aRifleAnimations), aWeaponAnimDescs },
|
||||||
{ "m60", "m60", MI_COP, 3, aM60Animations, aWeaponAnimDescs },
|
{ "m60", "m60", MI_COP, awc(aM60Animations), aWeaponAnimDescs },
|
||||||
{ "sniper", "sniper", MI_COP, 1, aSniperAnimations, aWeaponAnimDescs },
|
{ "sniper", "sniper", MI_COP, awc(aSniperAnimations), aWeaponAnimDescs },
|
||||||
{ "grenade", "grenade", MI_COP, 3, aThrowAnimations, aWeaponAnimDescs },
|
{ "grenade", "grenade", MI_COP, awc(aThrowAnimations), aWeaponAnimDescs },
|
||||||
{ "flame", "flame", MI_COP, 1, aFlamethrowerAnimations, aWeaponAnimDescs },
|
{ "flame", "flame", MI_COP, awc(aFlamethrowerAnimations), aWeaponAnimDescs },
|
||||||
{ "medic", "medic", MI_COP, 1, aMedicAnimations, aMedicAnimDescs },
|
{ "medic", "medic", MI_COP, awc(aMedicAnimations), aMedicAnimDescs },
|
||||||
{ "sunbathe", "sunbathe", MI_COP, 1, aSunbatheAnimations, aSunbatheAnimDescs },
|
{ "sunbathe", "sunbathe", MI_COP, awc(aSunbatheAnimations), aSunbatheAnimDescs },
|
||||||
{ "playidles", "playidles", MI_COP, 4, aPlayerIdleAnimations, aPlayerIdleAnimDescs },
|
{ "playidles", "playidles", MI_COP, awc(aPlayerIdleAnimations), aPlayerIdleAnimDescs },
|
||||||
{ "riot", "riot", MI_COP, 7, aRiotAnimations, aRiotAnimDescs },
|
{ "riot", "riot", MI_COP, awc(aRiotAnimations), aRiotAnimDescs },
|
||||||
{ "strip", "strip", MI_COP, 7, aStripAnimations, aStripAnimDescs },
|
{ "strip", "strip", MI_COP, awc(aStripAnimations), aStripAnimDescs },
|
||||||
{ "lance", "lance", MI_COP, 1, aLanceAnimations, aSunbatheAnimDescs },
|
{ "lance", "lance", MI_COP, awc(aLanceAnimations), aSunbatheAnimDescs },
|
||||||
{ "player", "ped", MI_COP, 5, aPlayerAnimations, aStdAnimDescs },
|
{ "player", "ped", MI_COP, awc(aPlayerAnimations), aStdAnimDescs },
|
||||||
{ "playerrocket", "ped", MI_COP, 5, aPlayerWithRocketAnimations, aStdAnimDescs },
|
{ "playerrocket", "ped", MI_COP, awc(aPlayerWithRocketAnimations), aStdAnimDescs },
|
||||||
{ "player1armed", "ped", MI_COP, 5, aPlayer1ArmedAnimations, aStdAnimDescs },
|
{ "player1armed", "ped", MI_COP, awc(aPlayer1ArmedAnimations), aStdAnimDescs },
|
||||||
{ "player2armed", "ped", MI_COP, 5, aPlayer2ArmedAnimations, aStdAnimDescs },
|
{ "player2armed", "ped", MI_COP, awc(aPlayer2ArmedAnimations), aStdAnimDescs },
|
||||||
{ "playerBBBat", "ped", MI_COP, 5, aPlayerBBBatAnimations, aStdAnimDescs },
|
{ "playerBBBat", "ped", MI_COP, awc(aPlayerBBBatAnimations), aStdAnimDescs },
|
||||||
{ "playercsaw", "ped", MI_COP, 5, aPlayerChainsawAnimations, aStdAnimDescs },
|
{ "playercsaw", "ped", MI_COP, awc(aPlayerChainsawAnimations), aStdAnimDescs },
|
||||||
{ "shuffle", "ped", MI_COP, 4, aShuffleAnimations, aStdAnimDescs },
|
{ "shuffle", "ped", MI_COP, awc(aShuffleAnimations), aStdAnimDescs },
|
||||||
{ "oldman", "ped", MI_COP, 4, aOldAnimations, aStdAnimDescs },
|
{ "oldman", "ped", MI_COP, awc(aOldAnimations), aStdAnimDescs },
|
||||||
{ "gang1", "ped", MI_COP, 4, aGang1Animations, aStdAnimDescs },
|
{ "gang1", "ped", MI_COP, awc(aGang1Animations), aStdAnimDescs },
|
||||||
{ "gang2", "ped", MI_COP, 4, aGang2Animations, aStdAnimDescs },
|
{ "gang2", "ped", MI_COP, awc(aGang2Animations), aStdAnimDescs },
|
||||||
{ "fatman", "ped", MI_COP, 4, aFatAnimations, aStdAnimDescs },
|
{ "fatman", "ped", MI_COP, awc(aFatAnimations), aStdAnimDescs },
|
||||||
{ "oldfatman", "ped", MI_COP, 4, aOldFatAnimations, aStdAnimDescs },
|
{ "oldfatman", "ped", MI_COP, awc(aOldFatAnimations), aStdAnimDescs },
|
||||||
{ "jogger", "ped", MI_COP, 4, aJoggerAnimations, aStdAnimDescs },
|
{ "jogger", "ped", MI_COP, awc(aJoggerAnimations), aStdAnimDescs },
|
||||||
{ "woman", "ped", MI_COP, 4, aStdWomanAnimations, aStdAnimDescs },
|
{ "woman", "ped", MI_COP, awc(aStdWomanAnimations), aStdAnimDescs },
|
||||||
{ "shopping", "ped", MI_COP, 4, aWomanShopAnimations, aStdAnimDescs },
|
{ "shopping", "ped", MI_COP, awc(aWomanShopAnimations), aStdAnimDescs },
|
||||||
{ "busywoman", "ped", MI_COP, 4, aBusyWomanAnimations, aStdAnimDescs },
|
{ "busywoman", "ped", MI_COP, awc(aBusyWomanAnimations), aStdAnimDescs },
|
||||||
{ "sexywoman", "ped", MI_COP, 4, aSexyWomanAnimations, aStdAnimDescs },
|
{ "sexywoman", "ped", MI_COP, awc(aSexyWomanAnimations), aStdAnimDescs },
|
||||||
{ "fatwoman", "ped", MI_COP, 4, aFatWomanAnimations, aStdAnimDescs },
|
{ "fatwoman", "ped", MI_COP, awc(aFatWomanAnimations), aStdAnimDescs },
|
||||||
{ "oldwoman", "ped", MI_COP, 4, aOldWomanAnimations, aStdAnimDescs },
|
{ "oldwoman", "ped", MI_COP, awc(aOldWomanAnimations), aStdAnimDescs },
|
||||||
{ "jogwoman", "ped", MI_COP, 4, aJoggerWomanAnimations, aStdAnimDescs },
|
{ "jogwoman", "ped", MI_COP, awc(aJoggerWomanAnimations), aStdAnimDescs },
|
||||||
{ "panicchunky", "ped", MI_COP, 4, aPanicChunkyAnimations, aStdAnimDescs },
|
{ "panicchunky", "ped", MI_COP, awc(aPanicChunkyAnimations), aStdAnimDescs },
|
||||||
{ "skate", "skate", MI_COP, 4, aSkateAnimations, aStdAnimDescs },
|
{ "skate", "skate", MI_COP, awc(aSkateAnimations), aStdAnimDescs },
|
||||||
{ "playerback", "ped", MI_COP, 5, aPlayerStrafeBackAnimations, aStdAnimDescs },
|
{ "playerback", "ped", MI_COP, awc(aPlayerStrafeBackAnimations), aStdAnimDescs },
|
||||||
{ "playerleft", "ped", MI_COP, 5, aPlayerStrafeLeftAnimations, aStdAnimDescsSide },
|
{ "playerleft", "ped", MI_COP, awc(aPlayerStrafeLeftAnimations), aStdAnimDescsSide },
|
||||||
{ "playerright", "ped", MI_COP, 5, aPlayerStrafeRightAnimations, aStdAnimDescsSide },
|
{ "playerright", "ped", MI_COP, awc(aPlayerStrafeRightAnimations), aStdAnimDescsSide },
|
||||||
{ "rocketback", "ped", MI_COP, 5, aRocketStrafeBackAnimations, aStdAnimDescs },
|
{ "rocketback", "ped", MI_COP, awc(aRocketStrafeBackAnimations), aStdAnimDescs },
|
||||||
{ "rocketleft", "ped", MI_COP, 5, aRocketStrafeLeftAnimations, aStdAnimDescsSide },
|
{ "rocketleft", "ped", MI_COP, awc(aRocketStrafeLeftAnimations), aStdAnimDescsSide },
|
||||||
{ "rocketright", "ped", MI_COP, 5, aRocketStrafeRightAnimations, aStdAnimDescsSide },
|
{ "rocketright", "ped", MI_COP, awc(aRocketStrafeRightAnimations), aStdAnimDescsSide },
|
||||||
{ "csawback", "ped", MI_COP, 5, aChainsawStrafeBackAnimations, aStdAnimDescs },
|
{ "csawback", "ped", MI_COP, awc(aChainsawStrafeBackAnimations), aStdAnimDescs },
|
||||||
{ "csawleft", "ped", MI_COP, 5, aChainsawStrafeLeftAnimations, aStdAnimDescsSide },
|
{ "csawleft", "ped", MI_COP, awc(aChainsawStrafeLeftAnimations), aStdAnimDescsSide },
|
||||||
{ "csawright", "ped", MI_COP, 5, aChainsawStrafeRightAnimations, aStdAnimDescsSide },
|
{ "csawright", "ped", MI_COP, awc(aChainsawStrafeRightAnimations), aStdAnimDescsSide },
|
||||||
};
|
};
|
||||||
|
#undef awc
|
||||||
|
|
||||||
void
|
void
|
||||||
CAnimManager::Initialise(void)
|
CAnimManager::Initialise(void)
|
||||||
|
|
|
@ -118,13 +118,13 @@ enum AnimationId
|
||||||
ANIM_DRIVE_LOW_R,
|
ANIM_DRIVE_LOW_R,
|
||||||
ANIM_DRIVEBY_L,
|
ANIM_DRIVEBY_L,
|
||||||
ANIM_DRIVEBY_R,
|
ANIM_DRIVEBY_R,
|
||||||
ANIM_DRIVEBY_L_L, // TODO: is this LOW?
|
ANIM_DRIVEBY_LOW_L,
|
||||||
ANIM_DRIVEBY_L_R,
|
ANIM_DRIVEBY_LOW_R,
|
||||||
ANIM_CAR_LB,
|
ANIM_CAR_LB,
|
||||||
ANIM_DRIVE_BOAT,
|
ANIM_DRIVE_BOAT,
|
||||||
ANIM_DRIVE_BOAT_L,
|
ANIM_DRIVE_BOAT_L,
|
||||||
ANIM_DRIVE_BOAT_R,
|
ANIM_DRIVE_BOAT_R,
|
||||||
ANIM_DRIVE_BOAT_BACK,
|
ANIM_BOAT_LB,
|
||||||
|
|
||||||
ANIM_BIKE_PICKUP_R,
|
ANIM_BIKE_PICKUP_R,
|
||||||
ANIM_BIKE_PICKUP_L,
|
ANIM_BIKE_PICKUP_L,
|
||||||
|
|
6502
src/audio/AudioLogic.cpp
Normal file
6502
src/audio/AudioLogic.cpp
Normal file
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -75,7 +75,18 @@ public:
|
||||||
uint8 m_nCommentsInBank[NUM_PED_COMMENTS_BANKS];
|
uint8 m_nCommentsInBank[NUM_PED_COMMENTS_BANKS];
|
||||||
uint8 m_nActiveBank;
|
uint8 m_nActiveBank;
|
||||||
|
|
||||||
cPedComments();
|
cPedComments()
|
||||||
|
{
|
||||||
|
for (int i = 0; i < NUM_PED_COMMENTS_SLOTS; i++)
|
||||||
|
for (int j = 0; j < NUM_PED_COMMENTS_BANKS; j++) {
|
||||||
|
m_asPedComments[j][i].m_nProcess = -1;
|
||||||
|
m_nIndexMap[j][i] = NUM_PED_COMMENTS_SLOTS;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < NUM_PED_COMMENTS_BANKS; i++)
|
||||||
|
m_nCommentsInBank[i] = 0;
|
||||||
|
m_nActiveBank = 0;
|
||||||
|
}
|
||||||
void Add(tPedComment *com);
|
void Add(tPedComment *com);
|
||||||
void Process();
|
void Process();
|
||||||
};
|
};
|
||||||
|
@ -222,91 +233,15 @@ public:
|
||||||
float speedMultiplier) const;
|
float speedMultiplier) const;
|
||||||
int32 ComputePan(float, CVector *);
|
int32 ComputePan(float, CVector *);
|
||||||
uint8 ComputeVolume(uint8 emittingVolume, float soundIntensity, float distance) const;
|
uint8 ComputeVolume(uint8 emittingVolume, float soundIntensity, float distance) const;
|
||||||
int32 CreateEntity(int32 type, void *entity);
|
int32 CreateEntity(eAudioType type, void *entity);
|
||||||
|
|
||||||
void DestroyAllGameCreatedEntities();
|
void DestroyAllGameCreatedEntities();
|
||||||
void DestroyEntity(int32 id);
|
void DestroyEntity(int32 id);
|
||||||
void DoJumboVolOffset() const;
|
|
||||||
void DoPoliceRadioCrackle();
|
void DoPoliceRadioCrackle();
|
||||||
|
|
||||||
// functions returning talk sfx,
|
// functions returning talk sfx,
|
||||||
// order from GetPedCommentSfx
|
// order from GetPedCommentSfx
|
||||||
uint32 GetPlayerTalkSfx(int16 sound);
|
// TODO: miami
|
||||||
uint32 GetCopTalkSfx(int16 sound);
|
|
||||||
uint32 GetSwatTalkSfx(int16 sound);
|
|
||||||
uint32 GetFBITalkSfx(int16 sound);
|
|
||||||
uint32 GetArmyTalkSfx(int16 sound);
|
|
||||||
uint32 GetMedicTalkSfx(int16 sound);
|
|
||||||
uint32 GetFiremanTalkSfx(int16 sound);
|
|
||||||
uint32 GetNormalMaleTalkSfx(int16 sound);
|
|
||||||
uint32 GetTaxiDriverTalkSfx(int16 sound);
|
|
||||||
uint32 GetPimpTalkSfx(int16 sound);
|
|
||||||
uint32 GetMafiaTalkSfx(int16 sound);
|
|
||||||
uint32 GetTriadTalkSfx(int16 sound);
|
|
||||||
uint32 GetDiabloTalkSfx(int16 sound);
|
|
||||||
uint32 GetYakuzaTalkSfx(int16 sound);
|
|
||||||
uint32 GetYardieTalkSfx(int16 sound);
|
|
||||||
uint32 GetColumbianTalkSfx(int16 sound);
|
|
||||||
uint32 GetHoodTalkSfx(int16 sound);
|
|
||||||
uint32 GetBlackCriminalTalkSfx(int16 sound);
|
|
||||||
uint32 GetWhiteCriminalTalkSfx(int16 sound);
|
|
||||||
uint32 GetMaleNo2TalkSfx(int16 sound);
|
|
||||||
uint32 GetBlackProjectMaleTalkSfx(int16 sound, int32 model);
|
|
||||||
uint32 GetWhiteFatMaleTalkSfx(int16 sound);
|
|
||||||
uint32 GetBlackFatMaleTalkSfx(int16 sound);
|
|
||||||
uint32 GetBlackCasualFemaleTalkSfx(int16 sound);
|
|
||||||
uint32 GetWhiteCasualFemaleTalkSfx(int16 sound);
|
|
||||||
uint32 GetFemaleNo3TalkSfx(int16 sound);
|
|
||||||
uint32 GetBlackFatFemaleTalkSfx(int16 sound);
|
|
||||||
uint32 GetWhiteFatFemaleTalkSfx(int16 sound);
|
|
||||||
uint32 GetBlackFemaleProstituteTalkSfx(int16 sound);
|
|
||||||
uint32 GetWhiteFemaleProstituteTalkSfx(int16 sound);
|
|
||||||
uint32 GetBlackProjectFemaleOldTalkSfx(int16 sound);
|
|
||||||
uint32 GetBlackProjectFemaleYoungTalkSfx(int16 sound);
|
|
||||||
uint32 GetChinatownMaleOldTalkSfx(int16 sound);
|
|
||||||
uint32 GetChinatownMaleYoungTalkSfx(int16 sound);
|
|
||||||
uint32 GetChinatownFemaleOldTalkSfx(int16 sound);
|
|
||||||
uint32 GetChinatownFemaleYoungTalkSfx(int16 sound);
|
|
||||||
uint32 GetLittleItalyMaleTalkSfx(int16 sound);
|
|
||||||
uint32 GetLittleItalyFemaleOldTalkSfx(int16 sound);
|
|
||||||
uint32 GetLittleItalyFemaleYoungTalkSfx(int16 sound);
|
|
||||||
uint32 GetWhiteDockerMaleTalkSfx(int16 sound);
|
|
||||||
uint32 GetBlackDockerMaleTalkSfx(int16 sound);
|
|
||||||
uint32 GetScumMaleTalkSfx(int16 sound);
|
|
||||||
uint32 GetScumFemaleTalkSfx(int16 sound);
|
|
||||||
uint32 GetWhiteWorkerMaleTalkSfx(int16 sound);
|
|
||||||
uint32 GetBlackWorkerMaleTalkSfx(int16 sound);
|
|
||||||
uint32 GetBusinessMaleYoungTalkSfx(int16 sound, int32 model);
|
|
||||||
uint32 GetBusinessMaleOldTalkSfx(int16 sound);
|
|
||||||
uint32 GetWhiteBusinessFemaleTalkSfx(int16 sound, int32 model);
|
|
||||||
uint32 GetBlackBusinessFemaleTalkSfx(int16 sound);
|
|
||||||
uint32 GetSupermodelMaleTalkSfx(int16 sound);
|
|
||||||
uint32 GetSupermodelFemaleTalkSfx(int16 sound);
|
|
||||||
uint32 GetStewardMaleTalkSfx(int16 sound);
|
|
||||||
uint32 GetStewardFemaleTalkSfx(int16 sound);
|
|
||||||
uint32 GetFanMaleTalkSfx(int16 sound, int32 model);
|
|
||||||
uint32 GetFanFemaleTalkSfx(int16 sound);
|
|
||||||
uint32 GetHospitalMaleTalkSfx(int16 sound);
|
|
||||||
uint32 GetHospitalFemaleTalkSfx(int16 sound);
|
|
||||||
uint32 GetWhiteConstructionWorkerTalkSfx(int16 sound);
|
|
||||||
uint32 GetBlackConstructionWorkerTalkSfx(int16 sound);
|
|
||||||
uint32 GetShopperFemaleTalkSfx(int16 sound, int32 model);
|
|
||||||
uint32 GetStudentMaleTalkSfx(int16 sound);
|
|
||||||
uint32 GetStudentFemaleTalkSfx(int16 sound);
|
|
||||||
uint32 GetCasualMaleOldTalkSfx(int16 sound);
|
|
||||||
|
|
||||||
uint32 GetSpecialCharacterTalkSfx(int32 modelIndex, int32 sound);
|
|
||||||
uint32 GetEightTalkSfx(int16 sound);
|
|
||||||
uint32 GetFrankieTalkSfx(int16 sound);
|
|
||||||
uint32 GetMistyTalkSfx(int16 sound);
|
|
||||||
uint32 GetOJGTalkSfx(int16 sound);
|
|
||||||
uint32 GetCatatalinaTalkSfx(int16 sound);
|
|
||||||
uint32 GetBomberTalkSfx(int16 sound);
|
|
||||||
uint32 GetSecurityGuardTalkSfx(int16 sound);
|
|
||||||
uint32 GetChunkyTalkSfx(int16 sound);
|
|
||||||
|
|
||||||
uint32 GetGenericMaleTalkSfx(int16 sound);
|
|
||||||
uint32 GetGenericFemaleTalkSfx(int16 sound);
|
|
||||||
// end of functions returning talk sfx
|
// end of functions returning talk sfx
|
||||||
|
|
||||||
void GenerateIntegerRandomNumberTable();
|
void GenerateIntegerRandomNumberTable();
|
||||||
|
@ -387,7 +322,6 @@ public:
|
||||||
void ProcessModelCarEngine(cVehicleParams *params);
|
void ProcessModelCarEngine(cVehicleParams *params);
|
||||||
void ProcessOneShotScriptObject(uint8 sound);
|
void ProcessOneShotScriptObject(uint8 sound);
|
||||||
void ProcessPed(CPhysical *ped);
|
void ProcessPed(CPhysical *ped);
|
||||||
void ProcessPedHeadphones(cPedParams *params);
|
|
||||||
void ProcessPedOneShots(cPedParams *params);
|
void ProcessPedOneShots(cPedParams *params);
|
||||||
void ProcessPhysical(int32 id);
|
void ProcessPhysical(int32 id);
|
||||||
void ProcessPlane(cVehicleParams *params);
|
void ProcessPlane(cVehicleParams *params);
|
||||||
|
@ -434,14 +368,14 @@ public:
|
||||||
void ServiceSoundEffects();
|
void ServiceSoundEffects();
|
||||||
int8 SetCurrent3DProvider(uint8 which);
|
int8 SetCurrent3DProvider(uint8 which);
|
||||||
void SetDynamicAcousticModelingStatus(bool status);
|
void SetDynamicAcousticModelingStatus(bool status);
|
||||||
void SetEffectsFadeVolume(uint8 volume) const;
|
void SetEffectsFadeVol(uint8 volume) const;
|
||||||
void SetEffectsMasterVolume(uint8 volume) const;
|
void SetEffectsMasterVolume(uint8 volume) const;
|
||||||
void SetEntityStatus(int32 id, uint8 status);
|
void SetEntityStatus(int32 id, uint8 status);
|
||||||
uint32 SetLoopingCollisionRequestedSfxFreqAndGetVol(const cAudioCollision &audioCollision);
|
uint32 SetLoopingCollisionRequestedSfxFreqAndGetVol(const cAudioCollision &audioCollision);
|
||||||
void SetMissionAudioLocation(float x, float y, float z);
|
void SetMissionAudioLocation(float x, float y, float z);
|
||||||
void SetMissionScriptPoliceAudio(int32 sfx) const;
|
void SetMissionScriptPoliceAudio(int32 sfx) const;
|
||||||
void SetMonoMode(uint8); // todo (mobile)
|
void SetMonoMode(uint8); // todo (mobile)
|
||||||
void SetMusicFadeVolume(uint8 volume) const;
|
void SetMusicFadeVol(uint8 volume) const;
|
||||||
void SetMusicMasterVolume(uint8 volume) const;
|
void SetMusicMasterVolume(uint8 volume) const;
|
||||||
void SetSpeakerConfig(int32 conf) const;
|
void SetSpeakerConfig(int32 conf) const;
|
||||||
void SetUpLoopingCollisionSound(const cAudioCollision &col, uint8 counter);
|
void SetUpLoopingCollisionSound(const cAudioCollision &col, uint8 counter);
|
||||||
|
@ -464,9 +398,11 @@ public:
|
||||||
bool UsesSiren(int32 model) const;
|
bool UsesSiren(int32 model) const;
|
||||||
bool UsesSirenSwitching(int32 model) const;
|
bool UsesSirenSwitching(int32 model) const;
|
||||||
|
|
||||||
|
#ifdef GTA_PC
|
||||||
// only used in pc
|
// only used in pc
|
||||||
void AdjustSamplesVolume();
|
void AdjustSamplesVolume();
|
||||||
uint8 ComputeEmittingVolume(uint8 emittingVolume, float intensity, float dist);
|
uint8 ComputeEmittingVolume(uint8 emittingVolume, float intensity, float dist);
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef AUDIO_MSS
|
#ifdef AUDIO_MSS
|
||||||
|
|
|
@ -29,7 +29,7 @@ cDMAudio::Service(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
int32
|
int32
|
||||||
cDMAudio::CreateEntity(int32 type, void *UID)
|
cDMAudio::CreateEntity(eAudioType type, void *UID)
|
||||||
{
|
{
|
||||||
return AudioManager.CreateEntity(type, (CPhysical *)UID);
|
return AudioManager.CreateEntity(type, (CPhysical *)UID);
|
||||||
}
|
}
|
||||||
|
@ -82,7 +82,7 @@ cDMAudio::SetEffectsFadeVol(uint8 volume)
|
||||||
uint8 vol = volume;
|
uint8 vol = volume;
|
||||||
if ( vol > MAX_VOLUME ) vol = MAX_VOLUME;
|
if ( vol > MAX_VOLUME ) vol = MAX_VOLUME;
|
||||||
|
|
||||||
AudioManager.SetEffectsFadeVolume(vol);
|
AudioManager.SetEffectsFadeVol(vol);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -91,7 +91,7 @@ cDMAudio::SetMusicFadeVol(uint8 volume)
|
||||||
uint8 vol = volume;
|
uint8 vol = volume;
|
||||||
if ( vol > MAX_VOLUME ) vol = MAX_VOLUME;
|
if ( vol > MAX_VOLUME ) vol = MAX_VOLUME;
|
||||||
|
|
||||||
AudioManager.SetMusicFadeVolume(vol);
|
AudioManager.SetMusicFadeVol(vol);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8
|
uint8
|
||||||
|
|
|
@ -20,7 +20,7 @@ public:
|
||||||
void Terminate(void);
|
void Terminate(void);
|
||||||
void Service(void);
|
void Service(void);
|
||||||
|
|
||||||
int32 CreateEntity(int32 type, void *UID);
|
int32 CreateEntity(eAudioType type, void *UID);
|
||||||
void DestroyEntity(int32 audioEntity);
|
void DestroyEntity(int32 audioEntity);
|
||||||
void SetEntityStatus(int32 audioEntity, uint8 status);
|
void SetEntityStatus(int32 audioEntity, uint8 status);
|
||||||
void PlayOneShot(int32 audioEntity, uint16 oneShot, float volume);
|
void PlayOneShot(int32 audioEntity, uint16 oneShot, float volume);
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#define TIME_COPS_WAIT_TO_EXIT_AFTER_STOPPING 2500
|
#define TIME_COPS_WAIT_TO_EXIT_AFTER_STOPPING 2500
|
||||||
|
|
||||||
class CZoneInfo;
|
class CZoneInfo;
|
||||||
|
class CAutomobile;
|
||||||
|
|
||||||
enum{
|
enum{
|
||||||
MAX_CARS_TO_KEEP = 2,
|
MAX_CARS_TO_KEEP = 2,
|
||||||
|
|
|
@ -44,15 +44,44 @@ uint32 CPickups::StaticCamStartTime;
|
||||||
|
|
||||||
tPickupMessage CPickups::aMessages[NUMPICKUPMESSAGES];
|
tPickupMessage CPickups::aMessages[NUMPICKUPMESSAGES];
|
||||||
|
|
||||||
// 20 ?! Some Miami leftover? (Originally at 0x5ED8D4)
|
// TODO(Miami)
|
||||||
uint16 AmmoForWeapon[20] = { 0, 1, 45, 125, 25, 150, 300, 25, 5, 250, 5, 5, 0, 500, 0, 100, 0, 0, 0, 0 };
|
uint16 AmmoForWeapon[20] = { 0, 1, 45, 125, 25, 150, 300, 25, 5, 250, 5, 5, 0, 500, 0, 100, 0, 0, 0, 0 };
|
||||||
uint16 AmmoForWeapon_OnStreet[20] = { 0, 1, 9, 25, 5, 30, 60, 5, 1, 50, 1, 1, 0, 200, 0, 100, 0, 0, 0, 0 };
|
uint16 AmmoForWeapon_OnStreet[WEAPONTYPE_TOTALWEAPONS] = {
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
4,
|
||||||
|
4,
|
||||||
|
4,
|
||||||
|
4,
|
||||||
|
34,
|
||||||
|
16,
|
||||||
|
100,
|
||||||
|
60,
|
||||||
|
60,
|
||||||
|
60,
|
||||||
|
60,
|
||||||
|
60,
|
||||||
|
20,
|
||||||
|
4,
|
||||||
|
14,
|
||||||
|
1,
|
||||||
|
400,
|
||||||
|
};
|
||||||
uint16 CostOfWeapon[20] = { 0, 10, 250, 800, 1500, 3000, 5000, 10000, 25000, 25000, 2000, 2000, 0, 50000, 0, 3000, 0, 0, 0, 0 };
|
uint16 CostOfWeapon[20] = { 0, 10, 250, 800, 1500, 3000, 5000, 10000, 25000, 25000, 2000, 2000, 0, 50000, 0, 3000, 0, 0, 0, 0 };
|
||||||
|
|
||||||
uint8 aWeaponReds[] = { 255, 0, 128, 255, 255, 0, 255, 0, 128, 128, 255, 255, 128, 0, 255, 0 };
|
// TODO(Miami): Those are all placeholders!!
|
||||||
uint8 aWeaponGreens[] = { 0, 255, 128, 255, 0, 255, 128, 255, 0, 255, 255, 0, 255, 0, 255, 0 };
|
uint8 aWeaponReds[] = { 0, 255, 0, 128, 255, 255, 0, 255, 0, 128, 128, 255,
|
||||||
uint8 aWeaponBlues[] = { 0, 0, 255, 0, 255, 255, 0, 128, 255, 0, 255, 0, 128, 255, 0, 0 };
|
255, 255, 255, 255, 255, 255, 255, 255,
|
||||||
float aWeaponScale[] = { 1.0f, 2.0f, 1.5f, 1.0f, 1.0f, 1.5f, 1.0f, 2.0f, 1.0f, 2.0f, 2.5f, 1.0f, 1.0f, 1.0f, 1.0f };
|
255, 128, 0, 255, 0 };
|
||||||
|
uint8 aWeaponGreens[] = { 0, 0, 255, 128, 255, 0, 255, 128, 255, 0, 255, 255,
|
||||||
|
255, 255, 255, 255, 255, 255, 255, 255,
|
||||||
|
0, 255, 0, 255, 0 };
|
||||||
|
uint8 aWeaponBlues[] = { 0, 0, 0, 255, 0, 255, 255, 0, 128, 255, 0, 255,
|
||||||
|
255, 255, 255, 255, 255, 255, 255, 255,
|
||||||
|
0, 128, 255, 0, 0 };
|
||||||
|
float aWeaponScale[] = { 1.0f, 1.0f, 2.0f, 1.5f, 1.0f, 1.0f, 1.5f, 1.0f, 2.0f, 1.0f, 2.0f, 2.5f,
|
||||||
|
1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f,
|
||||||
|
1.0f, 1.0f, 1.0f, 1.0f };
|
||||||
|
|
||||||
void
|
void
|
||||||
CPickup::RemoveKeepType()
|
CPickup::RemoveKeepType()
|
||||||
|
@ -380,6 +409,30 @@ CPickups::Init(void)
|
||||||
CollectedPickUpIndex = 0;
|
CollectedPickUpIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// --MIAMI: Done
|
||||||
|
bool
|
||||||
|
CPickups::TestForPickupsInBubble(CVector pos, float range)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < NUMPICKUPS; i++) {
|
||||||
|
if ((aPickUps[i].m_vecPos - pos).Magnitude() < range)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// --MIAMI: Done
|
||||||
|
bool
|
||||||
|
CPickups::TryToMerge_WeaponType(CVector pos, eWeaponType weapon, uint8 type, uint32 quantity, bool unused) {
|
||||||
|
for (int i = 0; i < NUMPICKUPS; i++) {
|
||||||
|
if (aPickUps[i].m_eType == type && aPickUps[i].m_eModelIndex == ModelForWeapon(weapon))
|
||||||
|
if ((aPickUps[i].m_vecPos - pos).Magnitude() < 7.5f) {
|
||||||
|
aPickUps[i].m_nQuantity += quantity;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
CPickups::IsPickUpPickedUp(int32 pickupId)
|
CPickups::IsPickUpPickedUp(int32 pickupId)
|
||||||
{
|
{
|
||||||
|
@ -561,53 +614,22 @@ CPickups::GetNewUniquePickupIndex(int32 slot)
|
||||||
return slot | (aPickUps[slot].m_nIndex << 16);
|
return slot | (aPickUps[slot].m_nIndex << 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// --MIAMI: Done
|
||||||
int32
|
int32
|
||||||
CPickups::ModelForWeapon(eWeaponType weaponType)
|
CPickups::ModelForWeapon(eWeaponType weaponType)
|
||||||
{
|
{
|
||||||
switch (weaponType)
|
return CWeaponInfo::GetWeaponInfo(weaponType)->m_nModelId;
|
||||||
{
|
|
||||||
case WEAPONTYPE_BASEBALLBAT: return MI_BASEBALL_BAT;
|
|
||||||
case WEAPONTYPE_COLT45: return MI_COLT;
|
|
||||||
case WEAPONTYPE_UZI: return MI_UZI;
|
|
||||||
case WEAPONTYPE_SHOTGUN: return MI_SHOTGUN;
|
|
||||||
case WEAPONTYPE_AK47: return MI_AK47;
|
|
||||||
case WEAPONTYPE_M16: return MI_M16;
|
|
||||||
case WEAPONTYPE_SNIPERRIFLE: return MI_SNIPER;
|
|
||||||
case WEAPONTYPE_ROCKETLAUNCHER: return MI_ROCKETLAUNCHER;
|
|
||||||
case WEAPONTYPE_FLAMETHROWER: return MI_FLAMETHROWER;
|
|
||||||
case WEAPONTYPE_MOLOTOV: return MI_MOLOTOV;
|
|
||||||
case WEAPONTYPE_GRENADE: return MI_GRENADE;
|
|
||||||
default: break;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// --MIAMI: Done
|
||||||
eWeaponType
|
eWeaponType
|
||||||
CPickups::WeaponForModel(int32 model)
|
CPickups::WeaponForModel(int32 model)
|
||||||
{
|
{
|
||||||
if (model == MI_PICKUP_BODYARMOUR) return WEAPONTYPE_ARMOUR;
|
if (model == MI_PICKUP_BODYARMOUR) return WEAPONTYPE_ARMOUR;
|
||||||
switch (model)
|
if (model == MI_PICKUP_HEALTH) return WEAPONTYPE_HEALTH;
|
||||||
{
|
if (model == MI_PICKUP_ADRENALINE) return WEAPONTYPE_ARMOUR;
|
||||||
case MI_GRENADE: return WEAPONTYPE_GRENADE;
|
if (model == -1) return WEAPONTYPE_UNARMED;
|
||||||
case MI_AK47: return WEAPONTYPE_AK47;
|
return (eWeaponType)((CWeaponModelInfo*)CModelInfo::GetModelInfo(model))->GetWeaponInfo();
|
||||||
case MI_BASEBALL_BAT: return WEAPONTYPE_BASEBALLBAT;
|
|
||||||
case MI_COLT: return WEAPONTYPE_COLT45;
|
|
||||||
case MI_MOLOTOV: return WEAPONTYPE_MOLOTOV;
|
|
||||||
case MI_ROCKETLAUNCHER: return WEAPONTYPE_ROCKETLAUNCHER;
|
|
||||||
case MI_SHOTGUN: return WEAPONTYPE_SHOTGUN;
|
|
||||||
case MI_SNIPER: return WEAPONTYPE_SNIPERRIFLE;
|
|
||||||
case MI_UZI: return WEAPONTYPE_UZI;
|
|
||||||
case MI_MISSILE: return WEAPONTYPE_UNARMED;
|
|
||||||
case MI_M16: return WEAPONTYPE_M16;
|
|
||||||
case MI_FLAMETHROWER: return WEAPONTYPE_FLAMETHROWER;
|
|
||||||
}
|
|
||||||
return WEAPONTYPE_UNARMED;
|
|
||||||
}
|
|
||||||
|
|
||||||
int32
|
|
||||||
CPickups::FindColourIndexForWeaponMI(int32 model)
|
|
||||||
{
|
|
||||||
return WeaponForModel(model) - 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -685,15 +707,15 @@ CPickups::DoPickUpEffects(CEntity *entity)
|
||||||
int16 colorId;
|
int16 colorId;
|
||||||
|
|
||||||
if (entity->GetModelIndex() == MI_PICKUP_ADRENALINE || entity->GetModelIndex() == MI_PICKUP_CAMERA)
|
if (entity->GetModelIndex() == MI_PICKUP_ADRENALINE || entity->GetModelIndex() == MI_PICKUP_CAMERA)
|
||||||
colorId = 11;
|
colorId = WEAPONTYPE_LAST_WEAPONTYPE;
|
||||||
else if (entity->GetModelIndex() == MI_PICKUP_BODYARMOUR || entity->GetModelIndex() == MI_PICKUP_BRIBE)
|
else if (entity->GetModelIndex() == MI_PICKUP_BODYARMOUR || entity->GetModelIndex() == MI_PICKUP_BRIBE)
|
||||||
colorId = 12;
|
colorId = WEAPONTYPE_LAST_WEAPONTYPE + 1;
|
||||||
else if (entity->GetModelIndex() == MI_PICKUP_INFO || entity->GetModelIndex() == MI_PICKUP_KILLFRENZY)
|
else if (entity->GetModelIndex() == MI_PICKUP_INFO || entity->GetModelIndex() == MI_PICKUP_KILLFRENZY)
|
||||||
colorId = 13;
|
colorId = WEAPONTYPE_LAST_WEAPONTYPE + 2;
|
||||||
else if (entity->GetModelIndex() == MI_PICKUP_HEALTH || entity->GetModelIndex() == MI_PICKUP_BONUS)
|
else if (entity->GetModelIndex() == MI_PICKUP_HEALTH || entity->GetModelIndex() == MI_PICKUP_BONUS)
|
||||||
colorId = 14;
|
colorId = WEAPONTYPE_LAST_WEAPONTYPE + 3;
|
||||||
else
|
else
|
||||||
colorId = FindColourIndexForWeaponMI(entity->GetModelIndex());
|
colorId = WeaponForModel(entity->GetModelIndex());
|
||||||
|
|
||||||
assert(colorId >= 0);
|
assert(colorId >= 0);
|
||||||
|
|
||||||
|
|
|
@ -85,11 +85,12 @@ public:
|
||||||
static bool IsPickUpPickedUp(int32 pickupId);
|
static bool IsPickUpPickedUp(int32 pickupId);
|
||||||
static int32 ModelForWeapon(eWeaponType weaponType);
|
static int32 ModelForWeapon(eWeaponType weaponType);
|
||||||
static enum eWeaponType WeaponForModel(int32 model);
|
static enum eWeaponType WeaponForModel(int32 model);
|
||||||
static int32 FindColourIndexForWeaponMI(int32 model);
|
|
||||||
static int32 GetActualPickupIndex(int32 index);
|
static int32 GetActualPickupIndex(int32 index);
|
||||||
static int32 GetNewUniquePickupIndex(int32 slot);
|
static int32 GetNewUniquePickupIndex(int32 slot);
|
||||||
static void PassTime(uint32 time);
|
static void PassTime(uint32 time);
|
||||||
static bool GivePlayerGoodiesWithPickUpMI(int16 modelIndex, int playerIndex);
|
static bool GivePlayerGoodiesWithPickUpMI(int16 modelIndex, int playerIndex);
|
||||||
|
static bool TestForPickupsInBubble(CVector pos, float range);
|
||||||
|
static bool TryToMerge_WeaponType(CVector pos, eWeaponType weapon, uint8 type, uint32 quantity, bool unused);
|
||||||
static void Load(uint8 *buf, uint32 size);
|
static void Load(uint8 *buf, uint32 size);
|
||||||
static void Save(uint8 *buf, uint32 *size);
|
static void Save(uint8 *buf, uint32 *size);
|
||||||
|
|
||||||
|
@ -105,7 +106,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
extern uint16 AmmoForWeapon[20];
|
extern uint16 AmmoForWeapon[20];
|
||||||
extern uint16 AmmoForWeapon_OnStreet[20];
|
extern uint16 AmmoForWeapon_OnStreet[WEAPONTYPE_TOTALWEAPONS];
|
||||||
extern uint16 CostOfWeapon[20];
|
extern uint16 CostOfWeapon[20];
|
||||||
|
|
||||||
enum ePacmanPickupType
|
enum ePacmanPickupType
|
||||||
|
|
|
@ -2909,13 +2909,7 @@ int8 CRunningScript::ProcessCommands200To299(int32 command)
|
||||||
pVehicle->AutoPilot.m_nCarMission = MISSION_CRUISE;
|
pVehicle->AutoPilot.m_nCarMission = MISSION_CRUISE;
|
||||||
pVehicle->bEngineOn = true;
|
pVehicle->bEngineOn = true;
|
||||||
pPed->bUsesCollision = false;
|
pPed->bUsesCollision = false;
|
||||||
#ifdef FIX_BUGS
|
pPed->AddInCarAnims(pVehicle, true);
|
||||||
AnimationId anim = pVehicle->GetDriverAnim();
|
|
||||||
#else
|
|
||||||
AnimationId anim = pVehicle->bLowVehicle ? ANIM_CAR_LSIT : ANIM_CAR_SIT;
|
|
||||||
#endif
|
|
||||||
pPed->m_pVehicleAnim = CAnimManager::BlendAnimation(pPed->GetClump(), ASSOCGRP_STD, anim, 100.0f);
|
|
||||||
pPed->StopNonPartialAnims();
|
|
||||||
pPed->m_nZoneLevel = CTheZones::GetLevelFromPosition(&pPed->GetPosition());
|
pPed->m_nZoneLevel = CTheZones::GetLevelFromPosition(&pPed->GetPosition());
|
||||||
CWorld::Add(pPed);
|
CWorld::Add(pPed);
|
||||||
ScriptParams[0] = CPools::GetPedPool()->GetIndex(pPed);
|
ScriptParams[0] = CPools::GetPedPool()->GetIndex(pPed);
|
||||||
|
@ -4088,13 +4082,7 @@ int8 CRunningScript::ProcessCommands400To499(int32 command)
|
||||||
pPed->SetPedState(PED_DRIVING);
|
pPed->SetPedState(PED_DRIVING);
|
||||||
pVehicle->SetStatus(STATUS_PHYSICS);
|
pVehicle->SetStatus(STATUS_PHYSICS);
|
||||||
pPed->bUsesCollision = false;
|
pPed->bUsesCollision = false;
|
||||||
#ifdef FIX_BUGS
|
pPed->AddInCarAnims(pVehicle, false);
|
||||||
AnimationId anim = pVehicle->GetDriverAnim();
|
|
||||||
#else
|
|
||||||
AnimationId anim = pVehicle->bLowVehicle ? ANIM_CAR_LSIT : ANIM_CAR_SIT;
|
|
||||||
#endif
|
|
||||||
pPed->m_pVehicleAnim = CAnimManager::BlendAnimation(pPed->GetClump(), ASSOCGRP_STD, anim, 100.0f);
|
|
||||||
pPed->StopNonPartialAnims();
|
|
||||||
pPed->m_nZoneLevel = CTheZones::GetLevelFromPosition(&pPed->GetPosition());
|
pPed->m_nZoneLevel = CTheZones::GetLevelFromPosition(&pPed->GetPosition());
|
||||||
CWorld::Add(pPed);
|
CWorld::Add(pPed);
|
||||||
ScriptParams[0] = CPools::GetPedPool()->GetIndex(pPed);
|
ScriptParams[0] = CPools::GetPedPool()->GetIndex(pPed);
|
||||||
|
@ -9831,16 +9819,11 @@ int8 CRunningScript::ProcessCommands1100To1199(int32 command)
|
||||||
{
|
{
|
||||||
CollectParameters(&m_nIp, 3);
|
CollectParameters(&m_nIp, 3);
|
||||||
CVector pos = *(CVector*)&ScriptParams[0];
|
CVector pos = *(CVector*)&ScriptParams[0];
|
||||||
bool bFound = false;
|
CRunningScript::UpdateCompareFlag(CPickups::TestForPickupsInBubble(pos, 0.5f));
|
||||||
for (int i = 0; i < NUMPICKUPS; i++) {
|
|
||||||
if ((CPickups::aPickUps[i].m_vecPos - pos).Magnitude() < 0.5f)
|
|
||||||
bFound = true;
|
|
||||||
}
|
|
||||||
UpdateCompareFlag(bFound);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
//case COMMAND_GET_FIRST_PICKUP_COORDS:
|
case COMMAND_GET_FIRST_PICKUP_COORDS:
|
||||||
//case COMMAND_GET_NEXT_PICKUP_COORDS:
|
case COMMAND_GET_NEXT_PICKUP_COORDS:
|
||||||
case COMMAND_REMOVE_ALL_CHAR_WEAPONS:
|
case COMMAND_REMOVE_ALL_CHAR_WEAPONS:
|
||||||
{
|
{
|
||||||
CollectParameters(&m_nIp, 1);
|
CollectParameters(&m_nIp, 1);
|
||||||
|
@ -9984,8 +9967,10 @@ int8 CRunningScript::ProcessCommands1100To1199(int32 command)
|
||||||
case COMMAND_GET_DEAD_CHAR_PICKUP_COORDS:
|
case COMMAND_GET_DEAD_CHAR_PICKUP_COORDS:
|
||||||
{
|
{
|
||||||
CollectParameters(&m_nIp, 1);
|
CollectParameters(&m_nIp, 1);
|
||||||
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
CPed *pTarget = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
||||||
pPed->CreateDeadPedPickupCoors((float*)&ScriptParams[0], (float*)&ScriptParams[1], (float*)&ScriptParams[2]);
|
CVector pos;
|
||||||
|
pTarget->CreateDeadPedPickupCoors(&pos.x, &pos.y, &pos.z);
|
||||||
|
*(CVector*)&ScriptParams[0] = pos;
|
||||||
StoreParameters(&m_nIp, 3);
|
StoreParameters(&m_nIp, 3);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5536,9 +5536,10 @@ CMenuManager::PrintMap(void)
|
||||||
if (mapPoint.y > fMapCenterY - fMapSize && mapPoint.y < fMapCenterY + fMapSize &&
|
if (mapPoint.y > fMapCenterY - fMapSize && mapPoint.y < fMapCenterY + fMapSize &&
|
||||||
mapPoint.x > fMapCenterX - fMapSize && mapPoint.x < fMapCenterX + fMapSize) {
|
mapPoint.x > fMapCenterX - fMapSize && mapPoint.x < fMapCenterX + fMapSize) {
|
||||||
|
|
||||||
|
// Don't ask me the meanings, I don't know. Found them by trying
|
||||||
float diffX = fMapCenterX - fMapSize, diffY = fMapCenterY - fMapSize;
|
float diffX = fMapCenterX - fMapSize, diffY = fMapCenterY - fMapSize;
|
||||||
float x = ((mapPoint.x - diffX) / (fMapSize * 2)) * 4000.0f - 2000.0f;
|
float x = ((mapPoint.x - diffX) / (fMapSize * 2)) * (WORLD_SIZE_X / MENU_MAP_WIDTH_SCALE) - (WORLD_SIZE_X / 2 + MENU_MAP_LEFT_OFFSET * MENU_MAP_LENGTH_UNIT);
|
||||||
float y = 2000.0f - ((mapPoint.y - diffY) / (fMapSize * 2)) * 4000.0f;
|
float y = (WORLD_SIZE_Y / 2 - MENU_MAP_TOP_OFFSET * MENU_MAP_LENGTH_UNIT) - ((mapPoint.y - diffY) / (fMapSize * 2)) * (WORLD_SIZE_Y / MENU_MAP_HEIGHT_SCALE);
|
||||||
CRadar::ToggleTargetMarker(x, y);
|
CRadar::ToggleTargetMarker(x, y);
|
||||||
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SUCCESS, 0);
|
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SUCCESS, 0);
|
||||||
}
|
}
|
||||||
|
@ -5584,7 +5585,8 @@ CMenuManager::PrintMap(void)
|
||||||
if (fMapCenterY + fMapSize < SCREEN_HEIGHT - MENU_Y(60.0f))
|
if (fMapCenterY + fMapSize < SCREEN_HEIGHT - MENU_Y(60.0f))
|
||||||
fMapCenterY = SCREEN_HEIGHT - MENU_Y(60.0f) - fMapSize;
|
fMapCenterY = SCREEN_HEIGHT - MENU_Y(60.0f) - fMapSize;
|
||||||
|
|
||||||
fMapCenterY = Min(fMapCenterY, fMapSize); // To not show beyond north border
|
if (fMapCenterY - fMapSize > SCREEN_HEIGHT / 2)
|
||||||
|
fMapCenterY = SCREEN_HEIGHT / 2 + fMapSize;
|
||||||
|
|
||||||
bMenuMapActive = false;
|
bMenuMapActive = false;
|
||||||
|
|
||||||
|
@ -5654,9 +5656,7 @@ CMenuManager::ConstructStatLine(int rowIdx)
|
||||||
|
|
||||||
STAT_LINE("PL_STAT", nil, false, nil);
|
STAT_LINE("PL_STAT", nil, false, nil);
|
||||||
|
|
||||||
int percentCompleted = (CStats::TotalProgressInGame == 0 ? 0 :
|
int percentCompleted = CStats::GetPercentageProgress();
|
||||||
CStats::ProgressMade * 100.0f / (CGame::nastyGame ? CStats::TotalProgressInGame : CStats::TotalProgressInGame - 1));
|
|
||||||
percentCompleted = Min(percentCompleted, 100);
|
|
||||||
|
|
||||||
STAT_LINE("PER_COM", &percentCompleted, false, nil);
|
STAT_LINE("PER_COM", &percentCompleted, false, nil);
|
||||||
STAT_LINE("NMISON", &CStats::MissionsGiven, false, nil);
|
STAT_LINE("NMISON", &CStats::MissionsGiven, false, nil);
|
||||||
|
|
|
@ -143,6 +143,7 @@ CPlayerInfo::Clear(void)
|
||||||
m_nMaxHealth = m_nMaxArmour = 100;
|
m_nMaxHealth = m_nMaxArmour = 100;
|
||||||
m_bGetOutOfJailFree = false;
|
m_bGetOutOfJailFree = false;
|
||||||
m_bGetOutOfHospitalFree = false;
|
m_bGetOutOfHospitalFree = false;
|
||||||
|
m_bDriveByAllowed = true;
|
||||||
m_nPreviousTimeRewardedForExplosion = 0;
|
m_nPreviousTimeRewardedForExplosion = 0;
|
||||||
m_nExplosionsSinceLastReward = 0;
|
m_nExplosionsSinceLastReward = 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,6 +57,7 @@ public:
|
||||||
uint8 m_nMaxArmour;
|
uint8 m_nMaxArmour;
|
||||||
bool m_bGetOutOfJailFree;
|
bool m_bGetOutOfJailFree;
|
||||||
bool m_bGetOutOfHospitalFree;
|
bool m_bGetOutOfHospitalFree;
|
||||||
|
bool m_bDriveByAllowed;
|
||||||
char m_aSkinName[32];
|
char m_aSkinName[32];
|
||||||
RwTexture *m_pSkinTexture;
|
RwTexture *m_pSkinTexture;
|
||||||
|
|
||||||
|
|
|
@ -87,12 +87,11 @@ static_assert(RADAR_TILE_SIZE == (RADAR_SIZE_Y / RADAR_NUM_TILES), "CRadar: not
|
||||||
CRGBA CRadar::ArrowBlipColour1;
|
CRGBA CRadar::ArrowBlipColour1;
|
||||||
CRGBA CRadar::ArrowBlipColour2;
|
CRGBA CRadar::ArrowBlipColour2;
|
||||||
uint16 CRadar::MapLegendCounter;
|
uint16 CRadar::MapLegendCounter;
|
||||||
uint16 CRadar::MapLegendList[NUM_MAP_LEGENDS];
|
int16 CRadar::MapLegendList[NUM_MAP_LEGENDS];
|
||||||
int CRadar::TargetMarkerId = -1;
|
int CRadar::TargetMarkerId = -1;
|
||||||
CVector CRadar::TargetMarkerPos;
|
CVector CRadar::TargetMarkerPos;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// taken from VC
|
|
||||||
float CRadar::cachedCos;
|
float CRadar::cachedCos;
|
||||||
float CRadar::cachedSin;
|
float CRadar::cachedSin;
|
||||||
|
|
||||||
|
@ -273,12 +272,9 @@ void CRadar::ClearBlip(int32 i)
|
||||||
if (index != -1) {
|
if (index != -1) {
|
||||||
SetRadarMarkerState(index, false);
|
SetRadarMarkerState(index, false);
|
||||||
ms_RadarTrace[index].m_bInUse = false;
|
ms_RadarTrace[index].m_bInUse = false;
|
||||||
#ifndef MENU_MAP
|
|
||||||
// Ssshhh
|
|
||||||
ms_RadarTrace[index].m_eBlipType = BLIP_NONE;
|
ms_RadarTrace[index].m_eBlipType = BLIP_NONE;
|
||||||
ms_RadarTrace[index].m_eBlipDisplay = BLIP_DISPLAY_NEITHER;
|
ms_RadarTrace[index].m_eBlipDisplay = BLIP_DISPLAY_NEITHER;
|
||||||
ms_RadarTrace[index].m_eRadarSprite = RADAR_SPRITE_NONE;
|
ms_RadarTrace[index].m_eRadarSprite = RADAR_SPRITE_NONE;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -481,11 +477,6 @@ void CRadar::DrawBlips()
|
||||||
|
|
||||||
CEntity *blipEntity = nil;
|
CEntity *blipEntity = nil;
|
||||||
for(int blipId = 0; blipId < NUMRADARBLIPS; blipId++) {
|
for(int blipId = 0; blipId < NUMRADARBLIPS; blipId++) {
|
||||||
#ifdef MENU_MAP
|
|
||||||
// A little hack to reuse cleared blips in menu map. hehe
|
|
||||||
if (!CMenuManager::bMenuMapActive || ms_RadarTrace[blipId].m_eBlipType == BLIP_CAR ||
|
|
||||||
ms_RadarTrace[blipId].m_eBlipType == BLIP_CHAR || ms_RadarTrace[blipId].m_eBlipType == BLIP_OBJECT)
|
|
||||||
#endif
|
|
||||||
if (!ms_RadarTrace[blipId].m_bInUse)
|
if (!ms_RadarTrace[blipId].m_bInUse)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -1338,9 +1329,8 @@ void CRadar::TransformRadarPointToScreenSpace(CVector2D &out, const CVector2D &i
|
||||||
{
|
{
|
||||||
#ifdef MENU_MAP
|
#ifdef MENU_MAP
|
||||||
if (CMenuManager::bMenuMapActive) {
|
if (CMenuManager::bMenuMapActive) {
|
||||||
// fMapSize is actually half map size. Radar range is 1000, so if x is -2000, in.x + 2.0f is 0.
|
out.x = (CMenuManager::fMapCenterX - CMenuManager::fMapSize) + (MENU_MAP_LENGTH / 2 + MENU_MAP_LEFT_OFFSET + in.x) * CMenuManager::fMapSize * MENU_MAP_WIDTH_SCALE * 2.0f / MENU_MAP_LENGTH;
|
||||||
out.x = (CMenuManager::fMapCenterX - CMenuManager::fMapSize) + (in.x + 2.0f) * CMenuManager::fMapSize * 2.0f / 4.0f;
|
out.y = (CMenuManager::fMapCenterY - CMenuManager::fMapSize) + (MENU_MAP_LENGTH / 2 - MENU_MAP_TOP_OFFSET - in.y) * CMenuManager::fMapSize * MENU_MAP_HEIGHT_SCALE * 2.0f / MENU_MAP_LENGTH;
|
||||||
out.y = (CMenuManager::fMapCenterY - CMenuManager::fMapSize) + (2.0f - in.y) * CMenuManager::fMapSize * 2.0f / 4.0f;
|
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
@ -1428,7 +1418,7 @@ CRadar::InitFrontEndMap()
|
||||||
CalculateCachedSinCos();
|
CalculateCachedSinCos();
|
||||||
vec2DRadarOrigin.x = 0.0f;
|
vec2DRadarOrigin.x = 0.0f;
|
||||||
vec2DRadarOrigin.y = 0.0f;
|
vec2DRadarOrigin.y = 0.0f;
|
||||||
m_radarRange = 1000.0f; // doesn't mean anything, just affects the calculation in TransformRadarPointToScreenSpace
|
m_radarRange = MENU_MAP_LENGTH_UNIT; // just affects the multiplier in TransformRadarPointToScreenSpace
|
||||||
for (int i = 0; i < NUM_MAP_LEGENDS; i++) {
|
for (int i = 0; i < NUM_MAP_LEGENDS; i++) {
|
||||||
MapLegendList[i] = RADAR_SPRITE_NONE;
|
MapLegendList[i] = RADAR_SPRITE_NONE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,13 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "Sprite2d.h"
|
#include "Sprite2d.h"
|
||||||
|
|
||||||
|
#define MENU_MAP_LENGTH_UNIT 1190.0f // in game unit
|
||||||
|
#define MENU_MAP_WIDTH_SCALE 1.112f // in game unit (originally 1.112494151260504f)
|
||||||
|
#define MENU_MAP_HEIGHT_SCALE 1.119f // in game unit (originally 1.118714268907563f)
|
||||||
|
#define MENU_MAP_TOP_OFFSET 0.28f // in length unit defined above - ~333 game unit
|
||||||
|
#define MENU_MAP_LEFT_OFFSET 0.185f // in length unit defined above - ~220 game unit
|
||||||
|
#define MENU_MAP_LENGTH (4000.f / MENU_MAP_LENGTH_UNIT)
|
||||||
|
|
||||||
enum eBlipType
|
enum eBlipType
|
||||||
{
|
{
|
||||||
BLIP_NONE,
|
BLIP_NONE,
|
||||||
|
@ -111,7 +118,7 @@ public:
|
||||||
#define NUM_MAP_LEGENDS 75
|
#define NUM_MAP_LEGENDS 75
|
||||||
static CRGBA ArrowBlipColour1;
|
static CRGBA ArrowBlipColour1;
|
||||||
static CRGBA ArrowBlipColour2;
|
static CRGBA ArrowBlipColour2;
|
||||||
static uint16 MapLegendList[NUM_MAP_LEGENDS];
|
static int16 MapLegendList[NUM_MAP_LEGENDS];
|
||||||
static uint16 MapLegendCounter;
|
static uint16 MapLegendCounter;
|
||||||
static int TargetMarkerId;
|
static int TargetMarkerId;
|
||||||
static CVector TargetMarkerPos;
|
static CVector TargetMarkerPos;
|
||||||
|
|
|
@ -209,19 +209,6 @@ void CStats::SetTotalNumberMissions(int32 total)
|
||||||
TotalNumberMissions = total;
|
TotalNumberMissions = total;
|
||||||
}
|
}
|
||||||
|
|
||||||
float CStats::GetPercentageProgress()
|
|
||||||
{
|
|
||||||
float p;
|
|
||||||
if (TotalProgressInGame == 0.0f)
|
|
||||||
p = 0.0f;
|
|
||||||
else if (CGame::nastyGame)
|
|
||||||
p = 100.0f * ProgressMade / TotalProgressInGame;
|
|
||||||
else
|
|
||||||
p = 100.0f * ProgressMade / (TotalProgressInGame - 1);
|
|
||||||
|
|
||||||
return Min(100.0f, p);
|
|
||||||
}
|
|
||||||
|
|
||||||
wchar *CStats::FindCriminalRatingString()
|
wchar *CStats::FindCriminalRatingString()
|
||||||
{
|
{
|
||||||
int rating = FindCriminalRatingNumber();
|
int rating = FindCriminalRatingNumber();
|
||||||
|
@ -263,6 +250,14 @@ int32 CStats::FindCriminalRatingNumber()
|
||||||
return rating;
|
return rating;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float CStats::GetPercentageProgress()
|
||||||
|
{
|
||||||
|
float percentCompleted = (CStats::TotalProgressInGame == 0 ? 0 :
|
||||||
|
CStats::ProgressMade * 100.0f / (CGame::nastyGame ? CStats::TotalProgressInGame : CStats::TotalProgressInGame - 1.0f));
|
||||||
|
|
||||||
|
return Min(percentCompleted, 100.0f);
|
||||||
|
}
|
||||||
|
|
||||||
void CStats::MoneySpentOnFashion(int32 money)
|
void CStats::MoneySpentOnFashion(int32 money)
|
||||||
{
|
{
|
||||||
FashionBudget += money;
|
FashionBudget += money;
|
||||||
|
|
|
@ -89,9 +89,9 @@ public:
|
||||||
static void CheckPointReachedSuccessfully() { TotalLegitimateKills += KillsSinceLastCheckpoint; KillsSinceLastCheckpoint = 0; };
|
static void CheckPointReachedSuccessfully() { TotalLegitimateKills += KillsSinceLastCheckpoint; KillsSinceLastCheckpoint = 0; };
|
||||||
static void CheckPointReachedUnsuccessfully() { KillsSinceLastCheckpoint = 0; };
|
static void CheckPointReachedUnsuccessfully() { KillsSinceLastCheckpoint = 0; };
|
||||||
static int32 FindCriminalRatingNumber();
|
static int32 FindCriminalRatingNumber();
|
||||||
static float GetPercentageProgress();
|
|
||||||
static void SaveStats(uint8 *buf, uint32 *size);
|
static void SaveStats(uint8 *buf, uint32 *size);
|
||||||
static void LoadStats(uint8 *buf, uint32 size);
|
static void LoadStats(uint8 *buf, uint32 size);
|
||||||
|
static float GetPercentageProgress();
|
||||||
|
|
||||||
static void MoneySpentOnFashion(int32);
|
static void MoneySpentOnFashion(int32);
|
||||||
};
|
};
|
||||||
|
|
|
@ -340,21 +340,6 @@ CWorld::ProcessLineOfSightSectorList(CPtrList &list, const CColLine &line, CColP
|
||||||
if(e->IsPed()) {
|
if(e->IsPed()) {
|
||||||
if(e->bUsesCollision || deadPeds && ((CPed *)e)->m_nPedState == PED_DEAD) {
|
if(e->bUsesCollision || deadPeds && ((CPed *)e)->m_nPedState == PED_DEAD) {
|
||||||
colmodel = ((CPedModelInfo *)CModelInfo::GetModelInfo(e->GetModelIndex()))->AnimatePedColModelSkinned(e->GetClump());
|
colmodel = ((CPedModelInfo *)CModelInfo::GetModelInfo(e->GetModelIndex()))->AnimatePedColModelSkinned(e->GetClump());
|
||||||
/* this should all be gone, right?
|
|
||||||
if(((CPed *)e)->UseGroundColModel())
|
|
||||||
colmodel = &CTempColModels::ms_colModelPedGroundHit;
|
|
||||||
else
|
|
||||||
#ifdef ANIMATE_PED_COL_MODEL
|
|
||||||
colmodel = CPedModelInfo::AnimatePedColModel(
|
|
||||||
((CPedModelInfo *)CModelInfo::GetModelInfo(e->GetModelIndex()))
|
|
||||||
->GetHitColModel(),
|
|
||||||
RpClumpGetFrame(e->GetClump()));
|
|
||||||
#else
|
|
||||||
colmodel =
|
|
||||||
((CPedModelInfo *)CModelInfo::GetModelInfo(e->GetModelIndex()))
|
|
||||||
->GetHitColModel();
|
|
||||||
#endif
|
|
||||||
*/
|
|
||||||
} else
|
} else
|
||||||
colmodel = nil;
|
colmodel = nil;
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,7 @@ RwRGBA gColourTop;
|
||||||
bool gameAlreadyInitialised;
|
bool gameAlreadyInitialised;
|
||||||
|
|
||||||
float NumberOfChunksLoaded;
|
float NumberOfChunksLoaded;
|
||||||
#define TOTALNUMCHUNKS 73.0f
|
#define TOTALNUMCHUNKS 95.0f
|
||||||
|
|
||||||
bool g_SlowMode = false;
|
bool g_SlowMode = false;
|
||||||
char version_name[64];
|
char version_name[64];
|
||||||
|
@ -356,6 +356,7 @@ Terminate3D(void)
|
||||||
CSprite2d splash;
|
CSprite2d splash;
|
||||||
int splashTxdId = -1;
|
int splashTxdId = -1;
|
||||||
|
|
||||||
|
//--MIAMI: done
|
||||||
CSprite2d*
|
CSprite2d*
|
||||||
LoadSplash(const char *name)
|
LoadSplash(const char *name)
|
||||||
{
|
{
|
||||||
|
@ -401,22 +402,23 @@ DestroySplashScreen(void)
|
||||||
splashTxdId = -1;
|
splashTxdId = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--MIAMI: done
|
||||||
Const char*
|
Const char*
|
||||||
GetRandomSplashScreen(void)
|
GetRandomSplashScreen(void)
|
||||||
{
|
{
|
||||||
int index;
|
int index;
|
||||||
static int index2 = 0;
|
static int index2 = 0;
|
||||||
static char splashName[128];
|
static char splashName[128];
|
||||||
static int splashIndex[24] = {
|
static int splashIndex[12] = {
|
||||||
25, 22, 4, 13,
|
1, 2,
|
||||||
1, 21, 14, 16,
|
3, 4,
|
||||||
10, 12, 5, 9,
|
5, 11,
|
||||||
11, 18, 3, 2,
|
6, 8,
|
||||||
19, 23, 7, 17,
|
9, 10,
|
||||||
15, 6, 8, 20
|
7, 12
|
||||||
};
|
};
|
||||||
|
|
||||||
index = splashIndex[4*index2 + CGeneral::GetRandomNumberInRange(0, 3)];
|
index = splashIndex[2*index2 + CGeneral::GetRandomNumberInRange(0, 2)];
|
||||||
index2++;
|
index2++;
|
||||||
if(index2 == 6)
|
if(index2 == 6)
|
||||||
index2 = 0;
|
index2 = 0;
|
||||||
|
@ -444,16 +446,14 @@ ResetLoadingScreenBar()
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: compare with PS2
|
// TODO: compare with PS2
|
||||||
|
//--MIAMI: done
|
||||||
void
|
void
|
||||||
LoadingScreen(const char *str1, const char *str2, const char *splashscreen)
|
LoadingScreen(const char *str1, const char *str2, const char *splashscreen)
|
||||||
{
|
{
|
||||||
CSprite2d *splash;
|
CSprite2d *splash;
|
||||||
|
|
||||||
#ifndef RANDOMSPLASH
|
#ifndef RANDOMSPLASH
|
||||||
if(CGame::frenchGame || CGame::germanGame || !CGame::nastyGame)
|
splashscreen = "LOADSC0";
|
||||||
splashscreen = "mainsc2";
|
|
||||||
else
|
|
||||||
splashscreen = "mainsc1";
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
splash = LoadSplash(splashscreen);
|
splash = LoadSplash(splashscreen);
|
||||||
|
@ -474,36 +474,50 @@ LoadingScreen(const char *str1, const char *str2, const char *splashscreen)
|
||||||
if(str1){
|
if(str1){
|
||||||
NumberOfChunksLoaded += 1;
|
NumberOfChunksLoaded += 1;
|
||||||
|
|
||||||
|
#ifndef RANDOMSPLASH
|
||||||
float hpos = SCREEN_SCALE_X(40);
|
float hpos = SCREEN_SCALE_X(40);
|
||||||
float length = SCREEN_WIDTH - SCREEN_SCALE_X(100);
|
float length = SCREEN_WIDTH - SCREEN_SCALE_X(80);
|
||||||
float vpos = SCREEN_HEIGHT - SCREEN_SCALE_Y(13);
|
float top = SCREEN_HEIGHT - SCREEN_SCALE_Y(14);
|
||||||
float height = SCREEN_SCALE_Y(7);
|
float bottom = top + SCREEN_SCALE_Y(5);
|
||||||
CSprite2d::DrawRect(CRect(hpos, vpos, hpos + length, vpos + height), CRGBA(40, 53, 68, 255));
|
#else
|
||||||
|
float hpos = SCREEN_STRETCH_X(40);
|
||||||
|
float length = SCREEN_STRETCH_X(440);
|
||||||
|
// this is rather weird
|
||||||
|
float top = SCREEN_STRETCH_Y(407.4f - 7.0f/3.0f);
|
||||||
|
float bottom = SCREEN_STRETCH_Y(407.4f + 7.0f/3.0f);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
CSprite2d::DrawRect(CRect(hpos-1.0f, top-1.0f, hpos+length+1.0f, bottom+1.0f), CRGBA(40, 53, 68, 255));
|
||||||
|
|
||||||
|
CSprite2d::DrawRect(CRect(hpos, top, hpos+length, bottom), CRGBA(155, 50, 125, 255));
|
||||||
|
|
||||||
length *= NumberOfChunksLoaded/TOTALNUMCHUNKS;
|
length *= NumberOfChunksLoaded/TOTALNUMCHUNKS;
|
||||||
CSprite2d::DrawRect(CRect(hpos, vpos, hpos + length, vpos + height), CRGBA(81, 106, 137, 255));
|
CSprite2d::DrawRect(CRect(hpos, top, hpos+length, bottom), CRGBA(255, 150, 225, 255));
|
||||||
|
|
||||||
// this is done by the game but is unused
|
// this is done by the game but is unused
|
||||||
|
CFont::SetBackgroundOff();
|
||||||
CFont::SetScale(SCREEN_SCALE_X(2), SCREEN_SCALE_Y(2));
|
CFont::SetScale(SCREEN_SCALE_X(2), SCREEN_SCALE_Y(2));
|
||||||
CFont::SetPropOn();
|
CFont::SetPropOn();
|
||||||
CFont::SetRightJustifyOn();
|
CFont::SetRightJustifyOn();
|
||||||
|
CFont::SetDropShadowPosition(1);
|
||||||
|
CFont::SetDropColor(CRGBA(0, 0, 0, 255));
|
||||||
CFont::SetFontStyle(FONT_HEADING);
|
CFont::SetFontStyle(FONT_HEADING);
|
||||||
|
|
||||||
#ifdef CHATTYSPLASH
|
#ifdef CHATTYSPLASH
|
||||||
// my attempt
|
// my attempt
|
||||||
static wchar tmpstr[80];
|
static wchar tmpstr[80];
|
||||||
float yscale = SCREEN_SCALE_Y(0.9f);
|
float yscale = SCREEN_SCALE_Y(0.9f);
|
||||||
vpos -= 45*yscale;
|
top -= 45*yscale;
|
||||||
CFont::SetScale(SCREEN_SCALE_X(0.75f), yscale);
|
CFont::SetScale(SCREEN_SCALE_X(0.75f), yscale);
|
||||||
CFont::SetPropOn();
|
CFont::SetPropOn();
|
||||||
CFont::SetRightJustifyOff();
|
CFont::SetRightJustifyOff();
|
||||||
CFont::SetFontStyle(FONT_BANK);
|
CFont::SetFontStyle(FONT_BANK);
|
||||||
CFont::SetColor(CRGBA(255, 255, 255, 255));
|
CFont::SetColor(CRGBA(255, 255, 255, 255));
|
||||||
AsciiToUnicode(str1, tmpstr);
|
AsciiToUnicode(str1, tmpstr);
|
||||||
CFont::PrintString(hpos, vpos, tmpstr);
|
CFont::PrintString(hpos, top, tmpstr);
|
||||||
vpos += 22*yscale;
|
top += 22*yscale;
|
||||||
AsciiToUnicode(str2, tmpstr);
|
AsciiToUnicode(str2, tmpstr);
|
||||||
CFont::PrintString(hpos, vpos, tmpstr);
|
CFont::PrintString(hpos, top, tmpstr);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -400,22 +400,6 @@ CEntity::PreRender(void)
|
||||||
GetMatrix().UpdateRW();
|
GetMatrix().UpdateRW();
|
||||||
UpdateRwFrame();
|
UpdateRwFrame();
|
||||||
}
|
}
|
||||||
}else if(IsPickupModel(GetModelIndex())){
|
|
||||||
if(((CObject*)this)->bIsPickup){
|
|
||||||
CPickups::DoPickUpEffects(this);
|
|
||||||
GetMatrix().UpdateRW();
|
|
||||||
UpdateRwFrame();
|
|
||||||
}else if(GetModelIndex() == MI_GRENADE){
|
|
||||||
CMotionBlurStreaks::RegisterStreak((uintptr)this,
|
|
||||||
100, 100, 100,
|
|
||||||
GetPosition() - 0.07f*TheCamera.GetRight(),
|
|
||||||
GetPosition() + 0.07f*TheCamera.GetRight());
|
|
||||||
}else if(GetModelIndex() == MI_MOLOTOV){
|
|
||||||
CMotionBlurStreaks::RegisterStreak((uintptr)this,
|
|
||||||
0, 100, 0,
|
|
||||||
GetPosition() - 0.07f*TheCamera.GetRight(),
|
|
||||||
GetPosition() + 0.07f*TheCamera.GetRight());
|
|
||||||
}
|
|
||||||
}else if(GetModelIndex() == MI_MISSILE){
|
}else if(GetModelIndex() == MI_MISSILE){
|
||||||
CVector pos = GetPosition();
|
CVector pos = GetPosition();
|
||||||
float flicker = (CGeneral::GetRandomNumber() & 0xF)/(float)0x10;
|
float flicker = (CGeneral::GetRandomNumber() & 0xF)/(float)0x10;
|
||||||
|
@ -437,7 +421,22 @@ CEntity::PreRender(void)
|
||||||
CCoronas::FLARE_NONE, CCoronas::REFLECTION_ON,
|
CCoronas::FLARE_NONE, CCoronas::REFLECTION_ON,
|
||||||
CCoronas::LOSCHECK_OFF, CCoronas::STREAK_OFF, 0.0f);
|
CCoronas::LOSCHECK_OFF, CCoronas::STREAK_OFF, 0.0f);
|
||||||
}else if(IsGlass(GetModelIndex())){
|
}else if(IsGlass(GetModelIndex())){
|
||||||
PreRenderForGlassWindow();
|
if(!((CSimpleModelInfo*)CModelInfo::GetModelInfo(GetModelIndex()))->m_isArtistGlass)
|
||||||
|
PreRenderForGlassWindow();
|
||||||
|
}else if (((CObject*)this)->bIsPickup) {
|
||||||
|
CPickups::DoPickUpEffects(this);
|
||||||
|
GetMatrix().UpdateRW();
|
||||||
|
UpdateRwFrame();
|
||||||
|
} else if (GetModelIndex() == MI_GRENADE) {
|
||||||
|
CMotionBlurStreaks::RegisterStreak((uintptr)this,
|
||||||
|
100, 100, 100,
|
||||||
|
GetPosition() - 0.07f * TheCamera.GetRight(),
|
||||||
|
GetPosition() + 0.07f * TheCamera.GetRight());
|
||||||
|
} else if (GetModelIndex() == MI_MOLOTOV) {
|
||||||
|
CMotionBlurStreaks::RegisterStreak((uintptr)this,
|
||||||
|
0, 100, 0,
|
||||||
|
GetPosition() - 0.07f * TheCamera.GetRight(),
|
||||||
|
GetPosition() + 0.07f * TheCamera.GetRight());
|
||||||
}
|
}
|
||||||
// fall through
|
// fall through
|
||||||
case ENTITY_TYPE_DUMMY:
|
case ENTITY_TYPE_DUMMY:
|
||||||
|
|
|
@ -414,7 +414,9 @@ enum
|
||||||
MI_AK47 = 276,
|
MI_AK47 = 276,
|
||||||
MI_SHOTGUN = 279,
|
MI_SHOTGUN = 279,
|
||||||
MI_M16 = 280,
|
MI_M16 = 280,
|
||||||
|
MI_TEC9 = 281,
|
||||||
MI_UZI = 282,
|
MI_UZI = 282,
|
||||||
|
MI_SILENCEDINGRAM = 283,
|
||||||
MI_MP5 = 284,
|
MI_MP5 = 284,
|
||||||
MI_SNIPER = 285,
|
MI_SNIPER = 285,
|
||||||
MI_ROCKETLAUNCHER = 287,
|
MI_ROCKETLAUNCHER = 287,
|
||||||
|
@ -530,29 +532,6 @@ IsBannerModel(int16 id)
|
||||||
id == MI_ITALYBANNER1 ||
|
id == MI_ITALYBANNER1 ||
|
||||||
id == MI_CHINALANTERN;
|
id == MI_CHINALANTERN;
|
||||||
}
|
}
|
||||||
inline bool
|
|
||||||
IsPickupModel(int16 id)
|
|
||||||
{
|
|
||||||
return id == MI_GRENADE ||
|
|
||||||
id == MI_AK47 ||
|
|
||||||
id == MI_BASEBALL_BAT ||
|
|
||||||
id == MI_COLT ||
|
|
||||||
id == MI_MOLOTOV ||
|
|
||||||
id == MI_ROCKETLAUNCHER ||
|
|
||||||
id == MI_SHOTGUN ||
|
|
||||||
id == MI_SNIPER ||
|
|
||||||
id == MI_UZI ||
|
|
||||||
id == MI_M16 ||
|
|
||||||
id == MI_FLAMETHROWER ||
|
|
||||||
id == MI_PICKUP_ADRENALINE ||
|
|
||||||
id == MI_PICKUP_BODYARMOUR ||
|
|
||||||
id == MI_PICKUP_INFO ||
|
|
||||||
id == MI_PICKUP_HEALTH ||
|
|
||||||
id == MI_PICKUP_BONUS ||
|
|
||||||
id == MI_PICKUP_BRIBE ||
|
|
||||||
id == MI_PICKUP_KILLFRENZY ||
|
|
||||||
id == MI_PICKUP_CAMERA;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline bool
|
inline bool
|
||||||
IsPolicePedModel(int16 id)
|
IsPolicePedModel(int16 id)
|
||||||
|
|
|
@ -200,7 +200,7 @@ CCivilianPed::ProcessControl(void)
|
||||||
if (DyingOrDead())
|
if (DyingOrDead())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
GetWeapon()->Update(m_audioEntityId);
|
GetWeapon()->Update(m_audioEntityId, nil);
|
||||||
switch (m_nPedState) {
|
switch (m_nPedState) {
|
||||||
case PED_WANDER_RANGE:
|
case PED_WANDER_RANGE:
|
||||||
case PED_WANDER_PATH:
|
case PED_WANDER_PATH:
|
||||||
|
|
|
@ -589,7 +589,7 @@ CCopPed::ProcessControl(void)
|
||||||
ArrestPlayer();
|
ArrestPlayer();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
GetWeapon()->Update(m_audioEntityId);
|
GetWeapon()->Update(m_audioEntityId, nil);
|
||||||
if (m_moved.Magnitude() > 0.0f)
|
if (m_moved.Magnitude() > 0.0f)
|
||||||
Avoid();
|
Avoid();
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ CEmergencyPed::ProcessControl(void)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(!DyingOrDead()) {
|
if(!DyingOrDead()) {
|
||||||
GetWeapon()->Update(m_audioEntityId);
|
GetWeapon()->Update(m_audioEntityId, nil);
|
||||||
|
|
||||||
if (IsPedInControl() && m_moved.Magnitude() > 0.0f)
|
if (IsPedInControl() && m_moved.Magnitude() > 0.0f)
|
||||||
Avoid();
|
Avoid();
|
||||||
|
|
370
src/peds/Ped.cpp
370
src/peds/Ped.cpp
|
@ -67,6 +67,9 @@ uint16 gnNumTempPedList;
|
||||||
|
|
||||||
CColPoint aTempPedColPts[MAX_COLLISION_POINTS];
|
CColPoint aTempPedColPts[MAX_COLLISION_POINTS];
|
||||||
|
|
||||||
|
// TODO(Miami)
|
||||||
|
#define AUDIO_NOT_READY
|
||||||
|
|
||||||
// Corresponds to ped sounds (from SOUND_PED_DEATH to SOUND_PED_TAXI_CALL)
|
// Corresponds to ped sounds (from SOUND_PED_DEATH to SOUND_PED_TAXI_CALL)
|
||||||
PedAudioData CommentWaitTime[39] = {
|
PedAudioData CommentWaitTime[39] = {
|
||||||
{500, 800, 500, 2},
|
{500, 800, 500, 2},
|
||||||
|
@ -647,6 +650,7 @@ CPed::CPed(uint32 pedType) : m_pedIK(this)
|
||||||
m_maxWeaponTypeAllowed = WEAPONTYPE_UNARMED;
|
m_maxWeaponTypeAllowed = WEAPONTYPE_UNARMED;
|
||||||
m_currentWeapon = WEAPONTYPE_UNARMED;
|
m_currentWeapon = WEAPONTYPE_UNARMED;
|
||||||
m_storedWeapon = WEAPONTYPE_UNIDENTIFIED;
|
m_storedWeapon = WEAPONTYPE_UNIDENTIFIED;
|
||||||
|
m_delayedWeapon = WEAPONTYPE_UNIDENTIFIED;
|
||||||
|
|
||||||
for(int i = 0; i < TOTAL_WEAPON_SLOTS; i++) {
|
for(int i = 0; i < TOTAL_WEAPON_SLOTS; i++) {
|
||||||
CWeapon &weapon = GetWeapon(i);
|
CWeapon &weapon = GetWeapon(i);
|
||||||
|
@ -658,7 +662,7 @@ CPed::CPed(uint32 pedType) : m_pedIK(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
m_lastFightMove = FIGHTMOVE_NULL;
|
m_lastFightMove = FIGHTMOVE_NULL;
|
||||||
GiveWeapon(WEAPONTYPE_UNARMED, 0);
|
GiveWeapon(WEAPONTYPE_UNARMED, 0, true);
|
||||||
m_wepAccuracy = 60;
|
m_wepAccuracy = 60;
|
||||||
m_lastWepDam = -1;
|
m_lastWepDam = -1;
|
||||||
m_collPoly.valid = false;
|
m_collPoly.valid = false;
|
||||||
|
@ -1181,7 +1185,7 @@ CPed::FinishedReloadCB(CAnimBlendAssociation *reloadAssoc, void *arg)
|
||||||
crouchFireAssoc = RpAnimBlendClumpGetAssociation(ped->GetClump(), ANIM_WEAPON_CROUCHFIRE);
|
crouchFireAssoc = RpAnimBlendClumpGetAssociation(ped->GetClump(), ANIM_WEAPON_CROUCHFIRE);
|
||||||
}
|
}
|
||||||
if (!!weapon->m_bReload && reloadAssoc) {
|
if (!!weapon->m_bReload && reloadAssoc) {
|
||||||
if (reloadAssoc->animId == ANIM_WEAPON_CROUCHRELOAD && !crouchFireAssoc) {
|
if (reloadAssoc->animId == GetCrouchReloadAnim(weapon) && !crouchFireAssoc) {
|
||||||
CAnimBlendAssociation *crouchAssoc = CAnimManager::BlendAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_WEAPON_CROUCH, 8.0f);
|
CAnimBlendAssociation *crouchAssoc = CAnimManager::BlendAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_WEAPON_CROUCH, 8.0f);
|
||||||
crouchAssoc->SetCurrentTime(crouchAssoc->hierarchy->totalLength);
|
crouchAssoc->SetCurrentTime(crouchAssoc->hierarchy->totalLength);
|
||||||
crouchAssoc->flags &= ~ASSOC_RUNNING;
|
crouchAssoc->flags &= ~ASSOC_RUNNING;
|
||||||
|
@ -1214,7 +1218,7 @@ CPed::FinishedAttackCB(CAnimBlendAssociation *attackAssoc, void *arg)
|
||||||
if (ped->m_nPedState != PED_ATTACK) {
|
if (ped->m_nPedState != PED_ATTACK) {
|
||||||
if (ped->bIsDucking && ped->IsPedInControl()) {
|
if (ped->bIsDucking && ped->IsPedInControl()) {
|
||||||
if (currentWeapon->m_bReload) {
|
if (currentWeapon->m_bReload) {
|
||||||
reloadAnimAssoc = RpAnimBlendClumpGetAssociation(ped->GetClump(), ANIM_WEAPON_CROUCHRELOAD);
|
reloadAnimAssoc = RpAnimBlendClumpGetAssociation(ped->GetClump(), GetCrouchReloadAnim(currentWeapon));
|
||||||
}
|
}
|
||||||
if (currentWeapon->m_bCrouchFire && attackAssoc) {
|
if (currentWeapon->m_bCrouchFire && attackAssoc) {
|
||||||
if (attackAssoc->animId == ANIM_WEAPON_CROUCHFIRE && !reloadAnimAssoc) {
|
if (attackAssoc->animId == ANIM_WEAPON_CROUCHFIRE && !reloadAnimAssoc) {
|
||||||
|
@ -1240,7 +1244,7 @@ CPed::FinishedAttackCB(CAnimBlendAssociation *attackAssoc, void *arg)
|
||||||
|
|
||||||
if (ped->bIsDucking && ped->bCrouchWhenShooting) {
|
if (ped->bIsDucking && ped->bCrouchWhenShooting) {
|
||||||
if (currentWeapon->m_bReload) {
|
if (currentWeapon->m_bReload) {
|
||||||
reloadAnimAssoc = RpAnimBlendClumpGetAssociation(ped->GetClump(), ANIM_WEAPON_CROUCHRELOAD);
|
reloadAnimAssoc = RpAnimBlendClumpGetAssociation(ped->GetClump(), GetCrouchReloadAnim(currentWeapon));
|
||||||
}
|
}
|
||||||
if (currentWeapon->m_bCrouchFire && attackAssoc) {
|
if (currentWeapon->m_bCrouchFire && attackAssoc) {
|
||||||
if (attackAssoc->animId == ANIM_WEAPON_CROUCHFIRE && !reloadAnimAssoc) {
|
if (attackAssoc->animId == ANIM_WEAPON_CROUCHFIRE && !reloadAnimAssoc) {
|
||||||
|
@ -1304,7 +1308,7 @@ CPed::FinishedAttackCB(CAnimBlendAssociation *attackAssoc, void *arg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// --MIAMI: Done
|
// --MIAMI: Done except melee weapons
|
||||||
void
|
void
|
||||||
CPed::Attack(void)
|
CPed::Attack(void)
|
||||||
{
|
{
|
||||||
|
@ -1356,11 +1360,11 @@ CPed::Attack(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ourWeapon->m_bReload) {
|
if (ourWeapon->m_bReload) {
|
||||||
reloadAnimAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_WEAPON_RELOAD);
|
reloadAnimAssoc = RpAnimBlendClumpGetAssociation(GetClump(), GetReloadAnim(ourWeapon));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!!ourWeapon->m_bReload && !reloadAnimAssoc) {
|
if (!!ourWeapon->m_bReload && !reloadAnimAssoc) {
|
||||||
reloadAnimAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_WEAPON_CROUCHRELOAD);
|
reloadAnimAssoc = RpAnimBlendClumpGetAssociation(GetClump(), GetCrouchReloadAnim(ourWeapon));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( reloadAnimAssoc && reloadAnimAssoc->IsRunning() ) {
|
if ( reloadAnimAssoc && reloadAnimAssoc->IsRunning() ) {
|
||||||
|
@ -1520,14 +1524,22 @@ CPed::Attack(void)
|
||||||
case ASSOCGRP_UNARMED:
|
case ASSOCGRP_UNARMED:
|
||||||
if (weaponAnimAssoc->animId == ANIM_FIGHT_PPUNCH || // TODO(Miami): Remove after fighting done
|
if (weaponAnimAssoc->animId == ANIM_FIGHT_PPUNCH || // TODO(Miami): Remove after fighting done
|
||||||
weaponAnimAssoc->animId == ANIM_MELEE_ATTACK || weaponAnimAssoc->animId == ANIM_MELEE_ATTACK_START) {
|
weaponAnimAssoc->animId == ANIM_MELEE_ATTACK || weaponAnimAssoc->animId == ANIM_MELEE_ATTACK_START) {
|
||||||
|
#ifdef AUDIO_NOT_READY
|
||||||
|
DMAudio.PlayOneShot(m_audioEntityId, SOUND_FIGHT_PUNCH_39, 0.0f);
|
||||||
|
#else
|
||||||
DMAudio.PlayOneShot(m_audioEntityId, SOUND_FIGHT_PUNCH_39, (damagerType | (ourWeaponType << 8)));
|
DMAudio.PlayOneShot(m_audioEntityId, SOUND_FIGHT_PUNCH_39, (damagerType | (ourWeaponType << 8)));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ASSOCGRP_KNIFE:
|
case ASSOCGRP_KNIFE:
|
||||||
case ASSOCGRP_BASEBALLBAT:
|
case ASSOCGRP_BASEBALLBAT:
|
||||||
case ASSOCGRP_GOLFCLUB:
|
case ASSOCGRP_GOLFCLUB:
|
||||||
case ASSOCGRP_CHAINSAW:
|
case ASSOCGRP_CHAINSAW:
|
||||||
|
#ifdef AUDIO_NOT_READY
|
||||||
|
DMAudio.PlayOneShot(m_audioEntityId, SOUND_WEAPON_BAT_ATTACK, 1.0f);
|
||||||
|
#else
|
||||||
DMAudio.PlayOneShot(m_audioEntityId, SOUND_WEAPON_BAT_ATTACK, (damagerType | (ourWeaponType << 8)));
|
DMAudio.PlayOneShot(m_audioEntityId, SOUND_WEAPON_BAT_ATTACK, (damagerType | (ourWeaponType << 8)));
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -1589,12 +1601,12 @@ CPed::Attack(void)
|
||||||
if (bIsDucking) {
|
if (bIsDucking) {
|
||||||
newReloadAssoc = CAnimManager::BlendAnimation(
|
newReloadAssoc = CAnimManager::BlendAnimation(
|
||||||
GetClump(), ourWeapon->m_AnimToPlay,
|
GetClump(), ourWeapon->m_AnimToPlay,
|
||||||
ANIM_WEAPON_CROUCHRELOAD,
|
GetCrouchReloadAnim(ourWeapon),
|
||||||
8.0f);
|
8.0f);
|
||||||
} else {
|
} else {
|
||||||
newReloadAssoc = CAnimManager::BlendAnimation(
|
newReloadAssoc = CAnimManager::BlendAnimation(
|
||||||
GetClump(), ourWeapon->m_AnimToPlay,
|
GetClump(), ourWeapon->m_AnimToPlay,
|
||||||
ANIM_WEAPON_RELOAD,
|
GetReloadAnim(ourWeapon),
|
||||||
8.0f);
|
8.0f);
|
||||||
}
|
}
|
||||||
newReloadAssoc->SetFinishCallback(FinishedReloadCB, this);
|
newReloadAssoc->SetFinishCallback(FinishedReloadCB, this);
|
||||||
|
@ -1604,7 +1616,26 @@ CPed::Attack(void)
|
||||||
bIsAttacking = false;
|
bIsAttacking = false;
|
||||||
bIsPointingGunAt = false;
|
bIsPointingGunAt = false;
|
||||||
m_shootTimer = CTimer::GetTimeInMilliseconds();
|
m_shootTimer = CTimer::GetTimeInMilliseconds();
|
||||||
|
#ifdef AUDIO_NOT_READY
|
||||||
|
switch (ourWeaponType) {
|
||||||
|
case WEAPONTYPE_UZI:
|
||||||
|
case WEAPONTYPE_TEC9:
|
||||||
|
case WEAPONTYPE_SILENCED_INGRAM:
|
||||||
|
case WEAPONTYPE_MP5:
|
||||||
|
DMAudio.PlayOneShot(m_audioEntityId, SOUND_WEAPON_UZI_BULLET_ECHO, 0.0f);
|
||||||
|
break;
|
||||||
|
case WEAPONTYPE_AK47:
|
||||||
|
DMAudio.PlayOneShot(m_audioEntityId, SOUND_WEAPON_AK47_BULLET_ECHO, 0.0f);
|
||||||
|
break;
|
||||||
|
case WEAPONTYPE_M16:
|
||||||
|
DMAudio.PlayOneShot(m_audioEntityId, SOUND_WEAPON_M16_BULLET_ECHO, 0.0f);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#else
|
||||||
DMAudio.PlayOneShot(m_audioEntityId, SOUND_WEAPON_AK47_BULLET_ECHO, GetWeapon()->m_eWeaponType);
|
DMAudio.PlayOneShot(m_audioEntityId, SOUND_WEAPON_AK47_BULLET_ECHO, GetWeapon()->m_eWeaponType);
|
||||||
|
#endif
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1649,10 +1680,28 @@ CPed::Attack(void)
|
||||||
ClearAimFlag();
|
ClearAimFlag();
|
||||||
|
|
||||||
// Echoes of bullets, at the end of the attack. (Bug: doesn't play while reloading)
|
// Echoes of bullets, at the end of the attack. (Bug: doesn't play while reloading)
|
||||||
if (weaponAnimAssoc->currentTime - weaponAnimAssoc->timeStep < ourWeapon->m_fAnimLoopEnd) {
|
if (weaponAnimAssoc->currentTime - weaponAnimAssoc->timeStep < animLoopEnd) {
|
||||||
|
|
||||||
// What?! Weapon id as volume??
|
#ifdef AUDIO_NOT_READY
|
||||||
|
switch (ourWeaponType) {
|
||||||
|
case WEAPONTYPE_UZI:
|
||||||
|
case WEAPONTYPE_TEC9:
|
||||||
|
case WEAPONTYPE_SILENCED_INGRAM:
|
||||||
|
case WEAPONTYPE_MP5:
|
||||||
|
DMAudio.PlayOneShot(m_audioEntityId, SOUND_WEAPON_UZI_BULLET_ECHO, 0.0f);
|
||||||
|
break;
|
||||||
|
case WEAPONTYPE_AK47:
|
||||||
|
DMAudio.PlayOneShot(m_audioEntityId, SOUND_WEAPON_AK47_BULLET_ECHO, 0.0f);
|
||||||
|
break;
|
||||||
|
case WEAPONTYPE_M16:
|
||||||
|
DMAudio.PlayOneShot(m_audioEntityId, SOUND_WEAPON_M16_BULLET_ECHO, 0.0f);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#else
|
||||||
DMAudio.PlayOneShot(m_audioEntityId, SOUND_WEAPON_AK47_BULLET_ECHO, GetWeapon()->m_eWeaponType);
|
DMAudio.PlayOneShot(m_audioEntityId, SOUND_WEAPON_AK47_BULLET_ECHO, GetWeapon()->m_eWeaponType);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fun fact: removing this part leds to reloading flamethrower
|
// Fun fact: removing this part leds to reloading flamethrower
|
||||||
|
@ -2135,7 +2184,7 @@ CPed::LineUpPedWithCar(PedLineUpPhase phase)
|
||||||
case ANIM_VAN_GETIN:
|
case ANIM_VAN_GETIN:
|
||||||
#ifdef VC_PED_PORTS
|
#ifdef VC_PED_PORTS
|
||||||
multExtractedFromAnim = true;
|
multExtractedFromAnim = true;
|
||||||
zBlend = Max(m_pVehicleAnim->currentTime / m_pVehicleAnim->hierarchy->totalLength - 0.3f, 0.0f) / (1.0f - 0.3f);
|
zBlend = Max(m_pVehicleAnim->GetProgress() - 0.3f, 0.0f) / (1.0f - 0.3f);
|
||||||
// fall through
|
// fall through
|
||||||
#endif
|
#endif
|
||||||
case ANIM_CAR_QJACKED:
|
case ANIM_CAR_QJACKED:
|
||||||
|
@ -2146,7 +2195,7 @@ CPed::LineUpPedWithCar(PedLineUpPhase phase)
|
||||||
#ifdef VC_PED_PORTS
|
#ifdef VC_PED_PORTS
|
||||||
if (!multExtractedFromAnim) {
|
if (!multExtractedFromAnim) {
|
||||||
multExtractedFromAnim = true;
|
multExtractedFromAnim = true;
|
||||||
zBlend = Max(m_pVehicleAnim->currentTime / m_pVehicleAnim->hierarchy->totalLength - 0.5f, 0.0f) / (1.0f - 0.5f);
|
zBlend = Max(m_pVehicleAnim->GetProgress() - 0.5f, 0.0f) / (1.0f - 0.5f);
|
||||||
}
|
}
|
||||||
// fall through
|
// fall through
|
||||||
#endif
|
#endif
|
||||||
|
@ -2154,14 +2203,14 @@ CPed::LineUpPedWithCar(PedLineUpPhase phase)
|
||||||
case ANIM_CAR_CRAWLOUT_RHS2:
|
case ANIM_CAR_CRAWLOUT_RHS2:
|
||||||
case ANIM_VAN_GETOUT_L:
|
case ANIM_VAN_GETOUT_L:
|
||||||
case ANIM_VAN_GETOUT:
|
case ANIM_VAN_GETOUT:
|
||||||
seatPosMult = m_pVehicleAnim->currentTime / m_pVehicleAnim->hierarchy->totalLength;
|
seatPosMult = m_pVehicleAnim->GetProgress();
|
||||||
break;
|
break;
|
||||||
case ANIM_CAR_GETIN_RHS:
|
case ANIM_CAR_GETIN_RHS:
|
||||||
case ANIM_CAR_GETIN_LHS:
|
case ANIM_CAR_GETIN_LHS:
|
||||||
#ifdef VC_PED_PORTS
|
#ifdef VC_PED_PORTS
|
||||||
if (veh && veh->IsCar() && veh->bIsBus) {
|
if (veh && veh->IsCar() && veh->bIsBus) {
|
||||||
multExtractedFromAnimBus = true;
|
multExtractedFromAnimBus = true;
|
||||||
zBlend = Min(m_pVehicleAnim->currentTime / m_pVehicleAnim->hierarchy->totalLength, 0.5f) / 0.5f;
|
zBlend = Min(m_pVehicleAnim->GetProgress(), 0.5f) / 0.5f;
|
||||||
}
|
}
|
||||||
// fall through
|
// fall through
|
||||||
#endif
|
#endif
|
||||||
|
@ -4522,6 +4571,9 @@ CPed::SetGetUp(void)
|
||||||
}
|
}
|
||||||
if (m_nPedState != PED_GETUP) {
|
if (m_nPedState != PED_GETUP) {
|
||||||
SetStoredState();
|
SetStoredState();
|
||||||
|
if (m_nPedState == PED_FOLLOW_PATH)
|
||||||
|
ClearFollowPath();
|
||||||
|
|
||||||
m_nPedState = PED_GETUP;
|
m_nPedState = PED_GETUP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5121,7 +5173,7 @@ CPed::SetAttack(CEntity *victim)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (curWeapon->m_bReload &&
|
if (curWeapon->m_bReload &&
|
||||||
(RpAnimBlendClumpGetAssociation(GetClump(), ANIM_WEAPON_RELOAD) || RpAnimBlendClumpGetAssociation(GetClump(), ANIM_WEAPON_CROUCHRELOAD))) {
|
(RpAnimBlendClumpGetAssociation(GetClump(), GetReloadAnim(curWeapon)) || RpAnimBlendClumpGetAssociation(GetClump(), GetCrouchReloadAnim(curWeapon)))) {
|
||||||
if (!IsPlayer() || m_nPedState != PED_ATTACK || ((CPlayerPed*)this)->m_bHaveTargetSelected)
|
if (!IsPlayer() || m_nPedState != PED_ATTACK || ((CPlayerPed*)this)->m_bHaveTargetSelected)
|
||||||
bIsAttacking = false;
|
bIsAttacking = false;
|
||||||
else
|
else
|
||||||
|
@ -5513,13 +5565,13 @@ CPed::FightStrike(CVector &touchedNodePos)
|
||||||
for (int j = 0; j < hisCol->numSpheres; j++) {
|
for (int j = 0; j < hisCol->numSpheres; j++) {
|
||||||
attackDistance = hisCol->spheres[j].center;
|
attackDistance = hisCol->spheres[j].center;
|
||||||
attackDistance -= touchedNodePos;
|
attackDistance -= touchedNodePos;
|
||||||
CColSphere *ourPieces = hisCol->spheres;
|
CColSphere *hisPieces = hisCol->spheres;
|
||||||
float maxDistanceToBeat = ourPieces[j].radius + tFightMoves[m_lastFightMove].strikeRadius;
|
float maxDistanceToBeat = hisPieces[j].radius + tFightMoves[m_lastFightMove].strikeRadius;
|
||||||
|
|
||||||
// We can beat him too
|
// We can beat him too
|
||||||
if (sq(maxDistanceToBeat) > attackDistance.MagnitudeSqr()) {
|
if (sq(maxDistanceToBeat) > attackDistance.MagnitudeSqr()) {
|
||||||
pedFound = true;
|
pedFound = true;
|
||||||
closestPedPiece = (ePedPieceTypes) ourPieces[j].piece;
|
closestPedPiece = (ePedPieceTypes) hisPieces[j].piece;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6325,6 +6377,57 @@ CPed::CreateDeadPedMoney(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CPed::CreateDeadPedPickupCoors(float *x, float *y, float *z)
|
||||||
|
{
|
||||||
|
bool found = false;
|
||||||
|
CVector pickupPos;
|
||||||
|
|
||||||
|
#define NUMBER_OF_ATTEMPTS 32
|
||||||
|
for (int i = 0; i < NUMBER_OF_ATTEMPTS; i++) {
|
||||||
|
|
||||||
|
pickupPos = GetPosition();
|
||||||
|
pickupPos.x = 1.5f * Sin((CGeneral::GetRandomNumber() % 256) * PI / 128) + GetPosition().x;
|
||||||
|
pickupPos.y = 1.5f * Cos((CGeneral::GetRandomNumber() % 256) * PI / 128) + GetPosition().y;
|
||||||
|
pickupPos.z = CWorld::FindGroundZFor3DCoord(pickupPos.x, pickupPos.y, pickupPos.z, &found) + 0.5f;
|
||||||
|
|
||||||
|
if (!found)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
CVector pedPos = GetPosition();
|
||||||
|
pedPos.z += 0.3f;
|
||||||
|
|
||||||
|
CVector pedToPickup = pickupPos - pedPos;
|
||||||
|
float distance = pedToPickup.Magnitude();
|
||||||
|
|
||||||
|
// outer edge of pickup
|
||||||
|
distance = (distance + 0.4f) / distance;
|
||||||
|
CVector pickupPos2 = pedPos;
|
||||||
|
pickupPos2 += distance * pedToPickup;
|
||||||
|
|
||||||
|
if ((pickupPos - FindPlayerCoors()).Magnitude2D() > 2.0f || i > NUMBER_OF_ATTEMPTS / 2) {
|
||||||
|
|
||||||
|
if (i > NUMBER_OF_ATTEMPTS / 2 || !CPickups::TestForPickupsInBubble(pickupPos, 1.3f)) {
|
||||||
|
|
||||||
|
if (CWorld::GetIsLineOfSightClear(pickupPos2, pedPos,
|
||||||
|
true, i < NUMBER_OF_ATTEMPTS / 2, false, i < NUMBER_OF_ATTEMPTS / 2, false, false, false)) {
|
||||||
|
|
||||||
|
if (i > NUMBER_OF_ATTEMPTS / 2 || !CWorld::TestSphereAgainstWorld(pickupPos, 1.2f, nil, false, true, false, false, false, false)) {
|
||||||
|
*x = pickupPos.x;
|
||||||
|
*y = pickupPos.y;
|
||||||
|
*z = pickupPos.z;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*x = GetPosition().x;
|
||||||
|
*y = GetPosition().y;
|
||||||
|
*z = GetPosition().z + 0.4f;
|
||||||
|
#undef NUMBER_OF_ATTEMPTS
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CPed::CreateDeadPedWeaponPickups(void)
|
CPed::CreateDeadPedWeaponPickups(void)
|
||||||
{
|
{
|
||||||
|
@ -6340,10 +6443,11 @@ CPed::CreateDeadPedWeaponPickups(void)
|
||||||
if (weapon == WEAPONTYPE_UNARMED || weapon == WEAPONTYPE_DETONATOR || (weaponAmmo == 0 && !GetWeapon(i).IsTypeMelee()))
|
if (weapon == WEAPONTYPE_UNARMED || weapon == WEAPONTYPE_DETONATOR || (weaponAmmo == 0 && !GetWeapon(i).IsTypeMelee()))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
int quantity = Min(weaponAmmo, AmmoForWeapon_OnStreet[weapon] / 2);
|
||||||
CreateDeadPedPickupCoors(&pickupPos.x, &pickupPos.y, &pickupPos.z);
|
CreateDeadPedPickupCoors(&pickupPos.x, &pickupPos.y, &pickupPos.z);
|
||||||
pickupPos.z += 0.4f;
|
if (!CPickups::TryToMerge_WeaponType(pickupPos, weapon, PICKUP_ONCE_TIMEOUT, quantity, false)) {
|
||||||
// TODO(MIAMI): there is more stuff it seems
|
CPickups::GenerateNewOne_WeaponType(pickupPos, weapon, PICKUP_ONCE_TIMEOUT, Min(weaponAmmo, quantity));
|
||||||
CPickups::GenerateNewOne_WeaponType(pickupPos, weapon, PICKUP_ONCE_TIMEOUT, Min(weaponAmmo, AmmoForWeapon_OnStreet[weapon]));
|
}
|
||||||
}
|
}
|
||||||
ClearWeapons();
|
ClearWeapons();
|
||||||
}
|
}
|
||||||
|
@ -8921,7 +9025,11 @@ CPed::InvestigateEvent(void)
|
||||||
bool
|
bool
|
||||||
CPed::IsPedDoingDriveByShooting(void)
|
CPed::IsPedDoingDriveByShooting(void)
|
||||||
{
|
{
|
||||||
|
#ifdef FIX_BUGS
|
||||||
if (FindPlayerPed() == this && CWeaponInfo::GetWeaponInfo(GetWeapon()->m_eWeaponType)->m_nWeaponSlot == 5) {
|
if (FindPlayerPed() == this && CWeaponInfo::GetWeaponInfo(GetWeapon()->m_eWeaponType)->m_nWeaponSlot == 5) {
|
||||||
|
#else
|
||||||
|
if (FindPlayerPed() == this && GetWeapon()->m_eWeaponType == WEAPONTYPE_UZI) {
|
||||||
|
#endif
|
||||||
if (TheCamera.Cams[TheCamera.ActiveCam].LookingLeft || TheCamera.Cams[TheCamera.ActiveCam].LookingRight)
|
if (TheCamera.Cams[TheCamera.ActiveCam].LookingLeft || TheCamera.Cams[TheCamera.ActiveCam].LookingRight)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -9958,11 +10066,8 @@ CPed::ProcessControl(void)
|
||||||
if (m_nPedState == PED_FOLLOW_PATH) {
|
if (m_nPedState == PED_FOLLOW_PATH) {
|
||||||
if (DotProduct(m_vecDamageNormal, GetForward()) < -0.866f && CanPedJumpThis(collidingEnt, &m_vecDamageNormal)) {
|
if (DotProduct(m_vecDamageNormal, GetForward()) < -0.866f && CanPedJumpThis(collidingEnt, &m_vecDamageNormal)) {
|
||||||
SetJump();
|
SetJump();
|
||||||
|
|
||||||
// Moved break into here, for compatibility with III
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
// break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (m_pedInObjective &&
|
if (m_pedInObjective &&
|
||||||
|
@ -10933,15 +11038,13 @@ CPed::ProcessControl(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_pMyVehicle->pDriver != this || m_pMyVehicle->IsBoat()) {
|
if (m_pMyVehicle->pDriver != this) {
|
||||||
LookForSexyPeds();
|
LookForSexyPeds();
|
||||||
LookForSexyCars();
|
LookForSexyCars();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_pMyVehicle->m_vehType == VEHICLE_TYPE_BIKE || !m_pMyVehicle->pDriver->IsPlayer()) {
|
// TODO(Miami): Start KILL_CHAR_ON_BOAT objective
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
CPad* pad = CPad::GetPad(0);
|
CPad* pad = CPad::GetPad(0);
|
||||||
|
|
||||||
|
@ -10971,12 +11074,24 @@ CPed::ProcessControl(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// TODO(Miami): This part moved to DriveVehicle in VC
|
||||||
float steerAngle = m_pMyVehicle->m_fSteerAngle;
|
float steerAngle = m_pMyVehicle->m_fSteerAngle;
|
||||||
CAnimBlendAssociation *lDriveAssoc;
|
CAnimBlendAssociation *lDriveAssoc;
|
||||||
CAnimBlendAssociation *rDriveAssoc;
|
CAnimBlendAssociation *rDriveAssoc;
|
||||||
CAnimBlendAssociation *lbAssoc;
|
CAnimBlendAssociation *lbAssoc;
|
||||||
CAnimBlendAssociation *sitAssoc;
|
CAnimBlendAssociation *sitAssoc;
|
||||||
if (m_pMyVehicle->bLowVehicle) {
|
if (m_pMyVehicle->IsBoat() && !(m_pMyVehicle->pHandling->Flags & HANDLING_SIT_IN_BOAT)) {
|
||||||
|
sitAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_DRIVE_BOAT);
|
||||||
|
|
||||||
|
if (!sitAssoc || sitAssoc->blendAmount < 1.0f) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
lDriveAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_DRIVE_BOAT_L);
|
||||||
|
rDriveAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_DRIVE_BOAT_R);
|
||||||
|
lbAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_BOAT_LB);
|
||||||
|
} else if (m_pMyVehicle->bLowVehicle) {
|
||||||
sitAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_LSIT);
|
sitAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_LSIT);
|
||||||
|
|
||||||
if (!sitAssoc || sitAssoc->blendAmount < 1.0f) {
|
if (!sitAssoc || sitAssoc->blendAmount < 1.0f) {
|
||||||
|
@ -10996,18 +11111,21 @@ CPed::ProcessControl(void)
|
||||||
lDriveAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_DRIVE_L);
|
lDriveAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_DRIVE_L);
|
||||||
rDriveAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_DRIVE_R);
|
rDriveAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_DRIVE_R);
|
||||||
lbAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_LB);
|
lbAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_LB);
|
||||||
|
}
|
||||||
|
|
||||||
if (lbAssoc &&
|
if (lbAssoc &&
|
||||||
TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_1STPERSON
|
TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_1STPERSON
|
||||||
&& TheCamera.Cams[TheCamera.ActiveCam].DirectionWasLooking == LOOKING_LEFT) {
|
&& TheCamera.Cams[TheCamera.ActiveCam].DirectionWasLooking == LOOKING_LEFT) {
|
||||||
lbAssoc->blendDelta = -1000.0f;
|
lbAssoc->blendDelta = -1000.0f;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CAnimBlendAssociation *driveByAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_DRIVEBY_L);
|
CAnimBlendAssociation *driveByAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_DRIVEBY_L);
|
||||||
|
|
||||||
if (!driveByAssoc)
|
if (!driveByAssoc)
|
||||||
driveByAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_DRIVEBY_R);
|
driveByAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_DRIVEBY_R);
|
||||||
|
if (!driveByAssoc)
|
||||||
|
driveByAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_DRIVEBY_LOW_L);
|
||||||
|
if (!driveByAssoc)
|
||||||
|
driveByAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_DRIVEBY_LOW_R);
|
||||||
|
|
||||||
if (m_pMyVehicle->bLowVehicle || m_pMyVehicle->m_fGasPedal >= 0.0f || driveByAssoc) {
|
if (m_pMyVehicle->bLowVehicle || m_pMyVehicle->m_fGasPedal >= 0.0f || driveByAssoc) {
|
||||||
if (steerAngle == 0.0f || driveByAssoc) {
|
if (steerAngle == 0.0f || driveByAssoc) {
|
||||||
|
@ -11022,6 +11140,8 @@ CPed::ProcessControl(void)
|
||||||
|
|
||||||
if (rDriveAssoc)
|
if (rDriveAssoc)
|
||||||
rDriveAssoc->blendAmount = clamp(steerAngle * -100.0f / 61.0f, 0.0f, 1.0f);
|
rDriveAssoc->blendAmount = clamp(steerAngle * -100.0f / 61.0f, 0.0f, 1.0f);
|
||||||
|
else if (m_pMyVehicle->IsBoat() && !(m_pMyVehicle->pHandling->Flags & HANDLING_SIT_IN_BOAT))
|
||||||
|
CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_DRIVE_BOAT_R);
|
||||||
else if (m_pMyVehicle->bLowVehicle)
|
else if (m_pMyVehicle->bLowVehicle)
|
||||||
CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_DRIVE_LOW_R);
|
CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_DRIVE_LOW_R);
|
||||||
else
|
else
|
||||||
|
@ -11033,6 +11153,8 @@ CPed::ProcessControl(void)
|
||||||
|
|
||||||
if (lDriveAssoc)
|
if (lDriveAssoc)
|
||||||
lDriveAssoc->blendAmount = clamp(steerAngle * 100.0f / 61.0f, 0.0f, 1.0f);
|
lDriveAssoc->blendAmount = clamp(steerAngle * 100.0f / 61.0f, 0.0f, 1.0f);
|
||||||
|
else if (m_pMyVehicle->IsBoat() && !(m_pMyVehicle->pHandling->Flags & HANDLING_SIT_IN_BOAT))
|
||||||
|
CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_DRIVE_BOAT_L);
|
||||||
else if (m_pMyVehicle->bLowVehicle)
|
else if (m_pMyVehicle->bLowVehicle)
|
||||||
CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_DRIVE_LOW_L);
|
CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_DRIVE_LOW_L);
|
||||||
else
|
else
|
||||||
|
@ -11045,10 +11167,18 @@ CPed::ProcessControl(void)
|
||||||
|
|
||||||
if ((TheCamera.Cams[TheCamera.ActiveCam].Mode != CCam::MODE_1STPERSON
|
if ((TheCamera.Cams[TheCamera.ActiveCam].Mode != CCam::MODE_1STPERSON
|
||||||
|| TheCamera.Cams[TheCamera.ActiveCam].DirectionWasLooking != LOOKING_LEFT)
|
|| TheCamera.Cams[TheCamera.ActiveCam].DirectionWasLooking != LOOKING_LEFT)
|
||||||
&& (!lbAssoc || lbAssoc->blendAmount < 1.0f)) {
|
&& (!lbAssoc || lbAssoc->blendAmount < 1.0f && lbAssoc->blendDelta <= 0.0f)) {
|
||||||
CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_CAR_LB, 4.0f);
|
|
||||||
|
if(m_pMyVehicle->IsBoat() && !(m_pMyVehicle->pHandling->Flags & HANDLING_SIT_IN_BOAT))
|
||||||
|
CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_BOAT_LB, 4.0f);
|
||||||
|
else
|
||||||
|
CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_CAR_LB, 4.0f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(Miami): This part belongs to DriveVehicle
|
||||||
|
if (!m_pMyVehicle)
|
||||||
|
return;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PED_DIE:
|
case PED_DIE:
|
||||||
|
@ -11100,7 +11230,8 @@ CPed::ProcessControl(void)
|
||||||
}
|
}
|
||||||
m_pCurrentPhysSurface = nil;
|
m_pCurrentPhysSurface = nil;
|
||||||
}
|
}
|
||||||
}
|
} else
|
||||||
|
ServiceTalking();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -11121,11 +11252,27 @@ CPed::SetInTheAir(void)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// --MIAMI: Done
|
||||||
void
|
void
|
||||||
CPed::RestoreHeadPosition(void)
|
CPed::RestoreHeadPosition(void)
|
||||||
{
|
{
|
||||||
|
bool canUseMyBody = false;
|
||||||
|
if (m_nPedState != PED_DRIVING && m_nPedState != PED_DRAG_FROM_CAR && !bIsDucking) {
|
||||||
|
if (m_animGroup != ASSOCGRP_SEXYWOMAN && m_animGroup != ASSOCGRP_WOMAN)
|
||||||
|
canUseMyBody = true;
|
||||||
|
}
|
||||||
|
if (!canUseMyBody)
|
||||||
|
m_pedIK.m_flags |= CPedIK::LOOKAROUND_HEAD_ONLY;
|
||||||
|
|
||||||
if (m_pedIK.RestoreLookAt()) {
|
if (m_pedIK.RestoreLookAt()) {
|
||||||
bIsRestoringLook = false;
|
bIsRestoringLook = false;
|
||||||
|
canUseMyBody = false;
|
||||||
|
if (m_nPedState != PED_DRIVING && m_nPedState != PED_DRAG_FROM_CAR && !bIsDucking) {
|
||||||
|
if (m_animGroup != ASSOCGRP_SEXYWOMAN && m_animGroup != ASSOCGRP_WOMAN)
|
||||||
|
canUseMyBody = true;
|
||||||
|
}
|
||||||
|
if(canUseMyBody)
|
||||||
|
m_pedIK.m_flags &= ~CPedIK::LOOKAROUND_HEAD_ONLY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12210,19 +12357,7 @@ CPed::PedSetInCarCB(CAnimBlendAssociation *animAssoc, void *arg)
|
||||||
ped->SetObjective(OBJECTIVE_NONE);
|
ped->SetObjective(OBJECTIVE_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (veh->pDriver == ped) {
|
ped->AddInCarAnims(veh, veh->pDriver == ped);
|
||||||
if (veh->bLowVehicle) {
|
|
||||||
ped->m_pVehicleAnim = CAnimManager::BlendAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_CAR_LSIT, 100.0f);
|
|
||||||
} else {
|
|
||||||
ped->m_pVehicleAnim = CAnimManager::BlendAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_CAR_SIT, 100.0f);
|
|
||||||
}
|
|
||||||
} else if (veh->bLowVehicle) {
|
|
||||||
ped->m_pVehicleAnim = CAnimManager::BlendAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_CAR_SITPLO, 100.0f);
|
|
||||||
} else {
|
|
||||||
ped->m_pVehicleAnim = CAnimManager::BlendAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_CAR_SITP, 100.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
ped->StopNonPartialAnims();
|
|
||||||
if (veh->bIsBus)
|
if (veh->bIsBus)
|
||||||
ped->bRenderPedInCar = false;
|
ped->bRenderPedInCar = false;
|
||||||
|
|
||||||
|
@ -12627,11 +12762,11 @@ CPed::ReplaceWeaponWhenExitingVehicle(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// --MIAMI: Add driveby check, enumarate weapon slots
|
// --MIAMI: Done
|
||||||
inline void
|
inline void
|
||||||
CPed::RemoveWeaponWhenEnteringVehicle(void)
|
CPed::RemoveWeaponWhenEnteringVehicle(void)
|
||||||
{
|
{
|
||||||
if (IsPlayer() && GetWeapon(5).m_eWeaponType && GetWeapon(5).m_nAmmoTotal > 0) {
|
if (IsPlayer() && HasWeaponSlot(5) && GetWeapon(5).m_nAmmoTotal > 0 && ((CPlayerPed*)this)->GetPlayerInfoForThisPlayerPed()->m_bDriveByAllowed) {
|
||||||
if (m_storedWeapon == WEAPONTYPE_UNIDENTIFIED)
|
if (m_storedWeapon == WEAPONTYPE_UNIDENTIFIED)
|
||||||
m_storedWeapon = GetWeapon()->m_eWeaponType;
|
m_storedWeapon = GetWeapon()->m_eWeaponType;
|
||||||
SetCurrentWeapon(GetWeapon(5).m_eWeaponType);
|
SetCurrentWeapon(GetWeapon(5).m_eWeaponType);
|
||||||
|
@ -14166,7 +14301,7 @@ CPed::ProcessObjective(void)
|
||||||
|
|
||||||
if (reloadAssoc || !m_pedInObjective->IsPedShootable()) {
|
if (reloadAssoc || !m_pedInObjective->IsPedShootable()) {
|
||||||
if (reloadAssoc &&
|
if (reloadAssoc &&
|
||||||
(!reloadAssoc->IsRunning() || reloadAssoc->currentTime / reloadAssoc->hierarchy->totalLength > 0.8f)) {
|
(!reloadAssoc->IsRunning() || reloadAssoc->GetProgress() > 0.8f)) {
|
||||||
CAnimBlendAssociation *punchAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_FIGHT_PPUNCH, 8.0f);
|
CAnimBlendAssociation *punchAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_FIGHT_PPUNCH, 8.0f);
|
||||||
punchAssoc->flags |= ASSOC_DELETEFADEDOUT;
|
punchAssoc->flags |= ASSOC_DELETEFADEDOUT;
|
||||||
punchAssoc->flags |= ASSOC_FADEOUTWHENDONE;
|
punchAssoc->flags |= ASSOC_FADEOUTWHENDONE;
|
||||||
|
@ -17505,33 +17640,11 @@ CPed::WarpPedIntoCar(CVehicle *car)
|
||||||
DMAudio.PlayOneShot(car->m_audioEntityId, SOUND_CAR_ENGINE_START, 1.0f);
|
DMAudio.PlayOneShot(car->m_audioEntityId, SOUND_CAR_ENGINE_START, 1.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef VC_PED_PORTS
|
|
||||||
RpAnimBlendClumpSetBlendDeltas(GetClump(), ASSOC_PARTIAL, -1000.0f);
|
RpAnimBlendClumpSetBlendDeltas(GetClump(), ASSOC_PARTIAL, -1000.0f);
|
||||||
|
|
||||||
// VC uses AddInCarAnims but we don't have that
|
AddInCarAnims(car, car->pDriver == this);
|
||||||
m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, car->GetDriverAnim(), 100.0f);
|
|
||||||
RemoveWeaponWhenEnteringVehicle();
|
RemoveWeaponWhenEnteringVehicle();
|
||||||
#else
|
|
||||||
if (car->IsBoat()) {
|
|
||||||
#ifndef FIX_BUGS
|
|
||||||
m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_DRIVE_BOAT, 100.0f);
|
|
||||||
#else
|
|
||||||
m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, car->GetDriverAnim(), 100.0f);
|
|
||||||
#endif
|
|
||||||
CWeaponInfo *ourWeapon = CWeaponInfo::GetWeaponInfo(GetWeapon()->m_eWeaponType);
|
|
||||||
RemoveWeaponModel(ourWeapon->m_nModelId);
|
|
||||||
} else {
|
|
||||||
// Because we can use Uzi for drive by
|
|
||||||
RemoveWeaponWhenEnteringVehicle();
|
|
||||||
|
|
||||||
if (car->bLowVehicle)
|
|
||||||
m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_CAR_LSIT, 100.0f);
|
|
||||||
else
|
|
||||||
m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_CAR_SIT, 100.0f);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
StopNonPartialAnims();
|
|
||||||
if (car->bIsBus)
|
if (car->bIsBus)
|
||||||
bRenderPedInCar = false;
|
bRenderPedInCar = false;
|
||||||
|
|
||||||
|
@ -17813,25 +17926,13 @@ CPed::SetEnterCar_AllClear(CVehicle *car, uint32 doorNode, uint32 doorFlag)
|
||||||
m_vecOffsetSeek = doorOpenPos - GetPosition();
|
m_vecOffsetSeek = doorOpenPos - GetPosition();
|
||||||
m_nPedStateTimer = CTimer::GetTimeInMilliseconds() + 600;
|
m_nPedStateTimer = CTimer::GetTimeInMilliseconds() + 600;
|
||||||
if (car->IsBoat()) {
|
if (car->IsBoat()) {
|
||||||
#ifdef VC_PED_PORTS
|
if(car->pHandling->Flags & HANDLING_SIT_IN_BOAT)
|
||||||
// VC checks for handling flag, but we can't do that
|
|
||||||
if(car->GetModelIndex() == MI_SPEEDER)
|
|
||||||
m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_CAR_SIT, 100.0f);
|
m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_CAR_SIT, 100.0f);
|
||||||
else
|
else
|
||||||
m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_DRIVE_BOAT, 100.0f);
|
m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_DRIVE_BOAT, 100.0f);
|
||||||
|
|
||||||
PedSetInCarCB(nil, this);
|
PedSetInCarCB(nil, this);
|
||||||
bVehExitWillBeInstant = true;
|
bVehExitWillBeInstant = true;
|
||||||
#else
|
|
||||||
|
|
||||||
#ifndef FIX_BUGS
|
|
||||||
m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_DRIVE_BOAT, 100.0f);
|
|
||||||
#else
|
|
||||||
m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, car->GetDriverAnim(), 100.0f);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
m_pVehicleAnim->SetFinishCallback(PedSetInCarCB, this);
|
|
||||||
#endif
|
|
||||||
if (IsPlayer())
|
if (IsPlayer())
|
||||||
CWaterLevel::AllocateBoatWakeArray();
|
CWaterLevel::AllocateBoatWakeArray();
|
||||||
} else {
|
} else {
|
||||||
|
@ -18394,14 +18495,15 @@ CPed::Load(uint8*& buf)
|
||||||
#undef CopyToBuf
|
#undef CopyToBuf
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// --MIAMI: Done
|
||||||
void
|
void
|
||||||
CPed::GiveDelayedWeapon(eWeaponType weapon, uint32 ammo)
|
CPed::GiveDelayedWeapon(eWeaponType weapon, uint32 ammo)
|
||||||
{
|
{
|
||||||
m_storedWeapon = weapon;
|
m_delayedWeapon = weapon;
|
||||||
m_storedWeaponAmmo = ammo;
|
m_delayedWeaponAmmo = ammo;
|
||||||
if (m_storedWeapon != WEAPONTYPE_UNIDENTIFIED) {
|
if (m_delayedWeapon != WEAPONTYPE_UNIDENTIFIED) {
|
||||||
int modelId1 = CWeaponInfo::GetWeaponInfo(m_storedWeapon)->m_nModelId;
|
int modelId1 = CWeaponInfo::GetWeaponInfo(m_delayedWeapon)->m_nModelId;
|
||||||
int modelId2 = CWeaponInfo::GetWeaponInfo(m_storedWeapon)->m_nModel2Id;
|
int modelId2 = CWeaponInfo::GetWeaponInfo(m_delayedWeapon)->m_nModel2Id;
|
||||||
if (modelId1 != -1)
|
if (modelId1 != -1)
|
||||||
CStreaming::RequestModel(modelId1, STREAMFLAGS_DEPENDENCY);
|
CStreaming::RequestModel(modelId1, STREAMFLAGS_DEPENDENCY);
|
||||||
if (modelId2 != -1)
|
if (modelId2 != -1)
|
||||||
|
@ -18409,18 +18511,19 @@ CPed::GiveDelayedWeapon(eWeaponType weapon, uint32 ammo)
|
||||||
|
|
||||||
if ((modelId1 == -1 || CStreaming::HasModelLoaded(modelId1))
|
if ((modelId1 == -1 || CStreaming::HasModelLoaded(modelId1))
|
||||||
&& (modelId2 == -1 || CStreaming::HasModelLoaded(modelId2))) {
|
&& (modelId2 == -1 || CStreaming::HasModelLoaded(modelId2))) {
|
||||||
GiveWeapon(m_storedWeapon, m_storedWeaponAmmo, 1);
|
GiveWeapon(m_delayedWeapon, m_delayedWeaponAmmo, true);
|
||||||
m_storedWeapon = WEAPONTYPE_UNIDENTIFIED;
|
m_delayedWeapon = WEAPONTYPE_UNIDENTIFIED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// --MIAMI: Done
|
||||||
void
|
void
|
||||||
CPed::RequestDelayedWeapon()
|
CPed::RequestDelayedWeapon()
|
||||||
{
|
{
|
||||||
if (m_storedWeapon != WEAPONTYPE_UNIDENTIFIED) {
|
if (m_delayedWeapon != WEAPONTYPE_UNIDENTIFIED) {
|
||||||
int modelId1 = CWeaponInfo::GetWeaponInfo(m_storedWeapon)->m_nModelId;
|
int modelId1 = CWeaponInfo::GetWeaponInfo(m_delayedWeapon)->m_nModelId;
|
||||||
int modelId2 = CWeaponInfo::GetWeaponInfo(m_storedWeapon)->m_nModel2Id;
|
int modelId2 = CWeaponInfo::GetWeaponInfo(m_delayedWeapon)->m_nModel2Id;
|
||||||
if (modelId1 != -1)
|
if (modelId1 != -1)
|
||||||
CStreaming::RequestModel(modelId1, STREAMFLAGS_DEPENDENCY);
|
CStreaming::RequestModel(modelId1, STREAMFLAGS_DEPENDENCY);
|
||||||
if (modelId2 != -1)
|
if (modelId2 != -1)
|
||||||
|
@ -18428,12 +18531,13 @@ CPed::RequestDelayedWeapon()
|
||||||
|
|
||||||
if ((modelId1 == -1 || CStreaming::HasModelLoaded(modelId1))
|
if ((modelId1 == -1 || CStreaming::HasModelLoaded(modelId1))
|
||||||
&& (modelId2 == -1 || CStreaming::HasModelLoaded(modelId2))) {
|
&& (modelId2 == -1 || CStreaming::HasModelLoaded(modelId2))) {
|
||||||
GiveWeapon(m_storedWeapon, m_storedWeaponAmmo, 1);
|
GiveWeapon(m_delayedWeapon, m_delayedWeaponAmmo, 1);
|
||||||
m_storedWeapon = WEAPONTYPE_UNIDENTIFIED;
|
m_delayedWeapon = WEAPONTYPE_UNIDENTIFIED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// --MIAMI: Done
|
||||||
void
|
void
|
||||||
CPed::ClearFollowPath()
|
CPed::ClearFollowPath()
|
||||||
{
|
{
|
||||||
|
@ -18444,34 +18548,42 @@ CPed::ClearFollowPath()
|
||||||
m_nCurPathNode = 0;
|
m_nCurPathNode = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// --MIAMI: Done
|
||||||
void
|
void
|
||||||
CPed::CreateDeadPedPickupCoors(float* x, float* y, float* z)
|
CPed::AddInCarAnims(CVehicle* car, bool isDriver)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < 32; i++) {
|
AnimationId anim;
|
||||||
CVector pickupPos = GetPosition();
|
AssocGroupId group;
|
||||||
pickupPos.x += 1.5f * Sin(CGeneral::GetRandomNumberInRange(0.0f, TWOPI));
|
if (car->IsBoat()) {
|
||||||
pickupPos.y += 1.5f * Cos(CGeneral::GetRandomNumberInRange(0.0f, TWOPI));
|
if (car->pHandling->Flags & HANDLING_SIT_IN_BOAT) {
|
||||||
bool found;
|
anim = ANIM_CAR_SIT;
|
||||||
pickupPos.z = CWorld::FindGroundZFor3DCoord(pickupPos.x, pickupPos.y, pickupPos.z, &found) + 0.5f;
|
} else {
|
||||||
if (!found)
|
anim = ANIM_DRIVE_BOAT;
|
||||||
continue;
|
}
|
||||||
CVector vPedPos = GetPosition();
|
group = ASSOCGRP_STD;
|
||||||
vPedPos.z += 0.3f;
|
} else if (car->IsBike()) {
|
||||||
CVector vTestPos = vPedPos + (pickupPos - vPedPos) * (((pickupPos - vPedPos).Magnitude() + 0.4f) / (pickupPos - vPedPos).Magnitude());
|
if (isDriver) {
|
||||||
if ((vTestPos - FindPlayerCoors()).Magnitude2D() > 2.0f || i > 16) {
|
// TODO(Miami): Bikes
|
||||||
if (i > 16 || CPickups::TestForPickupsInBubble(pickupPos, 1.3f)) {
|
} else {
|
||||||
if (CWorld::GetIsLineOfSightClear(vTestPos, vPedPos, true, i < 16, false, i < 16, false, false)) {
|
// TODO(Miami): Bikes
|
||||||
if (i > 16 || !CWorld::TestSphereAgainstWorld(pickupPos, 1.2f, nil, false, true, false, false, false, false)) {
|
}
|
||||||
*x = pickupPos.x;
|
} else {
|
||||||
*y = pickupPos.y;
|
if (isDriver) {
|
||||||
*z = pickupPos.z;
|
if (car->bLowVehicle) {
|
||||||
return;
|
anim = ANIM_CAR_LSIT;
|
||||||
}
|
} else {
|
||||||
}
|
anim = ANIM_CAR_SIT;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (car->bLowVehicle) {
|
||||||
|
anim = ANIM_CAR_SITPLO;
|
||||||
|
} else {
|
||||||
|
anim = ANIM_CAR_SITP;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
group = ASSOCGRP_STD;
|
||||||
}
|
}
|
||||||
*x = GetPosition().x;
|
m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), group, anim, 100.0f);
|
||||||
*y = GetPosition().y;
|
|
||||||
*z = GetPosition().z + 0.4f;
|
StopNonPartialAnims();
|
||||||
}
|
}
|
|
@ -523,7 +523,8 @@ public:
|
||||||
CVector2D *m_wanderRangeBounds; // array with 2 CVector2D (actually unused CRange2D class) - unused
|
CVector2D *m_wanderRangeBounds; // array with 2 CVector2D (actually unused CRange2D class) - unused
|
||||||
CWeapon m_weapons[TOTAL_WEAPON_SLOTS];
|
CWeapon m_weapons[TOTAL_WEAPON_SLOTS];
|
||||||
eWeaponType m_storedWeapon;
|
eWeaponType m_storedWeapon;
|
||||||
uint32 m_storedWeaponAmmo;
|
eWeaponType m_delayedWeapon;
|
||||||
|
uint32 m_delayedWeaponAmmo;
|
||||||
uint8 m_currentWeapon; // eWeaponType
|
uint8 m_currentWeapon; // eWeaponType
|
||||||
uint8 m_maxWeaponTypeAllowed; // eWeaponType
|
uint8 m_maxWeaponTypeAllowed; // eWeaponType
|
||||||
uint8 m_wepSkills;
|
uint8 m_wepSkills;
|
||||||
|
@ -704,7 +705,7 @@ public:
|
||||||
void RemoveWeaponAnims(int, float);
|
void RemoveWeaponAnims(int, float);
|
||||||
void CreateDeadPedMoney(void);
|
void CreateDeadPedMoney(void);
|
||||||
void CreateDeadPedWeaponPickups(void);
|
void CreateDeadPedWeaponPickups(void);
|
||||||
// void CreateDeadPedPickupCoors(float *x, float *y, float *z);
|
void CreateDeadPedPickupCoors(float *x, float *y, float *z);
|
||||||
void SetAttackTimer(uint32);
|
void SetAttackTimer(uint32);
|
||||||
void SetBeingDraggedFromCar(CVehicle*, uint32, bool);
|
void SetBeingDraggedFromCar(CVehicle*, uint32, bool);
|
||||||
void SetRadioStation(void);
|
void SetRadioStation(void);
|
||||||
|
@ -775,6 +776,7 @@ public:
|
||||||
void ClearFollowPath();
|
void ClearFollowPath();
|
||||||
void GiveDelayedWeapon(eWeaponType weapon, uint32 ammo);
|
void GiveDelayedWeapon(eWeaponType weapon, uint32 ammo);
|
||||||
void RequestDelayedWeapon();
|
void RequestDelayedWeapon();
|
||||||
|
void AddInCarAnims(CVehicle* car, bool isDriver);
|
||||||
|
|
||||||
// Static methods
|
// Static methods
|
||||||
static CVector GetLocalPositionToOpenCarDoor(CVehicle *veh, uint32 component, float offset);
|
static CVector GetLocalPositionToOpenCarDoor(CVehicle *veh, uint32 component, float offset);
|
||||||
|
@ -876,7 +878,7 @@ public:
|
||||||
bool Dead(void) { return m_nPedState == PED_DEAD; }
|
bool Dead(void) { return m_nPedState == PED_DEAD; }
|
||||||
bool Dying(void) { return m_nPedState == PED_DIE; }
|
bool Dying(void) { return m_nPedState == PED_DIE; }
|
||||||
bool DyingOrDead(void) { return m_nPedState == PED_DIE || m_nPedState == PED_DEAD; }
|
bool DyingOrDead(void) { return m_nPedState == PED_DIE || m_nPedState == PED_DEAD; }
|
||||||
bool OnGround(void) { return m_nPedState == PED_FALL || m_nPedState == PED_DIE || m_nPedState == PED_DEAD; }
|
bool OnGround(void) { return m_nPedState == PED_FALL || m_nPedState == PED_DIE || m_nPedState == PED_DEAD || m_nWaitState == WAITSTATE_SUN_BATHE_IDLE; }
|
||||||
|
|
||||||
bool Driving(void) { return m_nPedState == PED_DRIVING; }
|
bool Driving(void) { return m_nPedState == PED_DRIVING; }
|
||||||
bool InVehicle(void) { return bInVehicle && m_pMyVehicle; } // True when ped is sitting/standing in vehicle, not in enter/exit state.
|
bool InVehicle(void) { return bInVehicle && m_pMyVehicle; } // True when ped is sitting/standing in vehicle, not in enter/exit state.
|
||||||
|
@ -892,7 +894,7 @@ public:
|
||||||
void RemoveWeaponWhenEnteringVehicle(void);
|
void RemoveWeaponWhenEnteringVehicle(void);
|
||||||
bool IsNotInWreckedVehicle();
|
bool IsNotInWreckedVehicle();
|
||||||
|
|
||||||
// My addons. Maybe inlined in VC?
|
// My names. Inlined in VC
|
||||||
AnimationId GetFireAnimNotDucking(CWeaponInfo* weapon) {
|
AnimationId GetFireAnimNotDucking(CWeaponInfo* weapon) {
|
||||||
// TODO(Miami): Revert that when weapons got ported
|
// TODO(Miami): Revert that when weapons got ported
|
||||||
if (weapon->m_AnimToPlay == ASSOCGRP_STD)
|
if (weapon->m_AnimToPlay == ASSOCGRP_STD)
|
||||||
|
@ -929,6 +931,20 @@ public:
|
||||||
else
|
else
|
||||||
return ANIM_WEAPON_FIRE;
|
return ANIM_WEAPON_FIRE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static AnimationId GetCrouchReloadAnim(CWeaponInfo* weapon) {
|
||||||
|
if (!!weapon->m_bReload)
|
||||||
|
return ANIM_WEAPON_CROUCHRELOAD;
|
||||||
|
else
|
||||||
|
return (AnimationId)0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static AnimationId GetReloadAnim(CWeaponInfo* weapon) {
|
||||||
|
if (!!weapon->m_bReload)
|
||||||
|
return ANIM_WEAPON_RELOAD;
|
||||||
|
else
|
||||||
|
return (AnimationId)0;
|
||||||
|
}
|
||||||
// --
|
// --
|
||||||
|
|
||||||
// My additions, because there were many, many instances of that.
|
// My additions, because there were many, many instances of that.
|
||||||
|
|
|
@ -451,7 +451,7 @@ CPlayerPed::SetRealMoveAnim(void)
|
||||||
} else if (curSprintAssoc->blendDelta >= 0.0f || curSprintAssoc->blendAmount >= 0.8f) {
|
} else if (curSprintAssoc->blendDelta >= 0.0f || curSprintAssoc->blendAmount >= 0.8f) {
|
||||||
if (m_fMoveSpeed < 0.4f) {
|
if (m_fMoveSpeed < 0.4f) {
|
||||||
AnimationId runStopAnim;
|
AnimationId runStopAnim;
|
||||||
if (curSprintAssoc->currentTime / curSprintAssoc->hierarchy->totalLength < 0.5) // double
|
if (curSprintAssoc->GetProgress() < 0.5) // double
|
||||||
runStopAnim = ANIM_RUN_STOP;
|
runStopAnim = ANIM_RUN_STOP;
|
||||||
else
|
else
|
||||||
runStopAnim = ANIM_RUN_STOP_R;
|
runStopAnim = ANIM_RUN_STOP_R;
|
||||||
|
@ -638,7 +638,7 @@ CPlayerPed::PlayerControlSniper(CPad *padUsed)
|
||||||
firePos = GetMatrix() * firePos;
|
firePos = GetMatrix() * firePos;
|
||||||
GetWeapon()->Fire(this, &firePos);
|
GetWeapon()->Fire(this, &firePos);
|
||||||
}
|
}
|
||||||
GetWeapon()->Update(m_audioEntityId);
|
GetWeapon()->Update(m_audioEntityId, nil);
|
||||||
}
|
}
|
||||||
|
|
||||||
// --MIAMI: Made compatible with slots, but still TODO
|
// --MIAMI: Made compatible with slots, but still TODO
|
||||||
|
@ -742,7 +742,7 @@ CPlayerPed::PlayerControlM16(CPad *padUsed)
|
||||||
firePos = GetMatrix() * firePos;
|
firePos = GetMatrix() * firePos;
|
||||||
GetWeapon()->Fire(this, &firePos);
|
GetWeapon()->Fire(this, &firePos);
|
||||||
}
|
}
|
||||||
GetWeapon()->Update(m_audioEntityId);
|
GetWeapon()->Update(m_audioEntityId, nil);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1561,7 +1561,7 @@ CPlayerPed::ProcessControl(void)
|
||||||
}
|
}
|
||||||
if (padUsed && IsPedShootable()) {
|
if (padUsed && IsPedShootable()) {
|
||||||
ProcessWeaponSwitch(padUsed);
|
ProcessWeaponSwitch(padUsed);
|
||||||
GetWeapon()->Update(m_audioEntityId);
|
GetWeapon()->Update(m_audioEntityId, this);
|
||||||
}
|
}
|
||||||
ProcessAnimGroups();
|
ProcessAnimGroups();
|
||||||
if (padUsed) {
|
if (padUsed) {
|
||||||
|
|
|
@ -816,29 +816,11 @@ CPopulation::AddPedInCar(CVehicle* car, bool isDriver)
|
||||||
CPed *newPed = CPopulation::AddPed((ePedType)pedType, preferredModel, car->GetPosition(), miamiViceIndex);
|
CPed *newPed = CPopulation::AddPed((ePedType)pedType, preferredModel, car->GetPosition(), miamiViceIndex);
|
||||||
newPed->bUsesCollision = false;
|
newPed->bUsesCollision = false;
|
||||||
|
|
||||||
// what??
|
if (newPed->GetWeapon()->m_eWeaponType != WEAPONTYPE_UNARMED) {
|
||||||
if (pedType != PEDTYPE_COP) {
|
|
||||||
newPed->SetCurrentWeapon(WEAPONTYPE_COLT45);
|
|
||||||
newPed->RemoveWeaponModel(CWeaponInfo::GetWeaponInfo(newPed->GetWeapon()->m_eWeaponType)->m_nModelId);
|
newPed->RemoveWeaponModel(CWeaponInfo::GetWeaponInfo(newPed->GetWeapon()->m_eWeaponType)->m_nModelId);
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
// Miami leftover
|
|
||||||
if (car->m_vehType == VEHICLE_TYPE_BIKE) {
|
|
||||||
newPed->m_pVehicleAnim = CAnimManager::BlendAnimation(newPed->GetClump(), ASSOCGRP_STD, *((CBike*)car + 308h), 100.0f);
|
|
||||||
} else */
|
|
||||||
|
|
||||||
// FIX: Make peds comfortable while driving car/boat
|
newPed->AddInCarAnims(car, isDriver);
|
||||||
#ifdef FIX_BUGS
|
|
||||||
{
|
|
||||||
newPed->m_pVehicleAnim = CAnimManager::BlendAnimation(newPed->GetClump(), ASSOCGRP_STD, car->GetDriverAnim(), 100.0f);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
{
|
|
||||||
newPed->m_pVehicleAnim = CAnimManager::BlendAnimation(newPed->GetClump(), ASSOCGRP_STD, ANIM_CAR_SIT, 100.0f);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
newPed->StopNonPartialAnims();
|
|
||||||
return newPed;
|
return newPed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -70,7 +70,7 @@ public:
|
||||||
static void LoadPedGroups();
|
static void LoadPedGroups();
|
||||||
static void UpdatePedCount(ePedType, bool);
|
static void UpdatePedCount(ePedType, bool);
|
||||||
static void DealWithZoneChange(eLevelName oldLevel, eLevelName newLevel, bool);
|
static void DealWithZoneChange(eLevelName oldLevel, eLevelName newLevel, bool);
|
||||||
static CPed *AddPedInCar(CVehicle *car, bool isPassenger);
|
static CPed *AddPedInCar(CVehicle *car, bool isDriver);
|
||||||
static bool IsPointInSafeZone(CVector *coors);
|
static bool IsPointInSafeZone(CVector *coors);
|
||||||
static void RemovePed(CPed *ent);
|
static void RemovePed(CPed *ent);
|
||||||
static int32 ChooseCivilianOccupation(int32);
|
static int32 ChooseCivilianOccupation(int32);
|
||||||
|
|
|
@ -21,6 +21,28 @@
|
||||||
#include "User.h"
|
#include "User.h"
|
||||||
#include "World.h"
|
#include "World.h"
|
||||||
|
|
||||||
|
// Game has colors inlined in code.
|
||||||
|
// For easier modification we collect them here:
|
||||||
|
CRGBA MONEY_COLOR(0, 207, 133, 255);
|
||||||
|
CRGBA AMMO_COLOR(255, 150, 225, 255);
|
||||||
|
CRGBA HEALTH_COLOR(255, 150, 225, 255);
|
||||||
|
CRGBA ARMOUR_COLOR(185, 185, 185, 255);
|
||||||
|
CRGBA NOTWANTED_COLOR(27, 89, 130, 255);
|
||||||
|
CRGBA WANTED_COLOR_FLASH(62, 141, 181, 255);
|
||||||
|
CRGBA WANTED_COLOR(97, 194, 247, 255);
|
||||||
|
CRGBA ZONE_COLOR(45, 155, 90, 255);
|
||||||
|
CRGBA VEHICLE_COLOR(97, 194, 247, 255);
|
||||||
|
CRGBA CLOCK_COLOR(97, 194, 247, 255);
|
||||||
|
CRGBA TIMER_COLOR(97, 194, 247, 255);
|
||||||
|
CRGBA COUNTER_COLOR(97, 194, 247, 255);
|
||||||
|
CRGBA PAGER_COLOR(32, 162, 66, 205);
|
||||||
|
CRGBA RADARDISC_COLOR(255, 255, 255, 255);
|
||||||
|
CRGBA BIGMESSAGE_COLOR(85, 119, 133, 255);
|
||||||
|
CRGBA WASTEDBUSTED_COLOR(170, 123, 87, 255);
|
||||||
|
CRGBA ODDJOB_COLOR(89, 115, 150, 255);
|
||||||
|
CRGBA ODDJOB2_COLOR(156, 91, 40, 255);
|
||||||
|
CRGBA MISSIONTITLE_COLOR(220, 172, 2, 255);
|
||||||
|
|
||||||
wchar CHud::m_HelpMessage[256];
|
wchar CHud::m_HelpMessage[256];
|
||||||
wchar CHud::m_LastHelpMessage[256];
|
wchar CHud::m_LastHelpMessage[256];
|
||||||
uint32 CHud::m_HelpMessageState;
|
uint32 CHud::m_HelpMessageState;
|
||||||
|
@ -252,7 +274,7 @@ void CHud::Draw()
|
||||||
|
|
||||||
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(110.0f - 2.0f), SCREEN_SCALE_Y(43.0f + 2.0f), sPrint);
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(110.0f - 2.0f), SCREEN_SCALE_Y(43.0f + 2.0f), sPrint);
|
||||||
|
|
||||||
CFont::SetColor(CRGBA(89, 115, 150, 255));
|
CFont::SetColor(MONEY_COLOR);
|
||||||
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(110.0f), SCREEN_SCALE_Y(43.0f), sPrint);
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(110.0f), SCREEN_SCALE_Y(43.0f), sPrint);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -335,7 +357,7 @@ void CHud::Draw()
|
||||||
if (!CDarkel::FrenzyOnGoing() && weaponInfo->m_nWeaponSlot > 1 && weapon->m_eWeaponType != WEAPONTYPE_DETONATOR) {
|
if (!CDarkel::FrenzyOnGoing() && weaponInfo->m_nWeaponSlot > 1 && weapon->m_eWeaponType != WEAPONTYPE_DETONATOR) {
|
||||||
CFont::SetDropShadowPosition(2);
|
CFont::SetDropShadowPosition(2);
|
||||||
CFont::SetDropColor(CRGBA(0, 0, 0, 255));
|
CFont::SetDropColor(CRGBA(0, 0, 0, 255));
|
||||||
CFont::SetColor(CRGBA(255, 150, 225, 255));
|
CFont::SetColor(AMMO_COLOR);
|
||||||
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(66.0f), SCREEN_SCALE_Y(90.0f), sPrint);
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(66.0f), SCREEN_SCALE_Y(90.0f), sPrint);
|
||||||
CFont::SetDropShadowPosition(0);
|
CFont::SetDropShadowPosition(0);
|
||||||
}
|
}
|
||||||
|
@ -373,7 +395,7 @@ void CHud::Draw()
|
||||||
if (!CWorld::Players[CWorld::PlayerInFocus].m_nTimeLastHealthLoss || CTimer::GetTimeInMilliseconds() > CWorld::Players[CWorld::PlayerInFocus].m_nTimeLastHealthLoss + 2000 || CTimer::GetFrameCounter() & 4) {
|
if (!CWorld::Players[CWorld::PlayerInFocus].m_nTimeLastHealthLoss || CTimer::GetTimeInMilliseconds() > CWorld::Players[CWorld::PlayerInFocus].m_nTimeLastHealthLoss + 2000 || CTimer::GetFrameCounter() & 4) {
|
||||||
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(164.0f - 2.0f), SCREEN_SCALE_Y(65.0f + 2.0f), sPrintIcon);
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(164.0f - 2.0f), SCREEN_SCALE_Y(65.0f + 2.0f), sPrintIcon);
|
||||||
}
|
}
|
||||||
CFont::SetColor(CRGBA(186, 101, 50, 255));
|
CFont::SetColor(HEALTH_COLOR);
|
||||||
|
|
||||||
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(110.0f), SCREEN_SCALE_Y(65.0f), sPrint);
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(110.0f), SCREEN_SCALE_Y(65.0f), sPrint);
|
||||||
|
|
||||||
|
@ -404,7 +426,7 @@ void CHud::Draw()
|
||||||
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(234.0f - 2.0f), SCREEN_SCALE_Y(65.0f + 2.0f), sPrintIcon);
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(234.0f - 2.0f), SCREEN_SCALE_Y(65.0f + 2.0f), sPrintIcon);
|
||||||
}
|
}
|
||||||
|
|
||||||
CFont::SetColor(CRGBA(124, 140, 95, 255));
|
CFont::SetColor(ARMOUR_COLOR);
|
||||||
|
|
||||||
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(182.0f), SCREEN_SCALE_Y(65.0f), sPrint);
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(182.0f), SCREEN_SCALE_Y(65.0f), sPrint);
|
||||||
|
|
||||||
|
@ -434,7 +456,10 @@ void CHud::Draw()
|
||||||
&& (CTimer::GetTimeInMilliseconds() > FindPlayerPed()->m_pWanted->m_nLastWantedLevelChange
|
&& (CTimer::GetTimeInMilliseconds() > FindPlayerPed()->m_pWanted->m_nLastWantedLevelChange
|
||||||
+ 2000 || CTimer::GetFrameCounter() & 4)) {
|
+ 2000 || CTimer::GetFrameCounter() & 4)) {
|
||||||
|
|
||||||
CFont::SetColor(CRGBA(193, 164, 120, 255));
|
CFont::SetColor(WANTED_COLOR);
|
||||||
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(110.0f + 23.0f * i), SCREEN_SCALE_Y(87.0f), sPrintIcon);
|
||||||
|
}else{
|
||||||
|
CFont::SetColor(NOTWANTED_COLOR);
|
||||||
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(110.0f + 23.0f * i), SCREEN_SCALE_Y(87.0f), sPrintIcon);
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(110.0f + 23.0f * i), SCREEN_SCALE_Y(87.0f), sPrintIcon);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -528,7 +553,7 @@ void CHud::Draw()
|
||||||
CFont::SetColor(CRGBA(0, 0, 0, fZoneAlpha));
|
CFont::SetColor(CRGBA(0, 0, 0, fZoneAlpha));
|
||||||
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(32.0f) + SCREEN_SCALE_X(1.0f), SCREEN_SCALE_FROM_BOTTOM(30.0f) + SCREEN_SCALE_Y(1.0f), m_ZoneToPrint);
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(32.0f) + SCREEN_SCALE_X(1.0f), SCREEN_SCALE_FROM_BOTTOM(30.0f) + SCREEN_SCALE_Y(1.0f), m_ZoneToPrint);
|
||||||
|
|
||||||
CFont::SetColor(CRGBA(152, 154, 82, fZoneAlpha));
|
CFont::SetColor(CRGBA(ZONE_COLOR.r, ZONE_COLOR.g, ZONE_COLOR.b, fZoneAlpha));
|
||||||
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(32.0f), SCREEN_SCALE_FROM_BOTTOM(30.0f), m_ZoneToPrint);
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(32.0f), SCREEN_SCALE_FROM_BOTTOM(30.0f), m_ZoneToPrint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -622,7 +647,7 @@ void CHud::Draw()
|
||||||
CFont::SetColor(CRGBA(0, 0, 0, fVehicleAlpha));
|
CFont::SetColor(CRGBA(0, 0, 0, fVehicleAlpha));
|
||||||
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(32.0f) + SCREEN_SCALE_X(1.0f), SCREEN_SCALE_FROM_BOTTOM(55.0f) + SCREEN_SCALE_Y(1.0f), m_pVehicleNameToPrint);
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(32.0f) + SCREEN_SCALE_X(1.0f), SCREEN_SCALE_FROM_BOTTOM(55.0f) + SCREEN_SCALE_Y(1.0f), m_pVehicleNameToPrint);
|
||||||
|
|
||||||
CFont::SetColor(CRGBA(194, 165, 120, fVehicleAlpha));
|
CFont::SetColor(CRGBA(VEHICLE_COLOR.r, VEHICLE_COLOR.g, VEHICLE_COLOR.b, fVehicleAlpha));
|
||||||
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(32.0f), SCREEN_SCALE_FROM_BOTTOM(55.0f), m_pVehicleNameToPrint);
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(32.0f), SCREEN_SCALE_FROM_BOTTOM(55.0f), m_pVehicleNameToPrint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -654,7 +679,7 @@ void CHud::Draw()
|
||||||
|
|
||||||
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(111.0f) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(22.0f) + SCREEN_SCALE_Y(2.0f), sPrint);
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(111.0f) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(22.0f) + SCREEN_SCALE_Y(2.0f), sPrint);
|
||||||
|
|
||||||
CFont::SetColor(CRGBA(194, 165, 120, 255));
|
CFont::SetColor(CLOCK_COLOR);
|
||||||
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(111.0f), SCREEN_SCALE_Y(22.0f), sPrint);
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(111.0f), SCREEN_SCALE_Y(22.0f), sPrint);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -698,7 +723,7 @@ void CHud::Draw()
|
||||||
CFont::SetColor(CRGBA(0, 0, 0, 255));
|
CFont::SetColor(CRGBA(0, 0, 0, 255));
|
||||||
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(110.0f) + SCREEN_SCALE_Y(2.0f), sTimer);
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(110.0f) + SCREEN_SCALE_Y(2.0f), sTimer);
|
||||||
CFont::SetScale(SCREEN_SCALE_X(0.8f), SCREEN_SCALE_Y(1.35f));
|
CFont::SetScale(SCREEN_SCALE_X(0.8f), SCREEN_SCALE_Y(1.35f));
|
||||||
CFont::SetColor(CRGBA(186, 101, 50, 255));
|
CFont::SetColor(TIMER_COLOR);
|
||||||
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET), SCREEN_SCALE_Y(110.0f), sTimer);
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET), SCREEN_SCALE_Y(110.0f), sTimer);
|
||||||
|
|
||||||
if (CUserDisplay::OnscnTimer.m_sEntries[0].m_aTimerText[0]) {
|
if (CUserDisplay::OnscnTimer.m_sEntries[0].m_aTimerText[0]) {
|
||||||
|
@ -707,7 +732,7 @@ void CHud::Draw()
|
||||||
CFont::SetScale(SCREEN_SCALE_X(0.64f), SCREEN_SCALE_Y(1.35f));
|
CFont::SetScale(SCREEN_SCALE_X(0.64f), SCREEN_SCALE_Y(1.35f));
|
||||||
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(80.0f) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(110.0f) + SCREEN_SCALE_Y(2.0f), TheText.Get(CUserDisplay::OnscnTimer.m_sEntries[0].m_aTimerText));
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(80.0f) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(110.0f) + SCREEN_SCALE_Y(2.0f), TheText.Get(CUserDisplay::OnscnTimer.m_sEntries[0].m_aTimerText));
|
||||||
|
|
||||||
CFont::SetColor(CRGBA(186, 101, 50, 255));
|
CFont::SetColor(TIMER_COLOR);
|
||||||
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(80.0f), SCREEN_SCALE_Y(110.0f), TheText.Get(CUserDisplay::OnscnTimer.m_sEntries[0].m_aTimerText));
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(80.0f), SCREEN_SCALE_Y(110.0f), TheText.Get(CUserDisplay::OnscnTimer.m_sEntries[0].m_aTimerText));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -742,7 +767,7 @@ void CHud::Draw()
|
||||||
CFont::SetColor(CRGBA(0, 0, 0, 255));
|
CFont::SetColor(CRGBA(0, 0, 0, 255));
|
||||||
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(132.0f) + SCREEN_SCALE_Y(2.0f), sTimer);
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(132.0f) + SCREEN_SCALE_Y(2.0f), sTimer);
|
||||||
|
|
||||||
CFont::SetColor(CRGBA(0, 106, 164, 255));
|
CFont::SetColor(COUNTER_COLOR);
|
||||||
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET), SCREEN_SCALE_Y(132.0f), sTimer);
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET), SCREEN_SCALE_Y(132.0f), sTimer);
|
||||||
} else {
|
} else {
|
||||||
int counter = atoi(CUserDisplay::OnscnTimer.m_sEntries[0].m_bCounterBuffer);
|
int counter = atoi(CUserDisplay::OnscnTimer.m_sEntries[0].m_bCounterBuffer);
|
||||||
|
@ -759,7 +784,7 @@ void CHud::Draw()
|
||||||
CFont::SetColor(CRGBA(0, 0, 0, 255));
|
CFont::SetColor(CRGBA(0, 0, 0, 255));
|
||||||
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(61.0f) + SCREEN_SCALE_Y(2.0f), SCREEN_SCALE_Y(132.0f) + SCREEN_SCALE_Y(2.0f), TheText.Get(CUserDisplay::OnscnTimer.m_sEntries[0].m_aCounterText));
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(61.0f) + SCREEN_SCALE_Y(2.0f), SCREEN_SCALE_Y(132.0f) + SCREEN_SCALE_Y(2.0f), TheText.Get(CUserDisplay::OnscnTimer.m_sEntries[0].m_aCounterText));
|
||||||
|
|
||||||
CFont::SetColor(CRGBA(0, 106, 164, 255));
|
CFont::SetColor(COUNTER_COLOR);
|
||||||
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(61.0f), SCREEN_SCALE_Y(132.0f), TheText.Get(CUserDisplay::OnscnTimer.m_sEntries[0].m_aCounterText));
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(61.0f), SCREEN_SCALE_Y(132.0f), TheText.Get(CUserDisplay::OnscnTimer.m_sEntries[0].m_aCounterText));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -806,7 +831,7 @@ void CHud::Draw()
|
||||||
|
|
||||||
CFont::SetBackgroundOff();
|
CFont::SetBackgroundOff();
|
||||||
CFont::SetScale(SCREEN_SCALE_X(0.84f), SCREEN_SCALE_Y(1.0f));
|
CFont::SetScale(SCREEN_SCALE_X(0.84f), SCREEN_SCALE_Y(1.0f));
|
||||||
CFont::SetColor(CRGBA(32, 162, 66, 205));
|
CFont::SetColor(PAGER_COLOR);
|
||||||
CFont::SetRightJustifyOff();
|
CFont::SetRightJustifyOff();
|
||||||
CFont::SetBackgroundOff();
|
CFont::SetBackgroundOff();
|
||||||
CFont::SetCentreOff();
|
CFont::SetCentreOff();
|
||||||
|
@ -828,7 +853,7 @@ void CHud::Draw()
|
||||||
rect.Translate(RADAR_LEFT, SCREEN_SCALE_FROM_BOTTOM(RADAR_BOTTOM + RADAR_HEIGHT));
|
rect.Translate(RADAR_LEFT, SCREEN_SCALE_FROM_BOTTOM(RADAR_BOTTOM + RADAR_HEIGHT));
|
||||||
#endif
|
#endif
|
||||||
rect.Grow(4.0f);
|
rect.Grow(4.0f);
|
||||||
Sprites[HUD_RADARDISC].Draw(rect, CRGBA(0, 0, 0, 255));
|
Sprites[HUD_RADARDISC].Draw(rect, RADARDISC_COLOR);
|
||||||
CRadar::DrawBlips();
|
CRadar::DrawBlips();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -983,7 +1008,7 @@ void CHud::Draw()
|
||||||
CFont::PrintString(SCREEN_WIDTH / 2 + SCREEN_SCALE_X(2.0f), (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(20.0f) + SCREEN_SCALE_Y(2.0f), m_BigMessage[0]);
|
CFont::PrintString(SCREEN_WIDTH / 2 + SCREEN_SCALE_X(2.0f), (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(20.0f) + SCREEN_SCALE_Y(2.0f), m_BigMessage[0]);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
CFont::SetColor(CRGBA(85, 119, 133, BigMessageAlpha[0]));
|
CFont::SetColor(CRGBA(BIGMESSAGE_COLOR.r, BIGMESSAGE_COLOR.g, BIGMESSAGE_COLOR.b, BigMessageAlpha[0]));
|
||||||
CFont::PrintString(SCREEN_WIDTH / 2, (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(18.0f), m_BigMessage[0]);
|
CFont::PrintString(SCREEN_WIDTH / 2, (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(18.0f), m_BigMessage[0]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -1018,7 +1043,7 @@ void CHud::Draw()
|
||||||
CFont::SetColor(CRGBA(0, 0, 0, BigMessageAlpha[2]));
|
CFont::SetColor(CRGBA(0, 0, 0, BigMessageAlpha[2]));
|
||||||
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(20.0f - 4.0f), SCREEN_SCALE_FROM_BOTTOM(78.0f), m_BigMessage[2]);
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(20.0f - 4.0f), SCREEN_SCALE_FROM_BOTTOM(78.0f), m_BigMessage[2]);
|
||||||
|
|
||||||
CFont::SetColor(CRGBA(170, 123, 87, BigMessageAlpha[2]));
|
CFont::SetColor(CRGBA(WASTEDBUSTED_COLOR.r, WASTEDBUSTED_COLOR.g, WASTEDBUSTED_COLOR.b, BigMessageAlpha[2]));
|
||||||
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(20.0f), SCREEN_SCALE_FROM_BOTTOM(82.0f), m_BigMessage[2]);
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(20.0f), SCREEN_SCALE_FROM_BOTTOM(82.0f), m_BigMessage[2]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -1210,7 +1235,7 @@ void CHud::DrawAfterFade()
|
||||||
CFont::SetColor(CRGBA(0, 0, 0, 255));
|
CFont::SetColor(CRGBA(0, 0, 0, 255));
|
||||||
CFont::PrintString((SCREEN_WIDTH / 2) + SCREEN_SCALE_X(2.0f), (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(84.0f) + SCREEN_SCALE_Y(2.0f), m_BigMessage[3]);
|
CFont::PrintString((SCREEN_WIDTH / 2) + SCREEN_SCALE_X(2.0f), (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(84.0f) + SCREEN_SCALE_Y(2.0f), m_BigMessage[3]);
|
||||||
|
|
||||||
CFont::SetColor(CRGBA(89, 115, 150, 255));
|
CFont::SetColor(ODDJOB_COLOR);
|
||||||
CFont::PrintString((SCREEN_WIDTH / 2), (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(84.0f), m_BigMessage[3]);
|
CFont::PrintString((SCREEN_WIDTH / 2), (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(84.0f), m_BigMessage[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1226,7 +1251,7 @@ void CHud::DrawAfterFade()
|
||||||
|
|
||||||
CFont::PrintString((SCREEN_WIDTH / 2) - SCREEN_SCALE_X(2.0f), (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(84.0f) - SCREEN_SCALE_Y(2.0f), m_BigMessage[4]);
|
CFont::PrintString((SCREEN_WIDTH / 2) - SCREEN_SCALE_X(2.0f), (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(84.0f) - SCREEN_SCALE_Y(2.0f), m_BigMessage[4]);
|
||||||
|
|
||||||
CFont::SetColor(CRGBA(89, 115, 150, 255));
|
CFont::SetColor(ODDJOB_COLOR);
|
||||||
CFont::PrintString((SCREEN_WIDTH / 2), (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(84.0f), m_BigMessage[4]);
|
CFont::PrintString((SCREEN_WIDTH / 2), (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(84.0f), m_BigMessage[4]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1284,12 +1309,12 @@ void CHud::DrawAfterFade()
|
||||||
#ifdef BETA_SLIDING_TEXT
|
#ifdef BETA_SLIDING_TEXT
|
||||||
CFont::PrintString(SCREEN_WIDTH / 2 + SCREEN_SCALE_X(2.0f) - SCREEN_SCALE_X(OddJob2XOffset), SCREEN_HEIGHT / 2 - SCREEN_SCALE_Y(20.0f) + SCREEN_SCALE_Y(2.0f), m_BigMessage[5]);
|
CFont::PrintString(SCREEN_WIDTH / 2 + SCREEN_SCALE_X(2.0f) - SCREEN_SCALE_X(OddJob2XOffset), SCREEN_HEIGHT / 2 - SCREEN_SCALE_Y(20.0f) + SCREEN_SCALE_Y(2.0f), m_BigMessage[5]);
|
||||||
|
|
||||||
CFont::SetColor(CRGBA(156, 91, 40, 255));
|
CFont::SetColor(ODDJOB2_COLOR);
|
||||||
CFont::PrintString(SCREEN_WIDTH / 2 - SCREEN_SCALE_X(OddJob2XOffset), SCREEN_HEIGHT / 2 - SCREEN_SCALE_Y(20.0f), m_BigMessage[5]);
|
CFont::PrintString(SCREEN_WIDTH / 2 - SCREEN_SCALE_X(OddJob2XOffset), SCREEN_HEIGHT / 2 - SCREEN_SCALE_Y(20.0f), m_BigMessage[5]);
|
||||||
#else
|
#else
|
||||||
CFont::PrintString(SCREEN_WIDTH / 2 + SCREEN_SCALE_X(2.0f), SCREEN_HEIGHT / 2 - SCREEN_SCALE_Y(20.0f) + SCREEN_SCALE_Y(2.0f), m_BigMessage[5]);
|
CFont::PrintString(SCREEN_WIDTH / 2 + SCREEN_SCALE_X(2.0f), SCREEN_HEIGHT / 2 - SCREEN_SCALE_Y(20.0f) + SCREEN_SCALE_Y(2.0f), m_BigMessage[5]);
|
||||||
|
|
||||||
CFont::SetColor(CRGBA(156, 91, 40, 255));
|
CFont::SetColor(ODDJOB2_COLOR);
|
||||||
CFont::PrintString(SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2 - SCREEN_SCALE_Y(20.0f), m_BigMessage[5]);
|
CFont::PrintString(SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2 - SCREEN_SCALE_Y(20.0f), m_BigMessage[5]);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -1334,7 +1359,7 @@ void CHud::DrawAfterFade()
|
||||||
CFont::SetColor(CRGBA(40, 40, 40, BigMessageAlpha[1]));
|
CFont::SetColor(CRGBA(40, 40, 40, BigMessageAlpha[1]));
|
||||||
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(20.0f) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_FROM_BOTTOM(120.0f) + SCREEN_SCALE_Y(2.0f), m_BigMessage[1]);
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(20.0f) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_FROM_BOTTOM(120.0f) + SCREEN_SCALE_Y(2.0f), m_BigMessage[1]);
|
||||||
|
|
||||||
CFont::SetColor(CRGBA(220, 172, 2, BigMessageAlpha[1]));
|
CFont::SetColor(CRGBA(MISSIONTITLE_COLOR.r, MISSIONTITLE_COLOR.g, MISSIONTITLE_COLOR.b, BigMessageAlpha[1]));
|
||||||
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(20.0f), SCREEN_SCALE_FROM_BOTTOM(120.0f), m_BigMessage[1]);
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(20.0f), SCREEN_SCALE_FROM_BOTTOM(120.0f), m_BigMessage[1]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -3018,11 +3018,15 @@ void
|
||||||
CAutomobile::DoDriveByShootings(void)
|
CAutomobile::DoDriveByShootings(void)
|
||||||
{
|
{
|
||||||
CAnimBlendAssociation *anim;
|
CAnimBlendAssociation *anim;
|
||||||
|
CPlayerInfo* playerInfo = ((CPlayerPed*)this)->GetPlayerInfoForThisPlayerPed();
|
||||||
|
if (playerInfo && !playerInfo->m_bDriveByAllowed)
|
||||||
|
return;
|
||||||
|
|
||||||
CWeapon *weapon = pDriver->GetWeapon();
|
CWeapon *weapon = pDriver->GetWeapon();
|
||||||
if(CWeaponInfo::GetWeaponInfo(weapon->m_eWeaponType)->m_nWeaponSlot != 5)
|
if(CWeaponInfo::GetWeaponInfo(weapon->m_eWeaponType)->m_nWeaponSlot != 5)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
weapon->Update(pDriver->m_audioEntityId);
|
weapon->Update(pDriver->m_audioEntityId, nil);
|
||||||
|
|
||||||
bool lookingLeft = false;
|
bool lookingLeft = false;
|
||||||
bool lookingRight = false;
|
bool lookingRight = false;
|
||||||
|
@ -3038,37 +3042,42 @@ CAutomobile::DoDriveByShootings(void)
|
||||||
lookingRight = true;
|
lookingRight = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AnimationId rightAnim = ANIM_DRIVEBY_R;
|
||||||
|
AnimationId leftAnim = ANIM_DRIVEBY_L;
|
||||||
|
if (pDriver->m_pMyVehicle->bLowVehicle) {
|
||||||
|
rightAnim = ANIM_DRIVEBY_LOW_R;
|
||||||
|
leftAnim = ANIM_DRIVEBY_LOW_L;
|
||||||
|
}
|
||||||
|
|
||||||
if(lookingLeft || lookingRight){
|
if(lookingLeft || lookingRight){
|
||||||
if(lookingLeft){
|
if(lookingLeft){
|
||||||
anim = RpAnimBlendClumpGetAssociation(pDriver->GetClump(), ANIM_DRIVEBY_R);
|
anim = RpAnimBlendClumpGetAssociation(pDriver->GetClump(), rightAnim);
|
||||||
if(anim)
|
if(anim)
|
||||||
anim->blendDelta = -1000.0f;
|
anim->blendDelta = -1000.0f;
|
||||||
anim = RpAnimBlendClumpGetAssociation(pDriver->GetClump(), ANIM_DRIVEBY_L);
|
anim = RpAnimBlendClumpGetAssociation(pDriver->GetClump(), leftAnim);
|
||||||
if(anim == nil || anim->blendDelta < 0.0f)
|
if(anim == nil || anim->blendDelta < 0.0f)
|
||||||
CAnimManager::AddAnimation(pDriver->GetClump(), ASSOCGRP_STD, ANIM_DRIVEBY_L);
|
anim = CAnimManager::AddAnimation(pDriver->GetClump(), ASSOCGRP_STD, leftAnim);
|
||||||
else
|
|
||||||
anim->SetRun();
|
|
||||||
}else if(pDriver->m_pMyVehicle->pPassengers[0] == nil || TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_1STPERSON){
|
}else if(pDriver->m_pMyVehicle->pPassengers[0] == nil || TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_1STPERSON){
|
||||||
anim = RpAnimBlendClumpGetAssociation(pDriver->GetClump(), ANIM_DRIVEBY_L);
|
anim = RpAnimBlendClumpGetAssociation(pDriver->GetClump(), leftAnim);
|
||||||
if(anim)
|
if(anim)
|
||||||
anim->blendDelta = -1000.0f;
|
anim->blendDelta = -1000.0f;
|
||||||
anim = RpAnimBlendClumpGetAssociation(pDriver->GetClump(), ANIM_DRIVEBY_R);
|
anim = RpAnimBlendClumpGetAssociation(pDriver->GetClump(), rightAnim);
|
||||||
if(anim == nil || anim->blendDelta < 0.0f)
|
if(anim == nil || anim->blendDelta < 0.0f)
|
||||||
CAnimManager::AddAnimation(pDriver->GetClump(), ASSOCGRP_STD, ANIM_DRIVEBY_R);
|
anim = CAnimManager::AddAnimation(pDriver->GetClump(), ASSOCGRP_STD, rightAnim);
|
||||||
else
|
|
||||||
anim->SetRun();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(CPad::GetPad(0)->GetCarGunFired() && CTimer::GetTimeInMilliseconds() > weapon->m_nTimer){
|
if (!anim || !anim->IsRunning()) {
|
||||||
weapon->FireFromCar(this, lookingLeft);
|
if (CPad::GetPad(0)->GetCarGunFired() && CTimer::GetTimeInMilliseconds() > weapon->m_nTimer) {
|
||||||
weapon->m_nTimer = CTimer::GetTimeInMilliseconds() + 70;
|
weapon->FireFromCar(this, lookingLeft);
|
||||||
|
weapon->m_nTimer = CTimer::GetTimeInMilliseconds() + 70;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
weapon->Reload();
|
weapon->Reload();
|
||||||
anim = RpAnimBlendClumpGetAssociation(pDriver->GetClump(), ANIM_DRIVEBY_L);
|
anim = RpAnimBlendClumpGetAssociation(pDriver->GetClump(), leftAnim);
|
||||||
if(anim)
|
if(anim)
|
||||||
anim->blendDelta = -1000.0f;
|
anim->blendDelta = -1000.0f;
|
||||||
anim = RpAnimBlendClumpGetAssociation(pDriver->GetClump(), ANIM_DRIVEBY_R);
|
anim = RpAnimBlendClumpGetAssociation(pDriver->GetClump(), rightAnim);
|
||||||
if(anim)
|
if(anim)
|
||||||
anim->blendDelta = -1000.0f;
|
anim->blendDelta = -1000.0f;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,9 @@
|
||||||
#include "Pools.h"
|
#include "Pools.h"
|
||||||
#include "Pad.h"
|
#include "Pad.h"
|
||||||
#include "Boat.h"
|
#include "Boat.h"
|
||||||
|
#include "AnimBlendAssociation.h"
|
||||||
|
#include "RpAnimBlend.h"
|
||||||
|
#include "Record.h"
|
||||||
|
|
||||||
#define INVALID_ORIENTATION (-9999.99f)
|
#define INVALID_ORIENTATION (-9999.99f)
|
||||||
|
|
||||||
|
@ -149,6 +152,9 @@ CBoat::ProcessControl(void)
|
||||||
ProcessControlInputs(0);
|
ProcessControlInputs(0);
|
||||||
if(GetModelIndex() == MI_PREDATOR)
|
if(GetModelIndex() == MI_PREDATOR)
|
||||||
DoFixedMachineGuns();
|
DoFixedMachineGuns();
|
||||||
|
|
||||||
|
if (!CRecordDataForChase::IsRecording())
|
||||||
|
DoDriveByShootings();
|
||||||
break;
|
break;
|
||||||
case STATUS_SIMPLE:
|
case STATUS_SIMPLE:
|
||||||
m_bIsAnchored = false;
|
m_bIsAnchored = false;
|
||||||
|
@ -912,6 +918,68 @@ CBoat::AddWakePoint(CVector point)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CBoat::DoDriveByShootings(void)
|
||||||
|
{
|
||||||
|
CAnimBlendAssociation *anim;
|
||||||
|
CPlayerInfo* playerInfo = ((CPlayerPed*)this)->GetPlayerInfoForThisPlayerPed();
|
||||||
|
if (playerInfo && !playerInfo->m_bDriveByAllowed)
|
||||||
|
return;
|
||||||
|
|
||||||
|
CWeapon *weapon = pDriver->GetWeapon();
|
||||||
|
if(CWeaponInfo::GetWeaponInfo(weapon->m_eWeaponType)->m_nWeaponSlot != 5)
|
||||||
|
return;
|
||||||
|
|
||||||
|
weapon->Update(pDriver->m_audioEntityId, nil);
|
||||||
|
|
||||||
|
bool lookingLeft = false;
|
||||||
|
bool lookingRight = false;
|
||||||
|
if(TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_TOPDOWN){
|
||||||
|
if(CPad::GetPad(0)->GetLookLeft())
|
||||||
|
lookingLeft = true;
|
||||||
|
if(CPad::GetPad(0)->GetLookRight())
|
||||||
|
lookingRight = true;
|
||||||
|
}else{
|
||||||
|
if(TheCamera.Cams[TheCamera.ActiveCam].LookingLeft)
|
||||||
|
lookingLeft = true;
|
||||||
|
if(TheCamera.Cams[TheCamera.ActiveCam].LookingRight)
|
||||||
|
lookingRight = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(lookingLeft || lookingRight){
|
||||||
|
if(lookingLeft){
|
||||||
|
anim = RpAnimBlendClumpGetAssociation(pDriver->GetClump(), ANIM_DRIVEBY_R);
|
||||||
|
if(anim)
|
||||||
|
anim->blendDelta = -1000.0f;
|
||||||
|
anim = RpAnimBlendClumpGetAssociation(pDriver->GetClump(), ANIM_DRIVEBY_L);
|
||||||
|
if(anim == nil || anim->blendDelta < 0.0f)
|
||||||
|
anim = CAnimManager::AddAnimation(pDriver->GetClump(), ASSOCGRP_STD, ANIM_DRIVEBY_L);
|
||||||
|
}else if(pDriver->m_pMyVehicle->pPassengers[0] == nil || TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_1STPERSON){
|
||||||
|
anim = RpAnimBlendClumpGetAssociation(pDriver->GetClump(), ANIM_DRIVEBY_L);
|
||||||
|
if(anim)
|
||||||
|
anim->blendDelta = -1000.0f;
|
||||||
|
anim = RpAnimBlendClumpGetAssociation(pDriver->GetClump(), ANIM_DRIVEBY_R);
|
||||||
|
if(anim == nil || anim->blendDelta < 0.0f)
|
||||||
|
anim = CAnimManager::AddAnimation(pDriver->GetClump(), ASSOCGRP_STD, ANIM_DRIVEBY_R);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!anim || !anim->IsRunning()) {
|
||||||
|
if (CPad::GetPad(0)->GetCarGunFired() && CTimer::GetTimeInMilliseconds() > weapon->m_nTimer) {
|
||||||
|
weapon->FireFromCar(this, lookingLeft);
|
||||||
|
weapon->m_nTimer = CTimer::GetTimeInMilliseconds() + 70;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
weapon->Reload();
|
||||||
|
anim = RpAnimBlendClumpGetAssociation(pDriver->GetClump(), ANIM_DRIVEBY_L);
|
||||||
|
if(anim)
|
||||||
|
anim->blendDelta = -1000.0f;
|
||||||
|
anim = RpAnimBlendClumpGetAssociation(pDriver->GetClump(), ANIM_DRIVEBY_R);
|
||||||
|
if(anim)
|
||||||
|
anim->blendDelta = -1000.0f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef COMPATIBLE_SAVES
|
#ifdef COMPATIBLE_SAVES
|
||||||
void
|
void
|
||||||
CBoat::Save(uint8*& buf)
|
CBoat::Save(uint8*& buf)
|
||||||
|
|
|
@ -61,6 +61,7 @@ public:
|
||||||
void SetupModelNodes();
|
void SetupModelNodes();
|
||||||
void PruneWakeTrail(void);
|
void PruneWakeTrail(void);
|
||||||
void AddWakePoint(CVector point);
|
void AddWakePoint(CVector point);
|
||||||
|
void DoDriveByShootings(void);
|
||||||
|
|
||||||
static CBoat *apFrameWakeGeneratingBoats[4];
|
static CBoat *apFrameWakeGeneratingBoats[4];
|
||||||
|
|
||||||
|
|
|
@ -1046,7 +1046,7 @@ CVehicle::SetUpDriver(void)
|
||||||
if(VehicleCreatedBy != RANDOM_VEHICLE)
|
if(VehicleCreatedBy != RANDOM_VEHICLE)
|
||||||
return nil;
|
return nil;
|
||||||
|
|
||||||
pDriver = CPopulation::AddPedInCar(this, false);
|
pDriver = CPopulation::AddPedInCar(this, true);
|
||||||
pDriver->m_pMyVehicle = this;
|
pDriver->m_pMyVehicle = this;
|
||||||
pDriver->m_pMyVehicle->RegisterReference((CEntity**)&pDriver->m_pMyVehicle);
|
pDriver->m_pMyVehicle->RegisterReference((CEntity**)&pDriver->m_pMyVehicle);
|
||||||
pDriver->bInVehicle = true;
|
pDriver->bInVehicle = true;
|
||||||
|
@ -1062,7 +1062,7 @@ CVehicle::SetupPassenger(int n)
|
||||||
if(pPassengers[n])
|
if(pPassengers[n])
|
||||||
return pPassengers[n];
|
return pPassengers[n];
|
||||||
|
|
||||||
pPassengers[n] = CPopulation::AddPedInCar(this, true);
|
pPassengers[n] = CPopulation::AddPedInCar(this, false);
|
||||||
pPassengers[n]->m_pMyVehicle = this;
|
pPassengers[n]->m_pMyVehicle = this;
|
||||||
pPassengers[n]->m_pMyVehicle->RegisterReference((CEntity**)&pPassengers[n]->m_pMyVehicle);
|
pPassengers[n]->m_pMyVehicle->RegisterReference((CEntity**)&pPassengers[n]->m_pMyVehicle);
|
||||||
pPassengers[n]->bInVehicle = true;
|
pPassengers[n]->bInVehicle = true;
|
||||||
|
|
|
@ -300,7 +300,6 @@ public:
|
||||||
CVehicleModelInfo* GetModelInfo() { return (CVehicleModelInfo*)CModelInfo::GetModelInfo(GetModelIndex()); }
|
CVehicleModelInfo* GetModelInfo() { return (CVehicleModelInfo*)CModelInfo::GetModelInfo(GetModelIndex()); }
|
||||||
bool IsTaxi(void) { return GetModelIndex() == MI_TAXI || GetModelIndex() == MI_CABBIE || GetModelIndex() == MI_ZEBRA || GetModelIndex() == MI_KAUFMAN; }
|
bool IsTaxi(void) { return GetModelIndex() == MI_TAXI || GetModelIndex() == MI_CABBIE || GetModelIndex() == MI_ZEBRA || GetModelIndex() == MI_KAUFMAN; }
|
||||||
bool IsRealHeli(void) { return !!(pHandling->Flags & HANDLING_IS_HELI); }
|
bool IsRealHeli(void) { return !!(pHandling->Flags & HANDLING_IS_HELI); }
|
||||||
AnimationId GetDriverAnim(void) { return IsCar() && bLowVehicle ? ANIM_CAR_LSIT : (IsBoat() && GetModelIndex() != MI_SPEEDER ? ANIM_DRIVE_BOAT : ANIM_CAR_SIT); }
|
|
||||||
|
|
||||||
static bool bWheelsOnlyCheat;
|
static bool bWheelsOnlyCheat;
|
||||||
static bool bAllDodosCheat;
|
static bool bAllDodosCheat;
|
||||||
|
|
|
@ -30,25 +30,28 @@
|
||||||
#include "WeaponInfo.h"
|
#include "WeaponInfo.h"
|
||||||
#include "World.h"
|
#include "World.h"
|
||||||
|
|
||||||
|
// TODO(Miami)
|
||||||
|
#define AUDIO_NOT_READY
|
||||||
|
|
||||||
uint16 gReloadSampleTime[WEAPONTYPE_LAST_WEAPONTYPE] =
|
uint16 gReloadSampleTime[WEAPONTYPE_LAST_WEAPONTYPE] =
|
||||||
{
|
{
|
||||||
0, // UNARMED
|
0, // UNARMED
|
||||||
0, // BASEBALLBAT
|
0, // BASEBALLBAT
|
||||||
|
0, // GRENADE
|
||||||
|
0, // DETONATEGRENADE
|
||||||
|
0, // MOLOTOV
|
||||||
|
0, // ROCKET
|
||||||
250, // COLT45
|
250, // COLT45
|
||||||
|
650, // SHOTGUN
|
||||||
400, // TEC9
|
400, // TEC9
|
||||||
400, // UZIhec
|
400, // UZIhec
|
||||||
400, // SILENCED_INGRAM
|
400, // SILENCED_INGRAM
|
||||||
400, // MP5
|
400, // MP5
|
||||||
650, // SHOTGUN
|
|
||||||
300, // AK47
|
|
||||||
300, // M16
|
300, // M16
|
||||||
|
300, // AK47
|
||||||
423, // SNIPERRIFLE
|
423, // SNIPERRIFLE
|
||||||
400, // ROCKETLAUNCHER
|
400, // ROCKETLAUNCHER
|
||||||
0, // FLAMETHROWER
|
0, // FLAMETHROWER
|
||||||
0, // MOLOTOV
|
|
||||||
0, // ROCKET
|
|
||||||
0, // GRENADE
|
|
||||||
0, // DETONATEGRENADE
|
|
||||||
0, // DETONATOR
|
0, // DETONATOR
|
||||||
0 // HELICANNON
|
0 // HELICANNON
|
||||||
};
|
};
|
||||||
|
@ -96,10 +99,7 @@ CWeapon::Initialise(eWeaponType type, int32 ammo)
|
||||||
{
|
{
|
||||||
m_eWeaponType = type;
|
m_eWeaponType = type;
|
||||||
m_eWeaponState = WEAPONSTATE_READY;
|
m_eWeaponState = WEAPONSTATE_READY;
|
||||||
if (ammo > 99999)
|
m_nAmmoTotal = Min(ammo, 99999);
|
||||||
m_nAmmoTotal = 99999;
|
|
||||||
else
|
|
||||||
m_nAmmoTotal = ammo;
|
|
||||||
m_nAmmoInClip = 0;
|
m_nAmmoInClip = 0;
|
||||||
Reload();
|
Reload();
|
||||||
m_nTimer = 0;
|
m_nTimer = 0;
|
||||||
|
@ -283,8 +283,11 @@ CWeapon::Fire(CEntity *shooter, CVector *fireSource)
|
||||||
DMAudio.PlayOneShot(shooterPed->m_audioEntityId, SOUND_WEAPON_SHOT_FIRED, 0.0f);
|
DMAudio.PlayOneShot(shooterPed->m_audioEntityId, SOUND_WEAPON_SHOT_FIRED, 0.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( m_nAmmoInClip > 0 ) m_nAmmoInClip--;
|
if ( m_nAmmoInClip > 0 )
|
||||||
if ( m_nAmmoTotal > 0 && (m_nAmmoTotal < 25000 || isPlayer) ) m_nAmmoTotal--;
|
m_nAmmoInClip--;
|
||||||
|
|
||||||
|
if ( m_nAmmoTotal > 0 && (m_nAmmoTotal < 25000 || isPlayer) && (!isPlayer || CStats::GetPercentageProgress() < 100.0f || m_eWeaponType == WEAPONTYPE_DETONATOR))
|
||||||
|
m_nAmmoTotal--;
|
||||||
|
|
||||||
if ( m_eWeaponState == WEAPONSTATE_READY && m_eWeaponType == WEAPONTYPE_FLAMETHROWER )
|
if ( m_eWeaponState == WEAPONSTATE_READY && m_eWeaponType == WEAPONTYPE_FLAMETHROWER )
|
||||||
DMAudio.PlayOneShot(((CPhysical*)shooter)->m_audioEntityId, SOUND_WEAPON_FLAMETHROWER_FIRE, 0.0f);
|
DMAudio.PlayOneShot(((CPhysical*)shooter)->m_audioEntityId, SOUND_WEAPON_FLAMETHROWER_FIRE, 0.0f);
|
||||||
|
@ -331,7 +334,7 @@ CWeapon::Fire(CEntity *shooter, CVector *fireSource)
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
CWeapon::FireFromCar(CAutomobile *shooter, bool left)
|
CWeapon::FireFromCar(CVehicle *shooter, bool left)
|
||||||
{
|
{
|
||||||
ASSERT(shooter!=nil);
|
ASSERT(shooter!=nil);
|
||||||
|
|
||||||
|
@ -393,10 +396,10 @@ CWeapon::FireMelee(CEntity *shooter, CVector &fireSource)
|
||||||
{
|
{
|
||||||
bool collided = false;
|
bool collided = false;
|
||||||
|
|
||||||
CColModel *victimPedCol = &CTempColModels::ms_colModelPed1;
|
// TODO(Miami)
|
||||||
if ( victimPed->OnGround() || !victimPed->IsPedHeadAbovePos(-0.3f) )
|
if (victimPed->m_nPedState == PED_DRIVING && (m_eWeaponType == WEAPONTYPE_UNARMED /*|| m_eWeaponType == WEAPONTYPE_BRASSKNUCKLES*/
|
||||||
victimPedCol = &CTempColModels::ms_colModelPedGroundHit;
|
|| info->m_bFightMode))
|
||||||
|
continue;
|
||||||
|
|
||||||
float victimPedRadius = victimPed->GetBoundRadius() + info->m_fRadius;
|
float victimPedRadius = victimPed->GetBoundRadius() + info->m_fRadius;
|
||||||
if ( victimPed->bUsesCollision || victimPed->Dead() || victimPed->Driving() )
|
if ( victimPed->bUsesCollision || victimPed->Dead() || victimPed->Driving() )
|
||||||
|
@ -405,12 +408,29 @@ CWeapon::FireMelee(CEntity *shooter, CVector &fireSource)
|
||||||
if ( SQR(victimPedRadius) > (victimPedPos-(*fireSource)).MagnitudeSqr() )
|
if ( SQR(victimPedRadius) > (victimPedPos-(*fireSource)).MagnitudeSqr() )
|
||||||
{
|
{
|
||||||
CVector collisionDist;
|
CVector collisionDist;
|
||||||
|
CColModel* victimPedCol = &CTempColModels::ms_colModelPed1;
|
||||||
|
bool useLocalPos = false;
|
||||||
|
if (victimPed->m_nPedState == PED_FALL
|
||||||
|
|| victimPed->m_nPedState == PED_DIE && victimPed->bIsPedDieAnimPlaying
|
||||||
|
|| victimPed->m_nWaitState == WAITSTATE_SIT_IDLE
|
||||||
|
|| victimPed->m_nWaitState == WAITSTATE_SUN_BATHE_IDLE)
|
||||||
|
{
|
||||||
|
useLocalPos = true;
|
||||||
|
victimPedCol = ((CPedModelInfo*)CModelInfo::GetModelInfo(victimPed->GetModelIndex()))->AnimatePedColModelSkinnedWorld(victimPed->GetClump());
|
||||||
|
} else if (victimPed->DyingOrDead()) {
|
||||||
|
victimPedCol = &CTempColModels::ms_colModelPedGroundHit;
|
||||||
|
}
|
||||||
|
|
||||||
int32 s = 0;
|
int32 s = 0;
|
||||||
while ( s < victimPedCol->numSpheres )
|
while ( s < victimPedCol->numSpheres )
|
||||||
{
|
{
|
||||||
CColSphere *sphere = &victimPedCol->spheres[s];
|
CColSphere *sphere = &victimPedCol->spheres[s];
|
||||||
collisionDist = victimPedPos+sphere->center-(*fireSource);
|
|
||||||
|
if (useLocalPos) {
|
||||||
|
collisionDist = sphere->center - (*fireSource);
|
||||||
|
} else {
|
||||||
|
collisionDist = victimPedPos + sphere->center - (*fireSource);
|
||||||
|
}
|
||||||
|
|
||||||
if ( SQR(sphere->radius + info->m_fRadius) > collisionDist.MagnitudeSqr() )
|
if ( SQR(sphere->radius + info->m_fRadius) > collisionDist.MagnitudeSqr() )
|
||||||
{
|
{
|
||||||
|
@ -659,45 +679,15 @@ CWeapon::FireInstantHit(CEntity *shooter, CVector *fireSource)
|
||||||
|
|
||||||
switch ( m_eWeaponType )
|
switch ( m_eWeaponType )
|
||||||
{
|
{
|
||||||
case WEAPONTYPE_AK47:
|
|
||||||
{
|
|
||||||
static uint8 counter = 0;
|
|
||||||
|
|
||||||
if ( !(++counter & 1) )
|
|
||||||
{
|
|
||||||
CPointLights::AddLight(CPointLights::LIGHT_POINT,
|
|
||||||
*fireSource, CVector(0.0f, 0.0f, 0.0f), 5.0f,
|
|
||||||
1.0f, 0.8f, 0.0f, CPointLights::FOG_NONE, false);
|
|
||||||
|
|
||||||
CVector gunflashPos = *fireSource;
|
|
||||||
gunflashPos += CVector(0.06f*ahead.x, 0.06f*ahead.y, 0.0f);
|
|
||||||
CParticle::AddParticle(PARTICLE_GUNFLASH_NOANIM, gunflashPos, CVector(0.0f, 0.0f, 0.0f), nil, 0.10f);
|
|
||||||
gunflashPos += CVector(0.06f*ahead.x, 0.06f*ahead.y, 0.0f);
|
|
||||||
CParticle::AddParticle(PARTICLE_GUNFLASH_NOANIM, gunflashPos, CVector(0.0f, 0.0f, 0.0f), nil, 0.08f);
|
|
||||||
gunflashPos += CVector(0.05f*ahead.x, 0.05f*ahead.y, 0.0f);
|
|
||||||
CParticle::AddParticle(PARTICLE_GUNFLASH_NOANIM, gunflashPos, CVector(0.0f, 0.0f, 0.0f), nil, 0.06f);
|
|
||||||
gunflashPos += CVector(0.04f*ahead.x, 0.04f*ahead.y, 0.0f);
|
|
||||||
CParticle::AddParticle(PARTICLE_GUNFLASH_NOANIM, gunflashPos, CVector(0.0f, 0.0f, 0.0f), nil, 0.04f);
|
|
||||||
|
|
||||||
CVector gunsmokePos = *fireSource;
|
|
||||||
float rnd = CGeneral::GetRandomNumberInRange(0.05f, 0.25f);
|
|
||||||
CParticle::AddParticle(PARTICLE_GUNSMOKE2, gunsmokePos, CVector(ahead.x*rnd, ahead.y*rnd, 0.0f));
|
|
||||||
|
|
||||||
CVector gunshellPos = *fireSource;
|
|
||||||
gunshellPos -= CVector(0.5f*ahead.x, 0.5f*ahead.y, 0.0f);
|
|
||||||
CVector dir = CrossProduct(CVector(ahead.x, ahead.y, 0.0f), CVector(0.0f, 0.0f, 5.0f));
|
|
||||||
dir.Normalise2D();
|
|
||||||
AddGunshell(shooter, gunshellPos, CVector2D(dir.x, dir.y), 0.018f);
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case WEAPONTYPE_M16:
|
case WEAPONTYPE_M16:
|
||||||
|
case WEAPONTYPE_AK47:
|
||||||
|
// case WEAPONTYPE_M60:
|
||||||
|
// case WEAPONTYPE_MINIGUN:
|
||||||
|
case WEAPONTYPE_HELICANNON:
|
||||||
{
|
{
|
||||||
static uint8 counter = 0;
|
static uint8 counter = 0;
|
||||||
|
|
||||||
if ( !(++counter & 1) )
|
if ( info->m_nFiringRate >= 50 && !(++counter & 1) )
|
||||||
{
|
{
|
||||||
CPointLights::AddLight(CPointLights::LIGHT_POINT,
|
CPointLights::AddLight(CPointLights::LIGHT_POINT,
|
||||||
*fireSource, CVector(0.0f, 0.0f, 0.0f), 5.0f,
|
*fireSource, CVector(0.0f, 0.0f, 0.0f), 5.0f,
|
||||||
|
@ -1669,7 +1659,7 @@ CWeapon::FireM16_1stPerson(CEntity *shooter)
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
CWeapon::FireInstantHitFromCar(CAutomobile *shooter, bool left)
|
CWeapon::FireInstantHitFromCar(CVehicle *shooter, bool left)
|
||||||
{
|
{
|
||||||
CWeaponInfo *info = GetInfo();
|
CWeaponInfo *info = GetInfo();
|
||||||
|
|
||||||
|
@ -2040,8 +2030,10 @@ CWeapon::Reload(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CWeapon::Update(int32 audioEntity)
|
CWeapon::Update(int32 audioEntity, CPed *pedToAdjustSound)
|
||||||
{
|
{
|
||||||
|
CWeaponInfo *info = GetInfo();
|
||||||
|
|
||||||
switch ( m_eWeaponState )
|
switch ( m_eWeaponState )
|
||||||
{
|
{
|
||||||
case WEAPONSTATE_MELEE_MADECONTACT:
|
case WEAPONSTATE_MELEE_MADECONTACT:
|
||||||
|
@ -2074,9 +2066,57 @@ CWeapon::Update(int32 audioEntity)
|
||||||
{
|
{
|
||||||
if ( AEHANDLE_IS_OK(audioEntity) && m_eWeaponType < WEAPONTYPE_LAST_WEAPONTYPE )
|
if ( AEHANDLE_IS_OK(audioEntity) && m_eWeaponType < WEAPONTYPE_LAST_WEAPONTYPE )
|
||||||
{
|
{
|
||||||
uint32 timePassed = m_nTimer - gReloadSampleTime[m_eWeaponType];
|
CAnimBlendAssociation *reloadAssoc = nil;
|
||||||
if ( CTimer::GetPreviousTimeInMilliseconds() < timePassed && CTimer::GetTimeInMilliseconds() >= timePassed )
|
if (pedToAdjustSound) {
|
||||||
DMAudio.PlayOneShot(audioEntity, SOUND_WEAPON_RELOAD, 0.0f);
|
if (CPed::GetReloadAnim(info) && (!CWorld::Players[CWorld::PlayerInFocus].m_bFastReload || !pedToAdjustSound->IsPlayer())) {
|
||||||
|
reloadAssoc = RpAnimBlendClumpGetAssociation(pedToAdjustSound->GetClump(), CPed::GetReloadAnim(info));
|
||||||
|
if (!reloadAssoc) {
|
||||||
|
reloadAssoc = RpAnimBlendClumpGetAssociation(pedToAdjustSound->GetClump(), CPed::GetCrouchReloadAnim(info));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (reloadAssoc && reloadAssoc->IsRunning() && reloadAssoc->blendAmount > 0.2f) {
|
||||||
|
float soundStart = 0.75f;
|
||||||
|
switch (info->m_AnimToPlay) {
|
||||||
|
case ASSOCGRP_PYTHON:
|
||||||
|
soundStart = 0.5f;
|
||||||
|
break;
|
||||||
|
case ASSOCGRP_COLT:
|
||||||
|
case ASSOCGRP_TEC:
|
||||||
|
soundStart = 0.7f;
|
||||||
|
break;
|
||||||
|
case ASSOCGRP_UZI:
|
||||||
|
soundStart = 0.75f;
|
||||||
|
break;
|
||||||
|
case ASSOCGRP_RIFLE:
|
||||||
|
soundStart = 0.75f;
|
||||||
|
break;
|
||||||
|
case ASSOCGRP_M60:
|
||||||
|
soundStart = 0.7f;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (reloadAssoc->GetProgress() >= soundStart && (reloadAssoc->currentTime - reloadAssoc->timeStep) / reloadAssoc->hierarchy->totalLength < soundStart) {
|
||||||
|
#ifdef AUDIO_NOT_READY
|
||||||
|
DMAudio.PlayOneShot(audioEntity, SOUND_WEAPON_RELOAD, 0.0f);
|
||||||
|
#else
|
||||||
|
DMAudio.PlayOneShot(audioEntity, SOUND_WEAPON_RELOAD, m_eWeaponType);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
if (CTimer::GetTimeInMilliseconds() > m_nTimer && reloadAssoc->GetProgress() < 0.9f) {
|
||||||
|
m_nTimer = CTimer::GetTimeInMilliseconds();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
uint32 timePassed = m_nTimer - gReloadSampleTime[m_eWeaponType];
|
||||||
|
if (CTimer::GetPreviousTimeInMilliseconds() < timePassed && CTimer::GetTimeInMilliseconds() >= timePassed) {
|
||||||
|
#ifdef AUDIO_NOT_READY
|
||||||
|
DMAudio.PlayOneShot(audioEntity, SOUND_WEAPON_RELOAD, 0.0f);
|
||||||
|
#else
|
||||||
|
DMAudio.PlayOneShot(audioEntity, SOUND_WEAPON_RELOAD, m_eWeaponType);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( CTimer::GetTimeInMilliseconds() > m_nTimer )
|
if ( CTimer::GetTimeInMilliseconds() > m_nTimer )
|
||||||
|
|
|
@ -7,7 +7,8 @@
|
||||||
|
|
||||||
class CEntity;
|
class CEntity;
|
||||||
class CPhysical;
|
class CPhysical;
|
||||||
class CAutomobile;
|
class CVehicle;
|
||||||
|
class CPed;
|
||||||
struct CColPoint;
|
struct CColPoint;
|
||||||
class CWeaponInfo;
|
class CWeaponInfo;
|
||||||
|
|
||||||
|
@ -35,7 +36,7 @@ public:
|
||||||
void Shutdown();
|
void Shutdown();
|
||||||
|
|
||||||
bool Fire (CEntity *shooter, CVector *fireSource);
|
bool Fire (CEntity *shooter, CVector *fireSource);
|
||||||
bool FireFromCar (CAutomobile *shooter, bool left);
|
bool FireFromCar (CVehicle *shooter, bool left);
|
||||||
bool FireMelee (CEntity *shooter, CVector &fireSource);
|
bool FireMelee (CEntity *shooter, CVector &fireSource);
|
||||||
bool FireInstantHit(CEntity *shooter, CVector *fireSource);
|
bool FireInstantHit(CEntity *shooter, CVector *fireSource);
|
||||||
|
|
||||||
|
@ -50,14 +51,14 @@ public:
|
||||||
bool FireAreaEffect (CEntity *shooter, CVector *fireSource);
|
bool FireAreaEffect (CEntity *shooter, CVector *fireSource);
|
||||||
bool FireSniper (CEntity *shooter);
|
bool FireSniper (CEntity *shooter);
|
||||||
bool FireM16_1stPerson (CEntity *shooter);
|
bool FireM16_1stPerson (CEntity *shooter);
|
||||||
bool FireInstantHitFromCar(CAutomobile *shooter, bool left);
|
bool FireInstantHitFromCar(CVehicle *shooter, bool left);
|
||||||
|
|
||||||
static void DoDoomAiming (CEntity *shooter, CVector *source, CVector *target);
|
static void DoDoomAiming (CEntity *shooter, CVector *source, CVector *target);
|
||||||
static void DoTankDoomAiming (CEntity *shooter, CEntity *driver, CVector *source, CVector *target);
|
static void DoTankDoomAiming (CEntity *shooter, CEntity *driver, CVector *source, CVector *target);
|
||||||
static void DoDriveByAutoAiming(CEntity *shooter, CVector *source, CVector *target);
|
static void DoDriveByAutoAiming(CEntity *shooter, CVector *source, CVector *target);
|
||||||
|
|
||||||
void Reload(void);
|
void Reload(void);
|
||||||
void Update(int32 audioEntity);
|
void Update(int32 audioEntity, CPed *pedToAdjustSound);
|
||||||
bool IsTypeMelee (void);
|
bool IsTypeMelee (void);
|
||||||
bool IsType2Handed(void);
|
bool IsType2Handed(void);
|
||||||
|
|
||||||
|
|
|
@ -20,21 +20,21 @@ CWeaponInfo CWeaponInfo::ms_apWeaponInfos[WEAPONTYPE_TOTALWEAPONS];
|
||||||
static char ms_aWeaponNames[][32] = {
|
static char ms_aWeaponNames[][32] = {
|
||||||
"Unarmed",
|
"Unarmed",
|
||||||
"BaseballBat",
|
"BaseballBat",
|
||||||
|
"Grenade",
|
||||||
|
"DetonateGrenade",
|
||||||
|
"Molotov",
|
||||||
|
"Rocket",
|
||||||
"Colt45",
|
"Colt45",
|
||||||
|
"Shotgun",
|
||||||
"Tec9",
|
"Tec9",
|
||||||
"Uzi",
|
"Uzi",
|
||||||
"SilencedIngram",
|
"SilencedIngram",
|
||||||
"Mp5",
|
"Mp5",
|
||||||
"Shotgun",
|
|
||||||
"AK47",
|
|
||||||
"M16",
|
"M16",
|
||||||
|
"AK47",
|
||||||
"SniperRifle",
|
"SniperRifle",
|
||||||
"RocketLauncher",
|
"RocketLauncher",
|
||||||
"FlameThrower",
|
"FlameThrower",
|
||||||
"Molotov",
|
|
||||||
"Rocket",
|
|
||||||
"Grenade",
|
|
||||||
"DetonateGrenade",
|
|
||||||
"Detonator",
|
"Detonator",
|
||||||
"HeliCannon",
|
"HeliCannon",
|
||||||
};
|
};
|
||||||
|
|
|
@ -5,24 +5,25 @@ enum eWeaponType
|
||||||
{
|
{
|
||||||
WEAPONTYPE_UNARMED,
|
WEAPONTYPE_UNARMED,
|
||||||
WEAPONTYPE_BASEBALLBAT,
|
WEAPONTYPE_BASEBALLBAT,
|
||||||
|
WEAPONTYPE_GRENADE,
|
||||||
|
WEAPONTYPE_DETONATOR_GRENADE,
|
||||||
|
WEAPONTYPE_MOLOTOV,
|
||||||
|
WEAPONTYPE_ROCKET,
|
||||||
WEAPONTYPE_COLT45,
|
WEAPONTYPE_COLT45,
|
||||||
|
WEAPONTYPE_SHOTGUN,
|
||||||
WEAPONTYPE_TEC9,
|
WEAPONTYPE_TEC9,
|
||||||
WEAPONTYPE_UZI,
|
WEAPONTYPE_UZI,
|
||||||
WEAPONTYPE_SILENCED_INGRAM,
|
WEAPONTYPE_SILENCED_INGRAM,
|
||||||
WEAPONTYPE_MP5,
|
WEAPONTYPE_MP5,
|
||||||
WEAPONTYPE_SHOTGUN,
|
|
||||||
WEAPONTYPE_AK47,
|
|
||||||
WEAPONTYPE_M16,
|
WEAPONTYPE_M16,
|
||||||
|
WEAPONTYPE_AK47,
|
||||||
WEAPONTYPE_SNIPERRIFLE,
|
WEAPONTYPE_SNIPERRIFLE,
|
||||||
WEAPONTYPE_ROCKETLAUNCHER,
|
WEAPONTYPE_ROCKETLAUNCHER,
|
||||||
WEAPONTYPE_FLAMETHROWER,
|
WEAPONTYPE_FLAMETHROWER,
|
||||||
WEAPONTYPE_MOLOTOV,
|
|
||||||
WEAPONTYPE_ROCKET,
|
|
||||||
WEAPONTYPE_GRENADE,
|
|
||||||
WEAPONTYPE_DETONATOR_GRENADE,
|
|
||||||
WEAPONTYPE_DETONATOR,
|
WEAPONTYPE_DETONATOR,
|
||||||
WEAPONTYPE_HELICANNON,
|
WEAPONTYPE_HELICANNON,
|
||||||
WEAPONTYPE_LAST_WEAPONTYPE,
|
WEAPONTYPE_LAST_WEAPONTYPE,
|
||||||
|
WEAPONTYPE_HEALTH,
|
||||||
WEAPONTYPE_ARMOUR,
|
WEAPONTYPE_ARMOUR,
|
||||||
WEAPONTYPE_RAMMEDBYCAR,
|
WEAPONTYPE_RAMMEDBYCAR,
|
||||||
WEAPONTYPE_RUNOVERBYCAR,
|
WEAPONTYPE_RUNOVERBYCAR,
|
||||||
|
|
Loading…
Reference in a new issue