CBasePlasmaProjectile *CBasePlasmaProjectile::CreatePredicted( const Vector &vecOrigin, const Vector &vecForward, const Vector& gunOffset, int damageType, CBasePlayer *pOwner ) { CBasePlasmaProjectile *pMissile = (CBasePlasmaProjectile*)CREATE_PREDICTED_ENTITY("base_plasmaprojectile"); if ( pMissile ) { pMissile->SetOwnerEntity( pOwner ); pMissile->SetPlayerSimulated( pOwner ); pMissile->SetupProjectile( vecOrigin, vecForward, damageType, pOwner ); pMissile->m_vecGunOriginOffset = gunOffset; } return pMissile; }
//----------------------------------------------------------------------------- // Purpose: Create a laser designation //----------------------------------------------------------------------------- CEnvLaserDesignation *CEnvLaserDesignation::CreatePredicted( CBasePlayer *pOwner ) { CEnvLaserDesignation *pDesignation = (CEnvLaserDesignation*)CREATE_PREDICTED_ENTITY("env_laserdesignation"); if ( pDesignation ) { pDesignation->Spawn(); pDesignation->SetOwnerEntity( pOwner ); pDesignation->SetPlayerSimulated( pOwner ); pDesignation->ChangeTeam( pOwner->GetTeamNumber() ); pDesignation->SetActive( false ); } return pDesignation; }
//----------------------------------------------------------------------------- // Purpose: Create a missile //----------------------------------------------------------------------------- CASW_Shotgun_Pellet_Predicted *CASW_Shotgun_Pellet_Predicted::CreatePellet( const Vector &vecOrigin, const Vector &vecForward, CBasePlayer *pCommander, CBaseEntity *pMarine ) { CASW_Shotgun_Pellet_Predicted *pProjectile = (CASW_Shotgun_Pellet_Predicted*)CREATE_PREDICTED_ENTITY( "asw_shotgun_pellet_predicted" ); if ( pProjectile ) { UTIL_SetOrigin( pProjectile, vecOrigin ); pProjectile->SetOwnerEntity( pMarine ); pProjectile->Spawn(); pProjectile->SetPlayerSimulated( pCommander ); pProjectile->SetAbsVelocity( vecForward ); pProjectile->SetCommander(pCommander); QAngle angles; VectorAngles( vecForward, angles ); pProjectile->SetLocalAngles( angles ); #ifdef CLIENT_DLL // create a trail beam (it'll fade out and kill itself after a short period) C_ASW_Trail_Beam *pBeam = new C_ASW_Trail_Beam(); if (pBeam) { if ( pBeam->InitializeAsClientEntity( NULL, false ) ) { pBeam->InitBeam(pProjectile->GetAbsOrigin(), pProjectile); } else { UTIL_Remove( pBeam ); } } #endif //pProjectile->SetLocalAngularVelocity( SHARED_RANDOMANGLE( -500, 500 ) ); } return pProjectile; }