void LaunchPoisonExplosion(Vec3f * aePos) { // système de partoches pour l'explosion ParticleSystem * pPS = new ParticleSystem(); ParticleParams cp; cp.iNbMax = 80; cp.fLife = 1500; cp.fLifeRandom = 500; cp.p3Pos = Vec3f::repeat(5); cp.p3Direction.x = 0; cp.p3Direction.y = 4; cp.p3Direction.z = 0; cp.fAngle = radians(360); cp.fSpeed = 200; cp.fSpeedRandom = 0; cp.p3Gravity.x = 0; cp.p3Gravity.y = 17; cp.p3Gravity.z = 0; cp.fFlash = 0; cp.fRotation = 80; cp.bRotationRandomDirection = true; cp.bRotationRandomStart = true; cp.fStartSize = 5; cp.fStartSizeRandom = 3; cp.fStartColor[0] = 0; cp.fStartColor[1] = 76; cp.fStartColor[2] = 0; cp.fStartColor[3] = 0; cp.fStartColorRandom[0] = 0; cp.fStartColorRandom[1] = 0; cp.fStartColorRandom[2] = 0; cp.fStartColorRandom[3] = 150; cp.bStartLock = false; cp.fEndSize = 30; cp.fEndSizeRandom = 5; cp.fEndColor[0] = 0; cp.fEndColor[1] = 0; cp.fEndColor[2] = 0; cp.fEndColor[3] = 0; cp.fEndColorRandom[0] = 0; cp.fEndColorRandom[1] = 25; cp.fEndColorRandom[2] = 0; cp.fEndColorRandom[3] = 20; cp.bEndLock = false; cp.iBlendMode = 3; cp.iFreq = -1; cp.bTexInfo = false; pPS->SetParams(cp); pPS->ulParticleSpawn = 0; pPS->SetTexture("graph/particles/big_greypouf", 0, 200); pPS->SetPos(*aePos); pPS->Update(0); pPS->iParticleNbMax = 0; std::list<Particle *>::iterator i; for (i = pPS->listParticle.begin(); i != pPS->listParticle.end(); ++i) { Particle * pP = *i; if (pP->isAlive()) { if (pP->p3Velocity.y >= 0.5f * 200) pP->p3Velocity.y = 0.5f * 200; if (pP->p3Velocity.y <= -0.5f * 200) pP->p3Velocity.y = -0.5f * 200; } } if (pParticleManager) { pParticleManager->AddSystem(pPS); } }
//----------------------------------------------------------------------------- //!!!!!!! def non impair void CParalyse::Create(int adef, float arayon, float ahcapuchon, float ahauteur, Vec3f * aePos, int aduration) { if(adef < 3) return; key = -1; pos = *aePos; currduration = colduration = 0; duration = aduration; prisminterpcol = 0.f; r = arayon; SetColPrismDep(128.f, 128.f, 128.f); SetColPrismEnd(100.f, 100.f, 128.f); prismnbpt = 1 + (adef << 1); prismnbface = adef + (adef << 1); prismd3d = new TexturedVertex[prismnbpt]; prismvertex = new Vec3f[prismnbpt]; prismind = new unsigned short [prismnbface*3]; for(int i = 0; i < 100; i++) { tabprism[i].vertex = new Vec3f[prismnbpt]; } tex_prism = TextureContainer::Load("graph/obj3d/textures/(fx)_paralyze"); tex_p = TextureContainer::Load("graph/particles/missile"); tex_p1 = TextureContainer::Load("graph/obj3d/textures/(fx)_tsu_blueting"); tex_p2 = TextureContainer::Load("graph/obj3d/textures/(fx)_tsu_bluepouf"); CreatePrismTriangleList(arayon, ahcapuchon, ahauteur, adef); CreateLittlePrismTriangleList(); if(lLightId >= 0) { int id = lLightId; DynLight[id].exist = 1; DynLight[id].intensity = 1.4f + 4.f * rnd(); DynLight[id].fallend = r * 3.f; DynLight[id].fallstart = r * 3.f * .75f; DynLight[id].rgb.r = (prismrd * 2.f) / 255.f; DynLight[id].rgb.g = (prismgd * 2.f) / 255.f; DynLight[id].rgb.b = (prismbd * 2.f) / 255.f; DynLight[id].pos.x = pos.x; DynLight[id].pos.y = pos.y - ahcapuchon * .5f; DynLight[id].pos.z = pos.z; } // système de partoches pour la poussière ParticleSystem * pPS = new ParticleSystem(); ParticleParams cp; memset(&cp, 0, sizeof(cp)); cp.iNbMax = 200; cp.fLife = 500; //2000 cp.fLifeRandom = 900; cp.p3Pos.x = 20; cp.p3Pos.y = 80; cp.p3Pos.z = 20; cp.p3Direction.x = 0; cp.p3Direction.y = -10; cp.p3Direction.z = 0; cp.fAngle = radians(360); cp.fSpeed = 10; cp.fSpeedRandom = 10; cp.p3Gravity.x = 0; cp.p3Gravity.y = 10; cp.p3Gravity.z = 0; cp.fFlash = 0; cp.fRotation = 0; cp.fStartSize = 0; cp.fStartSizeRandom = 1; cp.fStartColor[0] = 20; cp.fStartColor[1] = 20; cp.fStartColor[2] = 20; cp.fStartColor[3] = 50; cp.fStartColorRandom[0] = 0; cp.fStartColorRandom[1] = 0; cp.fStartColorRandom[2] = 0; cp.fStartColorRandom[3] = 50; cp.fEndSize = 1; cp.fEndSizeRandom = 4; cp.fEndColor[0] = 20; cp.fEndColor[1] = 20; cp.fEndColor[2] = 20; cp.fEndColor[3] = 10; cp.fEndColorRandom[0] = 0; cp.fEndColorRandom[1] = 0; cp.fEndColorRandom[2] = 0; cp.fEndColorRandom[3] = 0; cp.iBlendMode = 5; pPS->SetParams(cp); pPS->ulParticleSpawn = 0; pPS->SetTexture("graph/particles/lil_greypouf", 0, 200); Vec3f ep; ep.x = aePos->x; ep.y = aePos->y - 80; ep.z = aePos->z; pPS->SetPos(ep); pPS->Update(0); pPS->iParticleNbMax = 0; if (pParticleManager) { pParticleManager->AddSystem(pPS); } else { // TODO memory leak (pPS)? } // système de partoches pour la poussière au sol pPS = new ParticleSystem(); cp.iNbMax = 20; cp.fLife = 1000; //2000 cp.fLifeRandom = 2000; cp.p3Pos.x = 20; cp.p3Pos.y = 5; cp.p3Pos.z = 20; cp.p3Direction.x = 0; cp.p3Direction.y = -10; cp.p3Direction.z = 0; cp.fAngle = radians(144); cp.fSpeed = 10; cp.fSpeedRandom = 10; cp.p3Gravity.x = 0; cp.p3Gravity.y = -4; cp.p3Gravity.z = 0; cp.fFlash = 0; cp.fRotation = 0; cp.fStartSize = 2; cp.fStartSizeRandom = 2; cp.fStartColor[0] = 25; cp.fStartColor[1] = 25; cp.fStartColor[2] = 25; cp.fStartColor[3] = 0; cp.fStartColorRandom[0] = 25; cp.fStartColorRandom[1] = 25; cp.fStartColorRandom[2] = 25; cp.fStartColorRandom[3] = 25; cp.bStartLock = true; cp.fEndSize = 5; cp.fEndSizeRandom = 10; cp.fEndColor[0] = 7; cp.fEndColor[1] = 7; cp.fEndColor[2] = 7; cp.fEndColor[3] = 0; cp.fEndColorRandom[0] = 27; cp.fEndColorRandom[1] = 0; cp.fEndColorRandom[2] = 0; cp.fEndColorRandom[3] = 0; cp.bEndLock = true; cp.iBlendMode = 5; pPS->SetParams(cp); pPS->ulParticleSpawn = 0; pPS->SetTexture("graph/particles/lil_greypouf", 0, 200); ep.x = aePos->x; ep.y = aePos->y - 10; ep.z = aePos->z; pPS->SetPos(ep); pPS->Update(0); pPS->iParticleNbMax = 0; if(pParticleManager) { pParticleManager->AddSystem(pPS); } else { // TODO memory leak (pPS)? } }
void LaunchMagicMissileExplosion(const Vec3f & _ePos, int t = 0, long spellinstance = -1) { // système de partoches pour l'explosion ParticleSystem * pPS = new ParticleSystem(); ParticleParams cp; memset(&cp, 0, sizeof(cp)); cp.iNbMax = 100 + t * 50; cp.fLife = 1500; cp.fLifeRandom = 0; cp.p3Pos = Vec3f(10.f); cp.p3Direction = Vec3f(0.f, -10.f, 0.f); cp.fAngle = radians(360); cp.fSpeed = 130; cp.fSpeedRandom = 100; cp.p3Gravity = Vec3f(0.f, 10.f, 0.f); cp.fFlash = 0; cp.fRotation = 16; cp.fStartSize = 5; cp.fStartSizeRandom = 10; cp.fEndSize = 0; cp.fEndSizeRandom = 2; if(spellinstance >= 0 && spells[spellinstance].caster == 0 && cur_mr == 3) { cp.fStartSize = 20; cp.fSpeed = 13; cp.fSpeedRandom = 10; cp.fStartColorRandom[0] = 0; cp.fStartColorRandom[1] = 0; cp.fStartColorRandom[2] = 0; cp.fStartColorRandom[3] = 0; cp.fStartColor[0] = 0; cp.fStartColor[1] = 0; cp.fStartColor[2] = 0; cp.fStartColor[3] = 0; cp.fEndColor[0] = 255; cp.fEndColor[1] = 40; cp.fEndColor[2] = 120; cp.fEndColor[3] = 10;//55; pPS->SetTexture("graph/particles/(fx)_mr", 0, 500); } else { cp.fStartColorRandom[0] = 100; cp.fStartColorRandom[1] = 100; cp.fStartColorRandom[2] = 100; cp.fStartColorRandom[3] = 100; cp.fStartColor[0] = 110; cp.fStartColor[1] = 110; cp.fStartColor[2] = 110; cp.fStartColor[3] = 110; cp.fEndColor[0] = 0; cp.fEndColor[1] = 0; cp.fEndColor[2] = 120; cp.fEndColor[3] = 10; pPS->SetTexture("graph/particles/magicexplosion", 0, 500); } cp.fEndColorRandom[0] = 50; cp.fEndColorRandom[1] = 50; cp.fEndColorRandom[2] = 50; cp.fEndColorRandom[3] = 50; cp.blendMode = RenderMaterial::Additive; pPS->SetParams(cp); pPS->ulParticleSpawn = 0; Vec3f eP = _ePos; pPS->SetPos(eP); pPS->Update(0); pPS->iParticleNbMax = 0; long id = GetFreeDynLight(); if(id != -1) { DynLight[id].exist = 1; DynLight[id].intensity = 2.3f; DynLight[id].fallstart = 250.f; DynLight[id].fallend = 420.f; if(spellinstance >= 0 && spells[spellinstance].caster == 0 && cur_mr == 3) { DynLight[id].rgb.r = 1.f; DynLight[id].rgb.g = 0.3f; DynLight[id].rgb.b = .8f; } else { DynLight[id].rgb.r = 0.f; DynLight[id].rgb.g = 0.f; DynLight[id].rgb.b = .8f; } DynLight[id].pos = eP; DynLight[id].duration = 1500; } if(pParticleManager) pParticleManager->AddSystem(pPS); ARX_SOUND_PlaySFX(SND_SPELL_MM_HIT, &_ePos); }