mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-01-27 06:07:56 +03:00
Improved implementaton of player model activities on SP HL2 weapons
This commit is contained in:
parent
b9a46bc4e0
commit
5855c634de
@ -2344,6 +2344,16 @@ void CAI_BaseNPC::InitDefaultActivitySR(void)
|
||||
ADD_ACTIVITY_TO_SR( ACT_COVER_WALL_LOW_R_PISTOL );
|
||||
ADD_ACTIVITY_TO_SR( ACT_COVER_WALL_LOW_L_PISTOL );
|
||||
#endif
|
||||
|
||||
#ifdef EXPANDED_HL2DM_ACTIVITIES
|
||||
ADD_ACTIVITY_TO_SR( ACT_HL2MP_IDLE_357 );
|
||||
ADD_ACTIVITY_TO_SR( ACT_HL2MP_RUN_357 );
|
||||
ADD_ACTIVITY_TO_SR( ACT_HL2MP_IDLE_CROUCH_357 );
|
||||
ADD_ACTIVITY_TO_SR( ACT_HL2MP_WALK_CROUCH_357 );
|
||||
ADD_ACTIVITY_TO_SR( ACT_HL2MP_GESTURE_RANGE_ATTACK_357 );
|
||||
ADD_ACTIVITY_TO_SR( ACT_HL2MP_GESTURE_RELOAD_357 );
|
||||
ADD_ACTIVITY_TO_SR( ACT_HL2MP_JUMP_357 );
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef MAPBASE
|
||||
|
@ -201,6 +201,15 @@ acttable_t CWeapon357::m_acttable[] =
|
||||
|
||||
#ifdef MAPBASE
|
||||
// HL2:DM activities (for third-person animations in SP)
|
||||
#ifdef EXPANDED_HL2DM_ACTIVITIES
|
||||
{ ACT_HL2MP_IDLE, ACT_HL2MP_IDLE_357, false },
|
||||
{ ACT_HL2MP_RUN, ACT_HL2MP_RUN_357, false },
|
||||
{ ACT_HL2MP_IDLE_CROUCH, ACT_HL2MP_IDLE_CROUCH_357, false },
|
||||
{ ACT_HL2MP_WALK_CROUCH, ACT_HL2MP_WALK_CROUCH_357, false },
|
||||
{ ACT_HL2MP_GESTURE_RANGE_ATTACK, ACT_HL2MP_GESTURE_RANGE_ATTACK_357, false },
|
||||
{ ACT_HL2MP_GESTURE_RELOAD, ACT_HL2MP_GESTURE_RELOAD_357, false },
|
||||
{ ACT_HL2MP_JUMP, ACT_HL2MP_JUMP_357, false },
|
||||
#else
|
||||
{ ACT_HL2MP_IDLE, ACT_HL2MP_IDLE_PISTOL, false },
|
||||
{ ACT_HL2MP_RUN, ACT_HL2MP_RUN_PISTOL, false },
|
||||
{ ACT_HL2MP_IDLE_CROUCH, ACT_HL2MP_IDLE_CROUCH_PISTOL, false },
|
||||
@ -209,6 +218,7 @@ acttable_t CWeapon357::m_acttable[] =
|
||||
{ ACT_HL2MP_GESTURE_RELOAD, ACT_HL2MP_GESTURE_RELOAD_PISTOL, false },
|
||||
{ ACT_HL2MP_JUMP, ACT_HL2MP_JUMP_PISTOL, false },
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
|
@ -179,7 +179,7 @@ acttable_t CWeaponAR2::m_acttable[] =
|
||||
{ ACT_HL2MP_IDLE_CROUCH, ACT_HL2MP_IDLE_CROUCH_AR2, false },
|
||||
{ ACT_HL2MP_WALK_CROUCH, ACT_HL2MP_WALK_CROUCH_AR2, false },
|
||||
{ ACT_HL2MP_GESTURE_RANGE_ATTACK, ACT_HL2MP_GESTURE_RANGE_ATTACK_AR2, false },
|
||||
{ ACT_HL2MP_GESTURE_RELOAD, ACT_GESTURE_RELOAD_SMG1, false },
|
||||
{ ACT_HL2MP_GESTURE_RELOAD, ACT_HL2MP_GESTURE_RELOAD_AR2, false },
|
||||
{ ACT_HL2MP_JUMP, ACT_HL2MP_JUMP_AR2, false },
|
||||
#endif
|
||||
};
|
||||
|
@ -58,6 +58,9 @@ public:
|
||||
bool ShouldDisplayHUDHint() { return true; }
|
||||
|
||||
DECLARE_DATADESC();
|
||||
#ifdef MAPBASE
|
||||
DECLARE_ACTTABLE();
|
||||
#endif
|
||||
|
||||
protected:
|
||||
|
||||
@ -86,6 +89,22 @@ BEGIN_DATADESC( CWeaponBugBait )
|
||||
|
||||
END_DATADESC()
|
||||
|
||||
#ifdef MAPBASE
|
||||
acttable_t CWeaponBugBait::m_acttable[] =
|
||||
{
|
||||
// HL2:DM activities (for third-person animations in SP)
|
||||
{ ACT_HL2MP_IDLE, ACT_HL2MP_IDLE_GRENADE, false },
|
||||
{ ACT_HL2MP_RUN, ACT_HL2MP_RUN_GRENADE, false },
|
||||
{ ACT_HL2MP_IDLE_CROUCH, ACT_HL2MP_IDLE_CROUCH_GRENADE, false },
|
||||
{ ACT_HL2MP_WALK_CROUCH, ACT_HL2MP_WALK_CROUCH_GRENADE, false },
|
||||
{ ACT_HL2MP_GESTURE_RANGE_ATTACK, ACT_HL2MP_GESTURE_RANGE_ATTACK_GRENADE, false },
|
||||
{ ACT_HL2MP_GESTURE_RELOAD, ACT_HL2MP_GESTURE_RELOAD_GRENADE, false },
|
||||
{ ACT_HL2MP_JUMP, ACT_HL2MP_JUMP_GRENADE, false },
|
||||
};
|
||||
|
||||
IMPLEMENT_ACTTABLE( CWeaponBugBait );
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -225,6 +244,10 @@ void CWeaponBugBait::PrimaryAttack( void )
|
||||
return;
|
||||
|
||||
SendWeaponAnim( ACT_VM_HAULBACK );
|
||||
|
||||
#ifdef MAPBASE
|
||||
pPlayer->SetAnimation( PLAYER_ATTACK1 );
|
||||
#endif
|
||||
|
||||
m_flTimeWeaponIdle = FLT_MAX;
|
||||
m_flNextPrimaryAttack = FLT_MAX;
|
||||
|
@ -389,6 +389,13 @@ bool CWeaponShotgun::StartReload( void )
|
||||
pOwner->m_flNextAttack = gpGlobals->curtime;
|
||||
m_flNextPrimaryAttack = gpGlobals->curtime + SequenceDuration();
|
||||
|
||||
#ifdef MAPBASE
|
||||
if ( pOwner->IsPlayer() )
|
||||
{
|
||||
static_cast<CBasePlayer*>(pOwner)->SetAnimation( PLAYER_RELOAD );
|
||||
}
|
||||
#endif
|
||||
|
||||
m_bInReload = true;
|
||||
return true;
|
||||
}
|
||||
|
@ -157,7 +157,7 @@ acttable_t CWeaponSMG1::m_acttable[] =
|
||||
{ ACT_HL2MP_IDLE_CROUCH, ACT_HL2MP_IDLE_CROUCH_SMG1, false },
|
||||
{ ACT_HL2MP_WALK_CROUCH, ACT_HL2MP_WALK_CROUCH_SMG1, false },
|
||||
{ ACT_HL2MP_GESTURE_RANGE_ATTACK, ACT_HL2MP_GESTURE_RANGE_ATTACK_SMG1, false },
|
||||
{ ACT_HL2MP_GESTURE_RELOAD, ACT_GESTURE_RELOAD_SMG1, false },
|
||||
{ ACT_HL2MP_GESTURE_RELOAD, ACT_HL2MP_GESTURE_RELOAD_SMG1, false },
|
||||
{ ACT_HL2MP_JUMP, ACT_HL2MP_JUMP_SMG1, false },
|
||||
#endif
|
||||
};
|
||||
|
@ -2461,6 +2461,16 @@ void ActivityList_RegisterSharedActivities( void )
|
||||
REGISTER_SHARED_ACTIVITY( ACT_COVER_WALL_LOW_L_PISTOL );
|
||||
#endif
|
||||
|
||||
#ifdef EXPANDED_HL2DM_ACTIVITIES
|
||||
REGISTER_SHARED_ACTIVITY( ACT_HL2MP_IDLE_357 );
|
||||
REGISTER_SHARED_ACTIVITY( ACT_HL2MP_RUN_357 );
|
||||
REGISTER_SHARED_ACTIVITY( ACT_HL2MP_IDLE_CROUCH_357 );
|
||||
REGISTER_SHARED_ACTIVITY( ACT_HL2MP_WALK_CROUCH_357 );
|
||||
REGISTER_SHARED_ACTIVITY( ACT_HL2MP_GESTURE_RANGE_ATTACK_357 );
|
||||
REGISTER_SHARED_ACTIVITY( ACT_HL2MP_GESTURE_RELOAD_357 );
|
||||
REGISTER_SHARED_ACTIVITY( ACT_HL2MP_JUMP_357 );
|
||||
#endif
|
||||
|
||||
AssertMsg( g_HighestActivity == LAST_SHARED_ACTIVITY - 1, "Not all activities from ai_activity.h registered in activitylist.cpp" );
|
||||
}
|
||||
|
||||
|
@ -49,6 +49,10 @@
|
||||
// This enables some new cover-related activities.
|
||||
#define EXPANDED_HL2_COVER_ACTIVITIES 1
|
||||
|
||||
// EXPANDED HL2DM ACTIVITIES
|
||||
// This enables some new activities for the HL2:DM set.
|
||||
#define EXPANDED_HL2DM_ACTIVITIES 1
|
||||
|
||||
#endif
|
||||
|
||||
#define ACTIVITY_NOT_AVAILABLE -1
|
||||
@ -2345,6 +2349,16 @@ typedef enum
|
||||
ACT_COVER_WALL_LOW_L_PISTOL,
|
||||
#endif
|
||||
|
||||
#ifdef EXPANDED_HL2DM_ACTIVITIES
|
||||
ACT_HL2MP_IDLE_357,
|
||||
ACT_HL2MP_RUN_357,
|
||||
ACT_HL2MP_IDLE_CROUCH_357,
|
||||
ACT_HL2MP_WALK_CROUCH_357,
|
||||
ACT_HL2MP_GESTURE_RANGE_ATTACK_357,
|
||||
ACT_HL2MP_GESTURE_RELOAD_357,
|
||||
ACT_HL2MP_JUMP_357,
|
||||
#endif
|
||||
|
||||
// this is the end of the global activities, private per-monster activities start here.
|
||||
LAST_SHARED_ACTIVITY,
|
||||
} Activity;
|
||||
|
Loading…
x
Reference in New Issue
Block a user