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;
}
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;
}
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;
}
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);
}
}
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;
}
Aggregations