Search in sources :

Example 91 with AMParticle

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

the class FrostDamage 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, "snowflakes", x, y, z);
        if (particle != null) {
            particle.addRandomOffset(1, 0.5, 1);
            particle.addVelocity(rand.nextDouble() * 0.2 - 0.1, rand.nextDouble() * 0.2, rand.nextDouble() * 0.2 - 0.1);
            particle.setAffectedByGravity();
            particle.setDontRequireControllers();
            particle.setMaxAge(5);
            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)

Example 92 with AMParticle

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

the class Ignition 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; ++i) {
        AMParticle particle = (AMParticle) AMCore.proxy.particleManager.spawn(world, "explosion_2", x + 0.5, y + 0.5, z + 0.5);
        if (particle != null) {
            particle.addRandomOffset(1, 0.5, 1);
            particle.addVelocity(rand.nextDouble() * 0.2 - 0.1, 0.3, rand.nextDouble() * 0.2 - 0.1);
            particle.setAffectedByGravity();
            particle.setDontRequireControllers();
            particle.setMaxAge(5);
            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)

Example 93 with AMParticle

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

the class Knockback 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, z);
        if (particle != null) {
            particle.addRandomOffset(1, 2, 1);
            double dx = caster.posX - target.posX;
            double dz = caster.posZ - target.posZ;
            double angle = Math.toDegrees(Math.atan2(-dz, -dx));
            particle.AddParticleController(new ParticleMoveOnHeading(particle, angle, 0, 0.1 + rand.nextDouble() * 0.5, 1, false));
            particle.AddParticleController(new ParticleFadeOut(particle, 1, false).setFadeSpeed(0.05f));
            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) ParticleFadeOut(am2.particles.ParticleFadeOut) ParticleMoveOnHeading(am2.particles.ParticleMoveOnHeading)

Example 94 with AMParticle

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

the class ItemFrameWatcher method spawnCompendiumProgressParticles.

@SideOnly(Side.CLIENT)
public void spawnCompendiumProgressParticles(EntityItemFrame frame, int x, int y, int z) {
    AMParticle particle = (AMParticle) AMCore.proxy.particleManager.spawn(frame.worldObj, "symbols", x + 0.5, y + 0.5, z + 0.5);
    if (particle != null) {
        particle.setIgnoreMaxAge(true);
        // particle.AddParticleController(new ParticleApproachEntity(particle, frame, 0.02f, 0.04f, 1, false).setKillParticleOnFinish(true));
        particle.AddParticleController(new ParticleArcToEntity(particle, 1, frame, false).SetSpeed(0.02f).setKillParticleOnFinish(true));
        particle.setRandomScale(0.05f, 0.12f);
    }
}
Also used : AMParticle(am2.particles.AMParticle) ParticleArcToEntity(am2.particles.ParticleArcToEntity) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Example 95 with AMParticle

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

the class ItemFrameWatcher method spawnCompendiumCompleteParticles.

@SideOnly(Side.CLIENT)
public void spawnCompendiumCompleteParticles(EntityItemFrame frame) {
    AMParticle particle = (AMParticle) AMCore.proxy.particleManager.spawn(frame.worldObj, "radiant", frame.posX, frame.posY, frame.posZ);
    if (particle != null) {
        particle.setIgnoreMaxAge(false);
        particle.setMaxAge(40);
        particle.setParticleScale(0.3f);
        // particle.AddParticleController(new ParticleApproachEntity(particle, frame, 0.02f, 0.04f, 1, false).setKillParticleOnFinish(true));
        particle.AddParticleController(new ParticleHoldPosition(particle, 40, 1, false));
        particle.AddParticleController(new ParticleColorShift(particle, 1, false).SetShiftSpeed(0.2f));
    }
}
Also used : AMParticle(am2.particles.AMParticle) ParticleColorShift(am2.particles.ParticleColorShift) ParticleHoldPosition(am2.particles.ParticleHoldPosition) SideOnly(cpw.mods.fml.relauncher.SideOnly)

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