当前位置: 首页>>代码示例>>C++>>正文


C++ UTIL_IsMasterTriggered函数代码示例

本文整理汇总了C++中UTIL_IsMasterTriggered函数的典型用法代码示例。如果您正苦于以下问题:C++ UTIL_IsMasterTriggered函数的具体用法?C++ UTIL_IsMasterTriggered怎么用?C++ UTIL_IsMasterTriggered使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了UTIL_IsMasterTriggered函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: DoorActivate

//
// Causes the door to "do its thing", i.e. start moving, and cascade activation.
//
int CBaseDoor::DoorActivate()
{
	if( !UTIL_IsMasterTriggered( m_sMaster, m_hActivator ) )
		return 0;

	if( GetSpawnFlags().Any( SF_DOOR_NO_AUTO_RETURN ) && m_toggle_state == TS_AT_TOP )
	{// door should close
		DoorGoDown();
	}
	else
	{// door should open

		if( m_hActivator != NULL && m_hActivator->IsPlayer() )
		{
			// give health if player opened the door (medikit)
			m_hActivator->GiveHealth( m_bHealthValue, DMG_GENERIC );
		}

		// play door unlock sounds
		PlayLockSounds( this, &m_ls, false, false );

		DoorGoUp();
	}

	return 1;
}
开发者ID:oskarlh,项目名称:HLEnhanced,代码行数:29,代码来源:CBaseDoor.cpp

示例2: ButtonResponseToTouch

void CBaseButton::ButtonTouch(CBaseEntity *pOther)
{
	if (!FClassnameIs(pOther->pev, "player"))
		return;

	m_hActivator = pOther;
	BUTTON_CODE code = ButtonResponseToTouch();

	if (code == BUTTON_NOTHING)
		return;

	if (!UTIL_IsMasterTriggered(m_sMaster, pOther))
	{
		PlayLockSounds(pev, &m_ls, TRUE, TRUE);
		return;
	}

	SetTouch(NULL);

	if (code == BUTTON_RETURN)
	{
		EMIT_SOUND(ENT(pev), CHAN_VOICE, STRING(pev->noise), VOL_NORM, ATTN_NORM);
		SUB_UseTargets(m_hActivator, USE_TOGGLE, 0);
		ButtonReturn();
	}
	else
		ButtonActivate();
}
开发者ID:AlexCSilva,项目名称:cs16-client,代码行数:28,代码来源:buttons.cpp

示例3: ItemTouch

void CItem::ItemTouch( CBaseEntity *pOther )
{
	//removed this limitation for monsters
	if ( !pOther->IsPlayer() ) return;
	CBasePlayer *pPlayer = (CBasePlayer *)pOther;
	if (!UTIL_IsMasterTriggered(m_sMaster, pPlayer)) return;
	if (pPlayer->pev->deadflag != DEAD_NO) return;

	if (AddItem( pPlayer ) != -1 )
	{
		UTIL_FireTargets( pev->target, pOther, this, USE_TOGGLE );
		SetTouch( NULL );
                  
		if( IsItem() && gmsg.ItemPickup )
		{
			//show icon for item
			MESSAGE_BEGIN( MSG_ONE, gmsg.ItemPickup, NULL, pPlayer->pev );
				WRITE_STRING( STRING(pev->classname) );
			MESSAGE_END();
		}
		
		// play pickup sound
		EMIT_SOUND( pPlayer->edict(), CHAN_ITEM, (char *)PickSound(), 1, ATTN_NORM );
		
		// tell the owner item was taken
 		if (!FNullEnt( pev->owner )) pev->owner->v.impulse = 0;
		
		// enable respawn in multiplayer
		if ( g_pGameRules->IsMultiplayer() && !FBitSet( pev->spawnflags, SF_NORESPAWN ))
			Respawn(); 
		else UTIL_Remove( this );
	}
	else if ( gEvilImpulse101 ) UTIL_Remove( this );
}
开发者ID:a1batross,项目名称:Xash3D_ancient,代码行数:34,代码来源:baseitem.cpp

示例4: DefaultTouch

void CBasePlayerAmmo :: DefaultTouch( CBaseEntity *pOther )
{
	if ( !pOther->IsPlayer() )
	{
		return;
	}

	if (!UTIL_IsMasterTriggered(m_sMaster, m_pPlayer))	//
		return ;										// AJH allows for locked weapons

	if (AddAmmo( pOther ))
	{
		if ( g_pGameRules->AmmoShouldRespawn( this ) == GR_AMMO_RESPAWN_YES )
		{
			Respawn();
		}
		else
		{
			SetTouch( NULL );
			SetThink(&CBasePlayerAmmo ::SUB_Remove);
			SetNextThink( 0.1 );
		}
		SUB_UseTargets( pOther, USE_TOGGLE, 0 );	//AJH now ammo can trigger stuff too
	}
	else if (gEvilImpulse101)
	{
		// evil impulse 101 hack, kill always
		SetTouch( NULL );
		SetThink(&CBasePlayerAmmo ::SUB_Remove);
		SetNextThink( 0.1 );
	}
}
开发者ID:fmoraw,项目名称:SpiritOfHalfLife,代码行数:32,代码来源:weapons.cpp

示例5: DoorActivate

/* <6a319> ../cstrike/dlls/doors.cpp:554 */
int CBaseDoor::DoorActivate(void)
{
	if (!UTIL_IsMasterTriggered(m_sMaster, m_hActivator))
		return 0;

	// door should close
	if ((pev->spawnflags & SF_DOOR_NO_AUTO_RETURN) && m_toggle_state == TS_AT_TOP)
	{
		DoorGoDown();
	}
	else // door should open
	{
		// give health if player opened the door (medikit)
		if (m_hActivator != NULL && m_hActivator->IsPlayer())
		{
			// VARS(m_eoActivator)->health += m_bHealthValue;
			m_hActivator->TakeHealth(m_bHealthValue, DMG_GENERIC);

		}

		// play door unlock sounds
		PlayLockSounds(pev, &m_ls, FALSE, FALSE);
		DoorGoUp();
	}

	return 1;
}
开发者ID:Arkshine,项目名称:ReGameDLL_CS,代码行数:28,代码来源:doors.cpp

示例6: DoorTouch

/* <6a3b8> ../cstrike/dlls/doors.cpp:508 */
void CBaseDoor::DoorTouch(CBaseEntity *pOther)
{
	entvars_t *pevToucher = pOther->pev;

	// Ignore touches by dead players
	if (pevToucher->deadflag != DEAD_NO)
		return;

	// If door has master, and it's not ready to trigger,
	// play 'locked' sound
	if (!FStringNull(m_sMaster) && !UTIL_IsMasterTriggered(m_sMaster, pOther))
	{
		PlayLockSounds(pev, &m_ls, TRUE, FALSE);
	}

	// If door is somebody's target, then touching does nothing.
	// You have to activate the owner (e.g. button).
	if (!FStringNull(pev->targetname))
	{
		// play locked sound
		PlayLockSounds(pev, &m_ls, TRUE, FALSE);
		return;
	}

	// remember who activated the door
	m_hActivator = pOther;

	if (DoorActivate())
	{
		// Temporarily disable the touch function, until movement is finished.
		SetTouch(NULL);
	}
}
开发者ID:Arkshine,项目名称:ReGameDLL_CS,代码行数:34,代码来源:doors.cpp

示例7: ASSERT

void CBaseButton::TriggerAndWait(void)
{
	ASSERT(m_toggle_state == TS_GOING_UP);

	if (!UTIL_IsMasterTriggered(m_sMaster, m_hActivator))
		return;

	m_toggle_state = TS_AT_TOP;

	if (m_fStayPushed || FBitSet(pev->spawnflags, SF_BUTTON_TOGGLE))
	{
		if (!FBitSet(pev->spawnflags, SF_BUTTON_TOUCH_ONLY))
			SetTouch(NULL);
		else
			SetTouch(&CBaseButton::ButtonTouch);
	}
	else
	{
		pev->nextthink = pev->ltime + m_flWait;
		SetThink(&CBaseButton::ButtonReturn);
	}

	pev->frame = 1;
	SUB_UseTargets(m_hActivator, USE_TOGGLE, 0);
}
开发者ID:AlexCSilva,项目名称:cs16-client,代码行数:25,代码来源:buttons.cpp

示例8: DoorTouch

//
// Doors not tied to anything (e.g. button, another door) can be touched, to make them activate.
//
void CBaseDoor::DoorTouch( CBaseEntity *pOther )
{
	// Ignore touches by anything but players
	if( !pOther->IsPlayer() )
		return;

	// If door has master, and it's not ready to trigger, 
	// play 'locked' sound

	if( m_sMaster && !UTIL_IsMasterTriggered( m_sMaster, pOther ) )
		PlayLockSounds( this, &m_ls, true, false );

	// If door is somebody's target, then touching does nothing.
	// You have to activate the owner (e.g. button).

	if( HasTargetname() )
	{
		// play locked sound
		PlayLockSounds( this, &m_ls, true, false );
		return;
	}

	m_hActivator = pOther;// remember who activated the door

	if( DoorActivate() )
		SetTouch( NULL ); // Temporarily disable the touch function, until movement is finished.
}
开发者ID:oskarlh,项目名称:HLEnhanced,代码行数:30,代码来源:CBaseDoor.cpp

示例9: GetState

STATE CBaseDMStart::GetState( CBaseEntity *pEntity )
{
	if (UTIL_IsMasterTriggered( pev->netname, pEntity ))
		return STATE_ON;
	else
		return STATE_OFF;
}
开发者ID:Hammermaps-DEV,项目名称:Spirit-of-Half-Life-1.8--VC2010,代码行数:7,代码来源:subs.cpp

示例10: StartControl

BOOL CFuncTank :: StartControl( CBasePlayer *pController )
{
	if ( m_pController != NULL )
		return FALSE;

	// Team only or disabled?
	if ( m_iszMaster )
	{
		if ( !UTIL_IsMasterTriggered( m_iszMaster, pController ) )
			return FALSE;
	}

	ALERT( at_console, "using TANK!\n");

	m_pController = pController;
	if ( m_pController->m_pActiveItem )
	{
		m_pController->m_pActiveItem->Holster();
		m_pController->pev->weaponmodel = 0;
		m_pController->pev->viewmodel = 0;

	}

	m_pController->m_iHideHUD |= HIDEHUD_WEAPONS;
	m_vecControllerUsePos = m_pController->pev->origin;

	pev->nextthink = pev->ltime + 0.1;

	return TRUE;
}
开发者ID:Xash3DLinux,项目名称:xash3dlinux,代码行数:30,代码来源:func_tank.cpp

示例11: IsLockedByMaster

bool CBaseToggle :: IsLockedByMaster( void )
{
	if (m_sMaster && !UTIL_IsMasterTriggered(m_sMaster, m_hActivator))
		return true;
	else
		return false;
}
开发者ID:BackupTheBerlios,项目名称:battlegrounds-svn,代码行数:7,代码来源:subs.cpp

示例12: IsTriggered

bool CBaseDMStart::IsTriggered( CBaseEntity *pEntity )
{
//	BOOL master = UTIL_IsMasterTriggered( pev->netname, pEntity );
	bool master = !!(UTIL_IsMasterTriggered( pev->netname, pEntity ));

	return master;
}
开发者ID:JoelTroch,项目名称:am_src_30jan2011,代码行数:7,代码来源:subs.cpp

示例13: DoorTouch

//
// Doors not tied to anything (e.g. button, another door) can be touched, to make them activate.
//
void CBaseDoor::DoorTouch( CBaseEntity *pOther )
{
	entvars_t*	pevToucher = pOther->pev;
	
	// Ignore touches by anything but players
	if (!FClassnameIs(pevToucher, "player"))
		return;

	// If door has master, and it's not ready to trigger, 
	// play 'locked' sound

	if (m_sMaster && !UTIL_IsMasterTriggered(m_sMaster, pOther))
		PlayLockSounds(pev, &m_ls, TRUE, FALSE);
	
	// If door is somebody's target, then touching does nothing.
	// You have to activate the owner (e.g. button).
	//LRC- allow flags to override this
	if (!FStringNull(pev->targetname) && !FBitSet(pev->spawnflags,SF_DOOR_FORCETOUCHABLE))
	{
		// play locked sound
		PlayLockSounds(pev, &m_ls, TRUE, FALSE);
		return; 
	}
	
	m_hActivator = pOther;// remember who activated the door

	if (DoorActivate( ))
		SetTouch( NULL ); // Temporarily disable the touch function, until movement is finished.
}
开发者ID:Hammermaps-DEV,项目名称:Spirit-of-Half-Life-1.8--VC2010,代码行数:32,代码来源:func_doors.cpp

示例14: IsLockedByMaster

BOOL CBaseToggle :: IsLockedByMaster( void )
{
	if (m_sMaster && !UTIL_IsMasterTriggered(m_sMaster, m_hActivator))
		return TRUE;
	else
		return FALSE;
}
开发者ID:JoelTroch,项目名称:am_src_30jan2011,代码行数:7,代码来源:subs.cpp

示例15: UTIL_IsMasterTriggered

bool CRuleEntity::CanFireForActivator( CBaseEntity *pActivator ) const
{
	if ( m_iszMaster )
	{
		return UTIL_IsMasterTriggered( m_iszMaster, pActivator );
	}
	
	return true;
}
开发者ID:CryoKeen,项目名称:HLEnhanced,代码行数:9,代码来源:CRuleEntity.cpp


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