From 017d3d829543445c6364b91322cfd2d03bd14de3 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Tue, 27 Aug 2019 13:51:35 +0300 Subject: [PATCH] Make penguins explosive --- dlls/gearbox/penguin.cpp | 36 ++++++++---------------------------- 1 file changed, 8 insertions(+), 28 deletions(-) diff --git a/dlls/gearbox/penguin.cpp b/dlls/gearbox/penguin.cpp index 2bba079b..57f55b67 100644 --- a/dlls/gearbox/penguin.cpp +++ b/dlls/gearbox/penguin.cpp @@ -131,7 +131,7 @@ void CPenguinGrenade::Spawn(void) pev->gravity = 0.5; pev->friction = 0.5; - pev->dmg = gSkillData.snarkDmgPop; + pev->dmg = gSkillData.plrDmgHandGrenade; m_flDie = gpGlobals->time + PENGUIN_DETONATE_DELAY; @@ -161,33 +161,12 @@ void CPenguinGrenade::Precache(void) void CPenguinGrenade::Killed(entvars_t *pevAttacker, int iGib) { - pev->model = iStringNull;// make invisible - SetThink(&CPenguinGrenade::SUB_Remove); - SetTouch(NULL); - pev->nextthink = gpGlobals->time + 0.1; - - // since squeak grenades never leave a body behind, clear out their takedamage now. - // Squeaks do a bit of radius damage when they pop, and that radius damage will - // continue to call this function unless we acknowledge the Squeak's death now. (sjb) - pev->takedamage = DAMAGE_NO; - - // play squeek blast - EMIT_SOUND_DYN(ENT(pev), CHAN_ITEM, "squeek/sqk_blast1.wav", 1, 0.5, 0, PITCH_NORM); - - CSoundEnt::InsertSound(bits_SOUND_COMBAT, pev->origin, SMALL_EXPLOSION_VOLUME, 3.0); - - UTIL_BloodDrips(pev->origin, g_vecZero, BloodColor(), 80); - - if (m_hOwner != 0) - RadiusDamage(pev, m_hOwner->pev, pev->dmg, CLASS_NONE, DMG_BLAST); - else - RadiusDamage(pev, pev, pev->dmg, CLASS_NONE, DMG_BLAST); - - // reset owner so death message happens - if (m_hOwner != 0) + if( m_hOwner != 0 ) + pev->owner = m_hOwner->edict(); + CGrenade::Detonate(); + UTIL_BloodDrips( pev->origin, g_vecZero, BloodColor(), 80 ); + if( m_hOwner != 0 ) pev->owner = m_hOwner->edict(); - - CBaseMonster::Killed(pevAttacker, GIB_ALWAYS); } void CPenguinGrenade::GibMonster(void) @@ -358,7 +337,8 @@ void CPenguinGrenade::SuperBounceTouch(CBaseEntity *pOther) else ApplyMultiDamage(pev, pev); - pev->dmg += gSkillData.snarkDmgPop; // add more explosion damage + pev->dmg += gSkillData.plrDmgHandGrenade; // add more explosion damage + pev->dmg = Q_min(pev->dmg, 500); // m_flDie += 2.0; // add more life // make bite sound