use of am2.particles.ParticleOrbitEntity in project ArsMagica2 by Mithion.
the class EntityNatureGuardian method spawnParticles.
private void spawnParticles() {
AMParticle leaf = (AMParticle) AMCore.proxy.particleManager.spawn(worldObj, "leaf", posX + (rand.nextDouble() * 3) - 1.5f, posY + (rand.nextDouble() * 5f), posZ + (rand.nextDouble() * 3) - 1.5f);
if (leaf != null) {
leaf.setMaxAge(20);
leaf.setIgnoreMaxAge(false);
leaf.AddParticleController(new ParticleFloatUpward(leaf, 0.05f, -0.02f, 1, false));
if (getCurrentAction() == BossActions.SPINNING) {
leaf.AddParticleController(new ParticleOrbitEntity(leaf, this, 0.6f, 1, false));
}
}
}
use of am2.particles.ParticleOrbitEntity in project ArsMagica2 by Mithion.
the class EntityDryad method onUpdate.
@Override
public void onUpdate() {
World world = this.worldObj;
super.onUpdate();
if (!world.isRemote || world == null) {
return;
}
if (worldObj.rand.nextInt(100) == 3) {
AMParticle effect = (AMParticle) AMCore.instance.proxy.particleManager.spawn(world, "hr_sparkles_1", this.posX, this.posY + 2, this.posZ);
if (effect != null) {
effect.AddParticleController(new ParticleOrbitEntity(effect, this, worldObj.rand.nextDouble() * 0.2 + 0.2, 1, false));
effect.setIgnoreMaxAge(false);
effect.setRGBColorF(0.1f, 0.8f, 0.1f);
}
}
}
use of am2.particles.ParticleOrbitEntity in project ArsMagica2 by Mithion.
the class Flight 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, rand.nextBoolean() ? "wind" : "ember", x, y, z);
if (particle != null) {
particle.addRandomOffset(1, 0.5, 1);
particle.AddParticleController(new ParticleOrbitEntity(particle, target, 0.2f + rand.nextFloat() * 0.2f, 1, false));
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);
}
}
}
}
use of am2.particles.ParticleOrbitEntity in project ArsMagica2 by Mithion.
the class Slowfall 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, "wind", 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);
if (colorModifier > -1) {
particle.setRGBColorF(((colorModifier >> 16) & 0xFF) / 255.0f, ((colorModifier >> 8) & 0xFF) / 255.0f, (colorModifier & 0xFF) / 255.0f);
}
}
}
}
use of am2.particles.ParticleOrbitEntity in project ArsMagica2 by Mithion.
the class Shield 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, "symbols", x, y - 1, z);
if (particle != null) {
particle.AddParticleController(new ParticleOrbitEntity(particle, target, 0.2f, 2, false).setOrbitY(-1).SetTargetDistance(1));
particle.setMaxAge(40);
particle.setParticleScale(0.1f);
if (colorModifier > -1) {
particle.setRGBColorF(((colorModifier >> 16) & 0xFF) / 255.0f, ((colorModifier >> 8) & 0xFF) / 255.0f, (colorModifier & 0xFF) / 255.0f);
}
}
}
}
Aggregations