Search in sources :

Example 21 with IArsMagicaBoss

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

the class EntityAIStrikeAttack method continueExecuting.

@Override
public boolean continueExecuting() {
    EntityLivingBase AITarget = host.getAttackTarget();
    if (AITarget == null || AITarget.isDead || (((IArsMagicaBoss) host).getCurrentAction() == BossActions.STRIKE && ((IArsMagicaBoss) host).getTicksInCurrentAction() > ((IArsMagicaBoss) host).getCurrentAction().getMaxActionTime())) {
        ((IArsMagicaBoss) host).setCurrentAction(BossActions.IDLE);
        cooldownTicks = 5;
        return false;
    }
    return true;
}
Also used : IArsMagicaBoss(am2.bosses.IArsMagicaBoss) EntityLivingBase(net.minecraft.entity.EntityLivingBase)

Example 22 with IArsMagicaBoss

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

the class EntityAIThrowRock method shouldExecute.

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

Example 23 with IArsMagicaBoss

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

the class EntityAIThrowRock method updateTask.

@Override
public void updateTask() {
    host.getLookHelper().setLookPositionWithEntity(target, 30, 30);
    if (host.getDistanceSqToEntity(target) > 100) {
        host.getNavigator().tryMoveToEntityLiving(target, moveSpeed);
    } else {
        host.getNavigator().clearPathEntity();
        if (((IArsMagicaBoss) host).getCurrentAction() != BossActions.THROWING_ROCK)
            ((IArsMagicaBoss) host).setCurrentAction(BossActions.THROWING_ROCK);
        if (((IArsMagicaBoss) host).getTicksInCurrentAction() == 27) {
            if (!host.worldObj.isRemote)
                host.worldObj.playSoundAtEntity(host, ((IArsMagicaBoss) host).getAttackSound(), 1.0f, 1.0f);
            host.faceEntity(target, 180, 180);
            if (!host.worldObj.isRemote) {
                EntityThrownRock projectile = new EntityThrownRock(host.worldObj, host, 2.0f);
                host.worldObj.spawnEntityInWorld(projectile);
            }
        }
    }
}
Also used : EntityThrownRock(am2.entities.EntityThrownRock) IArsMagicaBoss(am2.bosses.IArsMagicaBoss)

Example 24 with IArsMagicaBoss

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

the class EntityAIEnderwave method updateTask.

@Override
public void updateTask() {
    EntityEnderGuardian guardian = getEntity();
    if (guardian.getAttackTarget() != null) {
        guardian.getLookHelper().setLookPositionWithEntity(guardian.getAttackTarget(), 30, 30);
        if (guardian.getTicksInCurrentAction() == 7) {
            guardian.faceEntity(guardian.getAttackTarget(), 180, 180);
            guardian.worldObj.playSoundAtEntity(guardian, ((IArsMagicaBoss) guardian).getAttackSound(), 1.0f, (float) (0.5 + guardian.getRNG().nextDouble() * 0.5f));
            SpellHelper.instance.applyStackStage(NPCSpells.instance.enderGuardian_enderWave, guardian, guardian, guardian.posX, guardian.posY + 0.5f, guardian.posZ, 0, guardian.worldObj, false, false, 0);
        } else {
            guardian.faceEntity(guardian.getAttackTarget(), 180, 180);
        }
    }
}
Also used : EntityEnderGuardian(am2.bosses.EntityEnderGuardian)

Example 25 with IArsMagicaBoss

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

the class AMPacketProcessorClient method handleEntityActionUpdate.

private void handleEntityActionUpdate(byte[] data, EntityPlayer player) {
    AMDataReader rdr = new AMDataReader(data, false);
    int entityID = rdr.getInt();
    int actionOrdinal = rdr.getInt();
    Entity ent = player.worldObj.getEntityByID(entityID);
    if (ent == null || ent.isDead || !(ent instanceof IArsMagicaBoss))
        return;
    ((IArsMagicaBoss) ent).setCurrentAction(BossActions.values()[actionOrdinal]);
}
Also used : Entity(net.minecraft.entity.Entity) TileEntity(net.minecraft.tileentity.TileEntity) IArsMagicaBoss(am2.bosses.IArsMagicaBoss)

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