Search in sources :

Example 1 with EntitySpellEffect

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

the class Wall method beginStackStage.

@Override
public SpellCastResult beginStackStage(ItemSpellBase item, ItemStack stack, EntityLivingBase caster, EntityLivingBase target, World world, double x, double y, double z, int side, boolean giveXP, int useCount) {
    if (world.isRemote)
        return SpellCastResult.SUCCESS;
    int radius = SpellUtils.instance.getModifiedInt_Mul(3, stack, caster, target, world, 0, SpellModifiers.RADIUS);
    double gravity = SpellUtils.instance.getModifiedDouble_Add(0, stack, caster, target, world, 0, SpellModifiers.GRAVITY);
    int duration = SpellUtils.instance.getModifiedInt_Mul(100, stack, caster, target, world, 0, SpellModifiers.DURATION);
    EntitySpellEffect wall = new EntitySpellEffect(world);
    wall.setRadius(radius);
    wall.setTicksToExist(duration);
    wall.setGravity(gravity);
    wall.SetCasterAndStack(caster, SpellUtils.instance.popStackStage(stack));
    wall.setPosition(x, y, z);
    wall.setWall(caster.rotationYaw);
    world.spawnEntityInWorld(wall);
    return SpellCastResult.SUCCESS;
}
Also used : EntitySpellEffect(am2.entities.EntitySpellEffect)

Example 2 with EntitySpellEffect

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

the class Zone method beginStackStage.

@Override
public SpellCastResult beginStackStage(ItemSpellBase item, ItemStack stack, EntityLivingBase caster, EntityLivingBase target, World world, double x, double y, double z, int side, boolean giveXP, int useCount) {
    if (world.isRemote)
        return SpellCastResult.SUCCESS;
    int radius = SpellUtils.instance.getModifiedInt_Add(2, stack, caster, target, world, 0, SpellModifiers.RADIUS);
    double gravity = SpellUtils.instance.getModifiedDouble_Add(0, stack, caster, target, world, 0, SpellModifiers.GRAVITY);
    int duration = SpellUtils.instance.getModifiedInt_Mul(100, stack, caster, target, world, 0, SpellModifiers.DURATION);
    EntitySpellEffect zone = new EntitySpellEffect(world);
    zone.setRadius(radius);
    zone.setTicksToExist(duration);
    zone.setGravity(gravity);
    zone.SetCasterAndStack(caster, SpellUtils.instance.popStackStage(stack));
    zone.setPosition(x, y, z);
    world.spawnEntityInWorld(zone);
    return SpellCastResult.SUCCESS;
}
Also used : EntitySpellEffect(am2.entities.EntitySpellEffect)

Example 3 with EntitySpellEffect

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

the class EntityAIFireRain method updateTask.

@Override
public void updateTask() {
    if (((IArsMagicaBoss) host).getCurrentAction() != BossActions.CASTING)
        ((IArsMagicaBoss) host).setCurrentAction(BossActions.CASTING);
    boltTicks++;
    if (boltTicks == 12) {
        if (!host.worldObj.isRemote) {
            EntitySpellEffect fire = new EntitySpellEffect(host.worldObj);
            fire.setPosition(host.posX, host.posY, host.posZ);
            fire.setTicksToExist(300);
            fire.setRainOfFire(true);
            fire.setRadius(10);
            fire.SetCasterAndStack(host, null);
            host.worldObj.spawnEntityInWorld(fire);
        }
    }
    if (boltTicks >= 23) {
        resetTask();
    }
}
Also used : EntitySpellEffect(am2.entities.EntitySpellEffect)

Example 4 with EntitySpellEffect

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

the class Wave method beginStackStage.

@Override
public SpellCastResult beginStackStage(ItemSpellBase item, ItemStack stack, EntityLivingBase caster, EntityLivingBase target, World world, double x, double y, double z, int side, boolean giveXP, int useCount) {
    if (world.isRemote)
        return SpellCastResult.SUCCESS;
    double radius = SpellUtils.instance.getModifiedDouble_Add(1, stack, caster, target, world, 0, SpellModifiers.RADIUS);
    int duration = SpellUtils.instance.getModifiedInt_Mul(20, stack, caster, target, world, 0, SpellModifiers.DURATION);
    double speed = SpellUtils.instance.getModifiedDouble_Add(1f, stack, caster, target, world, 0, SpellModifiers.SPEED) * 0.5f;
    int gravityModifiers = SpellUtils.instance.countModifiers(SpellModifiers.GRAVITY, stack, 0);
    boolean hasPiercing = SpellUtils.instance.modifierIsPresent(SpellModifiers.PIERCING, stack, 0);
    EntitySpellEffect wave = new EntitySpellEffect(world);
    wave.setRadius((float) radius);
    wave.setTicksToExist(duration);
    wave.SetCasterAndStack(caster, SpellUtils.instance.popStackStage(stack));
    wave.setPosition(x, y + 1, z);
    wave.setWave(caster.rotationYaw, (float) speed);
    wave.noClip = hasPiercing;
    wave.setGravity(gravityModifiers * 0.5f);
    world.spawnEntityInWorld(wave);
    return SpellCastResult.SUCCESS;
}
Also used : EntitySpellEffect(am2.entities.EntitySpellEffect)

Example 5 with EntitySpellEffect

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

the class Blizzard method spawnBlizzard.

private boolean spawnBlizzard(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.isBlizzard())
            return false;
    }
    if (!world.isRemote) {
        int radius = SpellUtils.instance.getModifiedInt_Add(2, stack, caster, target, world, 0, SpellModifiers.RADIUS);
        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 blizzard = new EntitySpellEffect(world);
        blizzard.setPosition(x, y, z);
        blizzard.setBlizzard();
        blizzard.setRadius(radius);
        blizzard.setTicksToExist(duration);
        blizzard.setDamageBonus((float) damage);
        blizzard.SetCasterAndStack(caster, stack);
        world.spawnEntityInWorld(blizzard);
    }
    return true;
}
Also used : EntitySpellEffect(am2.entities.EntitySpellEffect)

Aggregations

EntitySpellEffect (am2.entities.EntitySpellEffect)6