Search in sources :

Example 46 with AMParticle

use of am2.particles.AMParticle in project ArsMagica2 by Mithion.

the class DivineIntervention method spawnParticles.

@Override
public void spawnParticles(World world, double x, double y, double z, EntityLivingBase caster, Entity target, Random rand, int colorModifier) {
    for (int i = 0; i < 100; ++i) {
        AMParticle particle = (AMParticle) AMCore.proxy.particleManager.spawn(world, "arcane", x, y - 1, z);
        if (particle != null) {
            particle.addRandomOffset(1, 1, 1);
            if (rand.nextBoolean())
                particle.AddParticleController(new ParticleOrbitEntity(particle, target, 0.1f, 1, false).SetTargetDistance(rand.nextDouble() + 0.5));
            else
                particle.AddParticleController(new ParticleOrbitPoint(particle, x, y, z, 1, false).SetOrbitSpeed(0.1f).SetTargetDistance(rand.nextDouble() + 0.5));
            particle.setMaxAge(25 + rand.nextInt(10));
            if (colorModifier > -1) {
                particle.setRGBColorF(((colorModifier >> 16) & 0xFF) / 255.0f, ((colorModifier >> 8) & 0xFF) / 255.0f, (colorModifier & 0xFF) / 255.0f);
            }
        }
    }
}
Also used : AMParticle(am2.particles.AMParticle) ParticleOrbitEntity(am2.particles.ParticleOrbitEntity) ParticleOrbitPoint(am2.particles.ParticleOrbitPoint) ParticleOrbitPoint(am2.particles.ParticleOrbitPoint)

Example 47 with AMParticle

use of am2.particles.AMParticle in project ArsMagica2 by Mithion.

the class Drown method spawnParticles.

@Override
public void spawnParticles(World world, double x, double y, double z, EntityLivingBase caster, Entity target, Random rand, int colorModifier) {
    for (int i = 0; i < 25; ++i) {
        AMParticle particle = (AMParticle) AMCore.proxy.particleManager.spawn(world, "bubbles", x, y, z);
        if (particle != null) {
            particle.addRandomOffset(1, 0.5, 1);
            particle.addVelocity(rand.nextDouble() * 0.2 - 0.1, rand.nextDouble() * 0.2, rand.nextDouble() * 0.2 - 0.1);
            particle.setAffectedByGravity();
            particle.setDontRequireControllers();
            particle.setMaxAge(5);
            particle.setParticleScale(0.1f);
            if (colorModifier > -1) {
                particle.setRGBColorF(((colorModifier >> 16) & 0xFF) / 255.0f, ((colorModifier >> 8) & 0xFF) / 255.0f, (colorModifier & 0xFF) / 255.0f);
            }
        }
    }
}
Also used : AMParticle(am2.particles.AMParticle)

Example 48 with AMParticle

use of am2.particles.AMParticle in project ArsMagica2 by Mithion.

the class Invisiblity method spawnParticles.

@Override
public void spawnParticles(World world, double x, double y, double z, EntityLivingBase caster, Entity target, Random rand, int colorModifier) {
    for (int i = 0; i < 25; ++i) {
        AMParticle particle = (AMParticle) AMCore.proxy.particleManager.spawn(world, "ember", x, y - 1, z);
        if (particle != null) {
            particle.addRandomOffset(1, 1, 1);
            particle.AddParticleController(new ParticleFloatUpward(particle, 0, 0.1f, 1, false));
            particle.AddParticleController(new ParticleOrbitPoint(particle, x, y, z, 2, false).SetOrbitSpeed(0.5f).setIgnoreYCoordinate(true).SetTargetDistance(0.3f + rand.nextDouble() * 0.3));
            particle.AddParticleController(new ParticleFadeOut(particle, 3, false).setFadeSpeed(0.05f).setKillParticleOnFinish(true));
            particle.setMaxAge(20);
            particle.setParticleScale(0.1f);
            if (colorModifier > -1) {
                particle.setRGBColorF(((colorModifier >> 16) & 0xFF) / 255.0f, ((colorModifier >> 8) & 0xFF) / 255.0f, (colorModifier & 0xFF) / 255.0f);
            }
        }
    }
}
Also used : AMParticle(am2.particles.AMParticle) ParticleOrbitPoint(am2.particles.ParticleOrbitPoint) ParticleFadeOut(am2.particles.ParticleFadeOut) ParticleFloatUpward(am2.particles.ParticleFloatUpward) ParticleOrbitPoint(am2.particles.ParticleOrbitPoint)

Example 49 with AMParticle

use of am2.particles.AMParticle in project ArsMagica2 by Mithion.

the class Leap method spawnParticles.

@Override
public void spawnParticles(World world, double x, double y, double z, EntityLivingBase caster, Entity target, Random rand, int colorModifier) {
    for (int i = 0; i < 5; ++i) {
        AMParticle particle = (AMParticle) AMCore.proxy.particleManager.spawn(world, "wind", x, y, z);
        if (particle != null) {
            particle.addRandomOffset(1, 0.5, 1);
            particle.addVelocity(rand.nextDouble() * 0.2 - 0.1, rand.nextDouble() * 0.2, rand.nextDouble() * 0.2 - 0.1);
            particle.setAffectedByGravity();
            particle.setDontRequireControllers();
            particle.setMaxAge(15);
            particle.setParticleScale(0.1f);
            if (colorModifier > -1) {
                particle.setRGBColorF(((colorModifier >> 16) & 0xFF) / 255.0f, ((colorModifier >> 8) & 0xFF) / 255.0f, (colorModifier & 0xFF) / 255.0f);
            }
        }
    }
}
Also used : AMParticle(am2.particles.AMParticle)

Example 50 with AMParticle

use of am2.particles.AMParticle in project ArsMagica2 by Mithion.

the class Mark method SetupParticle.

private void SetupParticle(World world, double x, double y, double z, double motionx, double motionz, int colorModifier) {
    AMParticle effect = (AMParticle) AMCore.proxy.particleManager.spawn(world, "symbols", x, y, z);
    if (effect != null) {
        effect.AddParticleController(new ParticleConverge(effect, motionx, -0.1, motionz, 1, true));
        effect.setMaxAge(40);
        effect.setIgnoreMaxAge(false);
        effect.setParticleScale(0.1f);
        if (colorModifier > -1) {
            effect.setRGBColorF(((colorModifier >> 16) & 0xFF) / 255.0f, ((colorModifier >> 8) & 0xFF) / 255.0f, (colorModifier & 0xFF) / 255.0f);
        }
    }
}
Also used : AMParticle(am2.particles.AMParticle) ParticleConverge(am2.particles.ParticleConverge)

Aggregations

AMParticle (am2.particles.AMParticle)103 ParticleFloatUpward (am2.particles.ParticleFloatUpward)38 ParticleFadeOut (am2.particles.ParticleFadeOut)25 ParticleOrbitEntity (am2.particles.ParticleOrbitEntity)19 ParticleMoveOnHeading (am2.particles.ParticleMoveOnHeading)13 EntityLivingBase (net.minecraft.entity.EntityLivingBase)13 ParticleHoldPosition (am2.particles.ParticleHoldPosition)11 Entity (net.minecraft.entity.Entity)9 AMVector3 (am2.api.math.AMVector3)8 ISpellModifier (am2.api.spell.component.interfaces.ISpellModifier)8 Colour (am2.spell.modifiers.Colour)8 EntityPlayer (net.minecraft.entity.player.EntityPlayer)7 ItemStack (net.minecraft.item.ItemStack)7 ParticleOrbitPoint (am2.particles.ParticleOrbitPoint)6 SideOnly (cpw.mods.fml.relauncher.SideOnly)6 Block (net.minecraft.block.Block)6 EntityDragonPart (net.minecraft.entity.boss.EntityDragonPart)6 TileEntity (net.minecraft.tileentity.TileEntity)5 List (java.util.List)4 BuffEffectFrostSlowed (am2.buffs.BuffEffectFrostSlowed)3