Cleaned up Player class from all unused action anim

Added all mohaas/mohaab fields
Added m_sDmPrimary to get the player's primary weapon
This commit is contained in:
smallmodel 2023-08-02 20:59:19 +02:00
parent ce02d782c4
commit f739588c73
No known key found for this signature in database
GPG key ID: 9F2D623CEDF08512
2 changed files with 101 additions and 114 deletions

View file

@ -419,14 +419,6 @@ Event EV_Player_AnimLoop_Torso
"Called when the torso animation has finished.",
EV_NORMAL
);
Event EV_Player_ActionAnimEnd
(
"actionanimend",
EV_DEFAULT,
NULL,
NULL,
"Called when the action animation has finished."
);
Event EV_Player_AnimLoop_Legs
(
"animloop_legs",
@ -1652,7 +1644,6 @@ CLASS_DECLARATION( Sentient, Player, "player" )
{ &EV_Player_RemoveClass, &Player::RemoveClass },
{ &EV_Player_AnimLoop_Legs, &Player::EndAnim_Legs },
{ &EV_Player_AnimLoop_Torso, &Player::EndAnim_Torso },
{ &EV_Player_ActionAnimEnd, &Player::EndActionAnim },
{ &EV_Player_Jump, &Player::Jump },
{ &EV_Sentient_JumpXY, &Player::JumpXY },
{ &EV_Player_ListInventory, &Player::ListInventoryEvent },
@ -3426,6 +3417,47 @@ qboolean Player::checkinvehicle( Conditional &condition )
return ( m_pVehicle != NULL );
}
qboolean Player::CondIsEscaping(Conditional& condition)
{
// FIXME: unimplemented
return true;
}
qboolean Player::CondAbleToDefuse(Conditional& condition)
{
// FIXME: unimplemented
return true;
}
qboolean Player::CondCanPlaceLandmine(Conditional& condition)
{
// FIXME: unimplemented
return false;
}
qboolean Player::CondOnLandmine(Conditional& condition)
{
// FIXME: unimplemented
return false;
}
qboolean Player::CondNearLandmine(Conditional& condition)
{
// FIXME: unimplemented
return false;
}
void Player::MeasureLandmineDistances()
{
// FIXME: unimplemented
}
qboolean Player::CondIsAssistingEscape(Conditional& condition)
{
// FIXME: unimplemented
return qfalse;
}
qboolean Player::checkturrettype( Conditional &condition )
{
str name = condition.getParm( 1 );
@ -3638,30 +3670,6 @@ qboolean Player::checkmovementspeed(Conditional& condition)
return client->ps.speed >= speed;
}
qboolean Player::checkabletodefuse(Conditional& condition)
{
// FIXME: unimplemented
return true;
}
qboolean Player::checkonlandmine(Conditional& condition)
{
// FIXME: unimplemented
return false;
}
qboolean Player::checknearlandmine(Conditional& condition)
{
// FIXME: unimplemented
return false;
}
qboolean Player::CondCanPlaceLandmine(Conditional& condition)
{
// FIXME: unimplemented
return false;
}
qboolean Player::CondWeaponCurrentFireAnim(Conditional& condition)
{
// FIXME: unimplemented
@ -4032,9 +4040,9 @@ Condition<Player> Player::Conditions[] =
{ "MAX_CHARGE_TIME_MET", &Player::checkmaxchargetimemet },
{ "IMMEDIATE_SWITCH", &Player::checkimmediateswitch },
{ "CHECK_MOVEMENT_SPEED", &Player::checkmovementspeed },
{ "ABLE_TO_DEFUSE", &Player::checkabletodefuse },
{ "ON_LANDMINE", &Player::checkonlandmine },
{ "NEAR_LANDMINE", &Player::checknearlandmine },
{ "ABLE_TO_DEFUSE", &Player::CondAbleToDefuse },
{ "ON_LANDMINE", &Player::CondOnLandmine },
{ "NEAR_LANDMINE", &Player::CondNearLandmine },
{ "CAN_PLACE_LANDMINE", &Player::CondCanPlaceLandmine },
{ "WEAPON_CURRENT_FIRE_ANIM", &Player::CondWeaponCurrentFireAnim },
{ "VEHICLE_TYPE", &Player::CondVehicleType },
@ -4098,16 +4106,7 @@ Player::Player()
partBlendMult[ 0 ] = 0;
partBlendMult[ 1 ] = 0;
m_fOldActionAnimFadeTime = 0;
m_bActionAnimPlaying = false;
m_fLastDeltaTime = level.time;
m_iBaseActionAnimSlot = 0;
m_iActionAnimType = 0;
m_fOldActionAnimWeight = 0;
m_fOldActionAnimFadeTime = 0;
m_bMovementAnimPlaying = false;
m_fOldMovementWeight = 0;
camera = NULL;
atobject = NULL;
@ -10588,15 +10587,6 @@ void Player::EndAnim_Torso
EvaluateState();
}
void Player::EndActionAnim
(
Event *ev
)
{
m_bActionAnimDone = qtrue;
EvaluateState();
}
void Player::SetPartAnim
(
const char *anim,
@ -11489,6 +11479,16 @@ void Player::EventGetFireHeld
ev->AddInteger( buttons & ( BUTTON_ATTACKLEFT | BUTTON_ATTACKRIGHT ) ? qtrue : qfalse );
}
void Player::EventForceLandmineMeasure(Event* ev)
{
MeasureLandmineDistances();
}
str Player::GetCurrentDMWeaponType() const
{
return m_sDmPrimary;
}
void Player::Score
(
Event *ev

View file

@ -89,6 +89,12 @@ typedef enum
PVT_AXIS_END
} voicetype_t;
typedef enum jailstate_e {
JAILSTATE_NONE,
JAILSTATE_ESCAPE,
JAILSTATE_ASSIST_ESCAPE
} jailstate_t;
typedef void ( Player::*movecontrolfunc_t )( void );
typedef struct vma_s {
@ -127,28 +133,13 @@ private:
bool animdone_Legs;
bool animdone_Torso;
bool animdone_Pain;
Container<Conditional *> legs_conditionals;
Container<Conditional *> torso_conditionals;
Conditional *m_pLegsPainCond;
Conditional *m_pTorsoPainCond;
float m_fLastDeltaTime;
qboolean m_bActionAnimPlaying;
int m_iBaseActionAnimSlot;
str m_sActionAnimName;
int m_iActionAnimType;
qboolean m_bActionAnimDone;
str m_sOldActionAnimName;
float m_fOldActionAnimWeight;
float m_fOldActionAnimFadeTime;
int m_iOldActionAnimType;
qboolean m_bMovementAnimPlaying;
int m_iBaseMovementAnimSlot;
str m_sMovementAnimName;
str m_sOldMovementAnimName;
float m_fOldMovementWeight;
float m_fOldMovementFadeTime;
str m_sSlotAnimNames[ MAX_ANIM_SLOT ];
movecontrol_t movecontrol;
int m_iMovePosFlags;
@ -169,8 +160,6 @@ private:
// aiming direction
Vector v_angle;
Vector m_vViewPos;
Vector m_vViewAng;
int buttons;
int new_buttons;
@ -213,7 +202,11 @@ private:
meansOfDeath_t pain_type;
int pain_location;
bool take_pain;
int nextpaintime;
int nextpaintime;
float m_fMineDist;
float m_fMineCheckTime;
str m_sDmPrimary;
bool m_bIsInJail;
bool knockdown;
bool canfall;
@ -252,12 +245,18 @@ private:
float damage_multiplier;
voicetype_t m_voiceType;
//
// Talking
//
voicetype_t m_voiceType;
float m_fTalkTime;
int num_deaths;
int num_kills;
int num_won_matches;
int num_lost_matches;
int num_team_kills;
int m_iLastNumTeamKills;
bool m_bTempSpectator;
bool m_bSpectator;
@ -270,8 +269,13 @@ private:
float m_fTeamSelectTime;
class PlayerStart *m_pLastSpawnpoint;
//
// Vote
///
bool voted;
int votecount;
float m_fLastVoteTime;
float m_fNextVoteOptionTime;
float m_fWeapSelectTime;
float fAttackerDispTime;
@ -280,6 +284,8 @@ private:
int m_iInfoClient;
int m_iInfoClientHealth;
float m_fInfoClientTime;
bool m_bDeathSpectator;
jailstate_t m_jailstate;
bool m_bShowingHint;
@ -289,6 +295,9 @@ public:
str m_sPerferredWeaponOverride;
float m_fHealRate;
Vector m_vViewPos;
Vector m_vViewAng;
Vector mvTrail[ MAX_TRAILS ];
Vector mvTrailEyes[ MAX_TRAILS ];
int mCurTrailOrigin;
@ -298,8 +307,6 @@ public:
int m_iNumObjectsDestroyed;
int m_iNumShotsFired;
int m_iNumHits;
float m_fAccuracy;
float m_fTimeUsed;
int m_iNumHeadShots;
int m_iNumTorsoShots;
int m_iNumLeftLegShots;
@ -308,14 +315,14 @@ public:
int m_iNumLeftArmShots;
int m_iNumRightArmShots;
qboolean yawing_left;
qboolean yawing_right;
qboolean yawing;
Vector headAngles;
Vector torsoAngles;
Vector headAimAngles;
Vector torsoAimAngles;
float m_fLastSprintTime;
bool m_bHasJumped;
float m_fLastInvulnerableTime;
int m_iInvulnerableTimeRemaining;
float m_fInvulnerableTimeElapsed;
float m_fSpawnTimeLeft;
bool m_bWaitingForRespawn;
bool m_bShouldRespawn;
// new variables
str m_sVision; // current vision
@ -425,7 +432,14 @@ public:
qboolean checkfacingupslope( Conditional &condition );
qboolean checkfacingdownslope( Conditional &condition );
qboolean checkinturret( Conditional &condition );
qboolean checkinvehicle( Conditional &condition );
qboolean checkinvehicle(Conditional& condition);
qboolean CondIsEscaping(Conditional& condition);
qboolean CondAbleToDefuse(Conditional& condition);
qboolean CondCanPlaceLandmine(Conditional& condition);
qboolean CondOnLandmine(Conditional& condition);
qboolean CondNearLandmine(Conditional& condition);
void MeasureLandmineDistances();
qboolean CondIsAssistingEscape(Conditional& condition);
qboolean checkturrettype( Conditional &condition );
qboolean checkduckedviewinwater( Conditional &condition );
qboolean checkviewinwater( Conditional &condition );
@ -443,10 +457,6 @@ public:
qboolean checkmaxchargetimemet( Conditional &condition );
qboolean checkimmediateswitch( Conditional &condition );
qboolean checkmovementspeed( Conditional &condition );
qboolean checkabletodefuse( Conditional &condition );
qboolean checkonlandmine( Conditional &condition );
qboolean checknearlandmine( Conditional &condition );
qboolean CondCanPlaceLandmine( Conditional &condition );
qboolean CondWeaponCurrentFireAnim( Conditional &condition );
qboolean CondVehicleType( Conditional &condition );
qboolean CondAnimDoneVM( Conditional &condition );
@ -550,7 +560,6 @@ public:
void EndAnim_Legs( Event *ev );
void EndAnim_Torso( Event *ev );
void EndActionAnim( Event *ev );
void SetPartAnim( const char *anim, bodypart_t slot = legs );
void StopPartAnimating( bodypart_t part );
void PausePartAnim( bodypart_t part );
@ -657,8 +666,6 @@ public:
void SetSelectedFov( float newFov );
void AdjustAnglesForAttack( void );
Entity *FindEnemyInFOV( float fov, float maxdist );
Entity *FindEnemyInFOVFromTagWithOffset( float fov, float maxdist, str tagname, Vector offset );
void DumpState( Event *ev );
void ForceLegsState( Event *ev );
void ForceTorsoState( Event *ev );
@ -715,6 +722,8 @@ public:
void EventGetUseHeld( Event *ev );
void EventGetFireHeld( Event *ev );
void EventForceLandmineMeasure(Event* ev);
str GetCurrentDMWeaponType() const;
void Score( Event *ev );
void WonMatch( void );
@ -890,26 +899,6 @@ inline void Player::Archive
arc.ArchiveBool( &animdone_Legs );
arc.ArchiveBool( &animdone_Torso );
arc.ArchiveBoolean( &m_bActionAnimPlaying );
arc.ArchiveInteger( &m_iBaseActionAnimSlot );
arc.ArchiveString( &m_sActionAnimName );
arc.ArchiveInteger( &m_iActionAnimType );
arc.ArchiveBoolean( &m_bActionAnimDone );
arc.ArchiveString( &m_sOldActionAnimName );
arc.ArchiveFloat( &m_fOldActionAnimWeight );
arc.ArchiveFloat( &m_fOldActionAnimFadeTime );
arc.ArchiveInteger( &m_iOldActionAnimType );
arc.ArchiveBoolean( &m_iBaseActionAnimSlot );
arc.ArchiveInteger( &m_iBaseMovementAnimSlot );
arc.ArchiveString( &m_sMovementAnimName );
arc.ArchiveString( &m_sOldMovementAnimName );
arc.ArchiveFloat( &m_fOldMovementWeight );
arc.ArchiveFloat( &m_fOldMovementFadeTime );
for( int i = 0; i < MAX_ANIM_SLOT; i++ )
{
arc.ArchiveString( &m_sSlotAnimNames[ i ] );
}
arc.ArchiveInteger( &m_iMovePosFlags );
ArchiveEnum( movecontrol, movecontrol_t );
@ -1033,8 +1022,6 @@ inline void Player::Archive
arc.ArchiveInteger( &m_iNumObjectsDestroyed );
arc.ArchiveInteger( &m_iNumShotsFired );
arc.ArchiveInteger( &m_iNumHits );
arc.ArchiveFloat( &m_fAccuracy );
arc.ArchiveFloat( &m_fTimeUsed );
arc.ArchiveInteger( &m_iNumHeadShots );
arc.ArchiveInteger( &m_iNumTorsoShots );
arc.ArchiveInteger( &m_iNumLeftLegShots );