Browse Source

Add ammo_m40a1 and weapon_eagle implementations. Fix drop from monsters.

residual_point
Night Owl 7 years ago
parent
commit
bf983da052
  1. 11
      dlls/crossbow.cpp
  2. 13
      dlls/python.cpp
  3. 2
      dlls/rp/massn.cpp
  4. 4
      dlls/rp/ngrunt.cpp
  5. 8
      dlls/rp/otis.cpp
  6. 2
      dlls/weapons.cpp

11
dlls/crossbow.cpp

@ -538,12 +538,18 @@ class CCrossbowAmmo : public CBasePlayerAmmo @@ -538,12 +538,18 @@ class CCrossbowAmmo : public CBasePlayerAmmo
void Spawn( void )
{
Precache();
SET_MODEL( ENT( pev ), "models/w_crossbow_clip.mdl" );
if( FClassnameIs( pev, "ammo_m40a1" ) )
SET_MODEL( ENT( pev ), "models/w_m40a1.mdl" );
else
SET_MODEL( ENT( pev ), "models/w_crossbow_clip.mdl" );
CBasePlayerAmmo::Spawn();
}
void Precache( void )
{
PRECACHE_MODEL( "models/w_crossbow_clip.mdl" );
if( FClassnameIs( pev, "ammo_m40a1" ) )
PRECACHE_MODEL( "models/w_m40a1.mdl" );
else
PRECACHE_MODEL( "models/w_crossbow_clip.mdl" );
PRECACHE_SOUND( "items/9mmclip1.wav" );
}
BOOL AddAmmo( CBaseEntity *pOther )
@ -558,4 +564,5 @@ class CCrossbowAmmo : public CBasePlayerAmmo @@ -558,4 +564,5 @@ class CCrossbowAmmo : public CBasePlayerAmmo
};
LINK_ENTITY_TO_CLASS( ammo_crossbow, CCrossbowAmmo )
LINK_ENTITY_TO_CLASS( ammo_m40a1, CCrossbowAmmo )
#endif

13
dlls/python.cpp

@ -286,17 +286,23 @@ class CPythonAmmo : public CBasePlayerAmmo @@ -286,17 +286,23 @@ class CPythonAmmo : public CBasePlayerAmmo
void Spawn( void )
{
Precache();
SET_MODEL( ENT(pev), "models/w_357ammobox.mdl" );
if( FClassnameIs( pev, "weapon_eagle" ) )
SET_MODEL( ENT(pev), "models/w_desert_eagle.mdl" );
else
SET_MODEL( ENT(pev), "models/w_357ammobox.mdl" );
CBasePlayerAmmo::Spawn();
}
void Precache( void )
{
PRECACHE_MODEL( "models/w_357ammobox.mdl" );
if( FClassnameIs( pev, "weapon_eagle" ) )
PRECACHE_MODEL( "models/w_desert_eagle.mdl" );
else
PRECACHE_MODEL( "models/w_357ammobox.mdl" );
PRECACHE_SOUND( "items/9mmclip1.wav" );
}
BOOL AddAmmo( CBaseEntity *pOther )
{
if( pOther->GiveAmmo( AMMO_357BOX_GIVE, "357", _357_MAX_CARRY ) != -1 )
if( pOther->GiveAmmo( FClassnameIs( pev, "weapon_eagle" ) ? ( AMMO_357BOX_GIVE + 1 ) : AMMO_357BOX_GIVE, "357", _357_MAX_CARRY ) != -1 )
{
EMIT_SOUND( ENT( pev ), CHAN_ITEM, "items/9mmclip1.wav", 1, ATTN_NORM );
return TRUE;
@ -306,4 +312,5 @@ class CPythonAmmo : public CBasePlayerAmmo @@ -306,4 +312,5 @@ class CPythonAmmo : public CBasePlayerAmmo
};
LINK_ENTITY_TO_CLASS( ammo_357, CPythonAmmo )
LINK_ENTITY_TO_CLASS( weapon_eagle, CPythonAmmo )
#endif

2
dlls/rp/massn.cpp

@ -178,7 +178,7 @@ void CMassn::HandleAnimEvent(MonsterEvent_t *pEvent) @@ -178,7 +178,7 @@ void CMassn::HandleAnimEvent(MonsterEvent_t *pEvent)
// now spawn a gun.
if (FBitSet(pev->weapons, MASSN_SNIPERRIFLE))
{
//DropItem("weapon_sniperrifle", vecGunPos, vecGunAngles);
DropItem("ammo_m40a1", vecGunPos, vecGunAngles);
}
else
{

4
dlls/rp/ngrunt.cpp

@ -228,11 +228,11 @@ void CNGrunt::HandleAnimEvent( MonsterEvent_t *pEvent ) @@ -228,11 +228,11 @@ void CNGrunt::HandleAnimEvent( MonsterEvent_t *pEvent )
// now spawn a gun.
if( FBitSet( pev->weapons, HGRUNT_SHOTGUN ) )
{
// DropItem( "weapon_shotgun", vecGunPos, vecGunAngles );
DropItem( "ammo_m40a1", vecGunPos, vecGunAngles );
}
else
{
DropItem( "weapon_9mmAR", vecGunPos, vecGunAngles );
DropItem( "weapon_9mmAR", vecGunPos, vecGunAngles );
}
if( FBitSet( pev->weapons, HGRUNT_GRENADELAUNCHER ) )

8
dlls/rp/otis.cpp

@ -100,8 +100,6 @@ void COtis::AlertSound(void) @@ -100,8 +100,6 @@ void COtis::AlertSound(void)
}
}
//=========================================================
// BarneyFirePistol - shoots one round from the pistol at
// the enemy otis is facing.
@ -127,7 +125,7 @@ void COtis::BarneyFirePistol(void) @@ -127,7 +125,7 @@ void COtis::BarneyFirePistol(void)
pitchShift = 0;
else
pitchShift -= 5;
EMIT_SOUND_DYN(ENT(pev), CHAN_WEAPON, "weapons/desert_eagle_fire.wav", 1, ATTN_NORM, 0, 100 + pitchShift);
EMIT_SOUND_DYN(ENT(pev), CHAN_WEAPON, "weapons/de_shot1.wav", 1, ATTN_NORM, 0, 100 + pitchShift);
CSoundEnt::InsertSound(bits_SOUND_COMBAT, pev->origin, 384, 0.3);
@ -220,7 +218,7 @@ void COtis::Precache() @@ -220,7 +218,7 @@ void COtis::Precache()
{
PRECACHE_MODEL("models/otis.mdl");
PRECACHE_SOUND("weapons/desert_eagle_fire.wav");
PRECACHE_SOUND("weapons/de_shot1.wav");
PRECACHE_SOUND("otis/ot_pain1.wav");
PRECACHE_SOUND("otis/ot_pain2.wav");
@ -401,7 +399,7 @@ void COtis::Killed(entvars_t *pevAttacker, int iGib) @@ -401,7 +399,7 @@ void COtis::Killed(entvars_t *pevAttacker, int iGib)
GetAttachment(0, vecGunPos, vecGunAngles);
CBaseEntity *pGun = DropItem("weapon_glock", vecGunPos, vecGunAngles);
CBaseEntity *pGun = DropItem("weapon_eagle", vecGunPos, vecGunAngles);
}
SetUse(NULL);

2
dlls/weapons.cpp

@ -327,6 +327,7 @@ void W_Precache( void ) @@ -327,6 +327,7 @@ void W_Precache( void )
// python
UTIL_PrecacheOtherWeapon( "weapon_357" );
UTIL_PrecacheOther( "ammo_357" );
UTIL_PrecacheOther( "weapon_eagle" );
// gauss
UTIL_PrecacheOtherWeapon( "weapon_gauss" );
@ -339,6 +340,7 @@ void W_Precache( void ) @@ -339,6 +340,7 @@ void W_Precache( void )
// crossbow
UTIL_PrecacheOtherWeapon( "weapon_crossbow" );
UTIL_PrecacheOther( "ammo_crossbow" );
UTIL_PrecacheOther( "ammo_m40a1" );
// egon
UTIL_PrecacheOtherWeapon( "weapon_egon" );

Loading…
Cancel
Save