summaryrefslogtreecommitdiffstats
path: root/src/peds/Ped.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/peds/Ped.h')
-rw-r--r--src/peds/Ped.h170
1 files changed, 150 insertions, 20 deletions
diff --git a/src/peds/Ped.h b/src/peds/Ped.h
index 26cdf03f..f415b386 100644
--- a/src/peds/Ped.h
+++ b/src/peds/Ped.h
@@ -100,9 +100,31 @@ enum PedFightMoves
{
FIGHTMOVE_NULL,
// Attacker
- FIGHTMOVE_STDPUNCH,
+// FIGHTMOVE_STDPUNCH,
FIGHTMOVE_IDLE,
FIGHTMOVE_SHUFFLE_F,
+ // Combos
+ FIGHTMOVE_COMBO_A1,
+ FIGHTMOVE_COMBO_A2,
+ FIGHTMOVE_COMBO_A3,
+ FIGHTMOVE_COMBO_B1,
+ FIGHTMOVE_COMBO_B2,
+ FIGHTMOVE_COMBO_B3,
+ // Melee
+ FIGHTMOVE_MELEE1,
+ FIGHTMOVE_MELEE2,
+ FIGHTMOVE_MELEE3,
+ // Special
+ FIGHTMOVE_GROUNDKICK,
+ // Opponent
+ FIGHTMOVE_HITFRONT,
+ FIGHTMOVE_HITBACK,
+ FIGHTMOVE_HITRIGHT,
+ FIGHTMOVE_HITLEFT,
+ FIGHTMOVE_HITONFLOOR,
+ FIGHTMOVE_HITBEHIND,
+ FIGHTMOVE_IDLE2NORM,
+/*
FIGHTMOVE_KNEE,
FIGHTMOVE_PUNCHHOOK,
FIGHTMOVE_PUNCHJAB,
@@ -134,7 +156,16 @@ enum PedFightMoves
FIGHTMOVE_MELEE2,
FIGHTMOVE_MELEE3,
FIGHTMOVE_IDLE2NORM,
- NUM_FIGHTMOVES
+*/
+
+ NUM_FIGHTMOVES,
+
+ // LCS replacements for the old names:
+ // NB: this may be totally bogus, i just need it to compile
+ FIGHTMOVE_PUNCH = FIGHTMOVE_COMBO_A2,
+ FIGHTMOVE_FWDRIGHT = FIGHTMOVE_COMBO_B1,
+ FIGHTMOVE_LONGKICK = FIGHTMOVE_COMBO_B2,
+ FIGHTMOVE_ROUNDHOUSE = FIGHTMOVE_COMBO_B3,
};
enum ePedPieceTypes
@@ -185,6 +216,56 @@ enum eWaitState {
WAITSTATE_GROUND_ATTACK,
WAITSTATE_LANCESITTING,
WAITSTATE_PLAYANIM_HANDSUP_SIMPLE,
+ WAITSTATE_MULTIPLAYER_CUTSCENE_MPNOTE,
+ WAITSTATE_MULTIPLAYER_CUTSCENE_MPNOTE_LOOP,
+ WAITSTATE_CS_MISC_IDLE_LOOK,
+ WAITSTATE_CS_MISC_IDLE_NO,
+ WAITSTATE_CS_MISC_IDLE_YES,
+ WAITSTATE_CS_MISC_IDLE_CHAT2,
+ WAITSTATE_CS_MISC_IDLE_COUGH,
+ WAITSTATE_CS_MISC_IDLE_GIGGLE_FEMALE,
+ WAITSTATE_CS_MISC_IDLE_TOUGH_CHAT,
+ WAITSTATE_CS_MISC_IDLE_CELL_TALK,
+ WAITSTATE_DONH2_CAMERA,
+ WAITSTATE_DONH3_HAPPY,
+ WAITSTATE_JDT2_ANXIOUS_TALK,
+ WAITSTATE_JDT2_SHRUG,
+ WAITSTATE_JDT4_DILDO_TALK,
+ WAITSTATE_JDT5_CALM_DOWN,
+ WAITSTATE_JDT5_POINT,
+ WAITSTATE_JDT6_PICKUP,
+ WAITSTATE_MAR1_SKIRT,
+ WAITSTATE_MAR2_CELL_ANSWER,
+ WAITSTATE_MAR2_CELL_END,
+ WAITSTATE_MAR2_CELL_TALK,
+ WAITSTATE_MAR2_FOOT_TAP,
+ WAITSTATE_MAR3_HOOCHY,
+ WAITSTATE_MAR3_NOTE_IDLE,
+ WAITSTATE_MAR3_NOTE_PICKUP,
+ WAITSTATE_SAL1_BIREFCASE_DOWN,
+ WAITSTATE_SAL2_IDLE_SEATED,
+ WAITSTATE_SAL2_SEAT_TO_STAND,
+ WAITSTATE_SAL3_SEATED_TALK,
+ WAITSTATE_SAL3_SEATED_IDLE,
+ WAITSTATE_SAL4_DUST_DOWN,
+ WAITSTATE_SAL4_GIRL_RUN,
+ WAITSTATE_SAL6_ANGRY_SEATED,
+ WAITSTATE_SAL6_IDLE_SEATED,
+ WAITSTATE_SAL7_LOOKOUT,
+ WAITSTATE_VIC2_POINT_ANGRY,
+ WAITSTATE_VIC3_WAFT,
+ WAITSTATE_VIC3_PICKUP_ROLL,
+ WAITSTATE_VIC4_CARRY_BOX,
+ WAITSTATE_VIC4_CELL_LOOK,
+ WAITSTATE_VIC4_CRATE_IDLE,
+ WAITSTATE_VIC6_CELL_ANGRY,
+ WAITSTATE_TOURIST3,
+ WAITSTATE_TOURIST2,
+ WAITSTATE_TOURIST1,
+ WAITSTATE_MAC2_PLEAD,
+ WAITSTATE_JDT6_KNOCK,
+ WAITSTATE_SAL3_SIT_DOWN,
+ WAITSTATE_VIC7_PROD_WITH_FOOT
};
enum eObjective {
@@ -347,7 +428,8 @@ enum PedState
PED_EXIT_CAR,
PED_HANDS_UP,
PED_ARRESTED,
- PED_DEPLOY_STINGER
+ PED_DEPLOY_STINGER,
+ PED_STATE64
};
enum eMoveState {
@@ -375,7 +457,7 @@ public:
float m_fCollisionSpeed;
// cf. https://github.com/DK22Pac/plugin-sdk/blob/master/plugin_sa/game_sa/CPed.h from R*
- uint32 bIsStanding : 1;
+ uint32 bIsStanding : 1; // 0x194 on PS2, 0x1A4 on android
uint32 bWasStanding : 1;
uint32 bIsAttacking : 1; // doesn't reset after fist fight
uint32 bIsPointingGunAt : 1;
@@ -469,11 +551,12 @@ public:
uint32 bDrownsInWater : 1;
uint32 bWaitForLeaderToComeCloser : 1;
uint32 bHeldHostageInCar : 1;
+ uint32 b19C_10 : 1;
uint32 bIsPlayerFriend : 1;
uint32 bHeadStuckInCollision : 1;
uint32 bDeadPedInFrontOfCar : 1;
- uint32 bStayInCarOnJack : 1;
+ uint32 bStayInCarOnJack : 1;
uint32 bDontFight : 1;
uint32 bDoomAim : 1;
uint32 bCanBeShotInVehicle : 1;
@@ -481,8 +564,8 @@ public:
uint32 bMakeFleeScream : 1;
uint32 bPushedAlongByCar : 1;
uint32 bRemoveMeWhenIGotIntoCar : 1;
- uint32 bIgnoreThreatsBehindObjects : 1;
+ uint32 bIgnoreThreatsBehindObjects : 1;
uint32 bNeverEverTargetThisPed : 1;
uint32 bCrouchWhenScared : 1;
uint32 bKnockedOffBike : 1;
@@ -490,18 +573,42 @@ public:
uint32 bCollectBusFare : 1;
uint32 bBoughtIceCream : 1;
uint32 bDonePositionOutOfCollision : 1;
- uint32 bCanAttackPlayerWithCops : 1;
+
+ uint32 bCanAttackPlayerWithCops : 1; // 1A1_1 on PS2
+ uint32 bOnlyAllowedToSitBehind : 1;
+ uint32 bOnlyAllowedToSitInFront : 1;
+ uint32 b1A1_8 : 1;
+ uint32 b1A1_10 : 1;
+ uint32 bOverrideMoveAnim : 1;
#ifdef KANGAROO_CHEAT
// our own flags
uint32 m_ped_flagI80 : 1; // KANGAROO_CHEAT define makes use of this as cheat toggle
#endif
- uint8 m_gangFlags;
- uint8 m_unused15D; // these 3 can't be padding but had to actually have been members ...
- uint8 m_unused15E;
- uint8 m_unused15F;
- uint8 CharCreatedBy;
+ uint16 m_gangFlags; // <- this one is uint16
+
+ uint8 bDropsWeaponsOnDeath : 1;
+ uint8 b1A4_2 : 1; // something to do with car hostages
+ uint8 bAttacksPlayerWithCops : 1;
+ uint8 b1A4_8 : 1;
+ uint8 b1A4_10 : 1;
+ uint8 b1A4_20 : 1;
+ uint8 b1A4_40 : 1;
+ uint8 b1A4_80 : 1;
+
+ uint8 bCanBeTargettedByLeader : 1;
+ uint8 b1A5_2 : 1;
+ uint8 b1A5_4 : 1;
+ uint8 b1A5_8 : 1;
+ uint8 b1A5_10 : 1;
+ uint8 b1A5_20 : 1;
+ uint8 b1A5_40 : 1;
+ uint8 b1A5_80 : 1;
+
+ uint8 unk_1A6; // <- init with 100 in constructor
+
+ uint8 CharCreatedBy; // 1AC
eObjective m_objective;
eObjective m_prevObjective;
CPed *m_pedInObjective;
@@ -550,6 +657,8 @@ public:
float m_fHealth;
float m_fArmour;
uint32 m_nExtendedRangeTimer;
+ uint32 m_nScriptShootTimer;
+ uint32 m_nScriptAttackTimer;
int16 m_routeLastPoint;
uint16 m_routeStartPoint;
int16 m_routePointsPassed;
@@ -596,7 +705,7 @@ public:
uint32 m_delayedWeaponAmmo;
uint8 m_currentWeapon; // eWeaponType
uint8 m_maxWeaponTypeAllowed; // eWeaponType
- uint8 m_wepSkills;
+ uint8 m_wepSkills; // TODO - missing?
uint8 m_wepAccuracy;
CEntity *m_pPointGunAt;
CVector m_vecHitLastPos;
@@ -649,6 +758,7 @@ public:
uint32 m_lastComment;
CVector m_vecSpotToGuard;
float m_radiusToGuard;
+ float m_fMaxHealth;
static void *operator new(size_t) throw();
static void *operator new(size_t, int) throw();
@@ -720,6 +830,7 @@ public:
void SetObjective(eObjective);
void SetObjective(eObjective, int16, int16);
void SetObjective(eObjective, CVector);
+ void SetObjective(eObjective, CVector, float);
void SetObjective(eObjective, float, const CVector&);
void ClearChat(void);
void InformMyGangOfAttack(CEntity*);
@@ -769,7 +880,7 @@ public:
void SetEvasiveDive(CPhysical*, uint8);
void SetAttack(CEntity*);
void StartFightAttack(uint8);
- void SetWaitState(eWaitState, void*);
+ void SetWaitState(eWaitState, void*, bool repeat = false);
bool FightStrike(CVector&, bool);
void FightHitPed(CPed*, CVector&, CVector&, int16);
int32 ChooseAttackPlayer(uint8, bool);
@@ -852,6 +963,7 @@ public:
void SetSolicit(uint32 time);
void ScanForInterestingStuff(void);
void WarpPedIntoCar(CVehicle*);
+ void WarpPedIntoCarAsPassenger(CVehicle*, int32);
void SetCarJack(CVehicle*);
bool WarpPedToNearLeaderOffScreen(void);
void Solicit(void);
@@ -980,8 +1092,13 @@ public:
PedState GetPedState(void) { return m_nPedState; }
void SetPedState(PedState state)
{
- if (GetPedState() == PED_FOLLOW_PATH && state != PED_FOLLOW_PATH)
+ if (GetPedState() == PED_FOLLOW_PATH && state != PED_FOLLOW_PATH) {
+ if (m_followPathTargetEnt) {
+ m_followPathTargetEnt->CleanUpOldReference(&m_followPathTargetEnt);
+ m_followPathTargetEnt = nil;
+ }
ClearFollowPath();
+ }
m_nPedState = state;
}
bool Dead(void) { return m_nPedState == PED_DEAD; }
@@ -1006,6 +1123,16 @@ public:
{
return m_pMyVehicle != nil && ((CEntity*)m_pMyVehicle)->GetStatus() != STATUS_WRECKED;
}
+ bool CanStartMission() // used in CAN_PLAYER_START_MISSION and can looks like inlined function
+ {
+ if (m_nPedState >= PED_WANDER_RANGE && m_nPedState < PED_STATES_NO_AI && m_nPedState != PED_ANSWER_MOBILE)
+ return false;
+ if (m_nPedState >= PED_JUMP && m_nPedState < PED_STATES_NO_ST)
+ return false;
+ if (m_nPedState >= PED_ENTER_TRAIN && m_nPedState < PED_DEPLOY_STINGER)
+ return false;
+ return !bIsInTheAir && !bIsLanding && m_fHealth > 0.0f;
+ }
// My names. Inlined in VC
AnimationId GetFireAnimNotDucking(CWeaponInfo* weapon) {
@@ -1024,7 +1151,7 @@ public:
static AnimationId GetFireAnimGround(CWeaponInfo* weapon, bool kickFloorIfNone = true) {
if (weapon->IsFlagSet(WEAPONFLAG_GROUND_2ND))
- return ANIM_WEAPON_CROUCHFIRE;
+ return ANIM_ATTACK_2;
else if (weapon->IsFlagSet(WEAPONFLAG_GROUND_3RD))
return ANIM_WEAPON_FIRE_3RD;
else if (kickFloorIfNone)
@@ -1037,26 +1164,26 @@ public:
if (weapon->IsFlagSet(WEAPONFLAG_ANIMDETONATE))
return ANIM_STD_DETONATE;
else
- return ANIM_WEAPON_FIRE;
+ return ANIM_ATTACK_1;
}
static AnimationId GetCrouchReloadAnim(CWeaponInfo* weapon) {
if (weapon->IsFlagSet(WEAPONFLAG_RELOAD))
- return ANIM_WEAPON_CROUCHRELOAD;
+ return ANIM_ATTACK_EXTRA2;
else
return (AnimationId)0;
}
static AnimationId GetCrouchFireAnim(CWeaponInfo* weapon) {
if (weapon->IsFlagSet(WEAPONFLAG_CROUCHFIRE))
- return ANIM_WEAPON_CROUCHFIRE;
+ return ANIM_ATTACK_2;
else
return (AnimationId)0;
}
static AnimationId GetReloadAnim(CWeaponInfo* weapon) {
if (weapon->IsFlagSet(WEAPONFLAG_RELOAD))
- return ANIM_WEAPON_RELOAD;
+ return ANIM_ATTACK_EXTRA1;
else
return (AnimationId)0;
}
@@ -1157,6 +1284,9 @@ public:
static bool bPedCheat3;
static CVector2D ms_vec2DFleePosition;
+ static void LoadNonStandardPedAnim(eWaitState waitState);
+ static void UnloadNonStandardPedAnim(eWaitState waitState);
+
#ifndef MASTER
// Mobile things
void DebugDrawPedDestination(CPed *, int, int);