Search in sources :

Example 1 with ParticleOrbitPoint

use of am2.particles.ParticleOrbitPoint 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 ParticleOrbitPoint

use of am2.particles.ParticleOrbitPoint 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 3 with ParticleOrbitPoint

use of am2.particles.ParticleOrbitPoint 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 4 with ParticleOrbitPoint

use of am2.particles.ParticleOrbitPoint 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 5 with ParticleOrbitPoint

use of am2.particles.ParticleOrbitPoint 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)7 ParticleOrbitPoint (am2.particles.ParticleOrbitPoint)6 ParticleFadeOut (am2.particles.ParticleFadeOut)5 ParticleFloatUpward (am2.particles.ParticleFloatUpward)3 ISpellModifier (am2.api.spell.component.interfaces.ISpellModifier)1 ParticleExpandingCollapsingRingAtPoint (am2.particles.ParticleExpandingCollapsingRingAtPoint)1 ParticleHoldPosition (am2.particles.ParticleHoldPosition)1 ParticleOrbitEntity (am2.particles.ParticleOrbitEntity)1 Colour (am2.spell.modifiers.Colour)1 SideOnly (cpw.mods.fml.relauncher.SideOnly)1 Entity (net.minecraft.entity.Entity)1 EntityLivingBase (net.minecraft.entity.EntityLivingBase)1 EntityDragonPart (net.minecraft.entity.boss.EntityDragonPart)1