Search in sources :

Example 11 with ParticleOrbitEntity

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

the class EntityNatureGuardian method spawnParticles.

private void spawnParticles() {
    AMParticle leaf = (AMParticle) AMCore.proxy.particleManager.spawn(worldObj, "leaf", posX + (rand.nextDouble() * 3) - 1.5f, posY + (rand.nextDouble() * 5f), posZ + (rand.nextDouble() * 3) - 1.5f);
    if (leaf != null) {
        leaf.setMaxAge(20);
        leaf.setIgnoreMaxAge(false);
        leaf.AddParticleController(new ParticleFloatUpward(leaf, 0.05f, -0.02f, 1, false));
        if (getCurrentAction() == BossActions.SPINNING) {
            leaf.AddParticleController(new ParticleOrbitEntity(leaf, this, 0.6f, 1, false));
        }
    }
}
Also used : AMParticle(am2.particles.AMParticle) ParticleOrbitEntity(am2.particles.ParticleOrbitEntity) ParticleFloatUpward(am2.particles.ParticleFloatUpward)

Example 12 with ParticleOrbitEntity

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

the class EntityDryad method onUpdate.

@Override
public void onUpdate() {
    World world = this.worldObj;
    super.onUpdate();
    if (!world.isRemote || world == null) {
        return;
    }
    if (worldObj.rand.nextInt(100) == 3) {
        AMParticle effect = (AMParticle) AMCore.instance.proxy.particleManager.spawn(world, "hr_sparkles_1", this.posX, this.posY + 2, this.posZ);
        if (effect != null) {
            effect.AddParticleController(new ParticleOrbitEntity(effect, this, worldObj.rand.nextDouble() * 0.2 + 0.2, 1, false));
            effect.setIgnoreMaxAge(false);
            effect.setRGBColorF(0.1f, 0.8f, 0.1f);
        }
    }
}
Also used : AMParticle(am2.particles.AMParticle) ParticleOrbitEntity(am2.particles.ParticleOrbitEntity) World(net.minecraft.world.World)

Example 13 with ParticleOrbitEntity

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

the class Flight 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 < 15; ++i) {
        AMParticle particle = (AMParticle) AMCore.proxy.particleManager.spawn(world, rand.nextBoolean() ? "wind" : "ember", x, y, z);
        if (particle != null) {
            particle.addRandomOffset(1, 0.5, 1);
            particle.AddParticleController(new ParticleOrbitEntity(particle, target, 0.2f + rand.nextFloat() * 0.2f, 1, false));
            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) ParticleOrbitEntity(am2.particles.ParticleOrbitEntity)

Example 14 with ParticleOrbitEntity

use of am2.particles.ParticleOrbitEntity 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 15 with ParticleOrbitEntity

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

the class Shield 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, "symbols", x, y - 1, z);
        if (particle != null) {
            particle.AddParticleController(new ParticleOrbitEntity(particle, target, 0.2f, 2, false).setOrbitY(-1).SetTargetDistance(1));
            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) ParticleOrbitEntity(am2.particles.ParticleOrbitEntity)

Aggregations

AMParticle (am2.particles.AMParticle)19 ParticleOrbitEntity (am2.particles.ParticleOrbitEntity)19 ParticleFloatUpward (am2.particles.ParticleFloatUpward)7 ParticleFadeOut (am2.particles.ParticleFadeOut)1 ParticleOrbitPoint (am2.particles.ParticleOrbitPoint)1 ExtendedProperties (am2.playerextensions.ExtendedProperties)1 EntityPlayer (net.minecraft.entity.player.EntityPlayer)1 World (net.minecraft.world.World)1