Search in sources :

Example 16 with ParticleFloatUpward

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

the class Regeneration 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(0.1f, 1f, 0.8f);
            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 17 with ParticleFloatUpward

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

the class Fury 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 < 5 * AMCore.config.getGFXLevel(); ++i) {
        AMParticle particle = (AMParticle) AMCore.proxy.particleManager.spawn(world, "pulse", x, y, z);
        if (particle != null) {
            particle.addRandomOffset(1, 1, 1);
            particle.setRGBColorF(1, 0, 0);
            particle.AddParticleController(new ParticleOrbitEntity(particle, target, 0.15f, 1, false).SetTargetDistance(world.rand.nextDouble() + 1f).setIgnoreYCoordinate(true));
            particle.AddParticleController(new ParticleFloatUpward(particle, 0, 0.1f, 1, false));
            particle.setMaxAge(10);
        }
    }
}
Also used : AMParticle(am2.particles.AMParticle) ParticleOrbitEntity(am2.particles.ParticleOrbitEntity) ParticleFloatUpward(am2.particles.ParticleFloatUpward)

Example 18 with ParticleFloatUpward

use of am2.particles.ParticleFloatUpward 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 19 with ParticleFloatUpward

use of am2.particles.ParticleFloatUpward 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 20 with ParticleFloatUpward

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

the class TileEntityCalefactor method updateEntity.

@Override
public void updateEntity() {
    super.updateEntity();
    if (isFirstTick) {
        rotationStepX = worldObj.rand.nextFloat() * 0.03f - 0.015f;
        isFirstTick = false;
    }
    if (this.worldObj.isRemote) {
        incrementRotations();
        if (this.isCooking) {
            particleCount--;
            if (particleCount <= 0) {
                particleCount = (int) (Math.random() * 20);
                double rStartX = Math.random() > 0.5 ? this.xCoord + 0.01 : this.xCoord + 1.01;
                double rStartY = this.yCoord + 1.1;
                double rStartZ = Math.random() > 0.5 ? this.zCoord + 0.01 : this.zCoord + 1.01;
                double endX = this.xCoord + 0.5f;
                double endY = this.yCoord + 0.7f + (worldObj.rand.nextDouble() * 0.5f);
                double endZ = this.zCoord + 0.5f;
                AMCore.proxy.particleManager.BeamFromPointToPoint(worldObj, rStartX, rStartY, rStartZ, endX, endY, endZ, 0xFF8811);
                if (worldObj.rand.nextBoolean()) {
                    AMParticle effect = (AMParticle) AMCore.instance.proxy.particleManager.spawn(worldObj, "smoke", endX, endY, endZ);
                    if (effect != null) {
                        effect.setIgnoreMaxAge(false);
                        effect.setMaxAge(60);
                        effect.AddParticleController(new ParticleFloatUpward(effect, 0.02f, 0.01f, 1, false));
                    }
                } else {
                    AMParticle effect = (AMParticle) AMCore.instance.proxy.particleManager.spawn(worldObj, "explosion_2", endX, endY, endZ);
                    if (effect != null) {
                        effect.setIgnoreMaxAge(false);
                        effect.setMaxAge(10);
                        effect.setParticleScale(0.04f);
                        effect.setVelocity(worldObj.rand.nextDouble() * 0.2f - 0.1f, 0.2f, worldObj.rand.nextDouble() * 0.2f - 0.1f);
                        effect.setAffectedByGravity();
                        effect.setDontRequireControllers();
                    }
                }
            }
        } else {
            particleCount = 0;
        }
    }
    boolean powerCheck = PowerNodeRegistry.For(this.worldObj).checkPower(this, getCookTickPowerCost());
    if (this.canSmelt() && this.isSmelting() && powerCheck) {
        ++this.timeSpentCooking;
        if (this.timeSpentCooking >= getModifiedCookTime()) {
            if (!this.worldObj.isRemote) {
                this.smeltItem();
            } else {
                worldObj.playSound(xCoord, yCoord, zCoord, "arsmagica2:misc.calefactor.burn", 0.2f, 1.0f, true);
            }
            this.timeSpentCooking = 0;
            if (!worldObj.isRemote) {
                sendCookStatusUpdate(false);
            }
        }
        if (!worldObj.isRemote) {
            if (PowerNodeRegistry.For(worldObj).checkPower(this, PowerTypes.DARK, getCookTickPowerCost()) && PowerNodeRegistry.For(worldObj).checkPower(this, PowerTypes.NEUTRAL, getCookTickPowerCost()) && PowerNodeRegistry.For(worldObj).checkPower(this, PowerTypes.LIGHT, getCookTickPowerCost())) {
                PowerNodeRegistry.For(this.worldObj).consumePower(this, PowerTypes.DARK, getCookTickPowerCost());
                PowerNodeRegistry.For(this.worldObj).consumePower(this, PowerTypes.NEUTRAL, getCookTickPowerCost());
                PowerNodeRegistry.For(this.worldObj).consumePower(this, PowerTypes.LIGHT, getCookTickPowerCost());
            } else {
                PowerNodeRegistry.For(this.worldObj).consumePower(this, PowerNodeRegistry.For(this.worldObj).getHighestPowerType(this), getCookTickPowerCost());
            }
        }
    } else if (!this.isSmelting() && this.canSmelt() && powerCheck) {
        this.timeSpentCooking = 1;
        if (!worldObj.isRemote) {
            sendCookStatusUpdate(true);
        }
    } else if (!this.canSmelt()) {
        this.timeSpentCooking = 0;
    }
}
Also used : AMParticle(am2.particles.AMParticle) 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