當前位置: 首頁>>代碼示例>>C++>>正文


C++ ARX_SOUND_PlaySFX函數代碼示例

本文整理匯總了C++中ARX_SOUND_PlaySFX函數的典型用法代碼示例。如果您正苦於以下問題:C++ ARX_SOUND_PlaySFX函數的具體用法?C++ ARX_SOUND_PlaySFX怎麽用?C++ ARX_SOUND_PlaySFX使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了ARX_SOUND_PlaySFX函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: ARX_SOUND_PlaySFX

void ColdProtectionSpell::Launch() {
	
	spells.endByTarget(m_target, SPELL_COLD_PROTECTION);
	spells.endByCaster(m_caster, SPELL_ARMOR);
	spells.endByCaster(m_caster, SPELL_LOWER_ARMOR);
	spells.endByCaster(m_caster, SPELL_FIRE_PROTECTION);
	
	if(m_caster == EntityHandle_Player) {
		m_target = EntityHandle_Player;
	}
	
	ARX_SOUND_PlaySFX(SND_SPELL_COLD_PROTECTION_START, &entities[m_target]->pos);
	
	if(m_caster == EntityHandle_Player) {
		m_duration = 0;
		m_hasDuration = false;
	} else {
		m_duration = (m_launchDuration >= 0) ? m_launchDuration : GameDurationMs(20000);
		m_hasDuration = true;
	}
	
	m_fManaCostPerSecond = 1.f;
	
	Entity * io = entities.get(m_target);
	if(io) {
		io->halo.flags = HALO_ACTIVE;
		io->halo.color = Color3f(0.2f, 0.2f, 0.45f);
		io->halo.radius = 45.f;
	}
	
	m_snd_loop = ARX_SOUND_PlaySFX(SND_SPELL_COLD_PROTECTION_LOOP, &entities[m_target]->pos, 1.f, ARX_SOUND_PLAY_LOOPED);
	
	m_targets.push_back(m_target);
}
開發者ID:BSzili,項目名稱:ArxLibertatis,代碼行數:34,代碼來源:SpellsLvl04.cpp

示例2: ARX_SOUND_PlaySFX

void LevitateSpell::Launch()
{
	spells.endByCaster(m_caster, SPELL_LEVITATE);
	
	if(m_caster == PlayerEntityHandle) {
		m_target = PlayerEntityHandle;
	}
	
	ARX_SOUND_PlaySFX(SND_SPELL_LEVITATE_START, &entities[m_target]->pos);
	
	m_duration = (m_launchDuration > -1) ? m_launchDuration : 2000000000;
	m_hasDuration = true;
	m_fManaCostPerSecond = 1.f;
	
	CLevitate * effect = new CLevitate();
	
	Vec3f target;
	if(m_target == PlayerEntityHandle) {
		target = player.pos + Vec3f(0.f, 150.f, 0.f);
		m_duration = 200000000;
		player.levitate = true;
	} else {
		target = entities[m_target]->pos;
	}
	
	effect->Create(16, 50.f, 100.f, 80.f, &target, m_duration);
	m_pSpellFx = effect;
	m_duration = effect->GetDuration();
	
	m_snd_loop = ARX_SOUND_PlaySFX(SND_SPELL_LEVITATE_LOOP,
	                                       &entities[m_target]->pos, 0.7f,
	                                       ARX_SOUND_PLAY_LOOPED);
	
	m_targets.push_back(m_target);
}
開發者ID:carriercomm,項目名稱:ArxLibertatis,代碼行數:35,代碼來源:SpellsLvl05.cpp

示例3: SetDuration

//-----------------------------------------------------------------------------
void CMagicMissile::Create(EERIE_3D aeSrc, EERIE_3D angles)
{
	int i;
	EERIE_3D s, e;

	SetDuration(ulDuration);
	SetAngle(angles.b);

	Vector_Copy(&this->angles, &angles);
	eCurPos.x = eSrc.x = aeSrc.x;
	eCurPos.y = eSrc.y = aeSrc.y;
	eCurPos.z = eSrc.z = aeSrc.z;


	fSize = 1;
	bDone = true;

	s.x = eSrc.x;
	s.y = eSrc.y;
	s.z = eSrc.z;
	e.x = eSrc.x;
	e.y = eSrc.y;
	e.z = eSrc.z;

	i = 0;

	i = 40;
	e.x -= fBetaRadSin * 50 * i;
	e.y += sin(DEG2RAD(MAKEANGLE(this->angles.a))) * 50 * i;
	e.z += fBetaRadCos * 50 * i;

	pathways[0].sx = eSrc.x;
	pathways[0].sy = eSrc.y;
	pathways[0].sz = eSrc.z;
	pathways[5].sx = e.x;
	pathways[5].sy = e.y;
	pathways[5].sz = e.z;
	Split(pathways, 0, 5, 50, 0.5f);

	for (i = 0; i < 6; i++)
	{
		if (pathways[i].sy >= eSrc.y + 150)
		{
			pathways[i].sy = eSrc.y + 150;
		}
	}

	fTrail = 0;

	iLength = 50;
	fOneOnLength = 1.0f / (float) iLength;
	iBezierPrecision = BEZIERPrecision;
	fOneOnBezierPrecision = 1.0f / (float) iBezierPrecision;
	bExplo = false;
	bMove = true;

	ARX_SOUND_PlaySFX(SND_SPELL_MM_CREATE, &eCurPos);
	ARX_SOUND_PlaySFX(SND_SPELL_MM_LAUNCH, &eCurPos);
	snd_loop = ARX_SOUND_PlaySFX(SND_SPELL_MM_LOOP, &eCurPos, 1.0F, ARX_SOUND_PLAY_LOOPED);
}
開發者ID:sopyer,項目名稱:ArxFatalis,代碼行數:61,代碼來源:ARX_SpellFX_Lvl01.cpp

示例4: ARX_SOUND_PlaySFX

void ColdProtectionSpell::Launch()
{
	spells.endByTarget(m_target, SPELL_COLD_PROTECTION);
	spells.endByCaster(m_caster, SPELL_ARMOR);
	spells.endByCaster(m_caster, SPELL_LOWER_ARMOR);
	spells.endByCaster(m_caster, SPELL_FIRE_PROTECTION);
	
	if(m_caster == PlayerEntityHandle) {
		m_target = PlayerEntityHandle;
	}
	
	ARX_SOUND_PlaySFX(SND_SPELL_COLD_PROTECTION_START, &entities[m_target]->pos);
	
	m_duration = (m_launchDuration > -1) ? m_launchDuration : 20000;
	
	if(m_caster == PlayerEntityHandle)
		m_duration = 2000000;
	
	m_hasDuration = true;
	m_fManaCostPerSecond = 1.f;
	
	if(ValidIONum(m_target)) {
		Entity *io = entities[m_target];
		io->halo.flags = HALO_ACTIVE;
		io->halo.color = Color3f(0.2f, 0.2f, 0.45f);
		io->halo.radius = 45.f;
	}
	
	m_snd_loop = ARX_SOUND_PlaySFX(SND_SPELL_COLD_PROTECTION_LOOP, &entities[m_target]->pos, 1.f, ARX_SOUND_PLAY_LOOPED);
	
	m_targets.push_back(m_target);
}
開發者ID:Batora07,項目名稱:ArxLibertatis,代碼行數:32,代碼來源:SpellsLvl04.cpp

示例5: ARX_SOUND_PlaySFX

void FlyingEyeSpell::End()
{
	ARX_SOUND_PlaySFX(SND_MAGIC_FIZZLE, &entities[m_caster]->pos);
	
	static TextureContainer * tc4=TextureContainer::Load("graph/particles/smoke");
	
	ARX_SOUND_PlaySFX(SND_SPELL_EYEBALL_OUT);
	eyeball.exist = -100;
	
	for(long n = 0; n < 12; n++) {
		
		PARTICLE_DEF * pd = createParticle();
		if(!pd) {
			break;
		}
		
		pd->ov = eyeball.pos + randomVec(-5.f, 5.f);
		pd->move = randomVec(-2.f, 2.f);
		pd->siz = 28.f;
		pd->tolive = Random::get(2000, 6000);
		pd->scale = Vec3f(12.f);
		pd->tc = tc4;
		pd->special = FADE_IN_AND_OUT | ROTATING | MODULATE_ROTATION | DISSIPATING;
		pd->fparam = 0.0000001f;
		pd->rgb = Color3f(0.7f, 0.7f, 1.f);
	}
	
	config.input.mouseLookToggle = bOldLookToggle;
	
	lightHandleDestroy(special[2]);
	lightHandleDestroy(special[1]);
}
開發者ID:Drakesinger,項目名稱:ArxLibertatis,代碼行數:32,代碼來源:SpellsLvl07.cpp

示例6: SetDuration

void CMagicMissile::Create(const Vec3f & aeSrc, const Anglef & angles)
{
	SetDuration(ulDuration);
	
	eCurPos = eSrc = aeSrc;
	
	short i = 40.f;
	Vec3f e = eSrc;
	e += angleToVectorXZ(angles.getPitch()) * (50.f * i);
	e.y += std::sin(glm::radians(MAKEANGLE(angles.getYaw()))) * (50.f * i);
	
	pathways[0] = eSrc;
	pathways[5] = e;
	Split(pathways, 0, 5, 50, 0.5f);

	for(i = 0; i < 6; i++) {
		if(pathways[i].y >= eSrc.y + 150) {
			pathways[i].y = eSrc.y + 150;
		}
	}

	fTrail = 0;

	iLength = 50;
	iBezierPrecision = BEZIERPrecision;
	fOneOnBezierPrecision = 1.0f / (float) iBezierPrecision;
	bExplo = false;
	bMove = true;

	ARX_SOUND_PlaySFX(SND_SPELL_MM_CREATE, &eCurPos);
	ARX_SOUND_PlaySFX(SND_SPELL_MM_LAUNCH, &eCurPos);
	snd_loop = ARX_SOUND_PlaySFX(SND_SPELL_MM_LOOP, &eCurPos, 1.0F, ARX_SOUND_PLAY_LOOPED);
}
開發者ID:hulu1528,項目名稱:ArxLibertatis,代碼行數:33,代碼來源:MagicMissile.cpp

示例7: AddQuakeFX

void AddQuakeFX(float intensity, float duration, float period, bool sound) {

	if(QuakeFx.intensity > 0.f) {
		QuakeFx.intensity += intensity;

		QuakeFx.duration += (unsigned long)duration;
		QuakeFx.frequency += period;
		QuakeFx.frequency *= .5f;
		QuakeFx.sound = QuakeFx.sound || sound;

		if(sound)
			ARX_SOUND_PlaySFX(SND_QUAKE, NULL, 1.0F - 0.5F * QuakeFx.intensity);
	} else {
		QuakeFx.intensity = intensity;

		QuakeFx.start = checked_range_cast<unsigned long>(arxtime.get_frame_time());

		QuakeFx.duration = (unsigned long)duration;
		QuakeFx.frequency = period;
		QuakeFx.sound = sound;

		if(sound)
			ARX_SOUND_PlaySFX(SND_QUAKE, NULL, 1.0F - 0.5F * QuakeFx.intensity);
	}

	if(!sound) {
		if(QuakeFx.duration > 1500)
			QuakeFx.duration = 1500;

		if(QuakeFx.intensity > 220)
			QuakeFx.intensity = 220;
	}
}
開發者ID:Dimoks,項目名稱:ArxLibertatis_fork,代碼行數:33,代碼來源:Quake.cpp

示例8: ARX_SOUND_PlaySFX

void MassIncinerateSpell::Launch()
{
	ARX_SOUND_PlaySFX(SND_SPELL_MASS_INCINERATE);
	
	m_duration = 20000;
	
	long nb_targets=0;
	for(size_t ii = 0; ii < entities.size(); ii++) {
		const EntityHandle handle = EntityHandle(ii);
		Entity * tio = entities[handle];
		
		if(handle == m_caster || !tio || !(tio->ioflags & IO_NPC)) {
			continue;
		}
		
		if(tio->_npcdata->lifePool.current <= 0.f || tio->show != SHOW_FLAG_IN_SCENE) {
			continue;
		}
		
		if(fartherThan(tio->pos, entities[m_caster]->pos, 500.f)) {
			continue;
		}
		
		tio->sfx_flag |= SFX_TYPE_YLSIDE_DEATH | SFX_TYPE_INCINERATE;
		tio->sfx_time = arxtime.now_ul();
		nb_targets++;
		m_targets.push_back(tio->index());
	}
	
	if(nb_targets) {
		m_snd_loop = ARX_SOUND_PlaySFX(SND_SPELL_INCINERATE_LOOP, &m_caster_pos, 1.f, ARX_SOUND_PLAY_LOOPED);
	} else {
		m_snd_loop = audio::INVALID_ID;
	}
}
開發者ID:Mixone-FinallyHere,項目名稱:ArxLibertatis,代碼行數:35,代碼來源:SpellsLvl10.cpp

示例9: ARX_SOUND_PlaySFX

void FlyingEyeSpell::End() {
	
	Entity * caster = entities.get(m_caster);
	if(caster) {
		ARX_SOUND_PlaySFX(g_snd.MAGIC_FIZZLE, &caster->pos);
	}
	
	static TextureContainer * tc4 = TextureContainer::Load("graph/particles/smoke");
	
	ARX_SOUND_PlaySFX(g_snd.SPELL_EYEBALL_OUT);
	eyeball.exist = -100;
	
	for(long n = 0; n < 12; n++) {
		
		PARTICLE_DEF * pd = createParticle();
		if(!pd) {
			break;
		}
		
		pd->ov = eyeball.pos + arx::randomVec(-5.f, 5.f);
		pd->move = arx::randomVec(-2.f, 2.f);
		pd->siz = 28.f;
		pd->tolive = Random::getu(2000, 6000);
		pd->scale = Vec3f(12.f);
		pd->tc = tc4;
		pd->m_flags = FADE_IN_AND_OUT | ROTATING | DISSIPATING;
		pd->m_rotation = 0.0000001f;
		pd->rgb = Color3f(0.7f, 0.7f, 1.f);
	}
	
	config.input.mouseLookToggle = bOldLookToggle;
	
	lightHandleDestroy(m_light1);
	lightHandleDestroy(m_light2);
}
開發者ID:bsxf-47,項目名稱:ArxLibertatis,代碼行數:35,代碼來源:SpellsLvl07.cpp

示例10: ARX_SOUND_PlaySFX

void CurePoisonSpell::Launch() {
	
	if(m_caster == EntityHandle_Player) {
		m_target = EntityHandle_Player;
	}
	
	float cure = m_level * 10;
	if(m_target == EntityHandle_Player) {
		player.poison -= std::min(player.poison, cure);
		ARX_SOUND_PlaySFX(g_snd.SPELL_CURE_POISON);
	} else if(Entity * io = entities.get(m_target)) {
		if(io->ioflags & IO_NPC) {
			io->_npcdata->poisonned -= std::min(io->_npcdata->poisonned, cure);
		}
		ARX_SOUND_PlaySFX(g_snd.SPELL_CURE_POISON, &io->pos);
	}
	
	m_duration = GameDurationMs(3500);
	m_hasDuration = true;
	
	m_particles.SetParams(g_particleParameters[ParticleParam_CurePoison]);
	
	EERIE_LIGHT * light = dynLightCreate(m_light);
	if(light) {
		light->intensity = 1.5f;
		light->fallstart = 200.f;
		light->fallend   = 350.f;
		light->rgb = Color3f(0.f, 1.f, 0.0f);
		light->pos = m_pos + Vec3f(0.f, -50.f, 0.f);
		light->creationTime = g_gameTime.now();
		light->duration = GameDurationMs(200);
		light->extras = 0;
	}
}
開發者ID:bsxf-47,項目名稱:ArxLibertatis,代碼行數:34,代碼來源:SpellsLvl05.cpp

示例11: Vec3f

void MassLightningStrikeSpell::Launch()
{
	spells.endByType(SPELL_MASS_LIGHTNING_STRIKE);
	
	m_duration = 5000; // TODO probably never read
	m_soundEffectPlayed = false;
	
	float beta;
	if(m_caster == PlayerEntityHandle) {
		m_pos = player.pos + Vec3f(0.f, 150.f, 0.f);
		beta = player.angle.getPitch();
	} else {
		Entity * io = entities[m_caster];
		m_pos = io->pos + Vec3f(0.f, -20.f, 0.f);
		beta = io->angle.getPitch();
	}
	m_pos += angleToVectorXZ(beta) * 500.f;
	
	long minDuration = long(500 * m_level);
	long maxDuration = 0;
	
	int number = glm::clamp(int(m_level), 1, 10);
	float ft = 360.0f / (float)number;
	
	for(int i = 0; i < number; i++) {
		Vec3f target = m_pos + angleToVectorXZ(i * ft) * 500.0f;
		long duration = minDuration + Random::get(0, 5000);
		maxDuration = std::max(maxDuration, duration);
		
		CLightning * lightning = new CLightning();
		lightning->m_isMassLightning = true;
		lightning->m_fDamage = 2;
		lightning->Create(m_pos, target);
		lightning->SetDuration(duration);
		pTab.push_back(lightning);
	}
	
	m_duration = maxDuration + 1000;
	
	m_light = GetFreeDynLight();
	if(lightHandleIsValid(m_light)) {
		EERIE_LIGHT * light = lightHandleGet(m_light);
		
		light->intensity = 1.8f;
		light->fallend = 850.f;
		light->fallstart = 500.f;
		light->rgb = Color3f::red; // Color3f(1.f, 0.75f, 0.75f);
		light->pos = m_pos;
	}
	
	ARX_SOUND_PlaySFX(SND_SPELL_LIGHTNING_START);
	m_snd_loop = ARX_SOUND_PlaySFX(SND_SPELL_LIGHTNING_LOOP, &m_pos, 1.f, ARX_SOUND_PLAY_LOOPED);
	
	// Draws White Flash on Screen
	GRenderer->SetBlendFunc(BlendOne, BlendOne);
	GRenderer->SetRenderState(Renderer::AlphaBlending, true);
	EERIEDrawBitmap(Rectf(g_size), 0.00009f, NULL, Color::white);
	GRenderer->SetRenderState(Renderer::AlphaBlending, false);
}
開發者ID:Mixone-FinallyHere,項目名稱:ArxLibertatis,代碼行數:59,代碼來源:SpellsLvl10.cpp

示例12: ARX_SOUND_Stop

void LightningStrikeSpell::End() {
	
	ARX_SOUND_Stop(m_snd_loop);
	m_snd_loop = audio::SourcedSample();
	
	Entity * caster = entities.get(m_caster);
	if(caster) {
		ARX_SOUND_PlaySFX(g_snd.SPELL_ELECTRIC, &caster->pos);
		ARX_SOUND_PlaySFX(g_snd.SPELL_LIGHTNING_END, &caster->pos);
	}
}
開發者ID:bsxf-47,項目名稱:ArxLibertatis,代碼行數:11,代碼來源:SpellsLvl07.cpp

示例13: ARX_SOUND_PlaySFX

void FireFieldSpell::Launch() {
	
	spells.endByCaster(m_caster, SPELL_FIRE_FIELD);
	
	ARX_SOUND_PlaySFX(SND_SPELL_FIRE_FIELD_START);
	
	m_duration = (m_launchDuration > ArxDuration(-1)) ? m_launchDuration : ArxDurationMs(100000);
	m_hasDuration = true;
	m_fManaCostPerSecond = 2.8f;
	m_light = LightHandle();
	
	Vec3f target;
	float beta = 0.f;
	bool displace = false;
	if(m_caster == EntityHandle_Player) {
		target = player.basePosition();
		beta = player.angle.getYaw();
		displace = true;
	} else {
		if(ValidIONum(m_caster)) {
			Entity * io = entities[m_caster];
			target = io->pos;
			beta = io->angle.getYaw();
			displace = (io->ioflags & IO_NPC) == IO_NPC;
		} else {
			ARX_DEAD_CODE();
		}
	}
	if(displace) {
		target += angleToVectorXZ(beta) * 250.f;
	}
	
	m_pos = target + Vec3f(0, -10, 0);
	
	DamageParameters damage;
	damage.radius = 150.f;
	damage.damages = 10.f;
	damage.area = DAMAGE_FULL;
	damage.duration = ArxDurationMs(100000000);
	damage.source = m_caster;
	damage.flags = 0;
	damage.type = DAMAGE_TYPE_MAGICAL | DAMAGE_TYPE_FIRE | DAMAGE_TYPE_FIELD;
	damage.pos = target;
	m_damage = DamageCreate(damage);
	
	m_snd_loop = ARX_SOUND_PlaySFX(SND_SPELL_FIRE_FIELD_LOOP, &target, 1.f, ARX_SOUND_PLAY_LOOPED);
	
	pPSStream.SetParams(g_particleParameters[ParticleParam_FireFieldBase]);
	pPSStream.SetPos(m_pos);
	
	pPSStream1.SetParams(g_particleParameters[ParticleParam_FireFieldFlame]);
	pPSStream1.SetPos(m_pos + Vec3f(0, 10, 0));
	pPSStream1.Update(0);
}
開發者ID:Dimoks,項目名稱:ArxLibertatis_fork,代碼行數:54,代碼來源:SpellsLvl07.cpp

示例14: target

void LightningStrikeSpell::Launch() {
	
	Vec3f target(0.f, 0.f, -500.f);
	m_lightning.Create(Vec3f_ZERO, target);
	m_lightning.SetDuration(long(500 * m_level));
	m_lightning.m_isMassLightning = false;
	m_duration = m_lightning.GetDuration();
	
	ARX_SOUND_PlaySFX(SND_SPELL_LIGHTNING_START, &m_caster_pos);
	
	m_snd_loop = ARX_SOUND_PlaySFX(SND_SPELL_LIGHTNING_LOOP, &m_caster_pos, 1.f, ARX_SOUND_PLAY_LOOPED);
}
開發者ID:Drakesinger,項目名稱:ArxLibertatis,代碼行數:12,代碼來源:SpellsLvl07.cpp

示例15: ArxDurationMs

void MagicSightSpell::Launch()
{
	m_fManaCostPerSecond = 0.36f;
	m_hasDuration = true;
	m_duration = (m_launchDuration > ArxDurationMs(-1)) ? m_launchDuration : ArxDurationMs(6000000);
	
	ARX_SOUND_PlaySFX(SND_SPELL_VISION_START, &m_caster_pos);
	
	if(m_caster == EntityHandle_Player) {
		player.m_improve = true;
		m_snd_loop = ARX_SOUND_PlaySFX(SND_SPELL_VISION_LOOP, &m_caster_pos, 1.f, ARX_SOUND_PLAY_LOOPED);
	}
}
開發者ID:Dimoks,項目名稱:ArxLibertatis_fork,代碼行數:13,代碼來源:SpellsLvl01.cpp


注:本文中的ARX_SOUND_PlaySFX函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。