use of am2.particles.ParticleFloatUpward in project ArsMagica2 by Mithion.
the class Regeneration 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, 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);
particle.setRGBColorF(0.1f, 1f, 0.8f);
if (colorModifier > -1) {
particle.setRGBColorF(((colorModifier >> 16) & 0xFF) / 255.0f, ((colorModifier >> 8) & 0xFF) / 255.0f, (colorModifier & 0xFF) / 255.0f);
}
}
}
}
use of am2.particles.ParticleFloatUpward in project ArsMagica2 by Mithion.
the class Fury 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 * AMCore.config.getGFXLevel(); ++i) {
AMParticle particle = (AMParticle) AMCore.proxy.particleManager.spawn(world, "pulse", x, y, z);
if (particle != null) {
particle.addRandomOffset(1, 1, 1);
particle.setRGBColorF(1, 0, 0);
particle.AddParticleController(new ParticleOrbitEntity(particle, target, 0.15f, 1, false).SetTargetDistance(world.rand.nextDouble() + 1f).setIgnoreYCoordinate(true));
particle.AddParticleController(new ParticleFloatUpward(particle, 0, 0.1f, 1, false));
particle.setMaxAge(10);
}
}
}
use of am2.particles.ParticleFloatUpward in project ArsMagica2 by Mithion.
the class Grow 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, "plant", x + 0.5, y + 1, z + 0.5);
if (particle != null) {
particle.addRandomOffset(1, 1, 1);
particle.AddParticleController(new ParticleFloatUpward(particle, 0, 0.1f, 1, false));
particle.AddParticleController(new ParticleOrbitPoint(particle, x + 0.5, y + 0.5, z + 0.5, 2, false).setIgnoreYCoordinate(true).SetOrbitSpeed(0.1f).SetTargetDistance(0.3f + rand.nextDouble() * 0.3));
particle.AddParticleController(new ParticleFadeOut(particle, 1, false).setFadeSpeed(0.05f).setKillParticleOnFinish(true));
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.ParticleFloatUpward in project ArsMagica2 by Mithion.
the class Invisiblity 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, "ember", 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 ParticleOrbitPoint(particle, x, y, z, 2, false).SetOrbitSpeed(0.5f).setIgnoreYCoordinate(true).SetTargetDistance(0.3f + rand.nextDouble() * 0.3));
particle.AddParticleController(new ParticleFadeOut(particle, 3, false).setFadeSpeed(0.05f).setKillParticleOnFinish(true));
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.ParticleFloatUpward in project ArsMagica2 by Mithion.
the class TileEntityCalefactor method updateEntity.
@Override
public void updateEntity() {
super.updateEntity();
if (isFirstTick) {
rotationStepX = worldObj.rand.nextFloat() * 0.03f - 0.015f;
isFirstTick = false;
}
if (this.worldObj.isRemote) {
incrementRotations();
if (this.isCooking) {
particleCount--;
if (particleCount <= 0) {
particleCount = (int) (Math.random() * 20);
double rStartX = Math.random() > 0.5 ? this.xCoord + 0.01 : this.xCoord + 1.01;
double rStartY = this.yCoord + 1.1;
double rStartZ = Math.random() > 0.5 ? this.zCoord + 0.01 : this.zCoord + 1.01;
double endX = this.xCoord + 0.5f;
double endY = this.yCoord + 0.7f + (worldObj.rand.nextDouble() * 0.5f);
double endZ = this.zCoord + 0.5f;
AMCore.proxy.particleManager.BeamFromPointToPoint(worldObj, rStartX, rStartY, rStartZ, endX, endY, endZ, 0xFF8811);
if (worldObj.rand.nextBoolean()) {
AMParticle effect = (AMParticle) AMCore.instance.proxy.particleManager.spawn(worldObj, "smoke", endX, endY, endZ);
if (effect != null) {
effect.setIgnoreMaxAge(false);
effect.setMaxAge(60);
effect.AddParticleController(new ParticleFloatUpward(effect, 0.02f, 0.01f, 1, false));
}
} else {
AMParticle effect = (AMParticle) AMCore.instance.proxy.particleManager.spawn(worldObj, "explosion_2", endX, endY, endZ);
if (effect != null) {
effect.setIgnoreMaxAge(false);
effect.setMaxAge(10);
effect.setParticleScale(0.04f);
effect.setVelocity(worldObj.rand.nextDouble() * 0.2f - 0.1f, 0.2f, worldObj.rand.nextDouble() * 0.2f - 0.1f);
effect.setAffectedByGravity();
effect.setDontRequireControllers();
}
}
}
} else {
particleCount = 0;
}
}
boolean powerCheck = PowerNodeRegistry.For(this.worldObj).checkPower(this, getCookTickPowerCost());
if (this.canSmelt() && this.isSmelting() && powerCheck) {
++this.timeSpentCooking;
if (this.timeSpentCooking >= getModifiedCookTime()) {
if (!this.worldObj.isRemote) {
this.smeltItem();
} else {
worldObj.playSound(xCoord, yCoord, zCoord, "arsmagica2:misc.calefactor.burn", 0.2f, 1.0f, true);
}
this.timeSpentCooking = 0;
if (!worldObj.isRemote) {
sendCookStatusUpdate(false);
}
}
if (!worldObj.isRemote) {
if (PowerNodeRegistry.For(worldObj).checkPower(this, PowerTypes.DARK, getCookTickPowerCost()) && PowerNodeRegistry.For(worldObj).checkPower(this, PowerTypes.NEUTRAL, getCookTickPowerCost()) && PowerNodeRegistry.For(worldObj).checkPower(this, PowerTypes.LIGHT, getCookTickPowerCost())) {
PowerNodeRegistry.For(this.worldObj).consumePower(this, PowerTypes.DARK, getCookTickPowerCost());
PowerNodeRegistry.For(this.worldObj).consumePower(this, PowerTypes.NEUTRAL, getCookTickPowerCost());
PowerNodeRegistry.For(this.worldObj).consumePower(this, PowerTypes.LIGHT, getCookTickPowerCost());
} else {
PowerNodeRegistry.For(this.worldObj).consumePower(this, PowerNodeRegistry.For(this.worldObj).getHighestPowerType(this), getCookTickPowerCost());
}
}
} else if (!this.isSmelting() && this.canSmelt() && powerCheck) {
this.timeSpentCooking = 1;
if (!worldObj.isRemote) {
sendCookStatusUpdate(true);
}
} else if (!this.canSmelt()) {
this.timeSpentCooking = 0;
}
}
Aggregations