本文整理汇总了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;
}
示例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();
}
示例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 );
}
示例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 );
}
}
示例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;
}
示例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);
}
}
示例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);
}
示例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.
}
示例9: GetState
STATE CBaseDMStart::GetState( CBaseEntity *pEntity )
{
if (UTIL_IsMasterTriggered( pev->netname, pEntity ))
return STATE_ON;
else
return STATE_OFF;
}
示例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;
}
示例11: IsLockedByMaster
bool CBaseToggle :: IsLockedByMaster( void )
{
if (m_sMaster && !UTIL_IsMasterTriggered(m_sMaster, m_hActivator))
return true;
else
return false;
}
示例12: IsTriggered
bool CBaseDMStart::IsTriggered( CBaseEntity *pEntity )
{
// BOOL master = UTIL_IsMasterTriggered( pev->netname, pEntity );
bool master = !!(UTIL_IsMasterTriggered( pev->netname, pEntity ));
return master;
}
示例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.
}
示例14: IsLockedByMaster
BOOL CBaseToggle :: IsLockedByMaster( void )
{
if (m_sMaster && !UTIL_IsMasterTriggered(m_sMaster, m_hActivator))
return TRUE;
else
return FALSE;
}
示例15: UTIL_IsMasterTriggered
bool CRuleEntity::CanFireForActivator( CBaseEntity *pActivator ) const
{
if ( m_iszMaster )
{
return UTIL_IsMasterTriggered( m_iszMaster, pActivator );
}
return true;
}