本文整理汇总了C++中CBaseAnimating::Dissolve方法的典型用法代码示例。如果您正苦于以下问题:C++ CBaseAnimating::Dissolve方法的具体用法?C++ CBaseAnimating::Dissolve怎么用?C++ CBaseAnimating::Dissolve使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBaseAnimating
的用法示例。
在下文中一共展示了CBaseAnimating::Dissolve方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Touch
void CTriggerPhysicsTrap::Touch( CBaseEntity *pOther )
{
if ( !PassesTriggerFilters(pOther) )
return;
CBaseAnimating *pAnim = pOther->GetBaseAnimating();
if ( !pAnim )
return;
pAnim->Dissolve( NULL, gpGlobals->curtime, false, m_nDissolveType );
}
示例2: InputDissolve
//-----------------------------------------------------------------------------
// Purpose:
// Input : inputdata -
//-----------------------------------------------------------------------------
void CEntityDissolve::InputDissolve( inputdata_t &inputdata )
{
string_t strTarget = inputdata.value.StringID();
if (strTarget == NULL_STRING)
{
strTarget = m_target;
}
CBaseEntity *pTarget = NULL;
while ((pTarget = gEntList.FindEntityGeneric(pTarget, STRING(strTarget), this, inputdata.pActivator)) != NULL)
{
CBaseAnimating *pBaseAnim = pTarget->GetBaseAnimating();
if (pBaseAnim)
{
pBaseAnim->Dissolve( NULL, gpGlobals->curtime, false, m_nDissolveType, GetAbsOrigin(), m_nMagnitude );
}
}
}
示例3: Touch
void CTriggerPhysicsTrap::Touch( CBaseEntity *pOther )
{
if ( !PassesTriggerFilters(pOther) )
return;
CBaseAnimating *pAnim = pOther->GetBaseAnimating();
if ( !pAnim )
return;
#ifdef HL2_DLL
// HACK: Upgrade the physcannon
if ( FClassnameIs( pAnim, "weapon_physcannon" ) )
{
PhysCannonBeginUpgrade( pAnim );
return;
}
#endif
pAnim->Dissolve( NULL, gpGlobals->curtime, false, m_nDissolveType );
}
示例4: Event_Killed
//-----------------------------------------------------------------------------
// Purpose:
// Input : &info -
// Output : Returns true on success, false on failure.
//-----------------------------------------------------------------------------
void CNPC_CombineS::Event_Killed( const CTakeDamageInfo &info )
{
// Don't bother if we've been told not to, or the player has a megaphyscannon
if ( combine_spawn_health.GetBool() == false || PlayerHasMegaPhysCannon() )
{
BaseClass::Event_Killed( info );
return;
}
CBasePlayer *pPlayer = ToBasePlayer( info.GetAttacker() );
if ( !pPlayer )
{
CPropVehicleDriveable *pVehicle = dynamic_cast<CPropVehicleDriveable *>( info.GetAttacker() ) ;
if ( pVehicle && pVehicle->GetDriver() && pVehicle->GetDriver()->IsPlayer() )
{
pPlayer = assert_cast<CBasePlayer *>( pVehicle->GetDriver() );
}
}
if ( pPlayer != NULL )
{
// Elites drop alt-fire ammo, so long as they weren't killed by dissolving.
if( IsElite() )
{
#ifdef HL2_EPISODIC
if ( HasSpawnFlags( SF_COMBINE_NO_AR2DROP ) == false )
#endif
{
CBaseEntity *pItem = DropItem( "item_ammo_ar2_altfire", WorldSpaceCenter()+RandomVector(-4,4), RandomAngle(0,360) );
if ( pItem )
{
IPhysicsObject *pObj = pItem->VPhysicsGetObject();
if ( pObj )
{
Vector vel = RandomVector( -64.0f, 64.0f );
AngularImpulse angImp = RandomAngularImpulse( -300.0f, 300.0f );
vel[2] = 0.0f;
pObj->AddVelocity( &vel, &angImp );
}
if( info.GetDamageType() & DMG_DISSOLVE )
{
CBaseAnimating *pAnimating = dynamic_cast<CBaseAnimating*>(pItem);
if( pAnimating )
{
pAnimating->Dissolve( NULL, gpGlobals->curtime, false, ENTITY_DISSOLVE_NORMAL );
}
}
else
{
WeaponManager_AddManaged( pItem );
}
}
}
}
CHalfLife2 *pHL2GameRules = static_cast<CHalfLife2 *>(g_pGameRules);
// Attempt to drop health
if ( pHL2GameRules->NPC_ShouldDropHealth( pPlayer ) )
{
DropItem( "item_healthvial", WorldSpaceCenter()+RandomVector(-4,4), RandomAngle(0,360) );
pHL2GameRules->NPC_DroppedHealth();
}
if ( HasSpawnFlags( SF_COMBINE_NO_GRENADEDROP ) == false )
{
// Attempt to drop a grenade
if ( pHL2GameRules->NPC_ShouldDropGrenade( pPlayer ) )
{
DropItem( "weapon_frag", WorldSpaceCenter()+RandomVector(-4,4), RandomAngle(0,360) );
pHL2GameRules->NPC_DroppedGrenade();
}
}
}
BaseClass::Event_Killed( info );
}
示例5: Event_Killed
//.........这里部分代码省略.........
if ( !pPlayer )
{
CPropVehicleDriveable *pVehicle = dynamic_cast<CPropVehicleDriveable *>( info.GetAttacker() ) ;
if ( pVehicle && pVehicle->GetDriver() && pVehicle->GetDriver()->IsPlayer() )
{
pPlayer = assert_cast<CBasePlayer *>( pVehicle->GetDriver() );
}
}
if ( pPlayer != NULL )
{
// Elites drop alt-fire ammo, so long as they weren't killed by dissolving.
#ifdef HL2_EPISODIC
if (HasSpawnFlags(SF_COMBINE_NO_AR2DROP) == false)
#endif
{
if (FClassnameIs(GetActiveWeapon(), "weapon_ar2"))
{
CBaseEntity *pItem = DropItem("item_ammo_ar2_altfire", WorldSpaceCenter() + RandomVector(-4, 4), RandomAngle(0, 360));
if (pItem)
{
IPhysicsObject *pObj = pItem->VPhysicsGetObject();
if (pObj)
{
Vector vel = RandomVector(-64.0f, 64.0f);
AngularImpulse angImp = RandomAngularImpulse(-300.0f, 300.0f);
vel[2] = 0.0f;
pObj->AddVelocity(&vel, &angImp);
}
if (info.GetDamageType() & DMG_DISSOLVE)
{
CBaseAnimating *pAnimating = dynamic_cast<CBaseAnimating*>(pItem);
if (pAnimating)
{
pAnimating->Dissolve(NULL, gpGlobals->curtime, false, ENTITY_DISSOLVE_NORMAL);
}
}
else
{
WeaponManager_AddManaged(pItem);
}
}
}
else if (FClassnameIs(GetActiveWeapon(), "weapon_smg1"))
{
CBaseEntity *pItem = DropItem("item_ammo_smg1_grenade", WorldSpaceCenter() + RandomVector(-4, 4), RandomAngle(0, 360));
if (pItem)
{
IPhysicsObject *pObj = pItem->VPhysicsGetObject();
if (pObj)
{
Vector vel = RandomVector(-64.0f, 64.0f);
AngularImpulse angImp = RandomAngularImpulse(-300.0f, 300.0f);
vel[2] = 0.0f;
pObj->AddVelocity(&vel, &angImp);
}
if (info.GetDamageType() & DMG_DISSOLVE)
{
CBaseAnimating *pAnimating = dynamic_cast<CBaseAnimating*>(pItem);
if (pAnimating)
{
pAnimating->Dissolve(NULL, gpGlobals->curtime, false, ENTITY_DISSOLVE_NORMAL);
}
}
else
{
WeaponManager_AddManaged(pItem);
}
}
}
}
CHalfLife2 *pHL2GameRules = static_cast<CHalfLife2 *>(g_pGameRules);
// Attempt to drop health
if ( pHL2GameRules->NPC_ShouldDropHealth( pPlayer ) )
{
DropItem( "item_healthvial", WorldSpaceCenter()+RandomVector(-4,4), RandomAngle(0,360) );
pHL2GameRules->NPC_DroppedHealth();
}
if (!m_bNoArmor && combine_ace_shieldspawnmode.GetInt() > 0)
{
DropItem("item_shield", WorldSpaceCenter() + RandomVector(-4, 4), RandomAngle(0, 360));
}
}
BaseClass::Event_Killed( info );
}
示例6: StartTouch
//-----------------------------------------------------------------------------
// Purpose: Called when an entity starts touching us.
// Input : pOther - The entity that is touching us.
//-----------------------------------------------------------------------------
void CTriggerPortalCleanser::StartTouch( CBaseEntity *pOther )
{
if ( PassesTriggerFilters(pOther) )
{
EHANDLE hOther;
hOther = pOther;
bool bAdded = false;
if ( m_hTouchingEntities.Find( hOther ) == m_hTouchingEntities.InvalidIndex() )
{
m_hTouchingEntities.AddToTail( hOther );
bAdded = true;
}
m_OnStartTouch.FireOutput(pOther, this);
if ( bAdded && ( m_hTouchingEntities.Count() == 1 ) )
{
// First entity to touch us that passes our filters
m_OnStartTouchAll.FireOutput( pOther, this );
}
if ( portal_cleanser_debug.GetBool() )
{
Msg("%s START-TOUCH: for %s\n", GetDebugName(), pOther->GetDebugName() );
}
if ( !pOther->IsPlayer() )
{
CBaseAnimating *pAnim = pOther->GetBaseAnimating();
if ( !pAnim )
return;
// Can't dissolve twice.
if ( pAnim->IsDissolving() )
return;
// Force player to drop this object.
Pickup_ForcePlayerToDropThisObject( pOther );
if ( !FClassnameIs( pOther, "prop_physics" ) )
{
if ( FClassnameIs( pOther, "simple_physics_prop" ) || FClassnameIs( pOther, "simple_physics_brush" ) )
{
// simple_physics_prop ?
return;
}
if ( portal_cleanser_debug.GetBool() )
{
Msg("%s IS CREATING: simple_physics_prop\n", GetDebugName());
}
// Other object needs to be replaced by simple_physics_prop.
pOther = CreateSimplePhysicsObject( pOther );
// Dissolve the entity.
CBaseAnimating *pAnim = pOther->GetBaseAnimating();
pAnim->Dissolve( NULL, gpGlobals->curtime, false, ENTITY_DISSOLVE_NORMAL );
if ( portal_cleanser_debug.GetBool() )
{
Msg("%s DISSOLVE SIMPLE PHYSICS: %s\n", GetDebugName(), pOther->GetDebugName() );
}
// Outputs
m_hActivator = pOther;
m_OnDissolve.FireOutput(m_hActivator, this);
return;
}
IPhysicsObject *pPhysics = pOther->VPhysicsGetObject();
if ( pPhysics )
{
// Dissolve the entity.
pAnim->Dissolve( NULL, gpGlobals->curtime, false, ENTITY_DISSOLVE_NORMAL );
if ( portal_cleanser_debug.GetBool() )
{
Msg("%s DISSOLVE PHYSICS: %s\n", GetDebugName(), pOther->GetDebugName() );
}
// Turn off the gravity for this object.
pPhysics->EnableGravity( false );
// Slow down and push up the object.
Vector vecVelocity, vecAngular;
pPhysics->GetVelocity( &vecVelocity, &vecAngular );
vecVelocity /= 2;
vecAngular /= 2;
vecVelocity.z += 10;
pPhysics->SetVelocity( &vecVelocity, &vecAngular );
// Outputs
m_hActivator = pOther;
m_OnDissolve.FireOutput(m_hActivator, this);
//.........这里部分代码省略.........
示例7: Event_Killed
//-----------------------------------------------------------------------------
// Purpose:
// Input : &info -
// Output : Returns true on success, false on failure.
//-----------------------------------------------------------------------------
void CTDP_NPC_CombineS::Event_Killed( const CTakeDamageInfo &info )
{
// Don't bother if we've been told not to, or the player has a megaphyscannon
/* if ( combine_spawn_health.GetBool() == false || PlayerHasMegaPhysCannon() )
{
BaseClass::Event_Killed( info );
return;
}*/
CBasePlayer *pPlayer = ToBasePlayer( info.GetAttacker() );
if ( pPlayer != NULL )
{
// Elites drop alt-fire ammo, so long as they weren't killed by dissolving.
if( IsElite() )
{
CBaseEntity *pItem = DropItem( "item_ammo_ar2_altfire", WorldSpaceCenter()+RandomVector(-4,4), RandomAngle(0,360) );
if ( pItem )
{
IPhysicsObject *pObj = pItem->VPhysicsGetObject();
if ( pObj )
{
Vector vel = RandomVector( -64.0f, 64.0f );
AngularImpulse angImp = RandomAngularImpulse( -300.0f, 300.0f );
vel[2] = 0.0f;
pObj->AddVelocity( &vel, &angImp );
}
if( info.GetDamageType() & DMG_DISSOLVE )
{
CBaseAnimating *pAnimating = dynamic_cast<CBaseAnimating*>(pItem);
if( pAnimating )
{
pAnimating->Dissolve( NULL, gpGlobals->curtime, false, ENTITY_DISSOLVE_NORMAL );
}
}
}
}
//CTDPGameRules *pTDPGameRules = static_cast<CTDPGameRules *>(g_pGameRules);
// Attempt to drop health
/*if ( pTDPGameRules->NPC_ShouldDropHealth( pPlayer ) )
{
DropItem( "item_healthvial", WorldSpaceCenter()+RandomVector(-4,4), RandomAngle(0,360) );
pTDPGameRules->NPC_DroppedHealth();
}*/
// Attempt to drop a grenade
/*if ( pTDPGameRules->NPC_ShouldDropGrenade( pPlayer ) )
{
DropItem( "weapon_frag", WorldSpaceCenter()+RandomVector(-4,4), RandomAngle(0,360) );
pTDPGameRules->NPC_DroppedGrenade();
}*/
}
BaseClass::Event_Killed( info );
}