本文整理汇总了C++中CBaseEntity::DeathNotice方法的典型用法代码示例。如果您正苦于以下问题:C++ CBaseEntity::DeathNotice方法的具体用法?C++ CBaseEntity::DeathNotice怎么用?C++ CBaseEntity::DeathNotice使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBaseEntity
的用法示例。
在下文中一共展示了CBaseEntity::DeathNotice方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Killed
void CLeech::Killed(entvars_t *pevAttacker, int iGib)
{
Vector vecSplatDir;
TraceResult tr;
//ALERT(at_aiconsole, "Leech: killed\n");
// tell owner ( if any ) that we're dead.This is mostly for MonsterMaker functionality.
CBaseEntity *pOwner = CBaseEntity::Instance(pev->owner);
if (pOwner)
pOwner->DeathNotice(pev);
// When we hit the ground, play the "death_end" activity
if ( pev->waterlevel )
{
pev->angles.z = 0;
pev->angles.x = 0;
pev->origin.z += 1;
pev->avelocity = g_vecZero;
if ( RANDOM_LONG( 0, 99 ) < 70 )
pev->avelocity.y = RANDOM_LONG( -720, 720 );
pev->gravity = 0.02;
ClearBits(pev->flags, FL_ONGROUND);
SetActivity( ACT_DIESIMPLE );
}
else
SetActivity( ACT_DIEFORWARD );
pev->movetype = MOVETYPE_TOSS;
pev->takedamage = DAMAGE_NO;
SetThink( &CLeech::DeadThink );
}
示例2: if
/*
============
Killed
============
*/
void CBaseMonster :: Killed( entvars_t *pevAttacker, int iGib )
{
unsigned int cCount = 0;
BOOL fDone = FALSE;
CBaseEntity* theBaseEntity = CBaseEntity::Instance(pevAttacker->owner);
if(!theBaseEntity)
{
theBaseEntity = CBaseEntity::Instance(pevAttacker);
}
ASSERT(theBaseEntity);
theBaseEntity->AwardKill(this->pev);
if ( HasMemory( bits_MEMORY_KILLED ) )
{
if ( ShouldGibMonster( iGib ) )
CallGibMonster();
return;
}
Remember( bits_MEMORY_KILLED );
// clear the deceased's sound channels.(may have been firing or reloading when killed)
EMIT_SOUND(ENT(pev), CHAN_WEAPON, "common/null.wav", 1, ATTN_NORM);
m_IdealMonsterState = MONSTERSTATE_DEAD;
// Make sure this condition is fired too (TakeDamage breaks out before this happens on death)
SetConditions( bits_COND_LIGHT_DAMAGE );
// tell owner ( if any ) that we're dead.This is mostly for MonsterMaker functionality.
CBaseEntity *pOwner = CBaseEntity::Instance(pev->owner);
if ( pOwner )
{
pOwner->DeathNotice( pev );
}
if ( ShouldGibMonster( iGib ) )
{
CallGibMonster();
return;
}
else if ( pev->flags & FL_MONSTER )
{
SetTouch( NULL );
BecomeDead();
}
// don't let the status bar glitch for players.with <0 health.
if (pev->health < -99)
{
pev->health = 0;
}
//pev->enemy = ENT( pevAttacker );//why? (sjb)
m_IdealMonsterState = MONSTERSTATE_DEAD;
}
示例3: DelayedKillThink
//-----------------------------------------------------------------------------
// Purpose: Marks the entity for deletion
//-----------------------------------------------------------------------------
void CBaseHelicopter::DelayedKillThink( )
{
// tell owner ( if any ) that we're dead.This is mostly for NPCMaker functionality.
CBaseEntity *pOwner = GetOwnerEntity();
if ( pOwner )
{
pOwner->DeathNotice( this );
SetOwnerEntity( NULL );
}
UTIL_Remove( this );
}
示例4: Killed
//=========================================================
// Killed.
//=========================================================
void CRoach :: Killed( entvars_t *pevAttacker, int iGib )
{
pev->solid = SOLID_NOT;
//random sound
if ( RANDOM_LONG(0,4) == 1 )
{
EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "roach/rch_die.wav", 0.8, ATTN_NORM, 0, 80 + RANDOM_LONG(0,39) );
}
else
{
EMIT_SOUND_DYN(ENT(pev), CHAN_BODY, "roach/rch_smash.wav", 0.7, ATTN_NORM, 0, 80 + RANDOM_LONG(0,39) );
}
CSoundEnt::InsertSound ( bits_SOUND_WORLD, pev->origin, 128, 1 );
CBaseEntity *pOwner = CBaseEntity::Instance(pev->owner);
if ( pOwner )
{
pOwner->DeathNotice( pev );
}
UTIL_Remove( this );
}