Browse Source

Merge @malortie's patches for Poke646: Vendetta.

poke646_vendetta
Night Owl 8 years ago
parent
commit
4afee2372b
  1. 119
      cl_dll/ev_hldm.cpp
  2. 1
      cl_dll/ev_hldm.h
  3. 2
      cl_dll/health.cpp
  4. 4
      cl_dll/hl/hl_events.cpp
  5. 28
      cl_dll/hl/hl_weapons.cpp
  6. 1
      cl_dll/view.cpp
  7. 21
      dlls/barnacle.cpp
  8. 2
      dlls/cbase.h
  9. 5
      dlls/client.cpp
  10. 3
      dlls/combat.cpp
  11. 16
      dlls/func_break.cpp
  12. 10
      dlls/game.cpp
  13. 3
      dlls/gamerules.cpp
  14. 52
      dlls/hgrunt.cpp
  15. 69
      dlls/player.cpp
  16. 2
      dlls/skill.h
  17. 8
      dlls/triggers.cpp
  18. 324
      dlls/vendetta/par21.cpp
  19. 17
      dlls/weapons.cpp
  20. 34
      dlls/weapons.h

119
cl_dll/ev_hldm.cpp

@ -78,6 +78,8 @@ void EV_FireCmlwbr(struct event_args_s *args); @@ -78,6 +78,8 @@ void EV_FireCmlwbr(struct event_args_s *args);
void EV_SpinXS(struct event_args_s *args);
void EV_FireXS(struct event_args_s *args);
void EV_Reload(struct event_args_s *args);
void EV_FirePar21(struct event_args_s *args);
void EV_M203(struct event_args_s *args);
}
#define VECTOR_CONE_1DEGREES Vector( 0.00873, 0.00873, 0.00873 )
@ -371,6 +373,7 @@ void EV_HLDM_DecalGunshot( pmtrace_t *pTrace, int iBulletType ) @@ -371,6 +373,7 @@ void EV_HLDM_DecalGunshot( pmtrace_t *pTrace, int iBulletType )
case BULLET_PLAYER_BUCKSHOT:
case BULLET_PLAYER_357:
//case BULLET_PLAYER_NAIL:
case BULLET_PLAYER_PAR21:
default:
// smoke and decal
EV_HLDM_GunshotDecalTrace( pTrace, EV_HLDM_DamageDecal( pe ) );
@ -411,6 +414,7 @@ int EV_HLDM_CheckTracer( int idx, float *vecSrc, float *end, float *forward, flo @@ -411,6 +414,7 @@ int EV_HLDM_CheckTracer( int idx, float *vecSrc, float *end, float *forward, flo
{
case BULLET_PLAYER_MP5:
case BULLET_PLAYER_NAIL:
case BULLET_PLAYER_PAR21:
case BULLET_MONSTER_MP5:
case BULLET_MONSTER_9MM:
case BULLET_MONSTER_12MM:
@ -510,6 +514,13 @@ void EV_HLDM_FireBullets( int idx, float *forward, float *right, float *up, int @@ -510,6 +514,13 @@ void EV_HLDM_FireBullets( int idx, float *forward, float *right, float *up, int
// EV_HLDM_DecalGunshot( &tr, iBulletType );
}
break;
case BULLET_PLAYER_PAR21:
if( !tracer )
{
EV_HLDM_PlayTextureSound( idx, &tr, vecSrc, vecEnd, iBulletType );
EV_HLDM_DecalGunshot( &tr, iBulletType );
}
break;
}
}
@ -1825,7 +1836,7 @@ enum bradnailer_e @@ -1825,7 +1836,7 @@ enum bradnailer_e
BRADNAILER_ADD_SILENCER,
BRADNAILER_UPRIGHT_TO_TILT,
BRADNAILER_TILT_TO_UPRIGHT,
BRADNAILER_FASTSHOOT,
BRADNAILER_FASTSHOOT
};
void EV_FireBradnailer( event_args_t *args )
@ -1891,7 +1902,7 @@ enum nailgun_e @@ -1891,7 +1902,7 @@ enum nailgun_e
NAILGUN_FIRE3,
NAILGUN_DEPLOY_EMPTY,
NAILGUN_LONGIDLE_EMPTY,
NAILGUN_IDLE1_EMPTY,
NAILGUN_IDLE1_EMPTY
};
void EV_FireNailgun( event_args_t *args )
@ -1950,7 +1961,7 @@ enum cmlwbr_e @@ -1950,7 +1961,7 @@ enum cmlwbr_e
CMLWBR_DRAW1, // drawn
CMLWBR_DRAW2, // undrawn
CMLWBR_HOLSTER1, // drawn
CMLWBR_HOLSTER2, // undrawn
CMLWBR_HOLSTER2 // undrawn
};
//TODO: Fully predict the fliying bolt.
@ -1990,7 +2001,7 @@ enum xensquasher_e @@ -1990,7 +2001,7 @@ enum xensquasher_e
XS_FIRE2,
XS_HOLSTER,
XS_DRAW,
XS_RELOAD,
XS_RELOAD
};
void EV_SpinXS( event_args_t *args )
@ -2105,3 +2116,103 @@ void EV_Reload( event_args_t *args ) @@ -2105,3 +2116,103 @@ void EV_Reload( event_args_t *args )
//======================
// RELOAD END
//======================
//======================
// PAR21 START
//======================
enum par21_e
{
PAR21_LONGIDLE = 0,
PAR21_IDLE1,
PAR21_LAUNCH,
PAR21_RELOAD,
PAR21_DEPLOY,
PAR21_FIRE1,
PAR21_FIRE2,
PAR21_FIRE3
};
void EV_FirePar21( struct event_args_s *args )
{
int idx;
vec3_t origin;
vec3_t angles;
vec3_t velocity;
vec3_t ShellVelocity;
vec3_t ShellOrigin;
int shell;
vec3_t vecSrc, vecAiming;
vec3_t up, right, forward;
float flSpread = 0.01;
idx = args->entindex;
VectorCopy( args->origin, origin );
VectorCopy( args->angles, angles );
VectorCopy( args->velocity, velocity );
AngleVectors( angles, forward, right, up );
shell = gEngfuncs.pEventAPI->EV_FindModelIndex( "models/shell.mdl" );// brass shell
if( EV_IsLocal( idx ) )
{
// Add muzzle flash to current weapon model
EV_MuzzleFlash();
gEngfuncs.pEventAPI->EV_WeaponAnimation( PAR21_FIRE1 + gEngfuncs.pfnRandomLong( 0, 2 ), 2 );
V_PunchAxis( 0, gEngfuncs.pfnRandomFloat( -2, 2 ) );
}
EV_GetDefaultShellInfo( args, origin, velocity, ShellVelocity, ShellOrigin, forward, right, up, 20, -12, 4 );
EV_EjectBrass( ShellOrigin, ShellVelocity, angles[YAW], shell, TE_BOUNCE_SHELL );
switch( gEngfuncs.pfnRandomLong( 0, 2 ) )
{
case 0:
gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON, "weapons/par21_1.wav", 1, ATTN_NORM, 0, 94 + gEngfuncs.pfnRandomLong( 0, 0xf ) );
break;
case 1:
gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON, "weapons/par21_2.wav", 1, ATTN_NORM, 0, 94 + gEngfuncs.pfnRandomLong( 0, 0xf ) );
break;
case 2:
gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON, "weapons/par21_3.wav", 1, ATTN_NORM, 0, 94 + gEngfuncs.pfnRandomLong( 0, 0xf ) );
break;
}
EV_GetGunPosition( args, vecSrc, origin );
VectorCopy( forward, vecAiming );
EV_HLDM_FireBullets( idx, forward, right, up, 1, vecSrc, vecAiming, 8192, BULLET_PLAYER_PAR21, 2, &tracerCount[idx - 1], args->fparam1, args->fparam2 );
}
void EV_M203( struct event_args_s *args )
{
int idx;
vec3_t origin;
idx = args->entindex;
VectorCopy( args->origin, origin );
if( EV_IsLocal( idx ) )
{
gEngfuncs.pEventAPI->EV_WeaponAnimation( PAR21_LAUNCH, 2 );
V_PunchAxis( 0, -10 );
}
switch( gEngfuncs.pfnRandomLong( 0, 1 ) )
{
case 0:
gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON, "weapons/glauncher.wav", 1, ATTN_NORM, 0, 94 + gEngfuncs.pfnRandomLong( 0, 0xf ) );
break;
case 1:
gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON, "weapons/glauncher2.wav", 1, ATTN_NORM, 0, 94 + gEngfuncs.pfnRandomLong( 0, 0xf ) );
break;
}
}
//======================
// PAR21 END
//======================

1
cl_dll/ev_hldm.h

@ -19,6 +19,7 @@ typedef enum @@ -19,6 +19,7 @@ typedef enum
BULLET_PLAYER_CROWBAR, // crowbar swipe
BULLET_PLAYER_NAIL, // nails
BULLET_PLAYER_XS, // xen squasher
BULLET_PLAYER_PAR21, // par21
BULLET_MONSTER_9MM,
BULLET_MONSTER_MP5,
BULLET_MONSTER_12MM

2
cl_dll/health.cpp

@ -61,7 +61,7 @@ int CHudHealth::Init( void ) @@ -61,7 +61,7 @@ int CHudHealth::Init( void )
{
HOOK_MESSAGE( Health );
HOOK_MESSAGE( Damage );
m_iHealth = 50;
m_iHealth = 100;
m_fFade = 0;
m_iFlags = 0;
m_bitsDamage = 0;

4
cl_dll/hl/hl_events.cpp

@ -48,6 +48,8 @@ void EV_FireCmlwbr( struct event_args_s *args ); @@ -48,6 +48,8 @@ void EV_FireCmlwbr( struct event_args_s *args );
void EV_SpinXS( struct event_args_s *args );
void EV_FireXS( struct event_args_s *args );
void EV_Reload( struct event_args_s *args );
void EV_FirePar21( struct event_args_s *args );
void EV_M203( struct event_args_s *args );
}
/*
@ -92,4 +94,6 @@ void Game_HookEvents( void ) @@ -92,4 +94,6 @@ void Game_HookEvents( void )
gEngfuncs.pfnHookEvent( "events/xsspin.sc", EV_SpinXS );
gEngfuncs.pfnHookEvent( "events/xs.sc", EV_FireXS );
gEngfuncs.pfnHookEvent( "events/reload.sc", EV_Reload );
gEngfuncs.pfnHookEvent( "events/par21.sc", EV_FirePar21 );
gEngfuncs.pfnHookEvent( "events/m203.sc", EV_M203 );
}

28
cl_dll/hl/hl_weapons.cpp

@ -57,9 +57,7 @@ CHeaterPipe g_HeaterPipe; @@ -57,9 +57,7 @@ CHeaterPipe g_HeaterPipe;
CCmlwbr g_Cmlwbr;
CShotgun g_Shotgun;
CPipeBomb g_PipeBomb;
CBradnailer g_Bradnailer;
CNailgun g_Nailgun;
CXenSquasher g_Xs;
CPar21 g_Par21;
/*
======================
AlertMessage
@ -619,9 +617,7 @@ void HUD_InitClientWeapons( void ) @@ -619,9 +617,7 @@ void HUD_InitClientWeapons( void )
HUD_PrepEntity( &g_Shotgun, &player );
HUD_PrepEntity( &g_Cmlwbr, &player );
HUD_PrepEntity( &g_PipeBomb, &player );
HUD_PrepEntity( &g_Bradnailer, &player );
HUD_PrepEntity( &g_Nailgun, &player );
HUD_PrepEntity( &g_Xs, &player );
HUD_PrepEntity( &g_Par21, &player );
}
/*
@ -697,14 +693,8 @@ void HUD_WeaponsPostThink( local_state_s *from, local_state_s *to, usercmd_t *cm @@ -697,14 +693,8 @@ void HUD_WeaponsPostThink( local_state_s *from, local_state_s *to, usercmd_t *cm
case WEAPON_PIPEBOMB:
pWeapon = &g_PipeBomb;
break;
case WEAPON_BRADNAILER:
pWeapon = &g_Bradnailer;
break;
case WEAPON_NAILGUN:
pWeapon = &g_Nailgun;
break;
case WEAPON_XS:
pWeapon = &g_Xs;
case WEAPON_PAR21:
pWeapon = &g_Par21;
break;
}
@ -818,6 +808,11 @@ void HUD_WeaponsPostThink( local_state_s *from, local_state_s *to, usercmd_t *cm @@ -818,6 +808,11 @@ void HUD_WeaponsPostThink( local_state_s *from, local_state_s *to, usercmd_t *cm
{
player.ammo_xencandy = (int)from->client.vuser2[1];
}
else if( player.m_pActiveItem->m_iId == WEAPON_PAR21 )
{
player.ammo_par21 = (int)from->client.vuser2[1];
player.ammo_m203grens = (int)from->client.vuser2[2];
}
// Don't go firing anything if we have died.
// Or if we don't have a weapon model deployed
@ -889,6 +884,11 @@ void HUD_WeaponsPostThink( local_state_s *from, local_state_s *to, usercmd_t *cm @@ -889,6 +884,11 @@ void HUD_WeaponsPostThink( local_state_s *from, local_state_s *to, usercmd_t *cm
{
from->client.vuser2[1] = player.ammo_xencandy;
}
else if( player.m_pActiveItem->m_iId == WEAPON_PAR21 )
{
from->client.vuser2[1] = player.ammo_par21;
from->client.vuser2[2] = player.ammo_m203grens;
}
// Make sure that weapon animation matches what the game .dll is telling us
// over the wire ( fixes some animation glitches )

1
cl_dll/view.cpp

@ -1313,6 +1313,7 @@ int V_FindViewModelByWeaponModel( int weaponindex ) @@ -1313,6 +1313,7 @@ int V_FindViewModelByWeaponModel( int weaponindex )
{ "models/p_cmlwbr.mdl", "models/v_cmlwbr.mdl" },
{ "models/p_heaterpipe.mdl", "models/v_heaterpipe.mdl" },
{ "models/p_nailgun.mdl", "models/v_nailgun.mdl" },
{ "models/p_par21.mdl", "models/v_par21.mdl" },
{ "models/p_pipebomb.mdl", "models/v_pipebomb.mdl" },
{ "models/p_pipebomb_watch.mdl","models/v_pipebomb_watch.mdl" },
{ "models/p_shotgun.mdl", "models/v_shotgun.mdl" },

21
dlls/barnacle.cpp

@ -22,7 +22,6 @@ @@ -22,7 +22,6 @@
#include "monsters.h"
#include "schedule.h"
#define SF_BARNACLE_SPAWN_XENCANDY 1
#define BARNACLE_BODY_HEIGHT 44 // how 'tall' the barnacle's model is.
#define BARNACLE_PULL_SPEED 8
#define BARNACLE_KILL_VICTIM_DELAY 5 // how many seconds after pulling prey in to gib them.
@ -55,7 +54,6 @@ public: @@ -55,7 +54,6 @@ public:
BOOL m_fTongueExtended;
BOOL m_fLiftingPrey;
float m_flTongueAdj;
BOOL m_fXenCandySpawned;
// FIXME: need a custom barnacle model with non-generic hitgroup
// otherwise we can apply to damage to tongue instead of body
@ -104,23 +102,6 @@ void CBarnacle::HandleAnimEvent( MonsterEvent_t *pEvent ) @@ -104,23 +102,6 @@ void CBarnacle::HandleAnimEvent( MonsterEvent_t *pEvent )
{
case BARNACLE_AE_PUKEGIB:
CGib::SpawnRandomGibs( pev, 1, 1 );
if( ( pev->spawnflags & SF_BARNACLE_SPAWN_XENCANDY ) && !m_fXenCandySpawned )
{
Vector vecSrc = pev->origin + Vector( 0, 0, -16 );
Vector vecAngles = pev->angles;
vecAngles.x = vecAngles.z = 0;
vecAngles.y = RANDOM_LONG(0, 36) * 10;
CBaseEntity*pItem = DropItem( "ammo_xencandy", vecSrc, vecAngles );
if( pItem )
{
pItem->pev->owner = edict();
m_fXenCandySpawned = TRUE;
}
}
break;
default:
CBaseMonster::HandleAnimEvent( pEvent );
@ -435,8 +416,6 @@ void CBarnacle::Precache() @@ -435,8 +416,6 @@ void CBarnacle::Precache()
PRECACHE_SOUND( "barnacle/bcl_chew3.wav" );
PRECACHE_SOUND( "barnacle/bcl_die1.wav" );
PRECACHE_SOUND( "barnacle/bcl_die3.wav" );
UTIL_PrecacheOther( "ammo_xencandy" );
}
//=========================================================

2
dlls/cbase.h

@ -342,6 +342,8 @@ public: @@ -342,6 +342,8 @@ public:
int ammo_argrens;
int ammo_nails;
int ammo_xencandy;
int ammo_par21;
int ammo_m203grens;
//Special stuff for grenades and satchels.
float m_flStartThrow;

5
dlls/client.cpp

@ -1628,6 +1628,11 @@ void UpdateClientData( const struct edict_s *ent, int sendweapons, struct client @@ -1628,6 +1628,11 @@ void UpdateClientData( const struct edict_s *ent, int sendweapons, struct client
{
cd->vuser2.y = pl->ammo_xencandy;
}
else if( pl->m_pActiveItem->m_iId == WEAPON_PAR21 )
{
cd->vuser2.y = pl->ammo_par21;
cd->vuser2.z = pl->ammo_m203grens;
}
}
}
}

3
dlls/combat.cpp

@ -1548,6 +1548,9 @@ Vector CBaseEntity::FireBulletsPlayer( ULONG cShots, Vector vecSrc, Vector vecDi @@ -1548,6 +1548,9 @@ Vector CBaseEntity::FireBulletsPlayer( ULONG cShots, Vector vecSrc, Vector vecDi
case BULLET_PLAYER_NAIL:
pEntity->TraceAttack( pevAttacker, 0, vecDir, &tr, DMG_BULLET );
break;
case BULLET_PLAYER_PAR21:
pEntity->TraceAttack( pevAttacker, gSkillData.plrDmgPar21, vecDir, &tr, DMG_BULLET );
break;
}
}
// make bullet trails

16
dlls/func_break.cpp

@ -39,22 +39,22 @@ const char *CBreakable::pSpawnObjects[] = @@ -39,22 +39,22 @@ const char *CBreakable::pSpawnObjects[] =
NULL, // 0
"item_healthkit", // 1
"item_healthkit", // 2
"weapon_bradnailer", // 3
"ammo_nailclip", // 4
"weapon_nailgun", // 5
"ammo_nailround", // 6
"weapon_9mmhandgun", // 3
"ammo_9mmclip", // 4
"weapon_9mmAR", // 5
"ammo_9mmAR", // 6
"weapon_cmlwbr", // 7
"ammo_bolts", // 8
"weapon_shotgun", // 8
"weapon_shotgun", // 9
"ammo_buckshot", // 10
"weapon_crossbow", // 10
"ammo_crossbow", // 11
"weapon_357", // 12
"ammo_357", // 13
"weapon_rpg", // 14
"weapon_pipebomb", // 15
"ammo_gaussclip", // 16
"weapon_handgrenade", // 17
"weapon_tripmine", // 18
"ammo_par21_clip", // 17
"ammo_m203grenade", // 18
"weapon_satchel", // 19
"weapon_snark", // 20
"weapon_hornetgun", // 21

10
dlls/game.cpp

@ -461,6 +461,11 @@ cvar_t sk_plr_nail1 = { "sk_plr_nail1", "0" }; @@ -461,6 +461,11 @@ cvar_t sk_plr_nail1 = { "sk_plr_nail1", "0" };
cvar_t sk_plr_nail2 = { "sk_plr_nail2", "0" };
cvar_t sk_plr_nail3 = { "sk_plr_nail3", "0" };
// Par21 Round
cvar_t sk_plr_par21_bullet1 = { "sk_plr_par21_bullet1", "0" };
cvar_t sk_plr_par21_bullet2 = { "sk_plr_par21_bullet2", "0" };
cvar_t sk_plr_par21_bullet3 = { "sk_plr_par21_bullet3", "0" };
// END Cvars for Skill Level settings
// Register your console variables here
@ -891,6 +896,11 @@ void GameDLLInit( void ) @@ -891,6 +896,11 @@ void GameDLLInit( void )
CVAR_REGISTER( &sk_plr_nail2 );
CVAR_REGISTER( &sk_plr_nail3 );
// Par21 Round
CVAR_REGISTER( &sk_plr_par21_bullet1 );
CVAR_REGISTER( &sk_plr_par21_bullet2 );
CVAR_REGISTER( &sk_plr_par21_bullet3 );
// END REGISTER CVARS FOR SKILL LEVEL STUFF
SERVER_COMMAND( "exec skill.cfg\n" );

3
dlls/gamerules.cpp

@ -310,6 +310,9 @@ void CGameRules::RefreshSkillData ( void ) @@ -310,6 +310,9 @@ void CGameRules::RefreshSkillData ( void )
// Nails
gSkillData.plrDmgNail = GetSkillCvar( "sk_plr_nail" );
// Par21
gSkillData.plrDmgPar21 = GetSkillCvar( "sk_plr_par21_bullet" );
}
//=========================================================

52
dlls/hgrunt.cpp

@ -275,6 +275,39 @@ int CHGrunt::IRelationship( CBaseEntity *pTarget ) @@ -275,6 +275,39 @@ int CHGrunt::IRelationship( CBaseEntity *pTarget )
//=========================================================
void CHGrunt::GibMonster( void )
{
Vector vecGunPos;
Vector vecGunAngles;
if( GetBodygroup(2) != 2 )
{
// throw a gun if the grunt has one
GetAttachment( 0, vecGunPos, vecGunAngles );
CBaseEntity *pGun;
// Only drop items such as par21 and m203 grenades
if( FBitSet( pev->weapons, HGRUNT_9MMAR ) )
{
pGun = DropItem( "weapon_par21", vecGunPos, vecGunAngles );
}
if( pGun )
{
pGun->pev->velocity = Vector( RANDOM_FLOAT( -100, 100 ), RANDOM_FLOAT( -100, 100 ), RANDOM_FLOAT( 200, 300 ) );
pGun->pev->avelocity = Vector( 0, RANDOM_FLOAT( 200, 400 ), 0 );
}
if( FBitSet( pev->weapons, HGRUNT_GRENADELAUNCHER ) )
{
pGun = DropItem( "ammo_m203grenade", vecGunPos, vecGunAngles );
if( pGun )
{
pGun->pev->velocity = Vector( RANDOM_FLOAT( -100, 100 ), RANDOM_FLOAT( -100, 100 ), RANDOM_FLOAT( 200, 300 ) );
pGun->pev->avelocity = Vector( 0, RANDOM_FLOAT( 200, 400 ), 0 );
}
}
}
CBaseMonster::GibMonster();
}
@ -812,6 +845,25 @@ void CHGrunt::HandleAnimEvent( MonsterEvent_t *pEvent ) @@ -812,6 +845,25 @@ void CHGrunt::HandleAnimEvent( MonsterEvent_t *pEvent )
switch( pEvent->event )
{
case HGRUNT_AE_DROP_GUN:
Vector vecGunPos;
Vector vecGunAngles;
GetAttachment( 0, vecGunPos, vecGunAngles );
// switch to body group with no gun.
SetBodygroup( GUN_GROUP, GUN_NONE );
// now spawn a gun.
// Only drop items such as par21 and m203 grenades
if( FBitSet( pev->weapons, HGRUNT_9MMAR ) )
{
DropItem( "weapon_par21", vecGunPos, vecGunAngles );
}
if( FBitSet( pev->weapons, HGRUNT_GRENADELAUNCHER ) )
{
DropItem( "ammo_m203grenade", BodyTarget( pev->origin ), vecGunAngles );
}
break;
case HGRUNT_AE_RELOAD:
EMIT_SOUND( ENT( pev ), CHAN_WEAPON, "hgrunt/gr_reload1.wav", 1, ATTN_NORM );

69
dlls/player.cpp

@ -1118,6 +1118,8 @@ void CBasePlayer::TabulateAmmo() @@ -1118,6 +1118,8 @@ void CBasePlayer::TabulateAmmo()
ammo_hornets = AmmoInventory( GetAmmoIndex( "Hornets" ) );
ammo_nails = AmmoInventory( GetAmmoIndex( "nails" ) );
ammo_xencandy = AmmoInventory( GetAmmoIndex( "xencandy" ) );
ammo_par21 = AmmoInventory( GetAmmoIndex( "par21" ) );
ammo_m203grens = AmmoInventory( GetAmmoIndex( "M203grenades" ) );
}
/*
@ -1871,54 +1873,50 @@ void CBasePlayer::PreThink( void ) @@ -1871,54 +1873,50 @@ void CBasePlayer::PreThink( void )
{
if( !m_bSong01_Played )
{
if( FStrEq( STRING( gpGlobals->mapname ), "po_haz01" ) )
if( FStrEq( STRING( gpGlobals->mapname ), "pv_intro" ) )
{
CLIENT_COMMAND( edict(), "play sound/mp3/hazard.mp3\n" );
CLIENT_COMMAND( edict(), "play sound/mp3/int.mp3\n" );
m_bSong01_Played = TRUE;
}
}
if( !m_bSong02_Played )
{
if( FStrEq( STRING( gpGlobals->mapname ), "po_aud01" ) )
if( FStrEq( STRING( gpGlobals->mapname ), "pv_orl01" ) )
{
CLIENT_COMMAND( edict(), "play sound/mp3/audion.mp3\n" );
CLIENT_COMMAND( edict(), "play sound/mp3/orl.mp3\n" );
m_bSong02_Played = TRUE;
}
}
if( !m_bSong03_Played )
{
if( FStrEq( STRING( gpGlobals->mapname ), "po_sew01" ) )
if( FStrEq( STRING( gpGlobals->mapname ), "pv_ntc01" ) )
{
CLIENT_COMMAND( edict(), "play sound/mp3/sewer.mp3\n" );
CLIENT_COMMAND( edict(), "play sound/mp3/ntc.mp3\n" );
m_bSong03_Played = TRUE;
}
}
if( !m_bSong04_Played )
{
if( FStrEq( STRING( gpGlobals->mapname ), "po_lib01" ) )
if( FStrEq( STRING( gpGlobals->mapname ), "pv_ntc05" ) )
{
CLIENT_COMMAND( edict(), "play sound/mp3/library.mp3\n" );
CLIENT_COMMAND( edict(), "play sound/mp3/asl.mp3\n" );
m_bSong04_Played = TRUE;
}
}
if( !m_bSong05_Played )
{
if( FStrEq( STRING( gpGlobals->mapname ), "po_eas01" ) )
if( FStrEq( STRING( gpGlobals->mapname ), "pv_outro" ) )
{
CLIENT_COMMAND( edict(), "play sound/mp3/eastend.mp3\n" );
CLIENT_COMMAND( edict(), "play sound/mp3/out.mp3\n" );
m_bSong05_Played = TRUE;
}
}
if( !m_bSong06_Played )
{
if( FStrEq( STRING( gpGlobals->mapname ), "credits" ) )
{
CLIENT_COMMAND( edict(), "play sound/mp3/credits.mp3\n" );
m_bSong06_Played = TRUE;
}
}
}
}
/* Time based Damage works as follows:
1) There are several types of timebased damage:
@ -2024,6 +2022,7 @@ void CBasePlayer::CheckTimeBasedDamage() @@ -2024,6 +2022,7 @@ void CBasePlayer::CheckTimeBasedDamage()
bDuration = NERVEGAS_DURATION;
break;
case itbd_Poison:
TakeDamage( pev, pev, POISON_DAMAGE, DMG_GENERIC );
bDuration = POISON_DURATION;
break;
case itbd_Radiation:
@ -2686,12 +2685,12 @@ ReturnSpot: @@ -2686,12 +2685,12 @@ ReturnSpot:
void CBasePlayer::Spawn( void )
{
pev->classname = MAKE_STRING( "player" );
pev->health = 50;
pev->health = 100;
pev->armorvalue = 0;
pev->takedamage = DAMAGE_AIM;
pev->solid = SOLID_SLIDEBOX;
pev->movetype = MOVETYPE_WALK;
pev->max_health = 100;
pev->max_health = pev->health;
pev->flags &= FL_PROXY; // keep proxy flag sey by engine
pev->flags |= FL_CLIENT;
pev->air_finished = gpGlobals->time + 12;
@ -3357,12 +3356,10 @@ void CBasePlayer::CheatImpulseCommands( int iImpulse ) @@ -3357,12 +3356,10 @@ void CBasePlayer::CheatImpulseCommands( int iImpulse )
GiveNamedItem( "weapon_cmlwbr" );
GiveNamedItem( "ammo_bolts" );
GiveNamedItem( "weapon_pipebomb" );
GiveNamedItem( "weapon_bradnailer" );
GiveNamedItem( "ammo_nailclip" );
GiveNamedItem( "ammo_nailround" );
GiveNamedItem( "weapon_nailgun" );
GiveNamedItem( "weapon_xs" );
GiveNamedItem( "ammo_xencandy" );
GiveNamedItem( "weapon_par21" );
GiveNamedItem( "ammo_par21_clip" );
GiveNamedItem( "ammo_par21_grenade" );
GiveNamedItem( "ammo_m203grenade" );
gEvilImpulse101 = FALSE;
break;
@ -3775,19 +3772,7 @@ void CBasePlayer::UpdateClientData( void ) @@ -3775,19 +3772,7 @@ void CBasePlayer::UpdateClientData( void )
//
if( !( pev->weapons & ( 1 << WEAPON_SUIT ) ) )
{
if( FStrEq( STRING( gpGlobals->mapname ), "po_haz01" ) )
{
pev->weapons |= ( 1 << WEAPON_SUIT );
// Force HUD update.
m_fHudVisible = TRUE;
//
// Make HUD completely transparent.
//
HidePlayerHUD( TRUE );
}
else if( FStrEq( STRING( gpGlobals->mapname ), "po_aud01" ) )
if( FStrEq( STRING( gpGlobals->mapname ), "pv_orl01" ) )
{
pev->weapons |= ( 1 << WEAPON_SUIT );
@ -3796,15 +3781,6 @@ void CBasePlayer::UpdateClientData( void ) @@ -3796,15 +3781,6 @@ void CBasePlayer::UpdateClientData( void )
//
ShowPlayerHUD();
}
else if( FStrEq( STRING( gpGlobals->mapname ), "credits" ) )
{
pev->weapons = 0;
//
// Make HUD completely transparent and slowly increase it's alpha.
//
HidePlayerHUD( TRUE );
}
}
// Update HUD visibility.
@ -4674,12 +4650,7 @@ void CStripWeapons::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE @@ -4674,12 +4650,7 @@ void CStripWeapons::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE
}
if( pPlayer )
{
if( !FStrEq( STRING( gpGlobals->mapname ), "po_xen01" ) )
pPlayer->RemoveAllItems( TRUE );
else
pPlayer->RemoveAllItems( FALSE );
}
}
class CRevertSaved : public CPointEntity

2
dlls/skill.h

@ -140,6 +140,8 @@ struct skilldata_t @@ -140,6 +140,8 @@ struct skilldata_t
float plrArm;
float plrDmgNail;
float plrDmgPar21;
};
extern DLL_GLOBAL skilldata_t gSkillData;

8
dlls/triggers.cpp

@ -2233,15 +2233,11 @@ void CTriggerCamera::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYP @@ -2233,15 +2233,11 @@ void CTriggerCamera::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYP
{
( (CBasePlayer *)pActivator )->EnableControl( FALSE );
if( !( FStrEq( STRING( gpGlobals->mapname ), "po_haz01" ) && FStrEq( STRING( pev->targetname ), "cam" ) ) &&
!( FStrEq( STRING( gpGlobals->mapname ), "po_aud01" ) && FStrEq( STRING( pev->targetname ), "cam" ) ) )
{
if( ( (CBasePlayer *)pActivator )->pev->weapons & ( 1 << WEAPON_SUIT ) )
{
( (CBasePlayer *)pActivator )->HidePlayerHUD();
}
}
}
if( m_sPath )
{
@ -2299,15 +2295,11 @@ void CTriggerCamera::FollowTarget() @@ -2299,15 +2295,11 @@ void CTriggerCamera::FollowTarget()
SET_VIEW( m_hPlayer->edict(), m_hPlayer->edict() );
( (CBasePlayer *)( (CBaseEntity *)m_hPlayer ) )->EnableControl( TRUE );
if( !( FStrEq( STRING( gpGlobals->mapname ), "po_aud01" ) && FStrEq( STRING( pev->targetname ), "cam" ) ) &&
!( FStrEq( STRING( gpGlobals->mapname ), "credits" ) && FStrEq( STRING( pev->targetname ), "credits_cam" ) ) )
{
if( ( (CBasePlayer *)( (CBaseEntity *)m_hPlayer ) )->pev->weapons & ( 1 << WEAPON_SUIT ) )
{
( (CBasePlayer *)( (CBaseEntity *)m_hPlayer ) )->ShowPlayerHUD();
}
}
}
SUB_UseTargets( this, USE_TOGGLE, 0 );
pev->avelocity = Vector( 0, 0, 0 );
m_state = 0;

324
dlls/vendetta/par21.cpp

@ -0,0 +1,324 @@ @@ -0,0 +1,324 @@
/***
*
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
* object code is restricted to non-commercial enhancements to products from
* Valve LLC. All other use, distribution, or modification is prohibited
* without written permission from Valve LLC.
*
****/
#include "extdll.h"
#include "util.h"
#include "cbase.h"
#include "monsters.h"
#include "weapons.h"
#include "nodes.h"
#include "player.h"
#include "soundent.h"
#include "gamerules.h"
enum par21_e
{
PAR21_LONGIDLE = 0,
PAR21_IDLE1,
PAR21_LAUNCH,
PAR21_RELOAD,
PAR21_DEPLOY,
PAR21_FIRE1,
PAR21_FIRE2,
PAR21_FIRE3,
};
LINK_ENTITY_TO_CLASS(weapon_par21, CPar21);
//=========================================================
//=========================================================
int CPar21::SecondaryAmmoIndex(void)
{
return m_iSecondaryAmmoType;
}
void CPar21::Spawn()
{
Precache();
SET_MODEL(ENT(pev), "models/w_par21.mdl");
m_iId = WEAPON_PAR21;
m_iDefaultAmmo = PAR21_DEFAULT_GIVE;
FallInit();// get ready to fall down.
}
void CPar21::Precache(void)
{
PRECACHE_MODEL("models/v_par21.mdl");
PRECACHE_MODEL("models/w_par21.mdl");
PRECACHE_MODEL("models/p_par21.mdl");
m_iShell = PRECACHE_MODEL("models/shell.mdl");// brass shellTE_MODEL
PRECACHE_MODEL("models/grenade.mdl"); // grenade
PRECACHE_MODEL("models/w_par21_clip.mdl");
PRECACHE_SOUND("items/9mmclip1.wav");
PRECACHE_SOUND("items/clipinsert1.wav");
PRECACHE_SOUND("items/cliprelease1.wav");
PRECACHE_SOUND("weapons/par21_1.wav");
PRECACHE_SOUND("weapons/par21_2.wav");
PRECACHE_SOUND("weapons/par21_3.wav");
PRECACHE_SOUND("weapons/glauncher.wav");
PRECACHE_SOUND("weapons/glauncher2.wav");
PRECACHE_SOUND("weapons/357_cock1.wav");
m_usReload = PRECACHE_EVENT(1, "events/reload.sc");
m_usPar21 = PRECACHE_EVENT(1, "events/par21.sc");
m_usM203 = PRECACHE_EVENT(1, "events/m203.sc");
}
int CPar21::GetItemInfo(ItemInfo *p)
{
p->pszName = STRING(pev->classname);
p->pszAmmo1 = "par21";
p->iMaxAmmo1 = PAR21_MAX_CARRY;
p->pszAmmo2 = "M203grenades";
p->iMaxAmmo2 = M203_GRENADE_MAX_CARRY;
p->iMaxClip = PAR21_MAX_CLIP;
p->iSlot = 1;
p->iPosition = 0;
p->iFlags = 0;
p->iId = m_iId = WEAPON_PAR21;
p->iWeight = PAR21_WEIGHT;
return 1;
}
int CPar21::AddToPlayer(CBasePlayer *pPlayer)
{
if (CBasePlayerWeapon::AddToPlayer(pPlayer))
{
MESSAGE_BEGIN(MSG_ONE, gmsgWeapPickup, NULL, pPlayer->pev);
WRITE_BYTE(m_iId);
MESSAGE_END();
return TRUE;
}
return FALSE;
}
BOOL CPar21::Deploy()
{
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1.0f;
return DefaultDeploy("models/v_par21.mdl", "models/p_par21.mdl", PAR21_DEPLOY, "par21");
}
void CPar21::PrimaryAttack()
{
// don't fire underwater
if (m_pPlayer->pev->waterlevel == 3)
{
PlayEmptySound();
m_flNextPrimaryAttack = 0.15;
return;
}
if (m_iClip <= 0)
{
PlayEmptySound();
m_flNextPrimaryAttack = 0.15;
return;
}
m_pPlayer->m_iWeaponVolume = NORMAL_GUN_VOLUME;
m_pPlayer->m_iWeaponFlash = NORMAL_GUN_FLASH;
m_iClip--;
m_pPlayer->pev->effects = (int)(m_pPlayer->pev->effects) | EF_MUZZLEFLASH;
// player "shoot" animation
m_pPlayer->SetAnimation(PLAYER_ATTACK1);
Vector vecSrc = m_pPlayer->GetGunPosition();
Vector vecAiming = m_pPlayer->GetAutoaimVector(AUTOAIM_5DEGREES);
Vector vecDir;
// single player spread
vecDir = m_pPlayer->FireBulletsPlayer(1, vecSrc, vecAiming, VECTOR_CONE_3DEGREES, 8192, BULLET_PLAYER_PAR21, 2, 0, m_pPlayer->pev, m_pPlayer->random_seed);
int flags;
#if defined( CLIENT_WEAPONS )
flags = FEV_NOTHOST;
#else
flags = 0;
#endif
PLAYBACK_EVENT_FULL(flags, m_pPlayer->edict(), m_usPar21, 0.0, (float *)&g_vecZero, (float *)&g_vecZero, vecDir.x, vecDir.y, 0, 0, 0, 0);
m_flNextPrimaryAttack = GetNextAttackDelay(0.1);
if (m_flNextPrimaryAttack < UTIL_WeaponTimeBase())
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.1;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat(m_pPlayer->random_seed, 10, 15);
}
void CPar21::SecondaryAttack(void)
{
// don't fire underwater
if (m_pPlayer->pev->waterlevel == 3)
{
PlayEmptySound();
m_flNextPrimaryAttack = 0.15;
return;
}
if (m_pPlayer->m_rgAmmo[m_iSecondaryAmmoType] == 0)
{
PlayEmptySound();
return;
}
m_pPlayer->m_iWeaponVolume = NORMAL_GUN_VOLUME;
m_pPlayer->m_iWeaponFlash = BRIGHT_GUN_FLASH;
m_pPlayer->m_iExtraSoundTypes = bits_SOUND_DANGER;
m_pPlayer->m_flStopExtraSoundTime = UTIL_WeaponTimeBase() + 0.2;
m_pPlayer->m_rgAmmo[m_iSecondaryAmmoType]--;
// player "shoot" animation
m_pPlayer->SetAnimation(PLAYER_ATTACK1);
UTIL_MakeVectors(m_pPlayer->pev->v_angle + m_pPlayer->pev->punchangle);
// we don't add in player velocity anymore.
CGrenade::ShootContact(m_pPlayer->pev,
m_pPlayer->pev->origin + m_pPlayer->pev->view_ofs + gpGlobals->v_forward * 16,
gpGlobals->v_forward * 800);
int flags;
#if defined( CLIENT_WEAPONS )
flags = FEV_NOTHOST;
#else
flags = 0;
#endif
PLAYBACK_EVENT(0, m_pPlayer->edict(), m_usM203);
m_flNextPrimaryAttack = GetNextAttackDelay(1);
m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 1;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 5;// idle pretty soon after shooting.
}
void CPar21::Reload(void)
{
if (m_pPlayer->ammo_par21 <= 0)
return;
int iAnim = PAR21_RELOAD;
int iResult = DefaultReload(PAR21_MAX_CLIP, iAnim, 1.5);
if ( iResult )
{
PLAYBACK_EVENT_FULL(0, m_pPlayer->edict(), m_usReload, 0.0, (float *)&g_vecZero, (float *)&g_vecZero, 0.0, 0.0, iAnim, 0, 0, 0);
}
}
void CPar21::WeaponIdle(void)
{
ResetEmptySound();
m_pPlayer->GetAutoaimVector(AUTOAIM_5DEGREES);
if (m_flTimeWeaponIdle > UTIL_WeaponTimeBase())
return;
int iAnim;
switch (RANDOM_LONG(0, 1))
{
case 0:
iAnim = PAR21_LONGIDLE;
break;
default:
case 1:
iAnim = PAR21_IDLE1;
break;
}
SendWeaponAnim(iAnim);
m_flTimeWeaponIdle = UTIL_SharedRandomFloat(m_pPlayer->random_seed, 10, 15); // how long till we do this again.
}
class CPar21AmmoClip : public CBasePlayerAmmo
{
void Spawn(void)
{
Precache();
SET_MODEL(ENT(pev), "models/w_par21_clip.mdl");
CBasePlayerAmmo::Spawn();
}
void Precache(void)
{
PRECACHE_MODEL("models/w_par21_clip.mdl");
PRECACHE_SOUND("items/9mmclip1.wav");
}
BOOL AddAmmo(CBaseEntity *pOther)
{
int bResult = (pOther->GiveAmmo(AMMO_PAR21CLIP_GIVE, "par21", PAR21_MAX_CARRY) != -1);
if (bResult)
{
EMIT_SOUND(ENT(pev), CHAN_ITEM, "items/9mmclip1.wav", 1, ATTN_NORM);
}
return bResult;
}
};
LINK_ENTITY_TO_CLASS(ammo_par21_clip, CPar21AmmoClip);
class CM203GrenadeAmmo : public CBasePlayerAmmo
{
void Spawn(void)
{
Precache();
SET_MODEL(ENT(pev), "models/w_par21_grenades.mdl");
CBasePlayerAmmo::Spawn();
}
void Precache(void)
{
PRECACHE_MODEL("models/w_par21_grenades.mdl");
PRECACHE_SOUND("items/9mmclip1.wav");
}
BOOL AddAmmo(CBaseEntity *pOther)
{
int bResult = (pOther->GiveAmmo(AMMO_M203BOX_GIVE, "M203grenades", M203_GRENADE_MAX_CARRY) != -1);
if (bResult)
{
EMIT_SOUND(ENT(pev), CHAN_ITEM, "items/9mmclip1.wav", 1, ATTN_NORM);
}
return bResult;
}
};
LINK_ENTITY_TO_CLASS(ammo_par21_grenade, CM203GrenadeAmmo);
LINK_ENTITY_TO_CLASS(ammo_m203grenade, CM203GrenadeAmmo);

17
dlls/weapons.cpp

@ -171,6 +171,7 @@ void DecalGunshot( TraceResult *pTrace, int iBulletType ) @@ -171,6 +171,7 @@ void DecalGunshot( TraceResult *pTrace, int iBulletType )
case BULLET_PLAYER_BUCKSHOT:
case BULLET_PLAYER_357:
case BULLET_PLAYER_NAIL:
case BULLET_PLAYER_PAR21:
default:
// smoke and decal
UTIL_GunshotDecalTrace( pTrace, DamageDecal( pEntity, DMG_BULLET ) );
@ -316,17 +317,11 @@ void W_Precache( void ) @@ -316,17 +317,11 @@ void W_Precache( void )
// pipebomb
UTIL_PrecacheOtherWeapon( "weapon_pipebomb" );
// bradnailer
UTIL_PrecacheOtherWeapon( "weapon_bradnailer" );
UTIL_PrecacheOther( "ammo_nailclip" );
UTIL_PrecacheOther( "ammo_nailround" );
// nailgun
UTIL_PrecacheOtherWeapon( "weapon_nailgun" );
// xen squasher
UTIL_PrecacheOtherWeapon( "weapon_xs" );
UTIL_PrecacheOther( "ammo_xencandy" );
// par21
UTIL_PrecacheOtherWeapon( "weapon_par21" );
UTIL_PrecacheOther( "ammo_par21_clip" );
UTIL_PrecacheOther( "ammo_par21_grenade" );
UTIL_PrecacheOther( "ammo_m203grenade" );
#if !defined( OEM_BUILD ) && !defined( HLDEMO_BUILD )
if( g_pGameRules->IsDeathmatch() )

34
dlls/weapons.h

@ -146,6 +146,7 @@ typedef enum @@ -146,6 +146,7 @@ typedef enum
BULLET_PLAYER_CROWBAR, // crowbar swipe
BULLET_PLAYER_NAIL, // nails
BULLET_PLAYER_XS, // xen squasher
BULLET_PLAYER_PAR21,
BULLET_MONSTER_9MM,
BULLET_MONSTER_MP5,
@ -1172,4 +1173,37 @@ public: @@ -1172,4 +1173,37 @@ public:
private:
unsigned short m_usReload;
};
class CPar21 : public CBasePlayerWeapon
{
public:
void Spawn( void );
void Precache( void );
int iItemSlot( void ) { return 2; }
int GetItemInfo( ItemInfo *p);
int AddToPlayer( CBasePlayer *pPlayer );
void PrimaryAttack( void );
void SecondaryAttack( void );
int SecondaryAmmoIndex( void );
BOOL Deploy( void );
void Reload( void );
void WeaponIdle( void );
int m_iShell;
virtual BOOL UseDecrement( void )
{
#if defined( CLIENT_WEAPONS )
return TRUE;
#else
return FALSE;
#endif
}
private:
unsigned short m_usReload;
unsigned short m_usPar21;
unsigned short m_usM203;
};
#endif // WEAPONS_H

Loading…
Cancel
Save