From 7eaf966a0f48e1640f58f3cc642272b8602444ce Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Wed, 21 Mar 2018 00:12:27 +0300 Subject: [PATCH 1/5] Adjust tentacle height values for opfor --- dlls/tentacle.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/tentacle.cpp b/dlls/tentacle.cpp index 44b8b45b..ff44014d 100644 --- a/dlls/tentacle.cpp +++ b/dlls/tentacle.cpp @@ -337,11 +337,11 @@ void CTentacle::KeyValue( KeyValueData *pkvd ) int CTentacle::Level( float dz ) { - if( dz < 216 ) + if( dz < 96 ) return 0; - if( dz < 408 ) + if( dz < 150 ) return 1; - if( dz < 600 ) + if( dz < 288 ) return 2; return 3; } @@ -351,11 +351,11 @@ float CTentacle::MyHeight() switch( MyLevel() ) { case 1: - return 256; + return 136; case 2: - return 448; + return 190; case 3: - return 640; + return 328; } return 0; } From bb4ef292012af833294bf569ac43eebad57e3148 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Wed, 21 Mar 2018 00:12:57 +0300 Subject: [PATCH 2/5] Displacer teleportation changes the gravity --- dlls/gearbox/displacer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/gearbox/displacer.cpp b/dlls/gearbox/displacer.cpp index 914f8b12..6982b5b0 100644 --- a/dlls/gearbox/displacer.cpp +++ b/dlls/gearbox/displacer.cpp @@ -639,10 +639,10 @@ void CDisplacer::Teleport( void ) if( !g_pGameRules->IsMultiplayer()) { m_pPlayer->m_fInXen = !m_pPlayer->m_fInXen; - /*if (m_pPlayer->m_fInXen) + if (m_pPlayer->m_fInXen) m_pPlayer->pev->gravity = 0.5; else - m_pPlayer->pev->gravity = 1.0;*/ + m_pPlayer->pev->gravity = 1.0; } } else From d89bd8e64af09836aff0b53307e2e0c721a85d8f Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Wed, 21 Mar 2018 00:13:19 +0300 Subject: [PATCH 3/5] Fix spore ammo name --- dlls/gearbox/sporelauncher.cpp | 4 ++-- dlls/player.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/gearbox/sporelauncher.cpp b/dlls/gearbox/sporelauncher.cpp index 86274b1b..20f886bf 100644 --- a/dlls/gearbox/sporelauncher.cpp +++ b/dlls/gearbox/sporelauncher.cpp @@ -92,7 +92,7 @@ int CSporelauncher::AddToPlayer(CBasePlayer *pPlayer) int CSporelauncher::GetItemInfo(ItemInfo *p) { p->pszName = STRING(pev->classname); - p->pszAmmo1 = "spores"; + p->pszAmmo1 = "Spores"; p->iMaxAmmo1 = SPORE_MAX_CARRY; p->pszAmmo2 = NULL; p->iMaxAmmo2 = -1; @@ -407,4 +407,4 @@ class CSporeAmmo : public CBasePlayerAmmo } }; -LINK_ENTITY_TO_CLASS(ammo_spore, CSporeAmmo); \ No newline at end of file +LINK_ENTITY_TO_CLASS(ammo_spore, CSporeAmmo); diff --git a/dlls/player.cpp b/dlls/player.cpp index 37945625..cbd8e5d6 100644 --- a/dlls/player.cpp +++ b/dlls/player.cpp @@ -1132,7 +1132,7 @@ void CBasePlayer::TabulateAmmo() ammo_556 = AmmoInventory( GetAmmoIndex( "556" ) ); ammo_762 = AmmoInventory( GetAmmoIndex( "762" ) ); ammo_shocks = AmmoInventory( GetAmmoIndex( "Shocks" ) ); - ammo_spores = AmmoInventory( GetAmmoIndex( "Spore" ) ); + ammo_spores = AmmoInventory( GetAmmoIndex( "Spores" ) ); } /* From b8178cf0a02853fff66456d766638d7bd54ca6e2 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Wed, 21 Mar 2018 00:14:31 +0300 Subject: [PATCH 4/5] Add shocktrooper eye blinking. Adjust attack, health, reload and size. --- dlls/gearbox/strooper.cpp | 103 +++++++++++++++++++++++++------------- 1 file changed, 68 insertions(+), 35 deletions(-) diff --git a/dlls/gearbox/strooper.cpp b/dlls/gearbox/strooper.cpp index 89430004..54774c44 100644 --- a/dlls/gearbox/strooper.cpp +++ b/dlls/gearbox/strooper.cpp @@ -112,6 +112,7 @@ class CStrooper : public CHGrunt { public: void Spawn(void); + void MonsterThink(); void Precache(void); int Classify(void); void HandleAnimEvent(MonsterEvent_t *pEvent); @@ -134,6 +135,9 @@ public: static TYPEDESCRIPTION m_SaveData[]; BOOL m_fRightClaw; + float m_rechargeTime; + float m_blinkTime; + float m_eyeChangeTime; static const char *pGruntSentences[]; }; @@ -143,6 +147,9 @@ LINK_ENTITY_TO_CLASS(monster_shocktrooper, CStrooper); TYPEDESCRIPTION CStrooper::m_SaveData[] = { DEFINE_FIELD(CStrooper, m_fRightClaw, FIELD_BOOLEAN), + DEFINE_FIELD(CStrooper, m_rechargeTime, FIELD_TIME), + DEFINE_FIELD(CStrooper, m_blinkTime, FIELD_TIME), + DEFINE_FIELD(CStrooper, m_eyeChangeTime, FIELD_TIME), }; IMPLEMENT_SAVERESTORE(CStrooper, CHGrunt); @@ -336,41 +343,38 @@ void CStrooper::HandleAnimEvent(MonsterEvent_t *pEvent) case STROOPER_AE_BURST1: { - //Shoot(); - - Vector vecGunPos; - Vector vecGunAngles; - - GetAttachment(0, vecGunPos, vecGunAngles); - - MESSAGE_BEGIN( MSG_PVS, SVC_TEMPENTITY, vecGunPos ); - WRITE_BYTE( TE_SPRITE ); - WRITE_COORD( vecGunPos.x ); // pos - WRITE_COORD( vecGunPos.y ); - WRITE_COORD( vecGunPos.z ); - WRITE_SHORT( iStrooperMuzzleFlash ); // model - WRITE_BYTE( 4 ); // size * 10 - WRITE_BYTE( 196 ); // brightness - MESSAGE_END(); - if (m_hEnemy) { - vecGunAngles = (m_hEnemy->EyePosition() - vecGunPos).Normalize(); + Vector vecGunPos; + Vector vecGunAngles; + + GetAttachment(0, vecGunPos, vecGunAngles); + + MESSAGE_BEGIN( MSG_PVS, SVC_TEMPENTITY, vecGunPos ); + WRITE_BYTE( TE_SPRITE ); + WRITE_COORD( vecGunPos.x ); // pos + WRITE_COORD( vecGunPos.y ); + WRITE_COORD( vecGunPos.z ); + WRITE_SHORT( iStrooperMuzzleFlash ); // model + WRITE_BYTE( 4 ); // size * 10 + WRITE_BYTE( 128 ); // brightness + MESSAGE_END(); + + Vector vecShootOrigin = GetGunPosition(); + Vector vecShootDir = ShootAtEnemy( vecShootOrigin ); + vecGunAngles = UTIL_VecToAngles(vecShootDir); + + CBaseEntity *pShock = CBaseEntity::Create("shock_beam", vecShootOrigin, vecGunAngles, edict()); + vecGunAngles.z += RANDOM_FLOAT( -0.05, 0 ); + pShock->pev->velocity = vecShootDir * 2000; + pShock->pev->nextthink = gpGlobals->time; + m_cAmmoLoaded--; + SetBlending( 0, vecGunAngles.x ); + + // Play fire sound. + EMIT_SOUND(ENT(pev), CHAN_WEAPON, "weapons/shock_fire.wav", 1, ATTN_NORM); + CSoundEnt::InsertSound(bits_SOUND_COMBAT, pev->origin, 384, 0.3); } - else - { - vecGunAngles = (m_vecEnemyLKP - vecGunPos).Normalize(); - } - - CBaseEntity *pShock = CBaseEntity::Create("shock_beam", vecGunPos, pev->angles, edict()); - vecGunAngles.z += RANDOM_FLOAT( -0.05, 0 ); - pShock->pev->velocity = vecGunAngles * 2000; - pShock->pev->nextthink = gpGlobals->time; - - // Play fire sound. - EMIT_SOUND(ENT(pev), CHAN_WEAPON, "weapons/shock_fire.wav", 1, ATTN_NORM); - - CSoundEnt::InsertSound(bits_SOUND_COMBAT, pev->origin, 384, 0.3); } break; @@ -419,13 +423,13 @@ void CStrooper::Spawn() Precache(); SET_MODEL(ENT(pev), "models/strooper.mdl"); - UTIL_SetSize(pev, VEC_HUMAN_HULL_MIN, VEC_HUMAN_HULL_MAX); + UTIL_SetSize( pev, Vector(-24, -24, 0), Vector(24, 24, 72) ); pev->solid = SOLID_SLIDEBOX; pev->movetype = MOVETYPE_STEP; m_bloodColor = BLOOD_COLOR_GREEN; pev->effects = 0; - pev->health = gSkillData.strooperHealth; + pev->health = gSkillData.strooperHealth * 2.5; m_flFieldOfView = 0.2;// indicates the width of this monster's forward view cone ( as a dotproduct result ) m_MonsterState = MONSTERSTATE_NONE; m_flNextGrenadeCheck = gpGlobals->time + 1; @@ -445,17 +449,46 @@ void CStrooper::Spawn() pev->weapons = STROOPER_SHOCKRIFLE | STROOPER_HANDGRENADE; } - m_cClipSize = SHOCKRIFLE_MAX_CLIP; + m_cClipSize = gSkillData.strooperMaxCharge; m_cAmmoLoaded = m_cClipSize; m_fRightClaw = FALSE; CTalkMonster::g_talkWaitTime = 0; + m_rechargeTime = gpGlobals->time + gSkillData.strooperRchgSpeed; + m_blinkTime = gpGlobals->time + RANDOM_FLOAT(3.0f, 7.0f); MonsterInit(); } +void CStrooper::MonsterThink() +{ + if (m_cAmmoLoaded < m_cClipSize) + { + if (m_rechargeTime < gpGlobals->time) + { + m_cAmmoLoaded++; + m_rechargeTime = gpGlobals->time + gSkillData.strooperRchgSpeed; + } + } + if (m_blinkTime <= gpGlobals->time && pev->skin == 0) { + pev->skin = 1; + m_blinkTime = gpGlobals->time + RANDOM_FLOAT(3.0f, 7.0f); + m_eyeChangeTime = gpGlobals->time + 0.1; + } + if (pev->skin != 0) { + if (m_eyeChangeTime <= gpGlobals->time) { + m_eyeChangeTime = gpGlobals->time + 0.1; + pev->skin++; + if (pev->skin > 3) { + pev->skin = 0; + } + } + } + CHGrunt::MonsterThink(); +} + //========================================================= // Precache - precaches all resources this monster needs //========================================================= From d4c0fea77861093a95966f95b26c1354ff81da4e Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Wed, 21 Mar 2018 00:19:05 +0300 Subject: [PATCH 5/5] Fix possible shockroach stuck --- dlls/gearbox/shockroach.cpp | 14 ++++++++++---- dlls/gearbox/shockroach.h | 5 +++-- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/dlls/gearbox/shockroach.cpp b/dlls/gearbox/shockroach.cpp index 21f38e9f..060aa3f7 100644 --- a/dlls/gearbox/shockroach.cpp +++ b/dlls/gearbox/shockroach.cpp @@ -31,7 +31,8 @@ LINK_ENTITY_TO_CLASS(monster_shockroach, CShockRoach); TYPEDESCRIPTION CShockRoach::m_SaveData[] = { - DEFINE_FIELD(CShockRoach, m_flDie, FIELD_TIME), + DEFINE_FIELD(CShockRoach, m_flBirthTime, FIELD_TIME), + DEFINE_FIELD(CShockRoach, m_fRoachSolid, FIELD_BOOLEAN), }; IMPLEMENT_SAVERESTORE(CShockRoach, CHeadCrab); @@ -75,7 +76,6 @@ void CShockRoach::Spawn() Precache(); SET_MODEL(ENT(pev), "models/w_shock_rifle.mdl"); - UTIL_SetSize(pev, Vector(-12, -12, 0), Vector(12, 12, 24)); pev->solid = SOLID_SLIDEBOX; pev->movetype = MOVETYPE_STEP; @@ -87,7 +87,8 @@ void CShockRoach::Spawn() m_flFieldOfView = 0.5;// indicates the width of this monster's forward view cone ( as a dotproduct result ) m_MonsterState = MONSTERSTATE_NONE; - m_flDie = gpGlobals->time + RANDOM_LONG(10, 15); + m_fRoachSolid = 0; + m_flBirthTime = gpGlobals->time; MonsterInit(); } @@ -152,7 +153,12 @@ void CShockRoach::LeapTouch(CBaseEntity *pOther) void CShockRoach::PrescheduleThink(void) { // explode when ready - if (gpGlobals->time >= m_flDie) + if (!m_fRoachSolid && m_flBirthTime + 0.2 >= gpGlobals->time) { + m_fRoachSolid = TRUE; + UTIL_SetSize(pev, Vector(-12, -12, 0), Vector(12, 12, 24)); + } + // explode when ready + if (gpGlobals->time >= m_flBirthTime + gSkillData.sroachLifespan) { pev->health = -1; Killed(pev, 0); diff --git a/dlls/gearbox/shockroach.h b/dlls/gearbox/shockroach.h index 7a9d0b02..1ecd5ea9 100644 --- a/dlls/gearbox/shockroach.h +++ b/dlls/gearbox/shockroach.h @@ -44,8 +44,9 @@ public: static const char *pDeathSounds[]; static const char *pBiteSounds[]; - float m_flDie; + float m_flBirthTime; + BOOL m_fRoachSolid; }; -#endif // SHOCKROACH_H \ No newline at end of file +#endif // SHOCKROACH_H