Browse Source

Crossbow gravgun tweaks

hlzbot-dirty
mittorn 8 years ago
parent
commit
22b1664df8
  1. 26
      dlls/crossbow.cpp

26
dlls/crossbow.cpp

@ -40,6 +40,20 @@ class CCrossbowBolt : public CBaseEntity @@ -40,6 +40,20 @@ class CCrossbowBolt : public CBaseEntity
void EXPORT BubbleThink( void );
void EXPORT BoltTouch( CBaseEntity *pOther );
void EXPORT ExplodeThink( void );
float TouchGravGun( CBaseEntity *attacker, int stage )
{
if( stage >= 2 )
{
pev->movetype = MOVETYPE_FLY;
pev->solid = SOLID_BBOX;
pev->nextthink = gpGlobals->time + 60.0;
SetTouch( &CCrossbowBolt::BoltTouch );
UTIL_MakeVectors( attacker->pev->v_angle + attacker->pev->punchangle);
pev->angles = UTIL_VecToAngles(gpGlobals->v_forward);
}
return 2000;
}
int m_iTrail;
@ -149,12 +163,12 @@ void CCrossbowBolt::BoltTouch( CBaseEntity *pOther ) @@ -149,12 +163,12 @@ void CCrossbowBolt::BoltTouch( CBaseEntity *pOther )
Vector vecDir = pev->velocity.Normalize();
UTIL_SetOrigin( pev, pev->origin - vecDir * 12 );
pev->angles = UTIL_VecToAngles( vecDir );
pev->solid = SOLID_NOT;
//pev->solid = SOLID_NOT;
pev->movetype = MOVETYPE_FLY;
pev->velocity = Vector( 0, 0, 0 );
pev->avelocity.z = 0;
pev->angles.z = RANDOM_LONG( 0, 360 );
pev->nextthink = gpGlobals->time + 10.0;
pev->nextthink = gpGlobals->time + 60.0;
}
else if( pOther->pev->movetype == MOVETYPE_PUSH || pOther->pev->movetype == MOVETYPE_PUSHSTEP )
{
@ -165,7 +179,7 @@ void CCrossbowBolt::BoltTouch( CBaseEntity *pOther ) @@ -165,7 +179,7 @@ void CCrossbowBolt::BoltTouch( CBaseEntity *pOther )
pev->velocity = Vector( 0, 0, 0 );
pev->avelocity.z = 0;
pev->angles.z = RANDOM_LONG( 0, 360 );
pev->nextthink = gpGlobals->time + 10.0;
pev->nextthink = gpGlobals->time + 60.0;
// g-cont. Setup movewith feature
pev->movetype = MOVETYPE_COMPOUND; // set movewith type
@ -388,6 +402,12 @@ void CCrossbow::FireSniperBolt() @@ -388,6 +402,12 @@ void CCrossbow::FireSniperBolt()
CBaseEntity::Instance( tr.pHit )->TraceAttack( m_pPlayer->pev, 120, vecDir, &tr, DMG_BULLET | DMG_NEVERGIB );
ApplyMultiDamage( pev, m_pPlayer->pev );
}
CCrossbowBolt *pBolt = CCrossbowBolt::BoltCreate();
pBolt->pev->origin = tr.vecEndPos;
pBolt->pev->angles = -anglesAim;
pBolt->pev->owner = m_pPlayer->edict();
pBolt->pev->avelocity.z = 10;
pBolt->SetTouch( NULL );
#endif
}

Loading…
Cancel
Save