Browse Source

Disintegrate effect

hlzbot-dirty
mittorn 8 years ago
parent
commit
62bf3a537e
  1. 4
      dlls/ar2.cpp
  2. 1
      dlls/cbase.h
  3. 20
      dlls/combat.cpp
  4. 2
      dlls/player.cpp

4
dlls/ar2.cpp

@ -201,11 +201,11 @@ void CAR2Ball::AR2Touch(CBaseEntity *pOther) @@ -201,11 +201,11 @@ void CAR2Ball::AR2Touch(CBaseEntity *pOther)
pevOwner = pev;
TraceResult tr = UTIL_GetGlobalTrace();
ClearMultiDamage();
pOther->TraceAttack(pevOwner, 250, gpGlobals->v_forward, &tr, DMG_CLUB);
pOther->TraceAttack(pevOwner, 2500, gpGlobals->v_forward, &tr, DMG_CLUB | DMG_DISINTEGRATE);
if( pOther->IsPlayer() || pOther->IsMoving() )
{
pev->velocity = gpGlobals->v_forward.Normalize() * 1600;
// play bounce sound
// play strike sound
switch (RANDOM_LONG(0, 2))
{
case 0: EMIT_SOUND(ENT(pev), CHAN_VOICE, "ar2/ar2strike1.wav", 1, ATTN_NORM); break;

1
dlls/cbase.h

@ -592,6 +592,7 @@ public: @@ -592,6 +592,7 @@ public:
#define DMG_NEVERGIB (1 << 12) // with this bit OR'd in, no damage type will be able to gib victims upon death
#define DMG_ALWAYSGIB (1 << 13) // with this bit OR'd in, any damage type can be made to gib victims upon death.
#define DMG_DROWN (1 << 14) // Drowning
#define DMG_DISINTEGRATE (1 << 15) // AR2 ball
// time-based damage
#define DMG_TIMEBASED (~(0x3fff)) // mask for time-based damage

20
dlls/combat.cpp

@ -193,7 +193,7 @@ void CGib::SpawnRandomGibs( entvars_t *pevVictim, int cGibs, int human ) @@ -193,7 +193,7 @@ void CGib::SpawnRandomGibs( entvars_t *pevVictim, int cGibs, int human )
}
else
{
if( human )
if( human & 1 )
{
// human pieces
pGib->Spawn( "models/hgibs.mdl" );
@ -247,6 +247,19 @@ void CGib::SpawnRandomGibs( entvars_t *pevVictim, int cGibs, int human ) @@ -247,6 +247,19 @@ void CGib::SpawnRandomGibs( entvars_t *pevVictim, int cGibs, int human )
UTIL_SetSize( pGib->pev, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ) );
}
pGib->LimitVelocity();
if(human & 2)
{
pGib->m_lifeTime = 0.3;
pGib->pev->renderfx = kRenderFxGlowShell;
pGib->pev->renderamt = 100;
pGib->pev->rendermode = kRenderTransTexture;
pGib->pev->solid = SOLID_NOT;
pGib->pev->nextthink = gpGlobals->time + 0.1;
pGib->SetThink( &CBaseEntity::SUB_FadeOut );
}
}
}
@ -299,6 +312,7 @@ void CBaseMonster::GibMonster( void ) @@ -299,6 +312,7 @@ void CBaseMonster::GibMonster( void )
{
TraceResult tr;
BOOL gibbed = FALSE;
byte disintegrate = (!!( m_bitsDamageType & DMG_DISINTEGRATE )) << 1;
EMIT_SOUND( ENT( pev ), CHAN_WEAPON, "common/bodysplat.wav", 1, ATTN_NORM );
@ -308,7 +322,7 @@ void CBaseMonster::GibMonster( void ) @@ -308,7 +322,7 @@ void CBaseMonster::GibMonster( void )
if( CVAR_GET_FLOAT( "violence_hgibs" ) != 0 ) // Only the player will ever get here
{
CGib::SpawnHeadGib( pev );
CGib::SpawnRandomGibs( pev, 4, 1 ); // throw some human gibs.
CGib::SpawnRandomGibs( pev, 4, 1 | disintegrate ); // throw some human gibs.
}
gibbed = TRUE;
}
@ -316,7 +330,7 @@ void CBaseMonster::GibMonster( void ) @@ -316,7 +330,7 @@ void CBaseMonster::GibMonster( void )
{
if( CVAR_GET_FLOAT( "violence_agibs" ) != 0 ) // Should never get here, but someone might call it directly
{
CGib::SpawnRandomGibs( pev, 4, 0 ); // Throw alien gibs
CGib::SpawnRandomGibs( pev, 4, disintegrate ); // Throw alien gibs
}
gibbed = TRUE;
}

2
dlls/player.cpp

@ -671,7 +671,7 @@ void CBasePlayer::PackDeadPlayerItems( void ) @@ -671,7 +671,7 @@ void CBasePlayer::PackDeadPlayerItems( void )
iWeaponRules = g_pGameRules->DeadPlayerWeapons( this );
iAmmoRules = g_pGameRules->DeadPlayerAmmo( this );
if( iWeaponRules == GR_PLR_DROP_GUN_NO && iAmmoRules == GR_PLR_DROP_AMMO_NO )
if( iWeaponRules == GR_PLR_DROP_GUN_NO && iAmmoRules == GR_PLR_DROP_AMMO_NO && !(m_bitsDamageType & DMG_DISINTEGRATE) )
{
// nothing to pack. Remove the weapons and return. Don't call create on the box!
RemoveAllItems( TRUE );

Loading…
Cancel
Save