Fix shocktrooper shoot and grenade origin. Adjust some voltigore values to match Opposing Force (#20)

This commit is contained in:
Roman Chistokhodov 2018-04-03 16:50:47 +03:00 committed by Andrey Akhmichin
parent 9b2bf66db5
commit 5b45a96a5e
2 changed files with 13 additions and 12 deletions

View File

@ -329,7 +329,7 @@ void CStrooper::HandleAnimEvent(MonsterEvent_t *pEvent)
{ {
UTIL_MakeVectors(pev->angles); UTIL_MakeVectors(pev->angles);
// CGrenade::ShootTimed( pev, pev->origin + gpGlobals->v_forward * 34 + Vector (0, 0, 32), m_vecTossVelocity, 3.5 ); // 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_fThrowGrenade = FALSE;
m_flNextGrenadeCheck = gpGlobals->time + 6;// wait six seconds before even looking again to see if a grenade can be thrown. 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 WRITE_BYTE( 128 ); // brightness
MESSAGE_END(); MESSAGE_END();
Vector vecShootOrigin = GetGunPosition(); UTIL_MakeVectors(pev->angles);
Vector vecShootOrigin = vecGunPos + gpGlobals->v_forward * 32;
Vector vecShootDir = ShootAtEnemy( vecShootOrigin ); Vector vecShootDir = ShootAtEnemy( vecShootOrigin );
vecGunAngles = UTIL_VecToAngles(vecShootDir); vecGunAngles = UTIL_VecToAngles(vecShootDir);

View File

@ -34,13 +34,13 @@
#define VOLTIGORE_CLASSNAME "monster_alien_voltigore" #define VOLTIGORE_CLASSNAME "monster_alien_voltigore"
#define VOLTIGORE_BABY_CLASSNAME "monster_alien_babyvoltigore" #define VOLTIGORE_BABY_CLASSNAME "monster_alien_babyvoltigore"
#define VOLTIGORE_ZAP_RED 160 #define VOLTIGORE_ZAP_RED 180
#define VOLTIGORE_ZAP_GREEN 0 #define VOLTIGORE_ZAP_GREEN 16
#define VOLTIGORE_ZAP_BLUE 255 #define VOLTIGORE_ZAP_BLUE 255
#define VOLTIGORE_ZAP_BEAM "sprites/lgtning.spr" #define VOLTIGORE_ZAP_BEAM "sprites/lgtning.spr"
#define VOLTIGORE_ZAP_NOISE 80 #define VOLTIGORE_ZAP_NOISE 80
#define VOLTIGORE_ZAP_WIDTH 40 #define VOLTIGORE_ZAP_WIDTH 40
#define VOLTIGORE_ZAP_BRIGHTNESS 210 #define VOLTIGORE_ZAP_BRIGHTNESS 255
#define VOLTIGORE_ZAP_DISTANCE 512 #define VOLTIGORE_ZAP_DISTANCE 512
#define VOLTIGORE_GLOW_SCALE 1.0f #define VOLTIGORE_GLOW_SCALE 1.0f
#define VOLTIGORE_GIB_COUNT 9 #define VOLTIGORE_GIB_COUNT 9
@ -121,9 +121,6 @@ void CVoltigoreEnergyBall::Spawn(void)
UTIL_SetSize(pev, Vector(0, 0, 0), Vector(0, 0, 0)); UTIL_SetSize(pev, Vector(0, 0, 0), Vector(0, 0, 0));
m_iBeams = 0; m_iBeams = 0;
// Create beams.
CreateBeams();
} }
//========================================================= //=========================================================
@ -192,7 +189,10 @@ void CVoltigoreEnergyBall::BeamThink(void)
} }
else else
{ {
if (m_iBeams)
UpdateBeams(); UpdateBeams();
else
CreateBeams();
} }
} }
@ -244,7 +244,7 @@ void CVoltigoreEnergyBall::CreateBeams()
{ {
for (int i = 0; i < VOLTIGORE_MAX_BEAMS; ++i) 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; m_iBeams = VOLTIGORE_MAX_BEAMS;
} }
@ -270,7 +270,7 @@ void CVoltigoreEnergyBall::UpdateBeams()
const Vector vecSrc = pev->origin; const Vector vecSrc = pev->origin;
const Vector directionVector = pev->velocity.Normalize(); const Vector directionVector = pev->velocity.Normalize();
const int baseDistance = VOLTIGORE_ZAP_DISTANCE; 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) for (j = 0; j < 3; ++j)
{ {
@ -645,7 +645,7 @@ void CVoltigore::HandleAnimEvent(MonsterEvent_t *pEvent)
// do stuff for this event. // do stuff for this event.
//AttackSound(); //AttackSound();
CVoltigoreEnergyBall::Shoot(pev, vecSpitOffset, vecSpitDir * 900); CVoltigoreEnergyBall::Shoot(pev, vecSpitOffset, vecSpitDir * 1000);
// turn the beam glow off. // turn the beam glow off.
DestroyBeams(); DestroyBeams();