Search in sources :

Example 1 with ParticleFadeOut

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

the class BlockDesertNova method randomDisplayTick.

@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(World world, int x, int y, int z, Random par5Random) {
    if (par5Random.nextInt(10) != 0)
        return;
    int increment = AMCore.config.getGFXLevel() * 15;
    if (increment <= 0)
        return;
    for (int i = 0; i < 360; i += increment) {
        int angle = i;
        double posX = x + 0.5 + Math.cos(angle) * 3;
        double posZ = z + 0.5 + Math.sin(angle) * 3;
        double posY = y + 0.6 + par5Random.nextFloat() * 0.2f;
        AMParticle effect = (AMParticle) AMCore.instance.proxy.particleManager.spawn(world, "explosion_2", x + 0.5, posY, z + 0.5);
        if (effect != null) {
            effect.setIgnoreMaxAge(true);
            effect.AddParticleController(new ParticleExpandingCollapsingRingAtPoint(effect, posX, posY, posZ, 0.3, 3, 0.2, 1, false).setExpanding());
            // effect.AddParticleController(new ParticleOrbitPoint(effect, x+0.5, y, z+0.5, 1, false).SetTargetDistance(0.35f + par5Random.nextFloat() * 0.2f).SetOrbitSpeed(0.5f).setIgnoreYCoordinate(true));
            // effect.AddParticleController(new ParticleFloatUpward(effect, 0, 0.035f, 1, false));
            effect.AddParticleController(new ParticleFadeOut(effect, 2, false).setFadeSpeed(0.05f).setKillParticleOnFinish(true));
            effect.setParticleScale(0.05f);
        }
    }
}
Also used : AMParticle(am2.particles.AMParticle) ParticleExpandingCollapsingRingAtPoint(am2.particles.ParticleExpandingCollapsingRingAtPoint) ParticleFadeOut(am2.particles.ParticleFadeOut) ParticleExpandingCollapsingRingAtPoint(am2.particles.ParticleExpandingCollapsingRingAtPoint) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Example 2 with ParticleFadeOut

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

the class EntityWaterElemental method spawnLivingParticles.

private void spawnLivingParticles() {
    if (rand.nextBoolean()) {
        double yPos = this.posY + 1.1;
        AMParticle effect = (AMParticle) AMCore.instance.proxy.particleManager.spawn(worldObj, "water_ball", this.posX + ((rand.nextFloat() * 0.2) - 0.1f), yPos, this.posZ + ((rand.nextFloat() * 0.4) - 0.2f));
        if (effect != null) {
            effect.AddParticleController(new ParticleFloatUpward(effect, 0.1f, -0.06f, 1, false));
            effect.AddParticleController(new ParticleFadeOut(effect, 2, false).setFadeSpeed(0.04f));
            effect.setMaxAge(25);
            effect.setIgnoreMaxAge(false);
            effect.setParticleScale(0.1f);
        }
    }
}
Also used : AMParticle(am2.particles.AMParticle) ParticleFadeOut(am2.particles.ParticleFadeOut) ParticleFloatUpward(am2.particles.ParticleFloatUpward)

Example 3 with ParticleFadeOut

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

the class EntityHecate method spawnLivingParticles.

private void spawnLivingParticles() {
    if (rand.nextInt(3) == 0) {
        double yPos = this.posY + 1.1;
        if (this.currentForwardRotation >= 0.24) {
            yPos += 0.3;
        }
        AMParticle effect = (AMParticle) AMCore.instance.proxy.particleManager.spawn(worldObj, "smoke", this.posX + ((rand.nextFloat() * 0.2) - 0.1f), yPos, this.posZ + ((rand.nextFloat() * 0.4) - 0.2f));
        if (effect != null) {
            if (this.currentForwardRotation < 0.24) {
                effect.AddParticleController(new ParticleFloatUpward(effect, 0.1f, -0.06f, 1, false));
            } else {
                effect.AddParticleController(new ParticleMoveOnHeading(effect, this.rotationYaw - 90, this.rotationPitch, 0.01f, 1, false));
            }
            effect.AddParticleController(new ParticleFadeOut(effect, 2, false).setFadeSpeed(0.04f));
            effect.setMaxAge(25);
            effect.setIgnoreMaxAge(false);
            effect.setRGBColorF(0.3f, 0.3f, 0.3f);
        }
    }
}
Also used : AMParticle(am2.particles.AMParticle) ParticleFadeOut(am2.particles.ParticleFadeOut) ParticleFloatUpward(am2.particles.ParticleFloatUpward) ParticleMoveOnHeading(am2.particles.ParticleMoveOnHeading)

Example 4 with ParticleFadeOut

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

the class EntityBroom method onUpdate.

@Override
public void onUpdate() {
    if (worldObj.isRemote) {
        updateRotations();
        if (isMoving()) {
            AMParticle particle = (AMParticle) AMCore.proxy.particleManager.spawn(worldObj, "smoke", posX, posY, posZ);
            if (particle != null) {
                particle.addRandomOffset(0.5, 0.5, 0.5);
                particle.setRGBColorF(0.8f, 0.6f, 0.4f);
                particle.AddParticleController(new ParticleFadeOut(particle, 1, false).setFadeSpeed(0.03f).setKillParticleOnFinish(true));
            }
        }
    }
    super.onUpdate();
}
Also used : AMParticle(am2.particles.AMParticle) ParticleFadeOut(am2.particles.ParticleFadeOut)

Example 5 with ParticleFadeOut

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

the class BuffEffectRegeneration method onUpdate.

public boolean onUpdate(EntityLivingBase entityliving) {
    World world = entityliving.worldObj;
    double ticks = 80 / Math.pow(2, this.getAmplifier());
    if (getDuration() != 0 && (getDuration() % ticks) == 0) {
        if (!world.isRemote) {
            entityliving.heal(1);
        } else {
            AMParticle effect = (AMParticle) AMCore.instance.proxy.particleManager.spawn(world, "hr_sparkles_1", entityliving.posX + world.rand.nextDouble() * entityliving.height - (entityliving.height / 2), entityliving.posY + world.rand.nextDouble() * entityliving.height - (entityliving.height / 2), entityliving.posZ + world.rand.nextDouble() * entityliving.height - (entityliving.height / 2));
            if (effect != null) {
                effect.setMaxAge(15 + world.rand.nextInt(10));
                effect.setIgnoreMaxAge(false);
                effect.AddParticleController(new ParticleFadeOut(effect, 1, true));
                effect.setRGBColorF(0.15f, 0.92f, 0.37f);
            }
        }
    }
    return super.onUpdate(entityliving);
}
Also used : AMParticle(am2.particles.AMParticle) ParticleFadeOut(am2.particles.ParticleFadeOut) World(net.minecraft.world.World)

Aggregations

AMParticle (am2.particles.AMParticle)25 ParticleFadeOut (am2.particles.ParticleFadeOut)25 ParticleFloatUpward (am2.particles.ParticleFloatUpward)10 ParticleMoveOnHeading (am2.particles.ParticleMoveOnHeading)10 ParticleOrbitPoint (am2.particles.ParticleOrbitPoint)4 EntityLivingBase (net.minecraft.entity.EntityLivingBase)4 AMVector3 (am2.api.math.AMVector3)2 ISpellModifier (am2.api.spell.component.interfaces.ISpellModifier)2 Colour (am2.spell.modifiers.Colour)2 ItemStack (net.minecraft.item.ItemStack)2 AMDataReader (am2.network.AMDataReader)1 AMDataWriter (am2.network.AMDataWriter)1 ParticleExpandingCollapsingRingAtPoint (am2.particles.ParticleExpandingCollapsingRingAtPoint)1 ParticleHoldPosition (am2.particles.ParticleHoldPosition)1 ParticleOrbitEntity (am2.particles.ParticleOrbitEntity)1 ExtendedProperties (am2.playerextensions.ExtendedProperties)1 SideOnly (cpw.mods.fml.relauncher.SideOnly)1 List (java.util.List)1 EntityItem (net.minecraft.entity.item.EntityItem)1 EntityPlayer (net.minecraft.entity.player.EntityPlayer)1