Search in sources :

Example 16 with IArsMagicaBoss

use of am2.bosses.IArsMagicaBoss in project ArsMagica2 by Mithion.

the class EntityAIHurricane method shouldExecute.

@Override
public boolean shouldExecute() {
    if (cooldownTicks-- > 0 || ((IArsMagicaBoss) host).getCurrentAction() != BossActions.IDLE || !((IArsMagicaBoss) host).isActionValid(BossActions.SPINNING))
        return false;
    EntityLivingBase AITarget = host.getAttackTarget();
    if (AITarget == null || AITarget.isDead || AITarget.getDistanceSqToEntity(host) > 25)
        return false;
    this.target = AITarget;
    ((IArsMagicaBoss) host).setCurrentAction(BossActions.SPINNING);
    return true;
}
Also used : IArsMagicaBoss(am2.bosses.IArsMagicaBoss) EntityLivingBase(net.minecraft.entity.EntityLivingBase)

Example 17 with IArsMagicaBoss

use of am2.bosses.IArsMagicaBoss in project ArsMagica2 by Mithion.

the class EntityAISmash method shouldExecute.

@Override
public boolean shouldExecute() {
    if (cooldownTicks-- > 0 || ((IArsMagicaBoss) host).getCurrentAction() != BossActions.IDLE || !((IArsMagicaBoss) host).isActionValid(BossActions.SMASH))
        return false;
    EntityLivingBase AITarget = host.getAttackTarget();
    if (AITarget == null || AITarget.isDead)
        return false;
    if (AITarget != null && host.getDistanceSqToEntity(AITarget) > 4D) {
        if (!host.getNavigator().tryMoveToEntityLiving(AITarget, moveSpeed))
            return false;
    }
    this.target = AITarget;
    return true;
}
Also used : IArsMagicaBoss(am2.bosses.IArsMagicaBoss) EntityLivingBase(net.minecraft.entity.EntityLivingBase)

Example 18 with IArsMagicaBoss

use of am2.bosses.IArsMagicaBoss in project ArsMagica2 by Mithion.

the class EntityAISmash method continueExecuting.

@Override
public boolean continueExecuting() {
    EntityLivingBase AITarget = host.getAttackTarget();
    if (AITarget != null && host.getDistanceSqToEntity(AITarget) > 4D) {
        if (host.onGround)
            return host.getNavigator().tryMoveToEntityLiving(AITarget, moveSpeed);
    }
    if (AITarget == null || AITarget.isDead || (((IArsMagicaBoss) host).getCurrentAction() == BossActions.SMASH && ((IArsMagicaBoss) host).getTicksInCurrentAction() > ((IArsMagicaBoss) host).getCurrentAction().getMaxActionTime())) {
        ((IArsMagicaBoss) host).setCurrentAction(BossActions.IDLE);
        cooldownTicks = 100;
        return false;
    }
    return true;
}
Also used : IArsMagicaBoss(am2.bosses.IArsMagicaBoss) EntityLivingBase(net.minecraft.entity.EntityLivingBase)

Example 19 with IArsMagicaBoss

use of am2.bosses.IArsMagicaBoss in project ArsMagica2 by Mithion.

the class EntityAISpinAttack method updateTask.

@Override
public void updateTask() {
    host.getLookHelper().setLookPositionWithEntity(target, 30, 30);
    host.getNavigator().tryMoveToEntityLiving(target, moveSpeed);
    List<EntityLivingBase> nearbyEntities = host.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, host.boundingBox.expand(2, 2, 2));
    for (EntityLivingBase ent : nearbyEntities) {
        if (ent == host)
            continue;
        ent.attackEntityFrom(DamageSource.causeMobDamage(host), damage);
    }
    if (((IArsMagicaBoss) host).getTicksInCurrentAction() % 50 == 0) {
        if (!host.worldObj.isRemote)
            host.worldObj.playSoundAtEntity(host, "arsmagica2:mob.natureguardian.whirlloop", 1.0f, 1.0f);
    }
}
Also used : IArsMagicaBoss(am2.bosses.IArsMagicaBoss) EntityLivingBase(net.minecraft.entity.EntityLivingBase)

Example 20 with IArsMagicaBoss

use of am2.bosses.IArsMagicaBoss in project ArsMagica2 by Mithion.

the class EntityAIStrikeAttack method shouldExecute.

@Override
public boolean shouldExecute() {
    if (cooldownTicks-- > 0 || ((IArsMagicaBoss) host).getCurrentAction() != BossActions.IDLE || !((IArsMagicaBoss) host).isActionValid(BossActions.STRIKE))
        return false;
    EntityLivingBase AITarget = host.getAttackTarget();
    if (AITarget == null || AITarget.isDead)
        return false;
    if (AITarget != null && host.getDistanceSqToEntity(AITarget) > 4D) {
        if (!host.getNavigator().tryMoveToEntityLiving(AITarget, moveSpeed))
            return false;
    }
    this.target = AITarget;
    return true;
}
Also used : IArsMagicaBoss(am2.bosses.IArsMagicaBoss) EntityLivingBase(net.minecraft.entity.EntityLivingBase)

Aggregations

IArsMagicaBoss (am2.bosses.IArsMagicaBoss)19 EntityLivingBase (net.minecraft.entity.EntityLivingBase)15 EntityEnderGuardian (am2.bosses.EntityEnderGuardian)4 EntityPlayer (net.minecraft.entity.player.EntityPlayer)3 AMVector3 (am2.api.math.AMVector3)2 BuffEffectMagicShield (am2.buffs.BuffEffectMagicShield)1 BuffEffectShrink (am2.buffs.BuffEffectShrink)1 EntityFlicker (am2.entities.EntityFlicker)1 EntityShockwave (am2.entities.EntityShockwave)1 EntitySpellEffect (am2.entities.EntitySpellEffect)1 EntityThrownRock (am2.entities.EntityThrownRock)1 EntityWhirlwind (am2.entities.EntityWhirlwind)1 Constructor (java.lang.reflect.Constructor)1 Render (net.minecraft.client.renderer.entity.Render)1 Entity (net.minecraft.entity.Entity)1 EntityCreature (net.minecraft.entity.EntityCreature)1 EntityLiving (net.minecraft.entity.EntityLiving)1 PotionEffect (net.minecraft.potion.PotionEffect)1 TileEntity (net.minecraft.tileentity.TileEntity)1 Vec3 (net.minecraft.util.Vec3)1