Search in sources :

Example 1 with BuffEffectHaste

use of am2.buffs.BuffEffectHaste in project ArsMagica2 by Mithion.

the class Haste method applyEffectEntity.

@Override
public boolean applyEffectEntity(ItemStack stack, World world, EntityLivingBase caster, Entity target) {
    if (target instanceof EntityLivingBase) {
        int duration = SpellUtils.instance.getModifiedInt_Mul(BuffList.default_buff_duration, stack, caster, target, world, 0, SpellModifiers.DURATION);
        duration = SpellUtils.instance.modifyDurationBasedOnArmor(caster, duration);
        int x = (int) Math.floor(target.posX);
        int y = (int) Math.floor(target.posY);
        int z = (int) Math.floor(target.posZ);
        if (RitualShapeHelper.instance.checkForRitual(this, world, x, y, z) != null) {
            duration += (3600 * (SpellUtils.instance.countModifiers(SpellModifiers.BUFF_POWER, stack, 0) + 1));
            RitualShapeHelper.instance.consumeRitualReagents(this, world, x, y, z);
        }
        if (!world.isRemote)
            ((EntityLivingBase) target).addPotionEffect(new BuffEffectHaste(duration, SpellUtils.instance.countModifiers(SpellModifiers.BUFF_POWER, stack, 0)));
        return true;
    }
    return false;
}
Also used : EntityLivingBase(net.minecraft.entity.EntityLivingBase) BuffEffectHaste(am2.buffs.BuffEffectHaste) ParticleOrbitPoint(am2.particles.ParticleOrbitPoint)

Aggregations

BuffEffectHaste (am2.buffs.BuffEffectHaste)1 ParticleOrbitPoint (am2.particles.ParticleOrbitPoint)1 EntityLivingBase (net.minecraft.entity.EntityLivingBase)1