• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ PLAYBACK_EVENT_FULL函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中PLAYBACK_EVENT_FULL函数的典型用法代码示例。如果您正苦于以下问题:C++ PLAYBACK_EVENT_FULL函数的具体用法?C++ PLAYBACK_EVENT_FULL怎么用?C++ PLAYBACK_EVENT_FULL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了PLAYBACK_EVENT_FULL函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: min

bool AvHBaseBuildable::Regenerate(float inRegenerationAmount, bool inPlaySound)
{
	bool theDidHeal = false;
	
	float theMaxHealth = this->mBaseHealth;

	if(!this->GetIsBuilt())
	{
		float theNormalizedBuildPercentage = this->GetNormalizedBuildPercentage();

		theMaxHealth = (kBaseHealthPercentage + theNormalizedBuildPercentage*(1.0f - kBaseHealthPercentage))*this->mBaseHealth;
	}

	// If we aren't at full health, heal health
	if(this->pev->health < theMaxHealth)
	{
		this->pev->health = min(theMaxHealth, this->pev->health + inRegenerationAmount);
		this->HealthChanged();
		theDidHeal = true;
	}
	
	// Play regen event
	if(theDidHeal)
	{
		if(inPlaySound)
		{
			// Play regeneration event
			PLAYBACK_EVENT_FULL(0, this->edict(), gRegenerationEventID, 0, this->pev->origin, (float *)&g_vecZero, 1.0f, 0.0, /*theWeaponIndex*/ 0, 0, 0, 0 );
		}
	}

	return theDidHeal;
}
开发者ID:Arkshine,项目名称:NS,代码行数:33,代码来源:AvHBaseBuildable.cpp


示例2: PLAYBACK_EVENT_FULL

//=========================================================
void CQuakeRocket::Explode()
{
	//We use the angles field to send the rocket velocity.
	PLAYBACK_EVENT_FULL( FEV_GLOBAL, edict(), g_sExplosion, 0.0, (float *)&pev->origin, (float *)&pev->velocity, 0.0, 0.0, 0, 0, 0, 0 );

	UTIL_Remove( this );
}
开发者ID:CecilHarvey,项目名称:RealBot,代码行数:8,代码来源:quake_rocket.cpp


示例3: W_FireSuperSpikes

// Nailgun
void CBasePlayer::W_FireSpikes(int iQuadSound)
{
	// If we're wielding the Super nailgun and we've got ammo for it, fire Super nails
	if(*m_pCurrentAmmo >= 2 && m_iQuakeWeapon == IT_SUPER_NAILGUN)
	{
		W_FireSuperSpikes(iQuadSound);
		return;
	}

	// Swap to next best weapon if this one just ran out
	if(*m_pCurrentAmmo < 1)
	{
		m_iQuakeWeapon = W_BestWeapon();
		W_SetCurrentAmmo();
		return;
	}

	PLAYBACK_EVENT_FULL(FEV_NOTHOST, edict(), m_usSpike, 0.0, (float *)&g_vecZero, (float *)&g_vecZero, 0.0, 0.0, iQuadSound, 0, m_iNailOffset > 0.0 ? 1 : 0, 0);

	// Fire left then right
	if(m_iNailOffset == 2)
		m_iNailOffset = -2;
	else
		m_iNailOffset = 2;

	if(gpGlobals->deathmatch != 4)
		*m_pCurrentAmmo -= 1;
	m_flNextAttack = UTIL_WeaponTimeBase() + 0.1;

	// Fire the nail
	UTIL_MakeVectors(pev->v_angle);
	Vector      vecDir = GetAutoaimVector(AUTOAIM_5DEGREES);
	CQuakeNail *pNail  = CQuakeNail::CreateNail(pev->origin + Vector(0, 0, 10) + (gpGlobals->v_right * m_iNailOffset), vecDir, this);
}
开发者ID:Sh1ft0x0EF,项目名称:HLSDKRevamp,代码行数:35,代码来源:quake_weapons_all.cpp


示例4: EMIT_SOUND_DYN

void CFuncVehicle::UpdateSound()
{
	if (!pev->noise)
		return;

#ifdef REGAMEDLL_FIXES
	float flpitch = VEHICLE_STARTPITCH + (Q_abs(pev->speed) * (VEHICLE_MAXPITCH - VEHICLE_STARTPITCH) / VEHICLE_MAXSPEED);
#else
	float flpitch = VEHICLE_STARTPITCH + (Q_abs(int(pev->speed)) * (VEHICLE_MAXPITCH - VEHICLE_STARTPITCH) / VEHICLE_MAXSPEED);
#endif

	if (flpitch > 200)
		flpitch = 200;

	if (!m_soundPlaying)
	{
		if (m_sounds < 5)
		{
			EMIT_SOUND_DYN(ENT(pev), CHAN_ITEM, "plats/vehicle_brake1.wav", m_flVolume, ATTN_NORM, 0, 100);
		}

		EMIT_SOUND_DYN(ENT(pev), CHAN_STATIC, (char *)STRING(pev->noise), m_flVolume, ATTN_NORM, 0, int(flpitch));
		m_soundPlaying = 1;
	}
	else
	{
		unsigned short us_sound = ((unsigned short)(m_sounds) & 0x0007) << 12;
		unsigned short us_pitch = ((unsigned short)(flpitch / 10.0) & 0x003F) << 6;
		unsigned short us_volume = ((unsigned short)(m_flVolume * 40) & 0x003F);
		unsigned short us_encode = us_sound | us_pitch | us_volume;

		PLAYBACK_EVENT_FULL(FEV_UPDATE, edict(), m_usAdjustPitch, 0.0, (float *)&g_vecZero, (float *)&g_vecZero, 0.0, 0.0, us_encode, 0, 0, 0);
	}
}
开发者ID:s1lentq,项目名称:ReGameDLL_CS,代码行数:34,代码来源:vehicle.cpp


示例5: Vector

void CGrenade::SG_Detonate(void)
{
	TraceResult tr;
	Vector vecSpot = pev->origin + Vector(0, 0, 8);
	UTIL_TraceLine(vecSpot, vecSpot + Vector(0, 0, -40), ignore_monsters, ENT(pev), &tr);
	EMIT_SOUND(ENT(pev), CHAN_WEAPON, "weapons/sg_explode.wav", VOL_NORM, ATTN_NORM);
	edict_t *pentFind = NULL;

	while ((pentFind = FIND_ENTITY_BY_STRING(pentFind, "classname", "grenade")) != NULL)
	{
		if (FNullEnt(pentFind))
			break;

		CBaseEntity *pEnt = CBaseEntity::Instance(pentFind);

		if (pEnt)
		{
			float fDistance = (pEnt->pev->origin - pev->origin).Length();

			if (fDistance != 0 && fDistance <= 250 && gpGlobals->time < pEnt->pev->dmgtime)
				m_bLightSmoke = true;
		}
	}

	m_bDetonated = true;
	PLAYBACK_EVENT_FULL(0, NULL, m_usEvent, 0, pev->origin, (float *)&g_vecZero, 0, 0, 0, 1, m_bLightSmoke, FALSE);
	m_vSmokeDetonate = pev->origin;
	pev->velocity = Vector(RANDOM_FLOAT(-175.0, 175.0), RANDOM_FLOAT(-175.0, 175.0), RANDOM_FLOAT(250.0, 350.0));
	pev->nextthink = gpGlobals->time + 0.1;
	SetThink(&CGrenade::SG_Smoke);
}
开发者ID:RomkaZVO,项目名称:cs16-client,代码行数:31,代码来源:ggrenade.cpp


示例6: UTIL_MakeVectors

void CGrenade::SG_Smoke(void)
{
	Vector vecDir;
	float flSmokeInterval[2];
	int iMaxSmokePuffs;

	if (UTIL_PointContents(pev->origin) != CONTENTS_WATER)
	{
		UTIL_MakeVectors(pev->angles);
		vecDir = gpGlobals->v_forward * RANDOM_FLOAT(3, 8);
		iMaxSmokePuffs = (int)(RANDOM_FLOAT(1.5, 3.5) * 100);
		flSmokeInterval[0] = vecDir.x * cos((float)m_angle * (180 / M_PI)) - vecDir.y * sin((float)m_angle * (180 / M_PI));
		flSmokeInterval[1] = vecDir.x * sin((float)m_angle * (180 / M_PI)) + vecDir.y * cos((float)m_angle * (180 / M_PI));
		m_angle = (m_angle + 30) % 360;
		PLAYBACK_EVENT_FULL(0, NULL, m_usEvent, 0, pev->origin, m_vSmokeDetonate, flSmokeInterval[0], flSmokeInterval[1], iMaxSmokePuffs, 4, m_bLightSmoke, 6);
	}
	else
		UTIL_Bubbles(pev->origin - Vector(64, 64, 64), pev->origin + Vector(64, 64, 64), 100);

	if (m_SGSmoke <= 20)
	{
		pev->nextthink = gpGlobals->time + 1;
		SetThink(&CGrenade::SG_Smoke);
		m_SGSmoke++;
	}
	else
	{
		pev->effects |= EF_NODRAW;
		UTIL_Remove(this);
	}
}
开发者ID:RomkaZVO,项目名称:cs16-client,代码行数:31,代码来源:ggrenade.cpp


示例7: PLAYBACK_EVENT_FULL

// Return TRUE if the weapon still has ammo
BOOL CBasePlayer::W_CheckNoAmmo()
{
	if(m_pCurrentAmmo && *m_pCurrentAmmo > 0)
		return TRUE;

	if(m_iQuakeWeapon == IT_AXE)
		return TRUE;

#ifdef THREEWAVE
	if(m_iQuakeWeapon == IT_EXTRA_WEAPON)
		return TRUE;
#endif

	if(m_iQuakeWeapon == IT_LIGHTNING)
	{
		PLAYBACK_EVENT_FULL(FEV_NOTHOST, edict(), m_usLightning, 0, (float *)&pev->origin, (float *)&pev->angles, 0.0, 0.0, 0, 1, 0, 0);

		if(m_pActiveItem)
			((CQuakeGun *)m_pActiveItem)->DestroyEffect();
	}

	m_iQuakeWeapon = W_BestWeapon();
	W_SetCurrentAmmo();
	return FALSE;
}
开发者ID:Sh1ft0x0EF,项目名称:HLSDKRevamp,代码行数:26,代码来源:quake_weapons_all.cpp


示例8: SetThink

void CDisplacer::FireThink( void )
{
	int flags;
	flags = 0;

	SetThink ( NULL );

	// player "shoot" animation
	m_pPlayer->SetAnimation( PLAYER_ATTACK1 );

	PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usFireDisplacer, 0.0, (float *)&g_vecZero, (float *)&g_vecZero, 0.0, 0.0, 0, 0, 0, 0); 
	m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1.0;
	m_pPlayer->m_iWeaponVolume = LOUD_GUN_VOLUME;
	m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 35/30;
	m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] -= DISPLACER_PRIMARY_USAGE;

	Vector anglesAim = m_pPlayer->pev->v_angle + m_pPlayer->pev->punchangle;
	UTIL_MakeVectors( anglesAim );

	anglesAim.x		= -anglesAim.x;
	Vector vecSrc	 = m_pPlayer->GetGunPosition( ) - gpGlobals->v_up * 2;
	Vector vecDir	 = gpGlobals->v_forward;

	#ifndef CLIENT_DLL
		CDisplacerBall *pBall = CDisplacerBall::BallCreate();
		pBall->pev->owner = m_pPlayer->edict();
		pBall->pev->origin = vecSrc;
		pBall->pev->angles = anglesAim;
		pBall->pev->avelocity.z = 10;
	#endif
}
开发者ID:Fograin,项目名称:hl-subsmod-ex,代码行数:31,代码来源:weapon_displacer.cpp


示例9: min

bool AvHBaseBuildable::Regenerate(float inRegenerationAmount, bool inPlaySound, bool dcHealing)
{
	bool theDidHeal = false;
	if ( gpGlobals->time > this->mTimeOfLastDCRegeneration + BALANCE_VAR(kDefenseChamberThinkInterval) - 0.05f || (dcHealing == false)) {
		if ( dcHealing )
			this->mTimeOfLastDCRegeneration = gpGlobals->time;
		float theMaxHealth = this->mBaseHealth;

		if(!this->GetIsBuilt())
		{
			float theNormalizedBuildPercentage = this->GetNormalizedBuildPercentage();

			theMaxHealth = (kBaseHealthPercentage + theNormalizedBuildPercentage*(1.0f - kBaseHealthPercentage))*this->mBaseHealth;
		}

		// If we aren't at full health, heal health
		if(this->pev->health < theMaxHealth)
		{
			this->pev->health = min(theMaxHealth, this->pev->health + inRegenerationAmount);
			this->HealthChanged();
			theDidHeal = true;
		}
		
		// Play regen event
		if(theDidHeal)
		{
			if(inPlaySound)
			{
				// Play regeneration event
				PLAYBACK_EVENT_FULL(0, this->edict(), gRegenerationEventID, 0, this->pev->origin, (float *)&g_vecZero, 1.0f, 0.0, /*theWeaponIndex*/ 0, 0, 0, 0 );
			}
		}
	}
	return theDidHeal;
}
开发者ID:Arkshine,项目名称:NS,代码行数:35,代码来源:AvHBaseBuildable.cpp


示例10: GetClassPtr

//=========================================================
CQuakeRocket *CQuakeRocket::CreateRocket( Vector vecOrigin, Vector vecAngles, CBaseEntity *pOwner )
{
	CQuakeRocket *pRocket = GetClassPtr( (CQuakeRocket *)NULL );
	
	UTIL_SetOrigin( pRocket->pev, vecOrigin );
	SET_MODEL(ENT(pRocket->pev), "models/rocket.mdl");
	pRocket->Spawn();
	pRocket->pev->classname = MAKE_STRING("missile");
	pRocket->pev->owner = pOwner->edict();

	// Setup
	pRocket->pev->movetype = MOVETYPE_FLYMISSILE;
	pRocket->pev->solid = SOLID_BBOX;
		
	// Velocity
	pRocket->pev->velocity = vecAngles * 1000;
	pRocket->pev->angles = UTIL_VecToAngles( vecAngles );
	
	// Touch
	pRocket->SetTouch( CQuakeRocket::RocketTouch );

	// Safety Remove
	pRocket->pev->nextthink = gpGlobals->time + 5;
	pRocket->SetThink( SUB_Remove );

	// Effects
//	pRocket->pev->effects |= EF_LIGHT;

	PLAYBACK_EVENT_FULL (FEV_GLOBAL, pRocket->edict(), g_sTrail, 0.0, 
	(float *)&pRocket->pev->origin, (float *)&pRocket->pev->angles, 0.7, 0.0, pRocket->entindex(), ROCKET_TRAIL, 0, 0);

	return pRocket;
} 
开发者ID:CecilHarvey,项目名称:RealBot,代码行数:34,代码来源:quake_rocket.cpp


示例11: min

void AvHHive::DonateUse(CBaseEntity* inActivator, CBaseEntity* inCaller, USE_TYPE inUseType, float inValue)
{
	// Player is trying to donate his resources to the pool
	if(this->GetIsActive())
	{
		AvHPlayer* inActivatingPlayer = dynamic_cast<AvHPlayer*>(inActivator);
		if(inActivatingPlayer && (inActivator->pev->team == this->pev->team))
		{
			// Take some resources, give some resources
			const float kResourcesToDonatePerUse = .4f;
			float theResourcesToGive = min(inActivatingPlayer->GetResources(), kResourcesToDonatePerUse);
			
			if(theResourcesToGive > 0.0f)
			{
				AvHTeam* theTeam = inActivatingPlayer->GetTeamPointer();
				if(theTeam)
				{
					inActivatingPlayer->SetResources(inActivatingPlayer->GetResources() - theResourcesToGive);
					theTeam->SetTeamResources(theTeam->GetTeamResources() + theResourcesToGive);

					if(g_engfuncs.pfnRandomLong(0, 20) == 0)
					{
						PLAYBACK_EVENT_FULL(0, this->edict(), gRegenerationEventID, 0, this->pev->origin, (float *)&g_vecZero, 1.0f, 0.0, /*theWeaponIndex*/ 0, 0, 0, 0 );

						// Just say "resources donated"
						inActivatingPlayer->PlaybackNumericalEvent(kNumericalInfoResourcesDonatedEvent, 0);
					}
				}
			}
		}
	}
}
开发者ID:Arkshine,项目名称:NS,代码行数:32,代码来源:AvHHive.cpp


示例12: PlayEmptySound

void CM249::M249Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim)
{
	m_bDelayFire = true;
	m_iShotsFired++;
	m_flAccuracy = ((m_iShotsFired * m_iShotsFired * m_iShotsFired) / 175.0) + 0.4;

	if (m_flAccuracy > 0.9)
		m_flAccuracy = 0.9;

	if (m_iClip <= 0)
	{
		if (m_fFireOnEmpty)
		{
			PlayEmptySound();
			m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.2;
		}

		return;
	}

	m_iClip--;
	m_pPlayer->pev->effects |= EF_MUZZLEFLASH;
#ifndef CLIENT_DLL
	m_pPlayer->SetAnimation(PLAYER_ATTACK1);
#endif

	UTIL_MakeVectors(m_pPlayer->pev->v_angle + m_pPlayer->pev->punchangle);

	m_pPlayer->m_iWeaponVolume = NORMAL_GUN_VOLUME;
	m_pPlayer->m_iWeaponFlash = BRIGHT_GUN_FLASH;

	Vector vecSrc = m_pPlayer->GetGunPosition();
	Vector vecDir = m_pPlayer->FireBullets3(vecSrc, gpGlobals->v_forward, flSpread, 8192, 2, BULLET_PLAYER_556MM, 32, 0.97, m_pPlayer->pev, FALSE, m_pPlayer->random_seed);

	int flags;
#ifdef CLIENT_WEAPONS
	flags = FEV_NOTHOST;
#else
	flags = 0;
#endif

	PLAYBACK_EVENT_FULL(flags, m_pPlayer->edict(), m_usFireM249, 0, (float *)&g_vecZero, (float *)&g_vecZero, vecDir.x, vecDir.y, (int)(m_pPlayer->pev->punchangle.x * 100), (int)(m_pPlayer->pev->punchangle.y * 100), FALSE, FALSE);
	m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + flCycleTime;

#ifndef CLIENT_DLL
	if (!m_iClip && m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0)
		m_pPlayer->SetSuitUpdate("!HEV_AMO0", FALSE, 0);
#endif
	m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.6;

	if (!FBitSet(m_pPlayer->pev->flags, FL_ONGROUND))
		KickBack(1.8, 0.65, 0.45, 0.125, 5.0, 3.5, 8);
	else if (m_pPlayer->pev->velocity.Length2D() > 0)
		KickBack(1.1, 0.5, 0.3, 0.06, 4.0, 3.0, 8);
	else if (FBitSet(m_pPlayer->pev->flags, FL_DUCKING))
		KickBack(0.75, 0.325, 0.25, 0.025, 3.5, 2.5, 9);
	else
		KickBack(0.8, 0.35, 0.3, 0.03, 3.75, 3.0, 9);
}
开发者ID:jeefo,项目名称:cs16-client,代码行数:59,代码来源:wpn_m249.cpp


示例13: UTIL_MakeVectors

void CSqueak::PrimaryAttack()
{
	if ( m_pPlayer->m_rgAmmo[ m_iPrimaryAmmoType ] )
	{
		Vector forward = m_pPlayer->GetAimForwardWithOffset();
		Vector forwardDeg = m_pPlayer->GetAimForwardWithOffset( true );

		UTIL_MakeVectors( forwardDeg );
		TraceResult tr;
		Vector trace_origin;

		// HACK HACK:  Ugly hacks to handle change in origin based on new physics code for players
		// Move origin up if crouched and start trace a bit outside of body ( 20 units instead of 16 )
		trace_origin = m_pPlayer->pev->origin;
		if ( m_pPlayer->pev->flags & FL_DUCKING )
		{
			trace_origin = trace_origin - ( VEC_HULL_MIN - VEC_DUCK_HULL_MIN );
		}

		// find place to toss monster
		UTIL_TraceLine( trace_origin + forward * 20, trace_origin + forward * 64, dont_ignore_monsters, NULL, &tr );

	int flags;
#ifdef CLIENT_WEAPONS
	flags = FEV_NOTHOST;
#else
	flags = 0;
#endif

	    PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usSnarkFire, 0.0, (float *)&g_vecZero, (float *)&g_vecZero, 0.0, 0.0, 0, 0, 0, 0 );

		if ( tr.fAllSolid == 0 && tr.fStartSolid == 0 && tr.flFraction > 0.25 )
		{
			// player "shoot" animation
			m_pPlayer->SetAnimation( PLAYER_ATTACK1 );

#ifndef CLIENT_DLL
			CBaseEntity *pSqueak = CBaseEntity::Create( "monster_snark", tr.vecEndPos, forwardDeg, m_pPlayer->edict() );
			pSqueak->pev->velocity = forward * 200 + m_pPlayer->pev->velocity;
#endif

			// play hunt sound
#ifndef CLIENT_DLL
			EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, gameplayMods::snarkPenguins.isActive() ? RANDOM_SOUND_ARRAY( pPinguHuntSounds ) : RANDOM_SOUND_ARRAY_PAYNED_DIE_MONSTER( pHuntSounds ), 1, ATTN_NORM, 0, 100 );
#endif // !CLIENT_DLL

			m_pPlayer->m_iWeaponVolume = QUIET_GUN_VOLUME;

			if ( !gameplayMods::infiniteAmmo.isActive() ) {
				m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]--;
			}

			m_fJustThrown = 1;

			m_flNextPrimaryAttack = GetNextAttackDelay(0.3);
			m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.0;
		}
	}
}
开发者ID:suXinjke,项目名称:HalfPayne,代码行数:59,代码来源:squeakgrenade.cpp


示例14: PlayEmptySound

void CAWP::AWPFire( float flSpread, float flCycleTime, BOOL fUseSemi )
{
    if( m_pPlayer->pev->fov == 90 )
    {
        flSpread += AWP_AJUSTED_SPREAD;
    }
    else
    {
        m_pPlayer->m_fResumeZoom = TRUE;
        m_pPlayer->m_iLastZoom   = m_pPlayer->m_iFOV;
        m_pPlayer->m_iFOV        = m_pPlayer->pev->fov = 90;
    }

    if( m_iClip <= 0 )
    {
        if( m_fFireOnEmpty )
        {
            PlayEmptySound();
            m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.2;
        }

        /*! @todo Implements me :
        if( TheBots )
            TheBots->OnEvent( EVENT_WEAPON_FIRED_ON_EMPTY, m_pPlayer->pev, NULL ); */

        return;
    }

    m_iClip--;
    m_pPlayer->pev->effects |= EF_MUZZLEFLASH;

    m_pPlayer->SetAnimation( PLAYER_ATTACK1 );

    m_pPlayer->m_iWeaponVolume = NORMAL_GUN_VOLUME;
    m_pPlayer->m_iWeaponFlash  = NORMAL_GUN_FLASH;

    UTIL_MakeVectors( m_pPlayer->pev->v_angle + m_pPlayer->pev->punchangle );

    m_pPlayer->m_flEjectBrass = gpGlobals->time + AWP_EJECT_BRASSE_TIME;

    Vector vecDir = m_pPlayer->FireBullets3(
        m_pPlayer->GetGunPosition(), gpGlobals->v_forward,
        flSpread, 8192.0, AWP_PENETRATION, BULLET_PLAYER_338MAG, AWP_DAMAGE, AWP_RANGE_MODIFIER, m_pPlayer->pev, 0, m_pPlayer->random_seed );

    PLAYBACK_EVENT_FULL( FEV_NOTHOST, m_pPlayer->edict(),
        m_usAwp, 0.0, (float *)&g_vecZero, (float *)&g_vecZero,
        vecDir.x, vecDir.y, m_pPlayer->pev->punchangle.x * 100, m_pPlayer->pev->punchangle.x * 100, FALSE, FALSE );

    m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + flCycleTime;

    if ( !m_iClip && m_pPlayer->m_rgAmmo[ m_iPrimaryAmmoType ] <= 0 )
    {
        m_pPlayer->SetSuitUpdate( "!HEV_AMO0", FALSE, 0 );
    }

    m_pPlayer->pev->punchangle.x -= 2.0;
    m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + AWP_IDLE_TIME;
}
开发者ID:johndrinkwater,项目名称:CSSDK,代码行数:58,代码来源:wpn_awp.cpp


示例15: UTIL_MakeVectors

void CSqueak::PrimaryAttack()
{
	if ( m_pPlayer->m_rgAmmo[ m_iPrimaryAmmoType ] )
	{
		UTIL_MakeVectors( m_pPlayer->pev->v_angle );
		TraceResult tr;
		Vector trace_origin;

		// HACK HACK:  Ugly hacks to handle change in origin based on new physics code for players
		// Move origin up if crouched and start trace a bit outside of body ( 20 units instead of 16 )
		trace_origin = m_pPlayer->pev->origin;
		/* Removed by Pcjoe
		if ( m_pPlayer->pev->flags & FL_DUCKING )
		{
			trace_origin = trace_origin - ( VEC_HULL_MIN - VEC_DUCK_HULL_MIN );
		}*/

		// find place to toss monster
		UTIL_TraceLine( trace_origin + gpGlobals->v_forward * 20, trace_origin + gpGlobals->v_forward * 64, dont_ignore_monsters, NULL, &tr );

	int flags;
#ifdef CLIENT_WEAPONS
	flags = FEV_NOTHOST;
#else
	flags = 0;
#endif

	    PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usSnarkFire, 0.0, (float *)&g_vecZero, (float *)&g_vecZero, 0.0, 0.0, 0, 0, 0, 0 );

		if ( tr.fAllSolid == 0 && tr.fStartSolid == 0 && tr.flFraction > 0.25 )
		{
			// player "shoot" animation
			m_pPlayer->SetAnimation( PLAYER_ATTACK1 );

#ifndef CLIENT_DLL
			CBaseEntity *pSqueak = CBaseEntity::Create( "monster_snark", tr.vecEndPos, m_pPlayer->pev->v_angle, m_pPlayer->edict() );
			pSqueak->pev->velocity = gpGlobals->v_forward * 200 + m_pPlayer->pev->velocity;
#endif

			// play hunt sound
			float flRndSound = RANDOM_FLOAT ( 0 , 1 );

			if ( flRndSound <= 0.5 )
				EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "squeek/sqk_hunt2.wav", 1, ATTN_NORM, 0, 105);
			else 
				EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "squeek/sqk_hunt3.wav", 1, ATTN_NORM, 0, 105);

			m_pPlayer->m_iWeaponVolume = QUIET_GUN_VOLUME;

			m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]--;

			m_fJustThrown = 1;

			m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.3;
			m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.0;
		}
	}
}
开发者ID:vermagav,项目名称:mechmod,代码行数:58,代码来源:squeakgrenade.cpp


示例16: PlayEmptySound

void CPython::PrimaryAttack()
{
	// don't fire underwater
	if (m_pPlayer->pev->waterlevel == 3)
	{
		PlayEmptySound( );
		m_flNextPrimaryAttack = 0.15;
		return;
	}

	if (m_iClip <= 0)
	{
		if (!m_fFireOnEmpty)
			Reload( );
		else
		{
			EMIT_SOUND(ENT(m_pPlayer->pev), CHAN_WEAPON, "weapons/357_cock1.wav", 0.8, ATTN_NORM);
			m_flNextPrimaryAttack = 0.15;
		}

		return;
	}

	m_pPlayer->m_iWeaponVolume = LOUD_GUN_VOLUME;
	m_pPlayer->m_iWeaponFlash = BRIGHT_GUN_FLASH;

	m_iClip--;

	m_pPlayer->pev->effects = (int)(m_pPlayer->pev->effects) | EF_MUZZLEFLASH;

	// player "shoot" animation
	m_pPlayer->SetAnimation( PLAYER_ATTACK1 );


	UTIL_MakeVectors( m_pPlayer->pev->v_angle + m_pPlayer->pev->punchangle );

	Vector vecSrc	 = m_pPlayer->GetGunPosition( );
	Vector vecAiming = m_pPlayer->GetAutoaimVector( AUTOAIM_10DEGREES );

	Vector vecDir;
	vecDir = m_pPlayer->FireBulletsPlayer( 1, vecSrc, vecAiming, VECTOR_CONE_1DEGREES, 8192, BULLET_PLAYER_357, 0, 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_usFirePython, 0.0, (float *)&g_vecZero, (float *)&g_vecZero, vecDir.x, vecDir.y, 0, 0, 0, 0 );

	if (!m_iClip && m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0)
		// HEV suit - indicate out of ammo condition
		m_pPlayer->SetSuitUpdate("!HEV_AMO0", FALSE, 0);

	m_flNextPrimaryAttack = 0.75;
	m_flTimeWeaponIdle = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 );
}
开发者ID:TomHaygarth,项目名称:RealBot,代码行数:58,代码来源:python.cpp


示例17: PlayEmptySound

void CG3SG1::G3SG1Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim)
{
	if (m_pPlayer->pev->fov == 90)
		flCycleTime += 0.025;

	if (m_flLastFire)
	{
		m_flAccuracy = (gpGlobals->time - m_flLastFire) * 0.3 + 0.55;

		if (m_flAccuracy > 0.98)
			m_flAccuracy = 0.98;
	}
	else
		m_flAccuracy = 0.98;

	m_flLastFire = gpGlobals->time;

	if (m_iClip <= 0)
	{
		if (m_fFireOnEmpty)
		{
			PlayEmptySound();
			m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.2;
		}

		return;
	}

	m_iClip--;
	m_pPlayer->pev->effects |= EF_MUZZLEFLASH;
	m_pPlayer->SetAnimation(PLAYER_ATTACK1);

	UTIL_MakeVectors(m_pPlayer->pev->v_angle + m_pPlayer->pev->punchangle);

	m_pPlayer->m_iWeaponVolume = BIG_EXPLOSION_VOLUME;
	m_pPlayer->m_iWeaponFlash = NORMAL_GUN_FLASH;

	Vector vecDir = FireBullets3(m_pPlayer->GetGunPosition(), gpGlobals->v_forward, flSpread, 8192, 3, BULLET_PLAYER_762MM, 80, 0.98, m_pPlayer->pev, TRUE, m_pPlayer->random_seed);

	int flags;
#ifdef CLIENT_WEAPONS
	flags = FEV_NOTHOST;
#else
	flags = 0;
#endif

	PLAYBACK_EVENT_FULL(flags, ENT(m_pPlayer->pev), m_usFireG3SG1, 0, (float *)&g_vecZero, (float *)&g_vecZero, vecDir.x, vecDir.y, (int)(m_pPlayer->pev->punchangle.x * 100), (int)(m_pPlayer->pev->punchangle.y * 100), TRUE, FALSE);
	m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + flCycleTime;

	if (!m_iClip && m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0)
		m_pPlayer->SetSuitUpdate("!HEV_AMO0", FALSE, 0);

	m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.8;

	m_pPlayer->pev->punchangle.x -= UTIL_SharedRandomFloat(m_pPlayer->random_seed + 4, 2.75, 3.25) + m_pPlayer->pev->punchangle.x * 0.25;
	m_pPlayer->pev->punchangle.y += UTIL_SharedRandomFloat(m_pPlayer->random_seed + 5, -1.25, 1.5);
}
开发者ID:AlexCSilva,项目名称:cs16-client,代码行数:57,代码来源:wpn_g3sg1.cpp


示例18: PLAYBACK_EVENT_FULL

void CGauss::Holster( int skiplocal /* = 0 */ )
{
	PLAYBACK_EVENT_FULL( FEV_RELIABLE | FEV_GLOBAL, m_pPlayer->edict(), m_usGaussFire, 0.01, (float *)&m_pPlayer->pev->origin, (float *)&m_pPlayer->pev->angles, 0.0, 0.0, 0, 0, 0, 1 );
	
	m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5;
	
	SendWeaponAnim( GAUSS_HOLSTER );
	m_fInAttack = 0;
}
开发者ID:Solexid,项目名称:halflife,代码行数:9,代码来源:gauss.cpp


示例19: UTIL_MakeVectors

void CTripmine::PrimaryAttack( void )
{
	if (m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0)
		return;

	UTIL_MakeVectors( m_pPlayer->pev->v_angle + m_pPlayer->pev->punchangle );
	Vector vecSrc	 = m_pPlayer->GetGunPosition( );
	Vector vecAiming = gpGlobals->v_forward;

	TraceResult tr;

	UTIL_TraceLine( vecSrc, vecSrc + vecAiming * 128, dont_ignore_monsters, ENT( m_pPlayer->pev ), &tr );

	int flags;
#ifdef CLIENT_WEAPONS
	flags = FEV_NOTHOST;
#else
	flags = 0;
#endif

	PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usTripFire, 0.0, (float *)&g_vecZero, (float *)&g_vecZero, 0.0, 0.0, 0, 0, 0, 0 );

	if (tr.flFraction < 1.0)
	{
		CBaseEntity *pEntity = CBaseEntity::Instance( tr.pHit );
		if ( pEntity && !(pEntity->pev->flags & FL_CONVEYOR) )
		{
			Vector angles = UTIL_VecToAngles( tr.vecPlaneNormal );

			CBaseEntity *pEnt = CBaseEntity::Create( "monster_tripmine", tr.vecEndPos + tr.vecPlaneNormal * 8, angles, m_pPlayer->edict() );

			m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]--;

			// player "shoot" animation
			m_pPlayer->SetAnimation( PLAYER_ATTACK1 );
			
			if ( m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0 )
			{
				// no more mines! 
				RetireWeapon();
				return;
			}
		}
		else
		{
			// ALERT( at_console, "no deploy\n" );
		}
	}
	else
	{

	}
	
	m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.3;
	m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 );
}
开发者ID:ET-NiK,项目名称:amxxgroup,代码行数:56,代码来源:tripmine.cpp


示例20: PlayEmptySound

void CM3::PrimaryAttack()
{
	if (m_iClip <= 0)
	{
		PlayEmptySound();
		m_flNextPrimaryAttack = 0.15;
		return;
	}

	SendWeaponAnim( M3_SHOOT1 );
	m_pPlayer->SetAnimation( PLAYER_ATTACK1 ); 
	m_pPlayer->m_iWeaponFlash = NORMAL_GUN_FLASH;
	m_pPlayer->m_iWeaponVolume = NORMAL_GUN_VOLUME;
	m_pPlayer->pev->effects = (int)(m_pPlayer->pev->effects) | EF_MUZZLEFLASH;
	EMIT_SOUND_DYN( ENT( m_pPlayer->pev ), CHAN_WEAPON,"weapons/m3-1.wav", 1.0, ATTN_NORM, 0, 100 );

	m_iClip -= 1;

	Vector vecSrc( m_pPlayer->GetGunPosition() );
	Vector vecAim( m_pPlayer->GetAutoaimVector( AUTOAIM_2DEGREES ) );
	Vector vecAcc( 0.08716, 0.04362, 0.00  );
	Vector vecDir;

	vecDir = m_pPlayer->FireBulletsPlayer( 9, vecSrc, vecAim, vecAcc, 8192,0, 0, 20, m_pPlayer->pev, m_pPlayer->random_seed );
#ifndef CLIENT_DLL
	MESSAGE_BEGIN( MSG_PVS, SVC_TEMPENTITY, vecSrc );

		WRITE_BYTE( TE_DLIGHT );

		WRITE_COORD( vecSrc.x );
		WRITE_COORD( vecSrc.y );
		WRITE_COORD( vecSrc.z );
		WRITE_BYTE( 30 );

		WRITE_BYTE( 210 );
		WRITE_BYTE( 200 );
		WRITE_BYTE( 60 );

		WRITE_BYTE( 1 );
		WRITE_BYTE( 1 );

	MESSAGE_END();
#endif
	if( !LeftSpread )
		LeftSpread = 1;

	m_pPlayer->pev->punchangle.x -= 5;

	PLAYBACK_EVENT_FULL( FEV_NOTHOST, m_pPlayer->edict(), m_event, 0.0,
		(float *)&g_vecZero, (float *)&g_vecZero,
		vecDir.x, vecDir.y, 0, 0, (m_iClip ? 0 : 1), 0 );

    m_flNextPrimaryAttack   = UTIL_WeaponTimeBase() + 0.875;
    m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat(m_pPlayer->random_seed, 1.085,2.085);

}
开发者ID:mittorn,项目名称:csdm,代码行数:56,代码来源:wpn_m3.cpp



注:本文中的PLAYBACK_EVENT_FULL函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ PLAYERNUM函数代码示例发布时间:2022-05-30
下一篇:
C++ PK_IS_BACKEND_JOB函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap