本文整理汇总了C++中CanFireForActivator函数的典型用法代码示例。如果您正苦于以下问题:C++ CanFireForActivator函数的具体用法?C++ CanFireForActivator怎么用?C++ CanFireForActivator使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CanFireForActivator函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Display
void CGameText::Display( CBaseEntity *pActivator )
{
if ( !CanFireForActivator( pActivator ) )
return;
#ifdef SecobMod__Enable_Fixed_Multiplayer_AI
// also send to all if we haven't got a specific activator player to send to
if ( MessageToAll() || !pActivator || !pActivator->IsPlayer() )
#else
if ( MessageToAll() )
#endif //SecobMod__Enable_Fixed_Multiplayer_AI
if ( MessageToAll() )
{
UTIL_HudMessageAll( m_textParms, MessageGet() );
}
else
{
#ifdef SecobMod__Enable_Fixed_Multiplayer_AI
UTIL_HudMessage( ToBasePlayer( pActivator ), m_textParms, MessageGet() );
#else
// If we're in singleplayer, show the message to the player.
if ( gpGlobals->maxClients == 1 )
{
CBasePlayer *pPlayer = UTIL_GetLocalPlayer();
UTIL_HudMessage( pPlayer, m_textParms, MessageGet() );
}
// Otherwise show the message to the player that triggered us.
else if ( pActivator && pActivator->IsNetClient() )
{
UTIL_HudMessage( ToBasePlayer( pActivator ), m_textParms, MessageGet() );
}
#endif //SecobMod__Enable_Fixed_Multiplayer_AI
}
}
示例2: Use
void CGameEnd::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
{
if ( !CanFireForActivator( pActivator ) )
return;
g_pGameRules->EndMultiplayerGame();
}
示例3: Display
void CGameText::Display( CBaseEntity *pActivator )
{
if ( !CanFireForActivator( pActivator ) )
return;
char fontbuf[48];
FontGet(fontbuf);
if ( MessageToAll() )
{
UTIL_HudMessageAll( m_textParms, MessageGet(), fontbuf );
}
else
{
// If we're in singleplayer, show the message to the player.
if ( gpGlobals->maxClients == 1 )
{
CBasePlayer *pPlayer = UTIL_GetLocalPlayer();
UTIL_HudMessage( pPlayer, m_textParms, MessageGet(), fontbuf );
}
// Otherwise show the message to the player that triggered us.
else if ( pActivator && pActivator->IsNetClient() )
{
UTIL_HudMessage( ToBasePlayer( pActivator ), m_textParms, MessageGet(), fontbuf );
}
}
}
示例4: Use
void CGameCounter::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
if (!CanFireForActivator(pActivator))
return;
switch (useType)
{
case USE_ON:
case USE_TOGGLE:
CountUp();
break;
case USE_OFF:
CountDown();
break;
case USE_SET:
SetCountValue((int)value);
break;
}
if (HitLimit())
{
SUB_UseTargets(pActivator, USE_TOGGLE, 0);
if (RemoveOnFire())
{
UTIL_Remove(this);
}
if (ResetOnFire())
{
ResetCount();
}
}
}
示例5: Use
void CGameTeamMaster::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
{
if( !CanFireForActivator( pActivator ) )
return;
if( useType == USE_SET )
{
if( value < 0 )
{
m_teamIndex = -1;
}
else
{
m_teamIndex = g_pGameRules->GetTeamIndex( pActivator->TeamID() );
}
return;
}
if( TeamMatch( pActivator ) )
{
SUB_UseTargets( pActivator, triggerType, value );
if( RemoveOnFire() )
UTIL_Remove( this );
}
}
示例6: Touch
void CGamePlayerEquip::Touch( CBaseEntity *pOther )
{
if ( !CanFireForActivator( pOther ) )
return;
if ( UseOnly() )
return;
EquipPlayer( pOther );
}
示例7: Display
void CGameText::Display( CBaseEntity *pActivator )
{
if ( !CanFireForActivator( pActivator ) )
return;
// also send to all if we haven't got a specific activator player to send to
if ( MessageToAll() || !pActivator || !pActivator->IsPlayer() )
UTIL_HudMessageAll( m_textParms, MessageGet() );
else
UTIL_HudMessage( ToBasePlayer( pActivator ), m_textParms, MessageGet() );
}
示例8: Display
void CGameText::Display( CBaseEntity *pActivator )
{
if ( !CanFireForActivator( pActivator ) )
return;
if (MessageToAll() || !pActivator || !pActivator->IsPlayer())
{
UTIL_HudMessageAll( m_textParms, MessageGet() );
}
else
{
UTIL_HudMessage(ToBasePlayer(pActivator), m_textParms, MessageGet());
}
}
示例9: Use
void CGameTeamSet::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
{
if( !CanFireForActivator( pActivator ) )
return;
if( ShouldClearTeam() )
{
SUB_UseTargets( pActivator, USE_SET, -1 );
}
else
{
SUB_UseTargets( pActivator, USE_SET, 0 );
}
if( RemoveOnFire() )
{
UTIL_Remove( this );
}
}
示例10: InputCountPlayersInZone
//-----------------------------------------------------------------------------
// Purpose: Counts all the players in the zone. Fires one output per player
// in the zone, one output per player out of the zone, and outputs
// with the total counts of players in and out of the zone.
//-----------------------------------------------------------------------------
void CGamePlayerZone::InputCountPlayersInZone( inputdata_t &inputdata )
{
int playersInCount = 0;
int playersOutCount = 0;
if ( !CanFireForActivator( inputdata.pActivator ) )
return;
CBaseEntity *pPlayer = NULL;
for ( int i = 1; i <= gpGlobals->maxClients; i++ )
{
pPlayer = UTIL_PlayerByIndex( i );
if ( pPlayer )
{
trace_t trace;
Hull_t hullType;
hullType = HULL_HUMAN;
if ( pPlayer->GetFlags() & FL_DUCKING )
{
hullType = HULL_SMALL_CENTERED;
}
UTIL_TraceModel( pPlayer->GetAbsOrigin(), pPlayer->GetAbsOrigin(), NAI_Hull::Mins(hullType),
NAI_Hull::Maxs(hullType), this, COLLISION_GROUP_NONE, &trace );
if ( trace.startsolid )
{
playersInCount++;
m_OnPlayerInZone.FireOutput(pPlayer, this);
}
else
{
playersOutCount++;
m_OnPlayerOutZone.FireOutput(pPlayer, this);
}
}
}
m_PlayersInCount.Set(playersInCount, inputdata.pActivator, this);
m_PlayersOutCount.Set(playersOutCount, inputdata.pActivator, this);
}
示例11: Use
void CGamePlayerHurt::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
{
if( !CanFireForActivator( pActivator ) )
return;
if( pActivator->IsPlayer() )
{
if( GetDamage() < 0 )
pActivator->GiveHealth( -GetDamage(), DMG_GENERIC );
else
pActivator->TakeDamage( this, this, GetDamage(), DMG_GENERIC );
}
SUB_UseTargets( pActivator, useType, value );
if( RemoveOnFire() )
{
UTIL_Remove( this );
}
}
示例12: InputApplyScore
void CGameScore::InputApplyScore( inputdata_t &inputdata )
{
CBaseEntity *pActivator = inputdata.pActivator;
if ( pActivator == NULL )
return;
if ( CanFireForActivator( pActivator ) == false )
return;
// Only players can use this
if ( pActivator->IsPlayer() )
{
if ( AwardToTeam() )
{
pActivator->AddPointsToTeam( Points(), AllowNegativeScore() );
}
else
{
pActivator->AddPoints( Points(), AllowNegativeScore() );
}
}
}