Browse Source

Add more mod-specific checks.

mobile_hacks
Andrey Akhmichin 5 years ago
parent
commit
680bbf3bbc
  1. 4
      dlls/h_battery.cpp
  2. 4
      dlls/healthkit.cpp
  3. 1
      dlls/items.cpp
  4. 18
      dlls/scientist.cpp
  5. 6
      dlls/weapons.cpp

4
dlls/h_battery.cpp

@ -101,6 +101,7 @@ void CRecharge::Spawn() @@ -101,6 +101,7 @@ void CRecharge::Spawn()
SET_MODEL( ENT( pev ), STRING( pev->model ) );
m_iJuice = (int)gSkillData.suitchargerCapacity;
#ifdef MOBILE_HACKS
if( g_iModType == MOD_TOT )
m_bTriggerable = !FStringNull( pev->target );
#endif // MOBILE_HACKS
pev->frame = 0;
@ -128,7 +129,7 @@ void CRecharge::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE use @@ -128,7 +129,7 @@ void CRecharge::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE use
{
pev->frame = 1;
#ifdef MOBILE_HACKS
if( m_bTriggerable )
if( g_iModType == MOD_TOT && m_bTriggerable )
{
FireTargets( STRING( pev->target ), pActivator, this, USE_TOGGLE, 0 );
m_bTriggerable = FALSE;
@ -189,6 +190,7 @@ void CRecharge::Recharge( void ) @@ -189,6 +190,7 @@ void CRecharge::Recharge( void )
{
m_iJuice = (int)gSkillData.suitchargerCapacity;
#ifdef MOBILE_HACKS
if( g_iModType == MOD_TOT )
m_bTriggerable = !FStringNull( pev->target );
#endif // MOBILE_HACKS
pev->frame = 0;

4
dlls/healthkit.cpp

@ -168,6 +168,7 @@ void CWallHealth::Spawn() @@ -168,6 +168,7 @@ void CWallHealth::Spawn()
SET_MODEL( ENT( pev ), STRING( pev->model ) );
m_iJuice = (int)gSkillData.healthchargerCapacity;
#ifdef MOBILE_HACKS
if( g_iModType == MOD_TOT )
m_bTriggerable = !FStringNull( pev->target );
#endif // MOBILE_HACKS
pev->frame = 0;
@ -193,7 +194,7 @@ void CWallHealth::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE u @@ -193,7 +194,7 @@ void CWallHealth::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE u
if( m_iJuice <= 0 )
{
#ifdef MOBILE_HACKS
if( m_bTriggerable )
if( g_iModType == MOD_TOT && m_bTriggerable )
{
FireTargets( STRING( pev->target ), pActivator, this, USE_TOGGLE, 0 );
m_bTriggerable = FALSE;
@ -249,6 +250,7 @@ void CWallHealth::Recharge( void ) @@ -249,6 +250,7 @@ void CWallHealth::Recharge( void )
EMIT_SOUND( ENT( pev ), CHAN_ITEM, "items/medshot4.wav", 1.0, ATTN_NORM );
m_iJuice = (int)gSkillData.healthchargerCapacity;
#ifdef MOBILE_HACKS
if( g_iModType == MOD_TOT )
m_bTriggerable = !FStringNull( pev->target );
#endif // MOBILE_HACKS
pev->frame = 0;

1
dlls/items.cpp

@ -72,6 +72,7 @@ void CWorldItem::Spawn( void ) @@ -72,6 +72,7 @@ void CWorldItem::Spawn( void )
break;
#ifdef MOBILE_HACKS
case 46: // ITEM_FLASHLIGHT:
if( g_iModType == MOD_TOT )
pEntity = CBaseEntity::Create( "item_flashlight", pev->origin, pev->angles );
break;
#endif // MOBILE_HACKS

18
dlls/scientist.cpp

@ -406,9 +406,11 @@ void CScientist::StartTask( Task_t *pTask ) @@ -406,9 +406,11 @@ void CScientist::StartTask( Task_t *pTask )
//if( FOkToSpeak() )
Talk( 2 );
m_hTalkTarget = m_hTargetEnt;
if( FClassnameIs( pev, "monster_rosenberg" ) )
#ifdef MOBILE_HACKS
if( g_iModType == MOD_BSHIFT && FClassnameIs( pev, "monster_rosenberg" ) )
PlaySentence( "RO_HEAL", 2, VOL_NORM, ATTN_IDLE );
else
#endif // MOBILE_HACKS
PlaySentence( "SC_HEAL", 2, VOL_NORM, ATTN_IDLE );
TaskComplete();
break;
@ -428,7 +430,7 @@ void CScientist::StartTask( Task_t *pTask ) @@ -428,7 +430,7 @@ void CScientist::StartTask( Task_t *pTask )
m_hTalkTarget = m_hEnemy;
#ifdef MOBILE_HACKS
if( FClassnameIs( pev, "monster_rosenberg" ) )
if( g_iModType == MOD_BSHIFT && FClassnameIs( pev, "monster_rosenberg" ) )
{
PlaySentence( "RO_FEAR", 5, VOL_NORM, ATTN_NORM );
}
@ -620,7 +622,7 @@ void CScientist::Spawn( void ) @@ -620,7 +622,7 @@ void CScientist::Spawn( void )
m_bloodColor = BLOOD_COLOR_RED;
#ifdef MOBILE_HACKS
if( FClassnameIs( pev, "monster_rosenberg" ) )
if( g_iModType == MOD_BSHIFT && FClassnameIs( pev, "monster_rosenberg" ) )
pev->health = gSkillData.scientistHealth * 2;
else
#endif // MOBILE_HACKS
@ -657,7 +659,7 @@ void CScientist::Precache( void ) @@ -657,7 +659,7 @@ void CScientist::Precache( void )
{
PRECACHE_MODEL( "models/scientist.mdl" );
#ifdef MOBILE_HACKS
if( !FClassnameIs( pev, "monster_rosenberg" ) )
if( g_iModType != MOD_BSHIFT || !FClassnameIs( pev, "monster_rosenberg" ) )
#endif // MOBILE_HACKS
{
PRECACHE_SOUND( "scientist/sci_pain1.wav" );
@ -695,7 +697,7 @@ void CScientist::TalkInit() @@ -695,7 +697,7 @@ void CScientist::TalkInit()
// scientists speach group names (group names are in sentences.txt)
#ifdef MOBILE_HACKS
if( FClassnameIs( pev, "monster_rosenberg" ) )
if( g_iModType == MOD_BSHIFT && FClassnameIs( pev, "monster_rosenberg" ) )
{
m_szGrp[TLK_ANSWER] = "RO_ANSWER";
m_szGrp[TLK_QUESTION] = "RO_QUESTION";
@ -769,7 +771,7 @@ int CScientist::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, flo @@ -769,7 +771,7 @@ int CScientist::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, flo
if( pevInflictor && pevInflictor->flags & FL_CLIENT )
{
#ifdef MOBILE_HACKS
if( !FClassnameIs( pev, "monster_rosenberg" ) )
if( g_iModType != MOD_BSHIFT && !FClassnameIs( pev, "monster_rosenberg" ) )
#endif // MOBILE_HACKS
{
Remember( bits_MEMORY_PROVOKED );
@ -806,7 +808,7 @@ void CScientist::PainSound( void ) @@ -806,7 +808,7 @@ void CScientist::PainSound( void )
m_painTime = gpGlobals->time + RANDOM_FLOAT( 0.5f, 0.75f );
#ifdef MOBILE_HACKS
if( FClassnameIs( pev, "monster_rosenberg" ) )
if( g_iModType == MOD_BSHIFT && FClassnameIs( pev, "monster_rosenberg" ) )
switch( RANDOM_LONG( 0, 8 ) )
{
case 0:
@ -1019,7 +1021,7 @@ Schedule_t *CScientist::GetSchedule( void ) @@ -1019,7 +1021,7 @@ Schedule_t *CScientist::GetSchedule( void )
return GetScheduleOfType( SCHED_TARGET_FACE ); // Just face and follow.
}
#ifdef MOBILE_HACKS
else if( !FClassnameIs( pev, "monster_rosenberg" ) ) // UNDONE: When afraid, scientist won't move out of your way. Keep This? If not, write move away scared
else if( g_iModType != MOD_BSHIFT || !FClassnameIs( pev, "monster_rosenberg" ) ) // UNDONE: When afraid, scientist won't move out of your way. Keep This? If not, write move away scared
#else // MOBILE_HACKS
else
#endif // MOBILE_HACKS

6
dlls/weapons.cpp

@ -297,13 +297,19 @@ void W_Precache( void ) @@ -297,13 +297,19 @@ void W_Precache( void )
UTIL_PrecacheOther( "item_suit" );
UTIL_PrecacheOther( "item_healthkit" );
#ifdef MOBILE_HACKS
if( g_iModType == MOD_BSHIFT )
{
UTIL_PrecacheOther( "item_armorvest" );
UTIL_PrecacheOther( "item_helmet" );
}
#endif // MOBILE_HACKS
UTIL_PrecacheOther( "item_battery" );
UTIL_PrecacheOther( "item_antidote" );
UTIL_PrecacheOther( "item_security" );
#ifdef MOBILE_HACKS
if( g_iModType == MOD_INDUCTION )
UTIL_PrecacheOther( "item_flashlight" );
#endif // MOBILE_HACKS
UTIL_PrecacheOther( "item_longjump" );
// shotgun

Loading…
Cancel
Save