From 5b45a96a5e333b6b3e22ab79dc304da5fb0dc4d2 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Tue, 3 Apr 2018 16:50:47 +0300 Subject: [PATCH] Fix shocktrooper shoot and grenade origin. Adjust some voltigore values to match Opposing Force (#20) --- dlls/gearbox/strooper.cpp | 5 +++-- dlls/gearbox/voltigore.cpp | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/dlls/gearbox/strooper.cpp b/dlls/gearbox/strooper.cpp index 54774c44..c4d9ecb3 100644 --- a/dlls/gearbox/strooper.cpp +++ b/dlls/gearbox/strooper.cpp @@ -329,7 +329,7 @@ void CStrooper::HandleAnimEvent(MonsterEvent_t *pEvent) { UTIL_MakeVectors(pev->angles); // CGrenade::ShootTimed( pev, pev->origin + gpGlobals->v_forward * 34 + Vector (0, 0, 32), m_vecTossVelocity, 3.5 ); - CSporeGrenade::ShootTimed(pev, GetGunPosition(), m_vecTossVelocity, 3.5); + CSporeGrenade::ShootTimed(pev, pev->origin + Vector(0,0,98), m_vecTossVelocity, 3.5); m_fThrowGrenade = FALSE; m_flNextGrenadeCheck = gpGlobals->time + 6;// wait six seconds before even looking again to see if a grenade can be thrown. @@ -360,7 +360,8 @@ void CStrooper::HandleAnimEvent(MonsterEvent_t *pEvent) WRITE_BYTE( 128 ); // brightness MESSAGE_END(); - Vector vecShootOrigin = GetGunPosition(); + UTIL_MakeVectors(pev->angles); + Vector vecShootOrigin = vecGunPos + gpGlobals->v_forward * 32; Vector vecShootDir = ShootAtEnemy( vecShootOrigin ); vecGunAngles = UTIL_VecToAngles(vecShootDir); diff --git a/dlls/gearbox/voltigore.cpp b/dlls/gearbox/voltigore.cpp index 35dcd301..dfaca4ca 100644 --- a/dlls/gearbox/voltigore.cpp +++ b/dlls/gearbox/voltigore.cpp @@ -34,13 +34,13 @@ #define VOLTIGORE_CLASSNAME "monster_alien_voltigore" #define VOLTIGORE_BABY_CLASSNAME "monster_alien_babyvoltigore" -#define VOLTIGORE_ZAP_RED 160 -#define VOLTIGORE_ZAP_GREEN 0 +#define VOLTIGORE_ZAP_RED 180 +#define VOLTIGORE_ZAP_GREEN 16 #define VOLTIGORE_ZAP_BLUE 255 #define VOLTIGORE_ZAP_BEAM "sprites/lgtning.spr" #define VOLTIGORE_ZAP_NOISE 80 #define VOLTIGORE_ZAP_WIDTH 40 -#define VOLTIGORE_ZAP_BRIGHTNESS 210 +#define VOLTIGORE_ZAP_BRIGHTNESS 255 #define VOLTIGORE_ZAP_DISTANCE 512 #define VOLTIGORE_GLOW_SCALE 1.0f #define VOLTIGORE_GIB_COUNT 9 @@ -121,9 +121,6 @@ void CVoltigoreEnergyBall::Spawn(void) UTIL_SetSize(pev, Vector(0, 0, 0), Vector(0, 0, 0)); m_iBeams = 0; - - // Create beams. - CreateBeams(); } //========================================================= @@ -192,7 +189,10 @@ void CVoltigoreEnergyBall::BeamThink(void) } else { - UpdateBeams(); + if (m_iBeams) + UpdateBeams(); + else + CreateBeams(); } } @@ -244,7 +244,7 @@ void CVoltigoreEnergyBall::CreateBeams() { for (int i = 0; i < VOLTIGORE_MAX_BEAMS; ++i) { - CreateBeam(i, pev->origin, VOLTIGORE_ZAP_WIDTH, VOLTIGORE_ZAP_BRIGHTNESS + RANDOM_LONG(1, 5) ); + CreateBeam(i, pev->origin, VOLTIGORE_ZAP_WIDTH, VOLTIGORE_ZAP_BRIGHTNESS ); } m_iBeams = VOLTIGORE_MAX_BEAMS; } @@ -270,7 +270,7 @@ void CVoltigoreEnergyBall::UpdateBeams() const Vector vecSrc = pev->origin; const Vector directionVector = pev->velocity.Normalize(); const int baseDistance = VOLTIGORE_ZAP_DISTANCE; - for (i = 0; i < VOLTIGORE_MAX_BEAMS; ++i) + for (i = 0; i < m_iBeams; ++i) { for (j = 0; j < 3; ++j) { @@ -645,7 +645,7 @@ void CVoltigore::HandleAnimEvent(MonsterEvent_t *pEvent) // do stuff for this event. //AttackSound(); - CVoltigoreEnergyBall::Shoot(pev, vecSpitOffset, vecSpitDir * 900); + CVoltigoreEnergyBall::Shoot(pev, vecSpitOffset, vecSpitDir * 1000); // turn the beam glow off. DestroyBeams();