Merge 51c940fa9a into 7191ecc418
This commit is contained in:
commit
c886453764
|
|
@ -6497,11 +6497,16 @@ bool C_TFPlayer::CreateMove( float flInputSampleTime, CUserCmd *pCmd )
|
|||
static float flTauntTurnSpeed = 0.f;
|
||||
|
||||
bool bNoTaunt = true;
|
||||
bool bInTaunt = m_Shared.InCond( TF_COND_TAUNTING ) || m_Shared.InCond( TF_COND_HALLOWEEN_THRILLER );
|
||||
bool bInTaunt = m_Shared.InCond( TF_COND_TAUNTING );
|
||||
|
||||
if ( m_Shared.InCond( TF_COND_FREEZE_INPUT ) )
|
||||
{
|
||||
pCmd->viewangles = angMoveAngle; // use the last save angles
|
||||
if ( !m_Shared.InCond( TF_COND_HALLOWEEN_THRILLER ) )
|
||||
{
|
||||
// if NOT halloween taunt, force their last-saved view angles
|
||||
// (thriller allows it so teleports can set the correct view angles)
|
||||
pCmd->viewangles = angMoveAngle;
|
||||
}
|
||||
pCmd->forwardmove = 0.0f;
|
||||
pCmd->sidemove = 0.0f;
|
||||
pCmd->upmove = 0.0f;
|
||||
|
|
|
|||
|
|
@ -156,12 +156,6 @@ static bool HalloweenHandlesKeyInput( int down, ButtonCode_t keynum, const char
|
|||
C_TFPlayer *pPlayer = ToTFPlayer( C_BasePlayer::GetLocalPlayer() );
|
||||
if ( pPlayer )
|
||||
{
|
||||
// don't do anything while dancing
|
||||
if ( pPlayer->m_Shared.InCond( TF_COND_HALLOWEEN_THRILLER ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// only allow +attack
|
||||
if ( pPlayer->m_Shared.InCond( TF_COND_HALLOWEEN_GHOST_MODE ) )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -524,6 +524,8 @@ $Project "Server (TF)"
|
|||
$File "tf\bot\behavior\tf_bot_melee_attack.h"
|
||||
$File "tf\bot\behavior\tf_bot_approach_object.cpp"
|
||||
$File "tf\bot\behavior\tf_bot_approach_object.h"
|
||||
$File "tf\bot\behavior\tf_bot_freeze_input.cpp"
|
||||
$File "tf\bot\behavior\tf_bot_freeze_input.h"
|
||||
$File "tf\bot\behavior\tf_bot_get_health.cpp"
|
||||
$File "tf\bot\behavior\tf_bot_get_health.h"
|
||||
$File "tf\bot\behavior\tf_bot_get_ammo.cpp"
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
#include "bot/tf_bot_manager.h"
|
||||
#include "bot/behavior/tf_bot_behavior.h"
|
||||
#include "bot/behavior/tf_bot_dead.h"
|
||||
#include "bot/behavior/tf_bot_freeze_input.h"
|
||||
#include "NextBot/NavMeshEntities/func_nav_prerequisite.h"
|
||||
#include "bot/behavior/nav_entities/tf_bot_nav_ent_destroy_entity.h"
|
||||
#include "bot/behavior/nav_entities/tf_bot_nav_ent_move_to.h"
|
||||
|
|
@ -106,6 +107,12 @@ ActionResult< CTFBot > CTFBotMainAction::Update( CTFBot *me, float interval )
|
|||
return Done( "Not on a playing team" );
|
||||
}
|
||||
|
||||
if ( me->m_Shared.InCond( TF_COND_FREEZE_INPUT ) )
|
||||
{
|
||||
// frozen - do nothing
|
||||
return SuspendFor( new CTFBotFreezeInput, "Frozen by TF_COND" );
|
||||
}
|
||||
|
||||
// Should I accept taunt from my partner?
|
||||
if ( me->FindPartnerTauntInitiator() )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -0,0 +1,20 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
// tf_bot_freeze_input.cpp
|
||||
// Don't do anything until the TF_COND_FREEZE_INPUT condition expires
|
||||
// Community-contributed, June 2025
|
||||
|
||||
#include "cbase.h"
|
||||
#include "bot/tf_bot.h"
|
||||
#include "bot/behavior/tf_bot_freeze_input.h"
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------------------------
|
||||
ActionResult< CTFBot > CTFBotFreezeInput::Update( CTFBot *me, float interval )
|
||||
{
|
||||
if ( !me->m_Shared.InCond( TF_COND_FREEZE_INPUT ) )
|
||||
{
|
||||
return Done( "No longer frozen by TF_COND" );
|
||||
}
|
||||
|
||||
return Continue();
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
// tf_bot_freeze_input.h
|
||||
// Don't do anything until the TF_COND_FREEZE_INPUT condition expires
|
||||
// Community-contributed, June 2025
|
||||
|
||||
#ifndef TF_BOT_FREEZE_INPUT_H
|
||||
#define TF_BOT_FREEZE_INPUT_H
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
class CTFBotFreezeInput : public Action< CTFBot >
|
||||
{
|
||||
public:
|
||||
virtual ActionResult< CTFBot > Update( CTFBot *me, float interval );
|
||||
|
||||
virtual const char *GetName( void ) const { return "FreezeInput"; };
|
||||
};
|
||||
|
||||
|
||||
#endif // TF_BOT_FREEZE_INPUT_H
|
||||
|
|
@ -3161,7 +3161,7 @@ void CTFPlayer::PlayerRunCommand( CUserCmd *ucmd, IMoveHelper *moveHelper )
|
|||
{
|
||||
m_Shared.CreateVehicleMove( gpGlobals->frametime, ucmd );
|
||||
}
|
||||
else if ( IsTaunting() || m_Shared.InCond( TF_COND_HALLOWEEN_THRILLER ) )
|
||||
else if ( IsTaunting() )
|
||||
{
|
||||
// For some taunts, it is critical that the player not move once they start
|
||||
if ( !CanMoveDuringTaunt() )
|
||||
|
|
@ -4933,6 +4933,9 @@ void CTFPlayer::UseActionSlotItemPressed( void )
|
|||
return;
|
||||
}
|
||||
|
||||
if ( m_Shared.InCond( TF_COND_FREEZE_INPUT ) )
|
||||
return;
|
||||
|
||||
CBaseEntity *pActionSlotEntity = GetEntityForLoadoutSlot( LOADOUT_POSITION_ACTION );
|
||||
if ( !pActionSlotEntity )
|
||||
return;
|
||||
|
|
@ -18264,6 +18267,12 @@ void CTFPlayer::HandleTauntCommand( int iTauntSlot )
|
|||
if ( !IsAllowedToTaunt() )
|
||||
return;
|
||||
|
||||
if ( m_Shared.InCond( TF_COND_HALLOWEEN_THRILLER ) )
|
||||
{
|
||||
// Don't allow econ taunts during thriller cond
|
||||
Taunt();
|
||||
return;
|
||||
}
|
||||
m_nActiveTauntSlot = LOADOUT_POSITION_INVALID;
|
||||
if ( iTauntSlot > 0 && iTauntSlot <= 8 )
|
||||
{
|
||||
|
|
@ -19536,7 +19545,7 @@ void CTFPlayer::ModifyOrAppendCriteria( AI_CriteriaSet& criteriaSet )
|
|||
}
|
||||
|
||||
// Force the thriller taunt if we have the thriller condition
|
||||
if( m_Shared.InCond( TF_COND_HALLOWEEN_THRILLER ) )
|
||||
if ( m_Shared.InCond( TF_COND_HALLOWEEN_THRILLER ) )
|
||||
{
|
||||
criteriaSet.AppendCriteria( "IsHalloweenTaunt", "1" );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -866,10 +866,10 @@ bool CTFSpellBook::HasASpellWithCharges()
|
|||
//-----------------------------------------------------------------------------
|
||||
bool CTFSpellBook::CanCastSpell( CTFPlayer *pPlayer )
|
||||
{
|
||||
if ( !pPlayer->m_Shared.InCond( TF_COND_HALLOWEEN_KART) && !pPlayer->CanAttack() )
|
||||
if ( !pPlayer->m_Shared.InCond( TF_COND_HALLOWEEN_KART ) && !pPlayer->CanAttack() )
|
||||
return false;
|
||||
|
||||
if ( pPlayer->m_Shared.InCond( TF_COND_HALLOWEEN_THRILLER ) )
|
||||
if ( pPlayer->m_Shared.InCond( TF_COND_FREEZE_INPUT ) )
|
||||
return false;
|
||||
|
||||
if ( tf_test_spellindex.GetInt() > -1 && tf_test_spellindex.GetInt() < GetTotalSpellCount( pPlayer ) )
|
||||
|
|
|
|||
|
|
@ -4490,7 +4490,9 @@ void CTFPlayerShared::OnAddHalloweenThriller( void )
|
|||
m_pOuter->EmitSound( "Halloween.dance_loop" );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
AddCond( TF_COND_FREEZE_INPUT );
|
||||
#endif // CLIENT_DLL
|
||||
}
|
||||
|
||||
void CTFPlayerShared::OnRemoveHalloweenThriller( void )
|
||||
|
|
@ -4506,6 +4508,7 @@ void CTFPlayerShared::OnRemoveHalloweenThriller( void )
|
|||
}
|
||||
}
|
||||
#else
|
||||
RemoveCond( TF_COND_FREEZE_INPUT );
|
||||
// If this is hightower, players will be healing themselves while dancing
|
||||
StopHealing( m_pOuter );
|
||||
#endif
|
||||
|
|
@ -13012,7 +13015,7 @@ bool CTFPlayer::CanMoveDuringTaunt()
|
|||
if ( m_Shared.InCond( TF_COND_HALLOWEEN_KART ) )
|
||||
return true;
|
||||
|
||||
if ( m_Shared.InCond( TF_COND_TAUNTING ) || m_Shared.InCond( TF_COND_HALLOWEEN_THRILLER ) )
|
||||
if ( m_Shared.InCond( TF_COND_TAUNTING ) )
|
||||
{
|
||||
#ifdef GAME_DLL
|
||||
if ( tf_allow_sliding_taunt.GetBool() )
|
||||
|
|
|
|||
Loading…
Reference in New Issue