Search in sources :

Example 6 with EntitySpellEffect

use of am2.entities.EntitySpellEffect in project ArsMagica2 by Mithion.

the class FireRain method spawnFireRain.

private boolean spawnFireRain(ItemStack stack, World world, EntityLivingBase caster, Entity target, double x, double y, double z) {
    List<EntitySpellEffect> zones = world.getEntitiesWithinAABB(EntitySpellEffect.class, AxisAlignedBB.getBoundingBox(x - 10, y - 10, z - 10, x + 10, y + 10, z + 10));
    for (EntitySpellEffect zone : zones) {
        if (zone.isRainOfFire())
            return false;
    }
    if (!world.isRemote) {
        int radius = SpellUtils.instance.getModifiedInt_Add(2, stack, caster, target, world, 0, SpellModifiers.RADIUS) / 2 + 1;
        double damage = SpellUtils.instance.getModifiedDouble_Mul(1, stack, caster, target, world, 0, SpellModifiers.DAMAGE);
        int duration = SpellUtils.instance.getModifiedInt_Mul(100, stack, caster, target, world, 0, SpellModifiers.DURATION);
        EntitySpellEffect fire = new EntitySpellEffect(world);
        fire.setPosition(x, y, z);
        fire.setRainOfFire(false);
        fire.setRadius(radius);
        fire.setDamageBonus((float) damage);
        fire.setTicksToExist(duration);
        fire.SetCasterAndStack(caster, stack);
        world.spawnEntityInWorld(fire);
    }
    return true;
}
Also used : EntitySpellEffect(am2.entities.EntitySpellEffect)

Aggregations

EntitySpellEffect (am2.entities.EntitySpellEffect)6