Search in sources :

Example 31 with ParticleFloatUpward

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

the class Slowfall 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, "wind", 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 ParticleOrbitEntity(particle, target, 0.5f, 2, false).setIgnoreYCoordinate(true).SetTargetDistance(0.3f + rand.nextDouble() * 0.3));
            particle.setMaxAge(20);
            particle.setParticleScale(0.2f);
            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) ParticleFloatUpward(am2.particles.ParticleFloatUpward)

Example 32 with ParticleFloatUpward

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

the class WaterBreathing 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, "water_ball", 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 ParticleOrbitEntity(particle, target, 0.5f, 2, false).setIgnoreYCoordinate(true).SetTargetDistance(0.3f + rand.nextDouble() * 0.3));
            particle.setMaxAge(20);
            particle.setParticleScale(0.1f);
            particle.SetParticleAlpha(0.2f);
            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) ParticleFloatUpward(am2.particles.ParticleFloatUpward)

Example 33 with ParticleFloatUpward

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

the class Absorption 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, "sparkle", 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 ParticleOrbitEntity(particle, target, 0.5f, 2, false).setIgnoreYCoordinate(true).SetTargetDistance(0.3f + rand.nextDouble() * 0.3));
            particle.setMaxAge(20);
            particle.setParticleScale(0.2f);
            particle.setRGBColorF(0f, 0.5f, 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) ParticleOrbitEntity(am2.particles.ParticleOrbitEntity) ParticleFloatUpward(am2.particles.ParticleFloatUpward)

Example 34 with ParticleFloatUpward

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

the class BanishRain 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, "water_ball", x, y, z);
        if (particle != null) {
            particle.addRandomOffset(5, 4, 5);
            particle.AddParticleController(new ParticleFloatUpward(particle, 0f, 0.5f, 1, false));
            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) ParticleFloatUpward(am2.particles.ParticleFloatUpward)

Example 35 with ParticleFloatUpward

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

the class Drought 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 + 0.5, y + 1, z + 0.5);
        if (particle != null) {
            particle.addRandomOffset(1, 0, 1);
            particle.AddParticleController(new ParticleFloatUpward(particle, 0, 0.1f, 1, false));
            particle.AddParticleController(new ParticleFadeOut(particle, 1, false).setFadeSpeed(0.05f));
            particle.setAffectedByGravity();
            particle.setRGBColorF(0.9f, 0.8f, 0.5f);
            particle.setMaxAge(40);
            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) ParticleFadeOut(am2.particles.ParticleFadeOut) ParticleFloatUpward(am2.particles.ParticleFloatUpward)

Aggregations

AMParticle (am2.particles.AMParticle)39 ParticleFloatUpward (am2.particles.ParticleFloatUpward)38 ParticleFadeOut (am2.particles.ParticleFadeOut)11 ParticleOrbitEntity (am2.particles.ParticleOrbitEntity)7 AMVector3 (am2.api.math.AMVector3)4 Entity (net.minecraft.entity.Entity)4 EntityLivingBase (net.minecraft.entity.EntityLivingBase)4 TileEntity (net.minecraft.tileentity.TileEntity)4 ParticleOrbitPoint (am2.particles.ParticleOrbitPoint)3 SideOnly (cpw.mods.fml.relauncher.SideOnly)3 EntityDragonPart (net.minecraft.entity.boss.EntityDragonPart)3 EntityPlayer (net.minecraft.entity.player.EntityPlayer)3 ISpellModifier (am2.api.spell.component.interfaces.ISpellModifier)2 ParticleHoldPosition (am2.particles.ParticleHoldPosition)2 ParticleMoveOnHeading (am2.particles.ParticleMoveOnHeading)2 Colour (am2.spell.modifiers.Colour)2 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 Block (net.minecraft.block.Block)2 EntityAnimal (net.minecraft.entity.passive.EntityAnimal)2