Search in sources :

Example 1 with EntityEnderGuardian

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

the class EntityAIOtherworldlyRoar method updateTask.

@Override
public void updateTask() {
    EntityEnderGuardian guardian = getEntity();
    if (guardian.getAttackTarget() != null) {
        if (guardian.getTicksInCurrentAction() == 33) {
            guardian.faceEntity(guardian.getAttackTarget(), 180, 180);
            SpellHelper.instance.applyStackStage(NPCSpells.instance.enderGuardian_otherworldlyRoar, 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 2 with EntityEnderGuardian

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

the class EntityAIEnderbolt 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_enderBolt, 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 3 with EntityEnderGuardian

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

the class EntityAIShadowstep method resetTask.

@Override
public void resetTask() {
    cooldownTicks = 30;
    EntityEnderGuardian guardian = getEntity();
    if (guardian.getAttackTarget() != null) {
        Vec3 facing = guardian.getAttackTarget().getLook(1.0f);
        double x = guardian.getAttackTarget().posX - facing.xCoord * 3;
        double y = guardian.getAttackTarget().posY;
        double z = guardian.getAttackTarget().posZ - facing.zCoord * 3;
        guardian.setPosition(x, y, z);
        guardian.lastTickPosX = x;
        guardian.lastTickPosY = y;
        guardian.lastTickPosZ = z;
        guardian.worldObj.playSoundAtEntity(guardian, ((IArsMagicaBoss) guardian).getAttackSound(), 1.0f, (float) (0.5 + guardian.getRNG().nextDouble() * 0.5f));
    }
    super.resetTask();
}
Also used : Vec3(net.minecraft.util.Vec3) EntityEnderGuardian(am2.bosses.EntityEnderGuardian)

Example 4 with EntityEnderGuardian

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

the class EntityAIEnderRush method updateTask.

@Override
public void updateTask() {
    EntityEnderGuardian guardian = getEntity();
    if (guardian.getAttackTarget() != null) {
        guardian.getLookHelper().setLookPositionWithEntity(guardian.getAttackTarget(), 30, 30);
    }
    if (guardian.getTicksInCurrentAction() >= 18 && guardian.getTicksInCurrentAction() <= 30 && guardian.getAttackTarget() != null) {
        AMVector3 a = new AMVector3(guardian);
        AMVector3 b = new AMVector3(guardian.getAttackTarget());
        if (a.distanceSqTo(b) > 4) {
            AMVector3 movement = MathUtilities.GetMovementVectorBetweenPoints(a, b);
            float speed = -5f;
            guardian.moveEntity(movement.x * speed, movement.y * speed, movement.z * speed);
        } else {
            guardian.worldObj.playSoundAtEntity(guardian, ((IArsMagicaBoss) guardian).getAttackSound(), 1.0f, (float) (0.5 + guardian.getRNG().nextDouble() * 0.5f));
            if (guardian.getAttackTarget().attackEntityFrom(DamageSource.causeMobDamage(guardian), 15) && guardian.getAttackTarget().getHealth() <= 0)
                guardian.heal(200);
        }
    }
}
Also used : AMVector3(am2.api.math.AMVector3) EntityEnderGuardian(am2.bosses.EntityEnderGuardian)

Example 5 with EntityEnderGuardian

use of am2.bosses.EntityEnderGuardian 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)

Aggregations

EntityEnderGuardian (am2.bosses.EntityEnderGuardian)5 AMVector3 (am2.api.math.AMVector3)1 Vec3 (net.minecraft.util.Vec3)1