This commit is contained in:
FlaminSarge 2025-12-16 01:19:52 -08:00 committed by GitHub
commit c886453764
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 75 additions and 15 deletions

View File

@ -6497,11 +6497,16 @@ bool C_TFPlayer::CreateMove( float flInputSampleTime, CUserCmd *pCmd )
static float flTauntTurnSpeed = 0.f; static float flTauntTurnSpeed = 0.f;
bool bNoTaunt = true; 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 ) ) 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->forwardmove = 0.0f;
pCmd->sidemove = 0.0f; pCmd->sidemove = 0.0f;
pCmd->upmove = 0.0f; pCmd->upmove = 0.0f;

View File

@ -156,12 +156,6 @@ static bool HalloweenHandlesKeyInput( int down, ButtonCode_t keynum, const char
C_TFPlayer *pPlayer = ToTFPlayer( C_BasePlayer::GetLocalPlayer() ); C_TFPlayer *pPlayer = ToTFPlayer( C_BasePlayer::GetLocalPlayer() );
if ( pPlayer ) if ( pPlayer )
{ {
// don't do anything while dancing
if ( pPlayer->m_Shared.InCond( TF_COND_HALLOWEEN_THRILLER ) )
{
return true;
}
// only allow +attack // only allow +attack
if ( pPlayer->m_Shared.InCond( TF_COND_HALLOWEEN_GHOST_MODE ) ) if ( pPlayer->m_Shared.InCond( TF_COND_HALLOWEEN_GHOST_MODE ) )
{ {

View File

@ -524,6 +524,8 @@ $Project "Server (TF)"
$File "tf\bot\behavior\tf_bot_melee_attack.h" $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.cpp"
$File "tf\bot\behavior\tf_bot_approach_object.h" $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.cpp"
$File "tf\bot\behavior\tf_bot_get_health.h" $File "tf\bot\behavior\tf_bot_get_health.h"
$File "tf\bot\behavior\tf_bot_get_ammo.cpp" $File "tf\bot\behavior\tf_bot_get_ammo.cpp"
@ -541,7 +543,7 @@ $Project "Server (TF)"
$File "tf\bot\behavior\tf_bot_escort.cpp" $File "tf\bot\behavior\tf_bot_escort.cpp"
$File "tf\bot\behavior\tf_bot_escort.h" $File "tf\bot\behavior\tf_bot_escort.h"
$File "tf\bot\behavior\tf_bot_use_item.cpp" $File "tf\bot\behavior\tf_bot_use_item.cpp"
$File "tf\bot\behavior\tf_bot_use_item.h" $File "tf\bot\behavior\tf_bot_use_item.h"
$File "tf\bot\behavior\tf_bot_mvm_deploy_bomb.cpp" $File "tf\bot\behavior\tf_bot_mvm_deploy_bomb.cpp"
$File "tf\bot\behavior\tf_bot_mvm_deploy_bomb.h" $File "tf\bot\behavior\tf_bot_mvm_deploy_bomb.h"

View File

@ -20,6 +20,7 @@
#include "bot/tf_bot_manager.h" #include "bot/tf_bot_manager.h"
#include "bot/behavior/tf_bot_behavior.h" #include "bot/behavior/tf_bot_behavior.h"
#include "bot/behavior/tf_bot_dead.h" #include "bot/behavior/tf_bot_dead.h"
#include "bot/behavior/tf_bot_freeze_input.h"
#include "NextBot/NavMeshEntities/func_nav_prerequisite.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_destroy_entity.h"
#include "bot/behavior/nav_entities/tf_bot_nav_ent_move_to.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" ); 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? // Should I accept taunt from my partner?
if ( me->FindPartnerTauntInitiator() ) if ( me->FindPartnerTauntInitiator() )
{ {

View File

@ -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();
}

View File

@ -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

View File

@ -3161,7 +3161,7 @@ void CTFPlayer::PlayerRunCommand( CUserCmd *ucmd, IMoveHelper *moveHelper )
{ {
m_Shared.CreateVehicleMove( gpGlobals->frametime, ucmd ); 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 // For some taunts, it is critical that the player not move once they start
if ( !CanMoveDuringTaunt() ) if ( !CanMoveDuringTaunt() )
@ -4933,6 +4933,9 @@ void CTFPlayer::UseActionSlotItemPressed( void )
return; return;
} }
if ( m_Shared.InCond( TF_COND_FREEZE_INPUT ) )
return;
CBaseEntity *pActionSlotEntity = GetEntityForLoadoutSlot( LOADOUT_POSITION_ACTION ); CBaseEntity *pActionSlotEntity = GetEntityForLoadoutSlot( LOADOUT_POSITION_ACTION );
if ( !pActionSlotEntity ) if ( !pActionSlotEntity )
return; return;
@ -18264,6 +18267,12 @@ void CTFPlayer::HandleTauntCommand( int iTauntSlot )
if ( !IsAllowedToTaunt() ) if ( !IsAllowedToTaunt() )
return; return;
if ( m_Shared.InCond( TF_COND_HALLOWEEN_THRILLER ) )
{
// Don't allow econ taunts during thriller cond
Taunt();
return;
}
m_nActiveTauntSlot = LOADOUT_POSITION_INVALID; m_nActiveTauntSlot = LOADOUT_POSITION_INVALID;
if ( iTauntSlot > 0 && iTauntSlot <= 8 ) 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 // 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" ); criteriaSet.AppendCriteria( "IsHalloweenTaunt", "1" );
} }

View File

@ -866,10 +866,10 @@ bool CTFSpellBook::HasASpellWithCharges()
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
bool CTFSpellBook::CanCastSpell( CTFPlayer *pPlayer ) 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; return false;
if ( pPlayer->m_Shared.InCond( TF_COND_HALLOWEEN_THRILLER ) ) if ( pPlayer->m_Shared.InCond( TF_COND_FREEZE_INPUT ) )
return false; return false;
if ( tf_test_spellindex.GetInt() > -1 && tf_test_spellindex.GetInt() < GetTotalSpellCount( pPlayer ) ) if ( tf_test_spellindex.GetInt() > -1 && tf_test_spellindex.GetInt() < GetTotalSpellCount( pPlayer ) )

View File

@ -4490,7 +4490,9 @@ void CTFPlayerShared::OnAddHalloweenThriller( void )
m_pOuter->EmitSound( "Halloween.dance_loop" ); m_pOuter->EmitSound( "Halloween.dance_loop" );
} }
} }
#endif #else
AddCond( TF_COND_FREEZE_INPUT );
#endif // CLIENT_DLL
} }
void CTFPlayerShared::OnRemoveHalloweenThriller( void ) void CTFPlayerShared::OnRemoveHalloweenThriller( void )
@ -4506,6 +4508,7 @@ void CTFPlayerShared::OnRemoveHalloweenThriller( void )
} }
} }
#else #else
RemoveCond( TF_COND_FREEZE_INPUT );
// If this is hightower, players will be healing themselves while dancing // If this is hightower, players will be healing themselves while dancing
StopHealing( m_pOuter ); StopHealing( m_pOuter );
#endif #endif
@ -13012,7 +13015,7 @@ bool CTFPlayer::CanMoveDuringTaunt()
if ( m_Shared.InCond( TF_COND_HALLOWEEN_KART ) ) if ( m_Shared.InCond( TF_COND_HALLOWEEN_KART ) )
return true; 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 #ifdef GAME_DLL
if ( tf_allow_sliding_taunt.GetBool() ) if ( tf_allow_sliding_taunt.GetBool() )