Browse Source

Add more mod-specific checks.

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

8
dlls/h_battery.cpp

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

8
dlls/healthkit.cpp

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

3
dlls/items.cpp

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

18
dlls/scientist.cpp

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

12
dlls/weapons.cpp

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

Loading…
Cancel
Save