Browse Source

Add mod-specific checks.

mobile_hacks
Andrey Akhmichin 5 years ago
parent
commit
ff08b8e96d
  1. 30
      cl_dll/ammo.cpp
  2. 4
      cl_dll/ammo_secondary.cpp
  3. 14
      cl_dll/ammohistory.cpp
  4. 4
      cl_dll/battery.cpp
  5. 1
      cl_dll/cl_util.h
  6. 9
      cl_dll/flashlight.cpp
  7. 12
      cl_dll/health.cpp
  8. 33
      cl_dll/hud.cpp
  9. 2
      cl_dll/hud.h
  10. 4
      cl_dll/hud_msg.cpp
  11. 4
      cl_dll/hud_spectator.cpp
  12. 4
      cl_dll/train.cpp
  13. 9
      dlls/agrunt.cpp
  14. 2
      dlls/buttons.cpp
  15. 5
      dlls/combat.cpp
  16. 7
      dlls/effects.cpp
  17. 4
      dlls/extdll.h
  18. 5
      dlls/game.cpp
  19. 3
      dlls/gamerules.cpp
  20. 51
      dlls/h_export.cpp
  21. 33
      dlls/items.cpp
  22. 3
      dlls/moddef.h
  23. 6
      dlls/player.cpp
  24. 14
      dlls/redempt/roy.cpp
  25. 5
      dlls/scientist.cpp
  26. 3
      dlls/scripted.cpp
  27. 2
      dlls/singleplay_gamerules.cpp
  28. 8
      dlls/tot/civ.cpp
  29. 7
      dlls/triggers.cpp

30
cl_dll/ammo.cpp

@ -866,7 +866,11 @@ int CHudAmmo::Draw( float flTime ) @@ -866,7 +866,11 @@ int CHudAmmo::Draw( float flTime )
if( m_fFade > 0 )
m_fFade -= ( (float)gHUD.m_flTimeDelta * 20.0f );
#ifdef MOBILE_HACKS
UnpackRGB( r, g, b, g_iHudColor );
#else // MOBILE_HACKS
UnpackRGB( r, g, b, RGB_YELLOWISH );
#endif // MOBILE_HACKS
ScaleColors( r, g, b, a );
@ -894,7 +898,11 @@ int CHudAmmo::Draw( float flTime ) @@ -894,7 +898,11 @@ int CHudAmmo::Draw( float flTime )
x += AmmoWidth / 2;
UnpackRGB( r,g,b, RGB_YELLOWISH );
#ifdef MOBILE_HACKS
UnpackRGB( r, g, b, g_iHudColor );
#else // MOBILE_HACKS
UnpackRGB( r, g, b, RGB_YELLOWISH );
#endif // MOBILE_HACKS
// draw the | bar
FillRGBA( x, y, iBarWidth, gHUD.m_iFontHeight, r, g, b, a );
@ -964,7 +972,11 @@ int DrawBar( int x, int y, int width, int height, float f ) @@ -964,7 +972,11 @@ int DrawBar( int x, int y, int width, int height, float f )
width -= w;
}
#ifdef MOBILE_HACKS
UnpackRGB( r, g, b, g_iHudColor );
#else // MOBILE_HACKS
UnpackRGB( r, g, b, RGB_YELLOWISH );
#endif // MOBILE_HACKS
FillRGBA( x, y, width, height, r, g, b, 128 );
@ -1032,7 +1044,11 @@ int CHudAmmo::DrawWList( float flTime ) @@ -1032,7 +1044,11 @@ int CHudAmmo::DrawWList( float flTime )
{
int iWidth;
#ifdef MOBILE_HACKS
UnpackRGB( r, g, b, g_iHudColor );
#else // MOBILE_HACKS
UnpackRGB( r, g, b, RGB_YELLOWISH );
#endif // MOBILE_HACKS
if( iActiveSlot == i )
a = 255;
@ -1083,7 +1099,11 @@ int CHudAmmo::DrawWList( float flTime ) @@ -1083,7 +1099,11 @@ int CHudAmmo::DrawWList( float flTime )
if( !p || !p->iId )
continue;
#ifdef MOBILE_HACKS
UnpackRGB( r, g, b, g_iHudColor );
#else // MOBILE_HACKS
UnpackRGB( r, g, b, RGB_YELLOWISH );
#endif // MOBILE_HACKS
// if active, then we must have ammo.
if( gpActiveSel == p )
@ -1120,7 +1140,11 @@ int CHudAmmo::DrawWList( float flTime ) @@ -1120,7 +1140,11 @@ int CHudAmmo::DrawWList( float flTime )
else
{
// Draw Row of weapons.
#ifdef MOBILE_HACKS
UnpackRGB( r, g, b, g_iHudColor );
#else // MOBILE_HACKS
UnpackRGB( r, g, b, RGB_YELLOWISH );
#endif // MOBILE_HACKS
for( int iPos = 0; iPos < MAX_WEAPON_POSITIONS; iPos++ )
{
@ -1131,7 +1155,11 @@ int CHudAmmo::DrawWList( float flTime ) @@ -1131,7 +1155,11 @@ int CHudAmmo::DrawWList( float flTime )
if( gWR.HasAmmo( p ) )
{
#ifdef MOBILE_HACKS
UnpackRGB( r, g, b, g_iHudColor );
#else // MOBILE_HACKS
UnpackRGB( r, g, b, RGB_YELLOWISH );
#endif // MOBILE_HACKS
a = 128;
}
else

4
cl_dll/ammo_secondary.cpp

@ -60,7 +60,11 @@ int CHudAmmoSecondary::Draw( float flTime ) @@ -60,7 +60,11 @@ int CHudAmmoSecondary::Draw( float flTime )
// draw secondary ammo icons above normal ammo readout
int a, x, y, r, g, b, AmmoWidth;
#ifdef MOBILE_HACKS
UnpackRGB( r, g, b, g_iHudColor );
#else // MOBILE_HACKS
UnpackRGB( r, g, b, RGB_YELLOWISH );
#endif // MOBILE_HACKS
a = (int)Q_max( MIN_ALPHA, m_fFade );
if( m_fFade > 0 )
m_fFade -= ( (float)gHUD.m_flTimeDelta * 20.0f ); // slowly lower alpha to fade out icons

14
cl_dll/ammohistory.cpp

@ -125,7 +125,11 @@ int HistoryResource::DrawAmmoHistory( float flTime ) @@ -125,7 +125,11 @@ int HistoryResource::DrawAmmoHistory( float flTime )
HSPRITE *spr = gWR.GetAmmoPicFromWeapon( rgAmmoHistory[i].iId, rcPic );
int r, g, b;
#ifdef MOBILE_HACKS
UnpackRGB( r, g, b, g_iHudColor );
#else // MOBILE_HACKS
UnpackRGB( r, g, b, RGB_YELLOWISH );
#endif // MOBILE_HACKS
float scale = ( rgAmmoHistory[i].DisplayTime - flTime ) * 80;
ScaleColors( r, g, b, Q_min( scale, 255 ) );
@ -152,7 +156,11 @@ int HistoryResource::DrawAmmoHistory( float flTime ) @@ -152,7 +156,11 @@ int HistoryResource::DrawAmmoHistory( float flTime )
return 1; // we don't know about the weapon yet, so don't draw anything
int r, g, b;
UnpackRGB( r,g,b, RGB_YELLOWISH );
#ifdef MOBILE_HACKS
UnpackRGB( r, g, b, g_iHudColor );
#else // MOBILE_HACKS
UnpackRGB( r, g, b, RGB_YELLOWISH );
#endif // MOBILE_HACKS
if( !gWR.HasAmmo( weap ) )
UnpackRGB( r, g, b, RGB_REDISH ); // if the weapon doesn't have ammo, display it as red
@ -174,7 +182,11 @@ int HistoryResource::DrawAmmoHistory( float flTime ) @@ -174,7 +182,11 @@ int HistoryResource::DrawAmmoHistory( float flTime )
wrect_t rect = gHUD.GetSpriteRect( rgAmmoHistory[i].iId );
#ifdef MOBILE_HACKS
UnpackRGB( r, g, b, g_iHudColor );
#else // MOBILE_HACKS
UnpackRGB( r, g, b, RGB_YELLOWISH );
#endif // MOBILE_HACKS
float scale = ( rgAmmoHistory[i].DisplayTime - flTime ) * 80;
ScaleColors( r, g, b, Q_min( scale, 255 ) );

4
cl_dll/battery.cpp

@ -80,7 +80,11 @@ int CHudBattery::Draw( float flTime ) @@ -80,7 +80,11 @@ int CHudBattery::Draw( float flTime )
rc = *m_prc2;
rc.top += m_iHeight * ( (float)( 100 - ( Q_min( 100, m_iBat ) ) ) * 0.01f ); // battery can go from 0 to 100 so * 0.01 goes from 0 to 1
#ifdef MOBILE_HACKS
UnpackRGB( r, g, b, g_iHudColor );
#else // MOBILE_HACKS
UnpackRGB( r, g, b, RGB_YELLOWISH );
#endif // MOBILE_HACKS
if( !( gHUD.m_iWeaponBits & ( 1 << ( WEAPON_SUIT ) ) ) )
return 1;

1
cl_dll/cl_util.h

@ -19,6 +19,7 @@ @@ -19,6 +19,7 @@
#define CL_UTIL_H
#include "exportdef.h"
#include "cvardef.h"
#include "moddef.h"
#ifndef TRUE
#define TRUE 1

9
cl_dll/flashlight.cpp

@ -112,7 +112,8 @@ int CHudFlashlight::Draw( float flTime ) @@ -112,7 +112,8 @@ int CHudFlashlight::Draw( float flTime )
return 1;
#ifdef MOBILE_HACKS
if( !( gHUD.m_iWeaponBits & ( 1 << ( WEAPON_FLASHLIGHT ) ) ) )
if( !( gHUD.m_iWeaponBits & ( 1 << ( WEAPON_SUIT ) ) )
|| ( g_iModType == MOD_INDUCTION && !( gHUD.m_iWeaponBits & ( 1 << ( WEAPON_FLASHLIGHT ) ) ) ) )
#else // MOBILE_HACKS
if( !( gHUD.m_iWeaponBits & ( 1 << ( WEAPON_SUIT ) ) ) )
#endif // MOBILE_HACKS
@ -126,7 +127,11 @@ int CHudFlashlight::Draw( float flTime ) @@ -126,7 +127,11 @@ int CHudFlashlight::Draw( float flTime )
if( m_flBat < 0.20f )
UnpackRGB( r,g,b, RGB_REDISH );
else
UnpackRGB( r,g,b, RGB_YELLOWISH );
#ifdef MOBILE_HACKS
UnpackRGB( r, g, b, g_iHudColor );
#else // MOBILE_HACKS
UnpackRGB( r, g, b, RGB_YELLOWISH );
#endif // MOBILE_HACKS
ScaleColors( r, g, b, a );

12
cl_dll/health.cpp

@ -166,7 +166,11 @@ void CHudHealth::GetPainColor( int &r, int &g, int &b ) @@ -166,7 +166,11 @@ void CHudHealth::GetPainColor( int &r, int &g, int &b )
#else
if( m_iHealth > 25 )
{
#ifdef MOBILE_HACKS
UnpackRGB( r, g, b, g_iHudColor );
#else // MOBILE_HACKS
UnpackRGB( r, g, b, RGB_YELLOWISH );
#endif // MOBILE_HACKS
}
else
{
@ -232,7 +236,11 @@ int CHudHealth::Draw( float flTime ) @@ -232,7 +236,11 @@ int CHudHealth::Draw( float flTime )
int iHeight = gHUD.m_iFontHeight;
int iWidth = HealthWidth / 10;
#ifdef MOBILE_HACKS
UnpackRGB( r, g, b, g_iHudColor );
#else // MOBILE_HACKS
UnpackRGB( r, g, b, RGB_YELLOWISH );
#endif // MOBILE_HACKS
FillRGBA( x, y, iWidth, iHeight, r, g, b, a );
}
@ -381,7 +389,11 @@ int CHudHealth::DrawDamage( float flTime ) @@ -381,7 +389,11 @@ int CHudHealth::DrawDamage( float flTime )
if( !m_bitsDamage )
return 1;
#ifdef MOBILE_HACKS
UnpackRGB( r, g, b, g_iHudColor );
#else // MOBILE_HACKS
UnpackRGB( r, g, b, RGB_YELLOWISH );
#endif // MOBILE_HACKS
a = (int)( fabs( sin( flTime * 2.0f ) ) * 256.0f );

33
cl_dll/hud.cpp

@ -28,6 +28,11 @@ @@ -28,6 +28,11 @@
#include "demo.h"
#include "demo_api.h"
#ifdef MOBILE_HACKS
int g_iModType;
int g_iHudColor;
#endif // MOBILE_HACKS
cvar_t *hud_textmode;
float g_hud_text_color[3];
@ -200,6 +205,34 @@ void CHud::Init( void ) @@ -200,6 +205,34 @@ void CHud::Init( void )
m_pSpriteList = NULL;
#ifdef MOBILE_HACKS
if( HUD_IsGame( "biglolly" ) )
{
g_iModType = MOD_BIGLOLLY;
g_iHudColor = PINKISH;
}
else if( HUD_IsGame( "bshift" ) )
{
g_iModType = MOD_BSHIFT;
g_iHudColor = BLUISH;
}
else if( HUD_IsGame( "halfsecret" ) )
{
g_iModType = MOD_HALFSECRET;
g_iHudColor = YELLOWISH;
}
else if( HUD_IsGame( "sewerbeta" ) )
{
g_iModType = MOD_SEWERBETA;
g_iHudColor = WHITISH;
}
else
{
g_iModType = MOD_VALVE;
g_iHudColor = YELLOWISH;
}
#endif // MOBILE_HACKS
// Clear any old HUD list
if( m_pHudList )
{

2
cl_dll/hud.h

@ -684,4 +684,6 @@ extern int g_iTeamNumber; @@ -684,4 +684,6 @@ extern int g_iTeamNumber;
extern int g_iUser1;
extern int g_iUser2;
extern int g_iUser3;
extern int g_iHudColor;
#endif

4
cl_dll/hud_msg.cpp

@ -120,7 +120,11 @@ int CHud::MsgFunc_Concuss( const char *pszName, int iSize, void *pbuf ) @@ -120,7 +120,11 @@ int CHud::MsgFunc_Concuss( const char *pszName, int iSize, void *pbuf )
m_iConcussionEffect = READ_BYTE();
if( m_iConcussionEffect )
{
#ifdef MOBILE_HACKS
UnpackRGB( r, g, b, g_iHudColor ); // Vit_amiN: fixed
#else // MOBILE_HACKS
UnpackRGB( r, g, b, RGB_YELLOWISH ); // Vit_amiN: fixed
#endif // MOBILE_HACKS
this->m_StatusIcons.EnableIcon( "dmg_concuss", r, g, b );
}
else

4
cl_dll/hud_spectator.cpp

@ -1113,7 +1113,11 @@ void CHudSpectator::DrawOverviewEntities() @@ -1113,7 +1113,11 @@ void CHudSpectator::DrawOverviewEntities()
z = m_OverviewData.layersHeights[0] * zScale;
// get yellow/brown HUD color
#ifdef MOBILE_HACKS
UnpackRGB( ir, ig, ib, g_iHudColor );
#else // MOBILE_HACKS
UnpackRGB( ir, ig, ib, RGB_YELLOWISH );
#endif // MOBILE_HACKS
r = (float)ir / 255.0f;
g = (float)ig / 255.0f;
b = (float)ib / 255.0f;

4
cl_dll/train.cpp

@ -53,7 +53,11 @@ int CHudTrain::Draw( float fTime ) @@ -53,7 +53,11 @@ int CHudTrain::Draw( float fTime )
{
int r, g, b, x, y;
#ifdef MOBILE_HACKS
UnpackRGB( r, g, b, g_iHudColor );
#else // MOBILE_HACKS
UnpackRGB( r, g, b, RGB_YELLOWISH );
#endif // MOBILE_HACKS
SPR_Set( m_hSprite, r, g, b );
// This should show up to the right and part way up the armor number

9
dlls/agrunt.cpp

@ -909,6 +909,11 @@ BOOL CAGrunt::FCanCheckAttacks( void ) @@ -909,6 +909,11 @@ BOOL CAGrunt::FCanCheckAttacks( void )
//=========================================================
BOOL CAGrunt::CheckMeleeAttack1( float flDot, float flDist )
{
#ifdef MOBILE_HACKS
if( g_iModType == MOD_AOM )
return FALSE;
#endif // MOBILE_HACKS
if( HasConditions( bits_COND_SEE_ENEMY ) && flDist <= AGRUNT_MELEE_DIST && flDot >= 0.6f && m_hEnemy != 0 )
{
return TRUE;
@ -1108,7 +1113,11 @@ Schedule_t *CAGrunt::GetSchedule( void ) @@ -1108,7 +1113,11 @@ Schedule_t *CAGrunt::GetSchedule( void )
return GetScheduleOfType( SCHED_RANGE_ATTACK1 );
}
#ifdef MOBILE_HACKS
if( g_iModType != MOD_AOM && OccupySlot ( bits_SLOT_AGRUNT_CHASE ) )
#else
if( OccupySlot ( bits_SLOT_AGRUNT_CHASE ) )
#endif
{
return GetScheduleOfType( SCHED_CHASE_ENEMY );
}

2
dlls/buttons.cpp

@ -1022,7 +1022,7 @@ void CMomentaryRotButton::KeyValue( KeyValueData *pkvd ) @@ -1022,7 +1022,7 @@ void CMomentaryRotButton::KeyValue( KeyValueData *pkvd )
{
m_returnSpeed = atof( pkvd->szValue );
#ifdef MOBILE_HACKS
if( m_returnSpeed > 45.0f )
if( g_iModType == MOD_REDEMPT && m_returnSpeed > 45.0f )
m_returnSpeed = 45.0f;
#endif // MOBILE_HACKS
pkvd->fHandled = TRUE;

5
dlls/combat.cpp

@ -522,6 +522,11 @@ void CBaseMonster::BecomeDead( void ) @@ -522,6 +522,11 @@ void CBaseMonster::BecomeDead( void )
BOOL CBaseMonster::ShouldGibMonster( int iGib )
{
#ifdef MOBILE_HACKS
if( g_iModType == MOD_AOM )
return FALSE;
#endif // MOBILE_HACKS
if( ( iGib == GIB_NORMAL && pev->health < GIB_HEALTH_VALUE ) || ( iGib == GIB_ALWAYS ) )
return TRUE;

7
dlls/effects.cpp

@ -2287,7 +2287,12 @@ public: @@ -2287,7 +2287,12 @@ public:
// BOOL m_fBeamsCleared;
};
LINK_ENTITY_TO_CLASS( env_warpball, CWarpBall )
// LINK_ENTITY_TO_CLASS( env_warpball, CWarpBall )
extern "C" EXPORT void env_warpball( entvars_t *pev )
{
if( g_iModType == MOD_BSHIFT )
GetClassPtr( (CWarpBall *)pev );
}
TYPEDESCRIPTION CWarpBall::m_SaveData[] =
{

4
dlls/extdll.h

@ -95,6 +95,10 @@ typedef float vec_t; // needed before including progdefs.h @@ -95,6 +95,10 @@ typedef float vec_t; // needed before including progdefs.h
// Shared header describing protocol between engine and DLLs
#include "eiface.h"
#ifdef MOBILE_HACKS
#include "moddef.h"
#endif // MOBILE_HACKS
// Shared header between the client DLL and the game DLLs
#include "cdll_dll.h"
#ifndef Q_min

5
dlls/game.cpp

@ -668,11 +668,14 @@ void GameDLLInit( void ) @@ -668,11 +668,14 @@ void GameDLLInit( void )
#ifdef MOBILE_HACKS
// Absolute Redemption
if( g_iModType == MOD_REDEMPT )
{
// Roy
CVAR_REGISTER( &sk_roy_health1 );// {"sk_roy_health1","0"};
CVAR_REGISTER( &sk_roy_health2 );// {"sk_roy_health2","0"};
CVAR_REGISTER( &sk_roy_health3 );// {"sk_roy_health3","0"};
#endif
}
#endif // MOBILE_HACKS
// Scientist
CVAR_REGISTER( &sk_scientist_health1 );// {"sk_scientist_health1","0"};

3
dlls/gamerules.cpp

@ -202,8 +202,11 @@ void CGameRules::RefreshSkillData ( void ) @@ -202,8 +202,11 @@ void CGameRules::RefreshSkillData ( void )
#ifdef MOBILE_HACKS
// Absolute Redeption
if( g_iModType == MOD_REDEMPT )
{
// Roy
gSkillData.royHealth = GetSkillCvar( "sk_roy_health" );
}
#endif // MOBILE_HACKS
// Scientist

51
dlls/h_export.cpp

@ -29,6 +29,9 @@ @@ -29,6 +29,9 @@
enginefuncs_t g_engfuncs;
globalvars_t *gpGlobals;
server_physics_api_t g_physfuncs;
#ifdef MOBILE_HACKS
int g_iModType;
#endif // MOBILE_HACKS
#ifdef _WIN32
@ -54,4 +57,52 @@ extern "C" void DLLEXPORT EXPORT2 GiveFnptrsToDll( enginefuncs_t *pengfuncsFromE @@ -54,4 +57,52 @@ extern "C" void DLLEXPORT EXPORT2 GiveFnptrsToDll( enginefuncs_t *pengfuncsFromE
{
memcpy( &g_engfuncs, pengfuncsFromEngine, sizeof(enginefuncs_t) );
gpGlobals = pGlobals;
#ifdef MOBILE_HACKS
char szGameFolder[64];
(*g_engfuncs.pfnGetGameDir)( szGameFolder );
if( FStrEq( szGameFolder, "aom" ) )
{
g_iModType = MOD_AOM;
}
else if( FStrEq( szGameFolder, "biglolly" ) )
{
g_iModType = MOD_BIGLOLLY;
}
else if( FStrEq( szGameFolder, "bshift" ) )
{
g_iModType = MOD_BSHIFT;
}
else if( FStrEq( szGameFolder, "halfsecret" ) )
{
g_iModType = MOD_HALFSECRET;
}
else if( FStrEq( szGameFolder, "borderlands" )
|| if( FStrEq( szGameFolder, "caseclosed" )
|| if( FStrEq( szGameFolder, "vendetta" ) )
{
g_ModType = MOD_HEVSUIT;
}
else if( FStrEq( szGameFolder, "induction" ) )
{
g_iModType = MOD_INDUCTION;
}
else if( FStrEq( szGameFolder, "redempt" ) )
{
g_iModType = MOD_REDEMPT;
}
else if( FStrEq( szGameFolder, "sewerbeta" ) )
{
g_iModType = MOD_SEWERBETA;
}
else if( FStrEq( szGameFolder, "tot" ) )
{
g_iModType = MOD_TOT;
}
else
{
g_iModType = MOD_VALVE;
}
#endif // MOBILE_HACKS
}

33
dlls/items.cpp

@ -238,7 +238,13 @@ class CItemArmorVest : public CItem @@ -238,7 +238,13 @@ class CItemArmorVest : public CItem
}
};
LINK_ENTITY_TO_CLASS( item_armorvest, CItemArmorVest )
// LINK_ENTITY_TO_CLASS( item_armorvest, CItemArmorVest )
extern "C" EXPORT void item_armorvest( entvars_t *pev )
{
if( g_iModType == MOD_BSHIFT )
GetClassPtr( (CItemArmorVest *)pev );
}
class CItemHelmet : public CItem
{
@ -272,7 +278,12 @@ class CItemHelmet : public CItem @@ -272,7 +278,12 @@ class CItemHelmet : public CItem
}
};
LINK_ENTITY_TO_CLASS( item_helmet, CItemHelmet )
// LINK_ENTITY_TO_CLASS( item_helmet, CItemHelmet )
extern "C" EXPORT void item_helmet( entvars_t *pev )
{
if( g_iModType == MOD_BSHIFT )
GetClassPtr( (CItemHelmet *)pev );
}
#endif // MOBILE_HACKS
class CItemBattery : public CItem
@ -286,6 +297,11 @@ class CItemBattery : public CItem @@ -286,6 +297,11 @@ class CItemBattery : public CItem
void Precache( void )
{
PRECACHE_MODEL( "models/w_battery.mdl" );
#ifdef MOBILE_HACKS
if( g_iModType == MOD_BIGLOLLY )
PRECACHE_SOUND( "items/smallmedkit1.wav" );
else
#endif // MOBILE_HACKS
PRECACHE_SOUND( "items/gunpickup2.wav" );
}
BOOL MyTouch( CBasePlayer *pPlayer )
@ -304,8 +320,14 @@ class CItemBattery : public CItem @@ -304,8 +320,14 @@ class CItemBattery : public CItem
pPlayer->pev->armorvalue += gSkillData.batteryCapacity;
pPlayer->pev->armorvalue = Q_min( pPlayer->pev->armorvalue, MAX_NORMAL_BATTERY );
#ifdef MOBILE_HACKS
if( g_iModType == MOD_BIGLOLLY )
EMIT_SOUND( pPlayer->edict(), CHAN_ITEM, "items/smallmedkit1.wav", 1, ATTN_NORM );
else
#endif // MOBILE_HACKS
EMIT_SOUND( pPlayer->edict(), CHAN_ITEM, "items/gunpickup2.wav", 1, ATTN_NORM );
MESSAGE_BEGIN( MSG_ONE, gmsgItemPickup, NULL, pPlayer->pev );
WRITE_STRING( STRING( pev->classname ) );
MESSAGE_END();
@ -399,7 +421,12 @@ class CItemFlashlight : public CItem @@ -399,7 +421,12 @@ class CItemFlashlight : public CItem
}
};
LINK_ENTITY_TO_CLASS( item_flashlight, CItemFlashlight )
// LINK_ENTITY_TO_CLASS( item_flashlight, CItemFlashlight )
extern "C" EXPORT void item_flashlight( entvars_t *pev )
{
if( g_iModType == MOD_INDUCTION )
GetClassPtr( (CItemFlashlight *)pev );
}
#endif // MOBILE_HACKS
class CItemLongJump : public CItem

3
dlls/moddef.h

@ -2,6 +2,8 @@ @@ -2,6 +2,8 @@
#ifndef MODDEF
#define MODDEF
extern int g_iModType;
enum
{
MOD_VALVE, // Half-Life
@ -11,7 +13,6 @@ enum @@ -11,7 +13,6 @@ enum
MOD_HALFSECRET, // Half-Secret
MOD_HEVSUIT, // Case Closed, Bloody Pizza: Vendetta, Borderlands
MOD_INDUCTION, // Half-Life: Induction
MOD_KLEINER // Kleiner's Adventures Demo
MOD_REDEMPT, // Redemption/Absolute Redemption
MOD_SEWER_BETA, // Sewer Beta
MOD_TOT // Times of Troubles

6
dlls/player.cpp

@ -3296,7 +3296,7 @@ void CBasePlayer::FlashlightTurnOn( void ) @@ -3296,7 +3296,7 @@ void CBasePlayer::FlashlightTurnOn( void )
}
#ifdef MOBILE_HACKS
if( (pev->weapons & ( 1 << WEAPON_FLASHLIGHT ) ) )
if( (pev->weapons & ( 1 << WEAPON_SUIT ) ) || ( g_iModType == MOD_INDUCTION && (pev->weapons & ( 1 << WEAPON_FLASHLIGHT ) ) ) )
#else // MOBILE_HACKS
if( (pev->weapons & ( 1 << WEAPON_SUIT ) ) )
#endif // MOBILE_HACKS
@ -3463,8 +3463,12 @@ void CBasePlayer::CheatImpulseCommands( int iImpulse ) @@ -3463,8 +3463,12 @@ void CBasePlayer::CheatImpulseCommands( int iImpulse )
gEvilImpulse101 = TRUE;
GiveNamedItem( "item_suit" );
#ifdef MOBILE_HACKS
if( g_iModType == BSHIFT )
{
GiveNamedItem( "item_armorvest" );
GiveNamedItem( "item_helmet" );
}
else
GiveNamedItem( "item_battery" );
#else // MOBILE_HACKS
GiveNamedItem( "item_battery" );

14
dlls/redempt/roy.cpp

@ -58,7 +58,12 @@ public: @@ -58,7 +58,12 @@ public:
void TalkInit( void );
};
LINK_ENTITY_TO_CLASS( monster_roy, CRoy )
// LINK_ENTITY_TO_CLASS( monster_roy, CRoy )
extern "C" EXPORT void monster_roy( entvars_t *pev )
{
if( g_iModType == MOD_REDEMPT )
GetClassPtr( (CRoy *)pev );
}
//=========================================================
// ALertSound - barney says "Freeze!"
@ -446,7 +451,12 @@ void CDeadRoy::KeyValue( KeyValueData *pkvd ) @@ -446,7 +451,12 @@ void CDeadRoy::KeyValue( KeyValueData *pkvd )
CBaseMonster::KeyValue( pkvd );
}
LINK_ENTITY_TO_CLASS( monster_roy_dead, CDeadRoy )
// LINK_ENTITY_TO_CLASS( monster_roy_dead, CDeadRoy )
extern "C" EXPORT void monster_roy_dead( entvars_t *pev )
{
if( g_iModType == MOD_REDEMPT )
GetClassPtr( (CDeadRoy *)pev );
}
//=========================================================
// ********** DeadRoy SPAWN **********

5
dlls/scientist.cpp

@ -62,6 +62,11 @@ enum @@ -62,6 +62,11 @@ enum
LINK_ENTITY_TO_CLASS( monster_scientist, CScientist )
#ifdef MOBILE_HACKS
LINK_ENTITY_TO_CLASS( monster_rosenberg, CScientist )
extern "C" EXPORT void monster_rosenberg( entvars_t *pev )
{
if( g_iModType == MOD_BSHIFT )
GetClassPtr( (CScientist *)pev );
}
#endif // MOBILE_HACKS
TYPEDESCRIPTION CScientist::m_SaveData[] =

3
dlls/scripted.cpp

@ -374,6 +374,9 @@ void CCineMonster::PossessEntity( void ) @@ -374,6 +374,9 @@ void CCineMonster::PossessEntity( void )
}
#ifdef MOBILE_HACKS
if( g_iModType != MOD_TOT )
return;
//
// Fix a bug where barney would not run to the osprey on map 7.
//

2
dlls/singleplay_gamerules.cpp

@ -127,6 +127,8 @@ float CHalfLifeRules::FlPlayerFallDamage( CBasePlayer *pPlayer ) @@ -127,6 +127,8 @@ float CHalfLifeRules::FlPlayerFallDamage( CBasePlayer *pPlayer )
void CHalfLifeRules::PlayerSpawn( CBasePlayer *pPlayer )
{
#ifdef MOBILE_HACKS
if( g_iModType == HEVSUIT
|| g_iModType == SEWERBETA )
pPlayer->GiveNamedItem( "item_suit" );
#endif // MOBILE_HACKS
}

8
dlls/tot/civ.cpp

@ -35,8 +35,12 @@ public: @@ -35,8 +35,12 @@ public:
BOOL CanHeal(void);
};
LINK_ENTITY_TO_CLASS(monster_civ, CCivScientist);
// LINK_ENTITY_TO_CLASS(monster_civ, CCivScientist);
extern "C" EXPORT void monster_civ( entvars_t *pev )
{
if( g_iModType == MOD_TOT )
GetClassPtr( (CCivScientist *)pev );
}
//=========================================================
// Spawn

7
dlls/triggers.cpp

@ -2047,7 +2047,12 @@ public: @@ -2047,7 +2047,12 @@ public:
int ObjectCaps( void ) { return CBaseDelay::ObjectCaps() & ~FCAP_ACROSS_TRANSITION; }
};
LINK_ENTITY_TO_CLASS( trigger_playerfreeze, CTriggerPlayerFreeze )
// LINK_ENTITY_TO_CLASS( trigger_playerfreeze, CTriggerPlayerFreeze )
extern "C" EXPORT void trigger_playerfreeze( entvars_t *pev )
{
if( g_iModType == MOD_BSHIFT || g_iModType == MOD_INDUCTION )
GetClassPtr( (CTriggerPlayerFreeze *)pev );
}
void CTriggerPlayerFreeze::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
{

Loading…
Cancel
Save