void COgre :: ChainSaw( float side ) { if( m_hEnemy == NULL ) return; if (!Q_CanDamage( m_hEnemy, this )) return; AI_Charge( 10 ); Vector delta = m_hEnemy->pev->origin - pev->origin; if (delta.Length() > 100) return; float ldmg = (RANDOM_FLOAT( 0.0f, 1.0f ) + RANDOM_FLOAT( 0.0f, 1.0f ) + RANDOM_FLOAT( 0.0f, 1.0f )) * 4; m_hEnemy->TakeDamage (pev, pev, ldmg, DMG_GENERIC); if( side ) { UTIL_MakeVectors( pev->angles ); if (side == 1) SpawnMeatSpray (pev->origin + gpGlobals->v_forward * 16, RANDOM_FLOAT( -100.0f, 100.0f ) * gpGlobals->v_right); else SpawnMeatSpray (pev->origin + gpGlobals->v_forward * 16, side * gpGlobals->v_right); } }
void CShambler :: ShamblerSmash( void ) { if (m_hEnemy == NULL) return; AI_Charge(0); Vector delta = m_hEnemy->pev->origin - pev->origin; if (delta.Length() > 100) return; if (!Q_CanDamage (m_hEnemy, this)) return; float ldmg = (RANDOM_FLOAT(0,1) + RANDOM_FLOAT(0,1) + RANDOM_FLOAT(0,1)) * 40; m_hEnemy->TakeDamage( pev, pev, ldmg, DMG_SLASH); EMIT_SOUND( edict(), CHAN_VOICE, "shambler/smack.wav", 1, ATTN_NORM); UTIL_MakeVectors( pev->angles ); SpawnMeatSpray (pev->origin + gpGlobals->v_forward * 16, RANDOM_FLOAT( -100, 100 ) * gpGlobals->v_right); SpawnMeatSpray (pev->origin + gpGlobals->v_forward * 16, RANDOM_FLOAT( -100, 100 ) * gpGlobals->v_right); }