Search in sources :

Example 11 with ParticleFadeOut

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

the class Grow 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, "plant", x + 0.5, y + 1, z + 0.5);
        if (particle != null) {
            particle.addRandomOffset(1, 1, 1);
            particle.AddParticleController(new ParticleFloatUpward(particle, 0, 0.1f, 1, false));
            particle.AddParticleController(new ParticleOrbitPoint(particle, x + 0.5, y + 0.5, z + 0.5, 2, false).setIgnoreYCoordinate(true).SetOrbitSpeed(0.1f).SetTargetDistance(0.3f + rand.nextDouble() * 0.3));
            particle.AddParticleController(new ParticleFadeOut(particle, 1, 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 12 with ParticleFadeOut

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

the class AoE method spawnAoEParticles.

private void spawnAoEParticles(ItemStack stack, EntityLivingBase caster, World world, double x, double y, double z, int radius) {
    String pfxName = AMParticleIcons.instance.getParticleForAffinity(SpellUtils.instance.mainAffinityFor(stack));
    float speed = 0.08f * radius;
    int color = 0xFFFFFF;
    if (SpellUtils.instance.modifierIsPresent(SpellModifiers.COLOR, stack, 0)) {
        ISpellModifier[] mods = SpellUtils.instance.getModifiersForStage(stack, 0);
        int ordinalCount = 0;
        for (ISpellModifier mod : mods) {
            if (mod instanceof Colour) {
                byte[] meta = SpellUtils.instance.getModifierMetadataFromStack(stack, mod, 0, ordinalCount++);
                color = (int) mod.getModifier(SpellModifiers.COLOR, null, null, null, meta);
            }
        }
    }
    for (int i = 0; i < 360; i += AMCore.config.FullGFX() ? 20 : AMCore.config.LowGFX() ? 40 : 60) {
        AMParticle effect = (AMParticle) AMCore.instance.proxy.particleManager.spawn(world, pfxName, x, y + 1.5f, z);
        if (effect != null) {
            effect.setIgnoreMaxAge(true);
            effect.AddParticleController(new ParticleMoveOnHeading(effect, i, 0, speed, 1, false));
            effect.noClip = false;
            effect.setRGBColorI(color);
            effect.AddParticleController(new ParticleFadeOut(effect, 1, false).setFadeSpeed(0.05f).setKillParticleOnFinish(true));
            effect.AddParticleController(new ParticleLeaveParticleTrail(effect, pfxName, false, 5, 1, false).addControllerToParticleList(new ParticleFadeOut(effect, 1, false).setFadeSpeed(0.1f).setKillParticleOnFinish(true)).setParticleRGB_I(color).addRandomOffset(0.2f, 0.2f, 0.2f));
        }
    }
}
Also used : ISpellModifier(am2.api.spell.component.interfaces.ISpellModifier) Colour(am2.spell.modifiers.Colour)

Example 13 with ParticleFadeOut

use of am2.particles.ParticleFadeOut 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 14 with ParticleFadeOut

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

the class BlockInvisibleUtility method spawnBlockParticles.

private void spawnBlockParticles(World world, int x, int y, int z) {
    AMParticle particle = (AMParticle) AMCore.proxy.particleManager.spawn(world, "symbols", x + 0.5, y + 0.5, z + 0.5);
    if (particle != null) {
        particle.addRandomOffset(1, 1.6, 1);
        particle.setParticleScale(0.1f);
        particle.AddParticleController(new ParticleFloatUpward(particle, 0, 0.02f, 1, false));
        particle.AddParticleController(new ParticleFadeOut(particle, 1, false).setFadeSpeed(0.05f));
        particle.setMaxAge(20);
        if (world.rand.nextBoolean()) {
            particle.setRGBColorI(0x481bc8);
        } else {
            particle.setRGBColorI(0x891bc8);
        }
    }
}
Also used : AMParticle(am2.particles.AMParticle) ParticleFadeOut(am2.particles.ParticleFadeOut) ParticleFloatUpward(am2.particles.ParticleFloatUpward)

Example 15 with ParticleFadeOut

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

the class TileEntityAstralBarrier method updateEntity.

@Override
public void updateEntity() {
    super.updateEntity();
    int radius = getRadius();
    if (IsActive()) {
        PowerNodeRegistry.For(this.worldObj).consumePower(this, PowerNodeRegistry.For(worldObj).getHighestPowerType(this), 0.35f * radius);
    }
    if (worldObj.isRemote) {
        if (IsActive()) {
            if (displayAura) {
                AMParticle effect = (AMParticle) AMCore.instance.proxy.particleManager.spawn(worldObj, "symbols", xCoord, yCoord + 0.5, zCoord);
                if (effect != null) {
                    effect.setIgnoreMaxAge(false);
                    effect.setMaxAge(100);
                    effect.setParticleScale(0.5f);
                    effect.AddParticleController(new ParticleOrbitPoint(effect, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, 1, false).SetOrbitSpeed(0.03).SetTargetDistance(radius));
                }
            }
            particleTickCounter++;
            if (particleTickCounter >= 15) {
                particleTickCounter = 0;
                String particleName = "";
                AMParticle effect = (AMParticle) AMCore.instance.proxy.particleManager.spawn(worldObj, "sparkle", xCoord + 0.5, yCoord + 0.1 + worldObj.rand.nextDouble() * 0.5, zCoord + 0.5);
                if (effect != null) {
                    effect.setIgnoreMaxAge(false);
                    effect.setMaxAge(100);
                    effect.setParticleScale(0.5f);
                    float color = worldObj.rand.nextFloat() * 0.2f + 0.8f;
                    effect.AddParticleController(new ParticleOrbitPoint(effect, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, 1, false).SetOrbitSpeed(0.005).SetTargetDistance(worldObj.rand.nextDouble() * 0.6 - 0.3));
                    effect.AddParticleController(new ParticleHoldPosition(effect, 80, 2, true));
                    effect.AddParticleController(new ParticleFadeOut(effect, 3, false).setFadeSpeed(0.05f));
                }
            }
        }
    }
}
Also used : AMParticle(am2.particles.AMParticle) ParticleHoldPosition(am2.particles.ParticleHoldPosition) ParticleOrbitPoint(am2.particles.ParticleOrbitPoint) ParticleFadeOut(am2.particles.ParticleFadeOut) ParticleOrbitPoint(am2.particles.ParticleOrbitPoint)

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