Search in sources :

Example 16 with ParticleMoveOnHeading

use of am2.particles.ParticleMoveOnHeading in project ArsMagica2 by Mithion.

the class SwiftSwim 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, "water_ball", x, y, z);
        if (particle != null) {
            particle.addRandomOffset(1, 2, 1);
            particle.AddParticleController(new ParticleMoveOnHeading(particle, MathHelper.wrapAngleTo180_double((target instanceof EntityLivingBase ? ((EntityLivingBase) target).rotationYawHead : target.rotationYaw) + 90), MathHelper.wrapAngleTo180_double(target.rotationPitch), 0.1 + rand.nextDouble() * 0.5, 1, false));
            particle.AddParticleController(new ParticleFadeOut(particle, 1, false).setFadeSpeed(0.05f));
            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);
            }
        }
    }
}
Also used : AMParticle(am2.particles.AMParticle) EntityLivingBase(net.minecraft.entity.EntityLivingBase) ParticleFadeOut(am2.particles.ParticleFadeOut) ParticleMoveOnHeading(am2.particles.ParticleMoveOnHeading)

Example 17 with ParticleMoveOnHeading

use of am2.particles.ParticleMoveOnHeading in project ArsMagica2 by Mithion.

the class Disarm 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, "sparkle2", x, y, z);
        if (particle != null) {
            particle.addRandomOffset(1, 2, 1);
            particle.AddParticleController(new ParticleMoveOnHeading(particle, MathHelper.wrapAngleTo180_double((target instanceof EntityLivingBase ? ((EntityLivingBase) target).rotationYawHead : target.rotationYaw) + 90), MathHelper.wrapAngleTo180_double(target.rotationPitch), 0.1 + rand.nextDouble() * 0.5, 1, false));
            particle.AddParticleController(new ParticleFadeOut(particle, 1, false).setFadeSpeed(0.05f));
            particle.setAffectedByGravity();
            if (rand.nextBoolean())
                particle.setRGBColorF(0.7f, 0.7f, 0.1f);
            else
                particle.setRGBColorF(0.1f, 0.7f, 0.1f);
            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);
            }
        }
    }
}
Also used : AMParticle(am2.particles.AMParticle) EntityLivingBase(net.minecraft.entity.EntityLivingBase) ParticleFadeOut(am2.particles.ParticleFadeOut) ParticleMoveOnHeading(am2.particles.ParticleMoveOnHeading)

Aggregations

AMParticle (am2.particles.AMParticle)13 ParticleMoveOnHeading (am2.particles.ParticleMoveOnHeading)13 ParticleFadeOut (am2.particles.ParticleFadeOut)10 EntityLivingBase (net.minecraft.entity.EntityLivingBase)6 ISpellModifier (am2.api.spell.component.interfaces.ISpellModifier)3 Colour (am2.spell.modifiers.Colour)3 Entity (net.minecraft.entity.Entity)3 ItemStack (net.minecraft.item.ItemStack)3 ParticleFloatUpward (am2.particles.ParticleFloatUpward)2 List (java.util.List)2 EntityPlayer (net.minecraft.entity.player.EntityPlayer)2 MovingObjectPosition (net.minecraft.util.MovingObjectPosition)2 Vec3 (net.minecraft.util.Vec3)2 AMVector3 (am2.api.math.AMVector3)1 Affinity (am2.api.spell.enums.Affinity)1 SpellCastResult (am2.api.spell.enums.SpellCastResult)1 EntityWinterGuardian (am2.bosses.EntityWinterGuardian)1 AMBeam (am2.particles.AMBeam)1 ExtendedProperties (am2.playerextensions.ExtendedProperties)1 ArrayList (java.util.ArrayList)1