Search in sources :

Example 41 with AMParticle

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

the class Charm 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 < 10; ++i) {
        AMParticle particle = (AMParticle) AMCore.proxy.particleManager.spawn(world, "heart", x, y, z);
        if (particle != null) {
            particle.addRandomOffset(1, 2, 1);
            particle.AddParticleController(new ParticleFloatUpward(particle, 0, 0.05f + rand.nextFloat() * 0.1f, 1, false));
            particle.setMaxAge(20);
            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) ParticleFloatUpward(am2.particles.ParticleFloatUpward)

Example 42 with AMParticle

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

the class Blind 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, "lens_flare", x, y, z);
        if (particle != null) {
            particle.AddParticleController(new ParticleOrbitEntity(particle, target, 0.1f, 1, false).SetTargetDistance(rand.nextDouble() + 0.5));
            particle.setMaxAge(25 + rand.nextInt(10));
            particle.setRGBColorF(0, 0, 0);
            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 43 with AMParticle

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

the class TileEntityEverstone method propagatePoweredByEverstone.

private void propagatePoweredByEverstone(boolean powered, ArrayList<ChunkPosition> completedUpdates) {
    ChunkPosition myPosition = new ChunkPosition(xCoord, yCoord, zCoord);
    if (completedUpdates.contains(myPosition)) {
        return;
    }
    completedUpdates.add(myPosition);
    poweredFromEverstone = powered;
    onBreak();
    if (worldObj.isRemote) {
        AMParticle particle = (AMParticle) AMCore.proxy.particleManager.spawn(worldObj, "radiant", xCoord + 0.5f, yCoord + 0.5f, zCoord + 0.5f);
        if (particle != null) {
            particle.setMaxAge(20);
            particle.setDontRequireControllers();
            particle.setIgnoreMaxAge(false);
        }
    }
    for (int i = -1; i <= 1; i++) {
        for (int j = -1; j <= 1; j++) {
            for (int k = -1; k <= 1; k++) {
                ChunkPosition targetPosition = new ChunkPosition(xCoord + i, yCoord + j, zCoord + k);
                Block blockID = worldObj.getBlock(targetPosition.chunkPosX, targetPosition.chunkPosY, targetPosition.chunkPosZ);
                if (blockID == BlocksCommonProxy.everstone && !completedUpdates.contains(targetPosition)) {
                    TileEntityEverstone everstone = ((TileEntityEverstone) worldObj.getTileEntity(targetPosition.chunkPosX, targetPosition.chunkPosY, targetPosition.chunkPosZ));
                    if (everstone != null)
                        everstone.propagatePoweredByEverstone(powered, completedUpdates);
                }
            }
        }
    }
}
Also used : AMParticle(am2.particles.AMParticle) ChunkPosition(net.minecraft.world.ChunkPosition) Block(net.minecraft.block.Block)

Example 44 with AMParticle

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

the class TileEntityCrystalMarkerSpellExport method spawnParticles.

private void spawnParticles() {
    for (int i = 0; i < 15; ++i) {
        AMParticle effect = (AMParticle) AMCore.proxy.particleManager.spawn(worldObj, "sparkle2", xCoord, yCoord, zCoord);
        if (effect != null) {
            effect.AddParticleController(new ParticleFloatUpward(effect, 0, worldObj.rand.nextFloat() * 0.1f, 1, false));
            effect.AddParticleController(new ParticleFadeOut(effect, 2, false).setFadeSpeed(0.035f).setKillParticleOnFinish(true));
            effect.addRandomOffset(0.2, 0.2, 0.2);
            effect.setRGBColorF(0, 0.5f, 1.0f);
            effect.setIgnoreMaxAge(true);
        }
    }
}
Also used : AMParticle(am2.particles.AMParticle) ParticleFadeOut(am2.particles.ParticleFadeOut) ParticleFloatUpward(am2.particles.ParticleFloatUpward)

Example 45 with AMParticle

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

the class Slow 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, 2, 1);
            particle.AddParticleController(new ParticleFloatUpward(particle, 0, -0.1f, 1, false));
            particle.AddParticleController(new ParticleOrbitEntity(particle, target, 0.2f, 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)

Aggregations

AMParticle (am2.particles.AMParticle)103 ParticleFloatUpward (am2.particles.ParticleFloatUpward)38 ParticleFadeOut (am2.particles.ParticleFadeOut)25 ParticleOrbitEntity (am2.particles.ParticleOrbitEntity)19 ParticleMoveOnHeading (am2.particles.ParticleMoveOnHeading)13 EntityLivingBase (net.minecraft.entity.EntityLivingBase)13 ParticleHoldPosition (am2.particles.ParticleHoldPosition)11 Entity (net.minecraft.entity.Entity)9 AMVector3 (am2.api.math.AMVector3)8 ISpellModifier (am2.api.spell.component.interfaces.ISpellModifier)8 Colour (am2.spell.modifiers.Colour)8 EntityPlayer (net.minecraft.entity.player.EntityPlayer)7 ItemStack (net.minecraft.item.ItemStack)7 ParticleOrbitPoint (am2.particles.ParticleOrbitPoint)6 SideOnly (cpw.mods.fml.relauncher.SideOnly)6 Block (net.minecraft.block.Block)6 EntityDragonPart (net.minecraft.entity.boss.EntityDragonPart)6 TileEntity (net.minecraft.tileentity.TileEntity)5 List (java.util.List)4 BuffEffectFrostSlowed (am2.buffs.BuffEffectFrostSlowed)3