use of am2.particles.ParticleFadeOut 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.ParticleFadeOut in project ArsMagica2 by Mithion.
the class AoE method spawnAoEParticles.
private void spawnAoEParticles(ItemStack stack, EntityLivingBase caster, World world, double x, double y, double z, int radius) {
String pfxName = AMParticleIcons.instance.getParticleForAffinity(SpellUtils.instance.mainAffinityFor(stack));
float speed = 0.08f * radius;
int color = 0xFFFFFF;
if (SpellUtils.instance.modifierIsPresent(SpellModifiers.COLOR, stack, 0)) {
ISpellModifier[] mods = SpellUtils.instance.getModifiersForStage(stack, 0);
int ordinalCount = 0;
for (ISpellModifier mod : mods) {
if (mod instanceof Colour) {
byte[] meta = SpellUtils.instance.getModifierMetadataFromStack(stack, mod, 0, ordinalCount++);
color = (int) mod.getModifier(SpellModifiers.COLOR, null, null, null, meta);
}
}
}
for (int i = 0; i < 360; i += AMCore.config.FullGFX() ? 20 : AMCore.config.LowGFX() ? 40 : 60) {
AMParticle effect = (AMParticle) AMCore.instance.proxy.particleManager.spawn(world, pfxName, x, y + 1.5f, z);
if (effect != null) {
effect.setIgnoreMaxAge(true);
effect.AddParticleController(new ParticleMoveOnHeading(effect, i, 0, speed, 1, false));
effect.noClip = false;
effect.setRGBColorI(color);
effect.AddParticleController(new ParticleFadeOut(effect, 1, false).setFadeSpeed(0.05f).setKillParticleOnFinish(true));
effect.AddParticleController(new ParticleLeaveParticleTrail(effect, pfxName, false, 5, 1, false).addControllerToParticleList(new ParticleFadeOut(effect, 1, false).setFadeSpeed(0.1f).setKillParticleOnFinish(true)).setParticleRGB_I(color).addRandomOffset(0.2f, 0.2f, 0.2f));
}
}
}
use of am2.particles.ParticleFadeOut 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.ParticleFadeOut in project ArsMagica2 by Mithion.
the class BlockInvisibleUtility method spawnBlockParticles.
private void spawnBlockParticles(World world, int x, int y, int z) {
AMParticle particle = (AMParticle) AMCore.proxy.particleManager.spawn(world, "symbols", x + 0.5, y + 0.5, z + 0.5);
if (particle != null) {
particle.addRandomOffset(1, 1.6, 1);
particle.setParticleScale(0.1f);
particle.AddParticleController(new ParticleFloatUpward(particle, 0, 0.02f, 1, false));
particle.AddParticleController(new ParticleFadeOut(particle, 1, false).setFadeSpeed(0.05f));
particle.setMaxAge(20);
if (world.rand.nextBoolean()) {
particle.setRGBColorI(0x481bc8);
} else {
particle.setRGBColorI(0x891bc8);
}
}
}
use of am2.particles.ParticleFadeOut in project ArsMagica2 by Mithion.
the class TileEntityAstralBarrier method updateEntity.
@Override
public void updateEntity() {
super.updateEntity();
int radius = getRadius();
if (IsActive()) {
PowerNodeRegistry.For(this.worldObj).consumePower(this, PowerNodeRegistry.For(worldObj).getHighestPowerType(this), 0.35f * radius);
}
if (worldObj.isRemote) {
if (IsActive()) {
if (displayAura) {
AMParticle effect = (AMParticle) AMCore.instance.proxy.particleManager.spawn(worldObj, "symbols", xCoord, yCoord + 0.5, zCoord);
if (effect != null) {
effect.setIgnoreMaxAge(false);
effect.setMaxAge(100);
effect.setParticleScale(0.5f);
effect.AddParticleController(new ParticleOrbitPoint(effect, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, 1, false).SetOrbitSpeed(0.03).SetTargetDistance(radius));
}
}
particleTickCounter++;
if (particleTickCounter >= 15) {
particleTickCounter = 0;
String particleName = "";
AMParticle effect = (AMParticle) AMCore.instance.proxy.particleManager.spawn(worldObj, "sparkle", xCoord + 0.5, yCoord + 0.1 + worldObj.rand.nextDouble() * 0.5, zCoord + 0.5);
if (effect != null) {
effect.setIgnoreMaxAge(false);
effect.setMaxAge(100);
effect.setParticleScale(0.5f);
float color = worldObj.rand.nextFloat() * 0.2f + 0.8f;
effect.AddParticleController(new ParticleOrbitPoint(effect, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, 1, false).SetOrbitSpeed(0.005).SetTargetDistance(worldObj.rand.nextDouble() * 0.6 - 0.3));
effect.AddParticleController(new ParticleHoldPosition(effect, 80, 2, true));
effect.AddParticleController(new ParticleFadeOut(effect, 3, false).setFadeSpeed(0.05f));
}
}
}
}
}
Aggregations