use of am2.particles.ParticleFadeOut in project ArsMagica2 by Mithion.
the class BlockDesertNova method randomDisplayTick.
@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(World world, int x, int y, int z, Random par5Random) {
if (par5Random.nextInt(10) != 0)
return;
int increment = AMCore.config.getGFXLevel() * 15;
if (increment <= 0)
return;
for (int i = 0; i < 360; i += increment) {
int angle = i;
double posX = x + 0.5 + Math.cos(angle) * 3;
double posZ = z + 0.5 + Math.sin(angle) * 3;
double posY = y + 0.6 + par5Random.nextFloat() * 0.2f;
AMParticle effect = (AMParticle) AMCore.instance.proxy.particleManager.spawn(world, "explosion_2", x + 0.5, posY, z + 0.5);
if (effect != null) {
effect.setIgnoreMaxAge(true);
effect.AddParticleController(new ParticleExpandingCollapsingRingAtPoint(effect, posX, posY, posZ, 0.3, 3, 0.2, 1, false).setExpanding());
// effect.AddParticleController(new ParticleOrbitPoint(effect, x+0.5, y, z+0.5, 1, false).SetTargetDistance(0.35f + par5Random.nextFloat() * 0.2f).SetOrbitSpeed(0.5f).setIgnoreYCoordinate(true));
// effect.AddParticleController(new ParticleFloatUpward(effect, 0, 0.035f, 1, false));
effect.AddParticleController(new ParticleFadeOut(effect, 2, false).setFadeSpeed(0.05f).setKillParticleOnFinish(true));
effect.setParticleScale(0.05f);
}
}
}
use of am2.particles.ParticleFadeOut in project ArsMagica2 by Mithion.
the class EntityWaterElemental method spawnLivingParticles.
private void spawnLivingParticles() {
if (rand.nextBoolean()) {
double yPos = this.posY + 1.1;
AMParticle effect = (AMParticle) AMCore.instance.proxy.particleManager.spawn(worldObj, "water_ball", this.posX + ((rand.nextFloat() * 0.2) - 0.1f), yPos, this.posZ + ((rand.nextFloat() * 0.4) - 0.2f));
if (effect != null) {
effect.AddParticleController(new ParticleFloatUpward(effect, 0.1f, -0.06f, 1, false));
effect.AddParticleController(new ParticleFadeOut(effect, 2, false).setFadeSpeed(0.04f));
effect.setMaxAge(25);
effect.setIgnoreMaxAge(false);
effect.setParticleScale(0.1f);
}
}
}
use of am2.particles.ParticleFadeOut in project ArsMagica2 by Mithion.
the class EntityHecate method spawnLivingParticles.
private void spawnLivingParticles() {
if (rand.nextInt(3) == 0) {
double yPos = this.posY + 1.1;
if (this.currentForwardRotation >= 0.24) {
yPos += 0.3;
}
AMParticle effect = (AMParticle) AMCore.instance.proxy.particleManager.spawn(worldObj, "smoke", this.posX + ((rand.nextFloat() * 0.2) - 0.1f), yPos, this.posZ + ((rand.nextFloat() * 0.4) - 0.2f));
if (effect != null) {
if (this.currentForwardRotation < 0.24) {
effect.AddParticleController(new ParticleFloatUpward(effect, 0.1f, -0.06f, 1, false));
} else {
effect.AddParticleController(new ParticleMoveOnHeading(effect, this.rotationYaw - 90, this.rotationPitch, 0.01f, 1, false));
}
effect.AddParticleController(new ParticleFadeOut(effect, 2, false).setFadeSpeed(0.04f));
effect.setMaxAge(25);
effect.setIgnoreMaxAge(false);
effect.setRGBColorF(0.3f, 0.3f, 0.3f);
}
}
}
use of am2.particles.ParticleFadeOut in project ArsMagica2 by Mithion.
the class EntityBroom method onUpdate.
@Override
public void onUpdate() {
if (worldObj.isRemote) {
updateRotations();
if (isMoving()) {
AMParticle particle = (AMParticle) AMCore.proxy.particleManager.spawn(worldObj, "smoke", posX, posY, posZ);
if (particle != null) {
particle.addRandomOffset(0.5, 0.5, 0.5);
particle.setRGBColorF(0.8f, 0.6f, 0.4f);
particle.AddParticleController(new ParticleFadeOut(particle, 1, false).setFadeSpeed(0.03f).setKillParticleOnFinish(true));
}
}
}
super.onUpdate();
}
use of am2.particles.ParticleFadeOut in project ArsMagica2 by Mithion.
the class BuffEffectRegeneration method onUpdate.
public boolean onUpdate(EntityLivingBase entityliving) {
World world = entityliving.worldObj;
double ticks = 80 / Math.pow(2, this.getAmplifier());
if (getDuration() != 0 && (getDuration() % ticks) == 0) {
if (!world.isRemote) {
entityliving.heal(1);
} else {
AMParticle effect = (AMParticle) AMCore.instance.proxy.particleManager.spawn(world, "hr_sparkles_1", entityliving.posX + world.rand.nextDouble() * entityliving.height - (entityliving.height / 2), entityliving.posY + world.rand.nextDouble() * entityliving.height - (entityliving.height / 2), entityliving.posZ + world.rand.nextDouble() * entityliving.height - (entityliving.height / 2));
if (effect != null) {
effect.setMaxAge(15 + world.rand.nextInt(10));
effect.setIgnoreMaxAge(false);
effect.AddParticleController(new ParticleFadeOut(effect, 1, true));
effect.setRGBColorF(0.15f, 0.92f, 0.37f);
}
}
}
return super.onUpdate(entityliving);
}
Aggregations