gravgun code

This commit is contained in:
mittorn 2016-03-21 16:07:17 +06:00
parent dccb3f4aab
commit 38bb95920e
5 changed files with 11 additions and 1 deletions

View File

@ -125,6 +125,7 @@ LOCAL_SRC_FILES := agrunt.cpp airtank.cpp \
xen.cpp \
zombie.cpp \
prop.cpp \
gravgun.cpp \
../pm_shared/pm_debug.c \
../pm_shared/pm_math.c \
../pm_shared/pm_shared.c \

View File

@ -213,6 +213,7 @@ public:
}
virtual void Blocked( CBaseEntity *pOther ) { if (m_pfnBlocked) (this->*m_pfnBlocked)( pOther ); };
virtual CBaseEntity * TouchGravGun( CBaseEntity *attacker ){ return NULL; };
// allow engine to allocate instance data
void *operator new( size_t stAllocateBlock, entvars_t *pev )
{

View File

@ -574,6 +574,7 @@ void CHalfLifeMultiplay :: PlayerSpawn( CBasePlayer *pPlayer )
pPlayer->GiveNamedItem( "weapon_crowbar" );
pPlayer->GiveNamedItem( "weapon_9mmhandgun" );
pPlayer->GiveAmmo( 68, "9mm", _9MM_MAX_CARRY );// 4 full reloads
pPlayer->GiveNamedItem( "weapon_gravgun" );
}
}

View File

@ -88,6 +88,12 @@ public:
virtual void BounceSound(void);
virtual int BloodColor(void) { return DONT_BLEED; }
virtual void Killed(entvars_t *pevAttacker, int iGib);
virtual CBaseEntity * TouchGravGun( CBaseEntity *attacker )
{
m_owner2 = attacker->edict();
m_attacker = attacker->edict();
return attacker;
}
void CheckRotate();
void EXPORT RespawnThink();
void EXPORT AngleThink();
@ -1063,7 +1069,7 @@ int CProp::TakeDamage(entvars_t* pevInflictor, entvars_t* pevAttacker, float flD
if ( !(pev->spawnflags & SF_PROP_BREAKABLE ) )
return 0;
if ( pev->health <= 0 )
return;
return 0;
// Breakables take double damage from the crowbar
if ( bitsDamageType & DMG_CLUB )
flDamage *= 2;

View File

@ -384,6 +384,7 @@ void W_Precache(void)
UTIL_PrecacheOtherWeapon( "weapon_hornetgun" );
#endif
UTIL_PrecacheOtherWeapon( "weapon_gravgun" );
#if !defined( OEM_BUILD ) && !defined( HLDEMO_BUILD )
if ( g_pGameRules->IsDeathmatch() )