Search in sources :

Example 6 with AMParticle

use of am2.particles.AMParticle 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);
        }
    }
}
Also used : AMParticle(am2.particles.AMParticle) ParticleFadeOut(am2.particles.ParticleFadeOut) ParticleFloatUpward(am2.particles.ParticleFloatUpward) ParticleMoveOnHeading(am2.particles.ParticleMoveOnHeading)

Example 7 with AMParticle

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

the class EntityFireElemental method onUpdate.

@Override
public void onUpdate() {
    int cookTargetID = dataWatcher.getWatchableObjectInt(19);
    if (cookTargetID != 0) {
        List<EntityItem> items = worldObj.getEntitiesWithinAABB(EntityItem.class, this.boundingBox.expand(cookRadius, cookRadius, cookRadius));
        EntityItem inanimate = null;
        for (EntityItem item : items) {
            if (item.getEntityId() == cookTargetID) {
                inanimate = item;
            }
        }
        if (inanimate != null && worldObj.isRemote) {
            AMParticle effect = (AMParticle) AMCore.instance.proxy.particleManager.spawn(worldObj, "fire", posX, posY + getEyeHeight(), posZ);
            if (effect != null) {
                effect.setIgnoreMaxAge(true);
                effect.AddParticleController(new ParticleApproachPoint(effect, inanimate.posX + (rand.nextFloat() - 0.5), inanimate.posY + (rand.nextFloat() - 0.5), inanimate.posZ + (rand.nextFloat() - 0.5), 0.1f, 0.1f, 1, false).setKillParticleOnFinish(true));
            }
        }
    }
    if (worldObj.isRemote && rand.nextInt(100) > 75 && !isBurning())
        for (int i = 0; i < AMCore.config.getGFXLevel(); i++) worldObj.spawnParticle("largesmoke", posX + (rand.nextDouble() - 0.5D) * width, posY + rand.nextDouble() * height, posZ + (rand.nextDouble() - 0.5D) * width, 0.0D, 0.0D, 0.0D);
    super.onUpdate();
}
Also used : AMParticle(am2.particles.AMParticle) ParticleApproachPoint(am2.particles.ParticleApproachPoint) ParticleApproachPoint(am2.particles.ParticleApproachPoint) EntityItem(net.minecraft.entity.item.EntityItem)

Example 8 with AMParticle

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

the class EntityBroom method interact.

@Override
protected boolean interact(EntityPlayer par1EntityPlayer) {
    if (par1EntityPlayer.getCurrentEquippedItem() != null && par1EntityPlayer.getCurrentEquippedItem().getItem() == ItemsCommonProxy.spellStaffMagitech) {
        if (this.worldObj.isRemote) {
            for (int i = 0; i < AMCore.config.getGFXLevel() * 2; ++i) {
                AMParticle particle = (AMParticle) AMCore.proxy.particleManager.spawn(worldObj, "smoke", posX, posY, posZ);
                if (particle != null) {
                    particle.AddParticleController(new ParticleFloatUpward(particle, 0.1f, 0.3f, 1, false));
                    particle.addRandomOffset(0.3, 1, 0.3);
                    particle.setMaxAge(10);
                }
            }
        } else {
            this.entityDropItem(new ItemStack(ItemsCommonProxy.magicBroom), 0);
            dropInventoryItems();
            this.setDead();
        }
        return true;
    }
    return false;
}
Also used : AMParticle(am2.particles.AMParticle) ParticleFloatUpward(am2.particles.ParticleFloatUpward) ItemStack(net.minecraft.item.ItemStack)

Example 9 with AMParticle

use of am2.particles.AMParticle 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();
}
Also used : AMParticle(am2.particles.AMParticle) ParticleFadeOut(am2.particles.ParticleFadeOut)

Example 10 with AMParticle

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

the class ItemCrystalWrench method spawnLinkParticles.

private void spawnLinkParticles(World world, double hitX, double hitY, double hitZ, boolean disconnect) {
    for (int i = 0; i < 10; ++i) {
        AMParticle particle = (AMParticle) AMCore.proxy.particleManager.spawn(world, "none_hand", hitX, hitY, hitZ);
        if (particle != null) {
            if (disconnect) {
                particle.setRGBColorF(1, 0, 0);
                particle.addRandomOffset(0.5f, 0.5f, 0.5f);
            }
            particle.setMaxAge(10);
            particle.setParticleScale(0.1f);
            particle.AddParticleController(new ParticleMoveOnHeading(particle, world.rand.nextInt(360), world.rand.nextInt(360), world.rand.nextDouble() * 0.2, 1, false));
            particle.AddParticleController(new ParticleFadeOut(particle, 1, false).setFadeSpeed(0.1f));
        }
    }
}
Also used : AMParticle(am2.particles.AMParticle) ParticleFadeOut(am2.particles.ParticleFadeOut) ParticleMoveOnHeading(am2.particles.ParticleMoveOnHeading)

Aggregations

AMParticle (am2.particles.AMParticle)103 ParticleFloatUpward (am2.particles.ParticleFloatUpward)38 ParticleFadeOut (am2.particles.ParticleFadeOut)25 ParticleOrbitEntity (am2.particles.ParticleOrbitEntity)19 ParticleMoveOnHeading (am2.particles.ParticleMoveOnHeading)13 EntityLivingBase (net.minecraft.entity.EntityLivingBase)13 ParticleHoldPosition (am2.particles.ParticleHoldPosition)11 Entity (net.minecraft.entity.Entity)9 AMVector3 (am2.api.math.AMVector3)8 ISpellModifier (am2.api.spell.component.interfaces.ISpellModifier)8 Colour (am2.spell.modifiers.Colour)8 EntityPlayer (net.minecraft.entity.player.EntityPlayer)7 ItemStack (net.minecraft.item.ItemStack)7 ParticleOrbitPoint (am2.particles.ParticleOrbitPoint)6 SideOnly (cpw.mods.fml.relauncher.SideOnly)6 Block (net.minecraft.block.Block)6 EntityDragonPart (net.minecraft.entity.boss.EntityDragonPart)6 TileEntity (net.minecraft.tileentity.TileEntity)5 List (java.util.List)4 BuffEffectFrostSlowed (am2.buffs.BuffEffectFrostSlowed)3