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);
}
}
}
}
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);
}
}
}
}
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);
}
}
}
}
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);
}
}
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));
}
}
Aggregations