void SummonCreatureSpell::Launch() { m_hasDuration = true; m_fManaCostPerSecond = 1.9f; m_requestSummon = false; m_summonedEntity = EntityHandle(); m_duration = (m_launchDuration > -1) ? m_launchDuration : 2000000; Vec3f target; float beta; GetTargetAndBeta(target, beta); m_megaCheat = (m_caster == PlayerEntityHandle && cur_mega == 10); m_targetPos = target; ARX_SOUND_PlaySFX(SND_SPELL_SUMMON_CREATURE, &m_targetPos); m_fissure.Create(target, MAKEANGLE(player.angle.getPitch())); m_fissure.SetDuration(2000, 500, 1500); m_fissure.SetColorBorder(Color3f::red); m_fissure.SetColorRays1(Color3f::red); m_fissure.SetColorRays2(Color3f::yellow * .5f); m_light = GetFreeDynLight(); if(lightHandleIsValid(m_light)) { EERIE_LIGHT * light = lightHandleGet(m_light); light->intensity = 0.3f; light->fallend = 500.f; light->fallstart = 400.f; light->rgb = Color3f::red; light->pos = m_fissure.m_eSrc; } }
void SummonCreatureSpell::Launch() { m_fManaCostPerSecond = 1.9f; m_requestSummon = false; m_summonedEntity = EntityHandle(); m_hasDuration = m_launchDuration >= 0; m_duration = m_hasDuration ? m_launchDuration : 0; Vec3f target; float beta; GetTargetAndBeta(target, beta); m_megaCheat = (m_caster == EntityHandle_Player && cur_mega == 10); m_targetPos = target; ARX_SOUND_PlaySFX(SND_SPELL_SUMMON_CREATURE, &m_targetPos); m_fissure.Create(target, MAKEANGLE(player.angle.getYaw())); m_fissure.SetDuration(GameDurationMs(2000), GameDurationMs(500), GameDurationMs(1500)); m_fissure.SetColorBorder(Color3f::red); m_fissure.SetColorRays1(Color3f::red); m_fissure.SetColorRays2(Color3f::yellow * .5f); EERIE_LIGHT * light = dynLightCreate(m_light); if(light) { light->intensity = 0.3f; light->fallend = 500.f; light->fallstart = 400.f; light->rgb = Color3f::red; light->pos = m_fissure.m_eSrc; } }
bool SummonCreatureSpell::CanLaunch() { Vec3f target; float beta; GetTargetAndBeta(target, beta); if(!ARX_INTERACTIVE_ConvertToValidPosForIO(NULL, &target)) { ARX_SOUND_PlaySFX(SND_MAGIC_FIZZLE); return false; } return true; }
bool RiseDeadSpell::CanLaunch() { //TODO always cancel spell even if new one can't be launched ? spells.endByCaster(m_caster, SPELL_RISE_DEAD); float beta; Vec3f target; GetTargetAndBeta(target, beta); if(!ARX_INTERACTIVE_ConvertToValidPosForIO(NULL, &target)) { ARX_SOUND_PlaySFX(SND_MAGIC_FIZZLE); return false; } return true; }
void RiseDeadSpell::Launch() { float beta; Vec3f target; GetTargetAndBeta(target, beta); m_targetPos = target; ARX_SOUND_PlaySFX(SND_SPELL_RAISE_DEAD, &m_targetPos); // TODO this tolive value is probably never read m_duration = (m_launchDuration > -1) ? m_launchDuration : 2000000; m_hasDuration = true; m_fManaCostPerSecond = 1.2f; m_creationFailed = false; m_entity = EntityHandle(); m_fissure.Create(target, beta); m_fissure.SetDuration(2000, 500, 1800); m_fissure.SetColorBorder(Color3f(0.5, 0.5, 0.5)); m_fissure.SetColorRays1(Color3f(0.5, 0.5, 0.5)); m_fissure.SetColorRays2(Color3f(1.f, 0.f, 0.f)); if(!lightHandleIsValid(m_light)) { m_light = GetFreeDynLight(); } if(lightHandleIsValid(m_light)) { EERIE_LIGHT * light = lightHandleGet(m_light); light->intensity = 1.3f; light->fallend = 450.f; light->fallstart = 380.f; light->rgb = Color3f::black; light->pos = target - Vec3f(0.f, 100.f, 0.f); light->duration = 200; light->time_creation = (unsigned long)(arxtime); } m_duration = m_fissure.GetDuration(); }