Example #1
0
void MagicMissileSpell::Update(float timeDelta)
{
	CSpellFx *pCSpellFX = m_pSpellFx;

	if(pCSpellFX) {
		CMultiMagicMissile *pMMM = (CMultiMagicMissile *) pCSpellFX;
		pMMM->CheckCollision(m_level, m_caster);

		// Update
		pCSpellFX->Update(timeDelta);

		if(pMMM->CheckAllDestroyed())
			m_duration = 0;

		pCSpellFX->Render();
	}
}
void LevitateSpell::Update(float timeDelta)
{
	CLevitate *pLevitate=(CLevitate *)m_pSpellFx;
	Vec3f target;

	if(m_target == PlayerEntityHandle) {
		target = player.pos + Vec3f(0.f, 150.f, 0.f);
		player.levitate = true;
	} else {
		target = entities[m_caster]->pos;
	}

	pLevitate->ChangePos(&target);
		
	CSpellFx *pCSpellFX = m_pSpellFx;

	if(pCSpellFX) {
		pCSpellFX->Update(timeDelta);
		pCSpellFX->Render();
	}
	ARX_SOUND_RefreshPosition(m_snd_loop, entities[m_target]->pos);
}