• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ CanFireForActivator函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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
	}
}
开发者ID:Mangmasta,项目名称:MangsterMod,代码行数:35,代码来源:maprules.cpp


示例2: Use

void CGameEnd::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
{
	if ( !CanFireForActivator( pActivator ) )
		return;

	g_pGameRules->EndMultiplayerGame();
}
开发者ID:Mangmasta,项目名称:MangsterMod,代码行数:7,代码来源:maprules.cpp


示例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 );
		}
	}
}
开发者ID:P1x3lF3v3r,项目名称:Estranged-Act-1,代码行数:27,代码来源:maprules.cpp


示例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();
		}
	}
}
开发者ID:Chuvi-w,项目名称:CSSDK,代码行数:35,代码来源:maprules.cpp


示例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 );
	}
}
开发者ID:CryoKeen,项目名称:HLEnhanced,代码行数:25,代码来源:CGameTeamMaster.cpp


示例6: Touch

void CGamePlayerEquip::Touch( CBaseEntity *pOther )
{
	if ( !CanFireForActivator( pOther ) )
		return;

	if ( UseOnly() )
		return;

	EquipPlayer( pOther );
}
开发者ID:Mangmasta,项目名称:MangsterMod,代码行数:10,代码来源:maprules.cpp


示例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() );
}
开发者ID:NEITMod,项目名称:HL2BM2,代码行数:11,代码来源:maprules.cpp


示例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());
	}
}
开发者ID:RaraFolf,项目名称:FIREFIGHT-RELOADED-src-sdk-2013,代码行数:14,代码来源:maprules.cpp


示例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 );
	}
}
开发者ID:CryoKeen,项目名称:HLEnhanced,代码行数:19,代码来源:CGameTeamSet.cpp


示例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);
}
开发者ID:Mangmasta,项目名称:MangsterMod,代码行数:48,代码来源:maprules.cpp


示例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 );
	}
}
开发者ID:oskarlh,项目名称:HLEnhanced,代码行数:20,代码来源:CGamePlayerHurt.cpp


示例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() );
		}
	}
}
开发者ID:Mangmasta,项目名称:MangsterMod,代码行数:23,代码来源:maprules.cpp



注:本文中的CanFireForActivator函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ CanMove函数代码示例发布时间:2022-05-30
下一篇:
C++ CanAttack函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap