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