use of am2.bosses.IArsMagicaBoss in project ArsMagica2 by Mithion.
the class EntityAIThrowRock method continueExecuting.
@Override
public boolean continueExecuting() {
EntityLivingBase AITarget = host.getAttackTarget();
if (AITarget == null || AITarget.isDead || (((IArsMagicaBoss) host).getCurrentAction() == BossActions.THROWING_ROCK && ((IArsMagicaBoss) host).getTicksInCurrentAction() > ((IArsMagicaBoss) host).getCurrentAction().getMaxActionTime())) {
((IArsMagicaBoss) host).setCurrentAction(BossActions.IDLE);
cooldownTicks = 50;
return false;
}
return true;
}
use of am2.bosses.IArsMagicaBoss in project ArsMagica2 by Mithion.
the class EntityAIShieldBash method continueExecuting.
@Override
public boolean continueExecuting() {
EntityLivingBase AITarget = host.getAttackTarget();
if (AITarget == null || AITarget.isDead || (((IArsMagicaBoss) host).getCurrentAction() == BossActions.SHIELD_BASH && ((IArsMagicaBoss) host).getTicksInCurrentAction() > ((IArsMagicaBoss) host).getCurrentAction().getMaxActionTime())) {
((IArsMagicaBoss) host).setCurrentAction(BossActions.IDLE);
cooldownTicks = 10;
return false;
}
return true;
}
use of am2.bosses.IArsMagicaBoss in project ArsMagica2 by Mithion.
the class EntityAIShieldBash method updateTask.
@Override
public void updateTask() {
host.getLookHelper().setLookPositionWithEntity(target, 30, 30);
host.getNavigator().tryMoveToEntityLiving(target, moveSpeed);
if (host.getDistanceSqToEntity(target) < 16)
if (((IArsMagicaBoss) host).getCurrentAction() != BossActions.SHIELD_BASH)
((IArsMagicaBoss) host).setCurrentAction(BossActions.SHIELD_BASH);
if (((IArsMagicaBoss) host).getCurrentAction() == BossActions.SHIELD_BASH && ((IArsMagicaBoss) host).getTicksInCurrentAction() > 12) {
if (!host.worldObj.isRemote)
host.worldObj.playSoundAtEntity(host, ((IArsMagicaBoss) host).getAttackSound(), 1.0f, 1.0f);
double offsetX = Math.cos(host.rotationYaw) * 2;
double offsetZ = Math.sin(host.rotationYaw) * 2;
List<EntityLivingBase> aoeEntities = host.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, host.boundingBox.getOffsetBoundingBox(offsetX, 0, offsetZ).expand(2.5, 2, 2.5));
for (EntityLivingBase ent : aoeEntities) {
if (ent == host)
continue;
double speed = 4;
double vertSpeed = 0.325;
double deltaZ = ent.posZ - host.posZ;
double deltaX = ent.posX - host.posX;
double angle = Math.atan2(deltaZ, deltaX);
double radians = angle;
if (ent instanceof EntityPlayer) {
AMNetHandler.INSTANCE.sendVelocityAddPacket(host.worldObj, ent, speed * Math.cos(radians), vertSpeed, speed * Math.sin(radians));
}
ent.motionX = (speed * Math.cos(radians));
ent.motionZ = (speed * Math.sin(radians));
ent.motionY = vertSpeed;
ent.attackEntityFrom(DamageSource.causeMobDamage(host), 2);
}
}
}
use of am2.bosses.IArsMagicaBoss in project ArsMagica2 by Mithion.
the class EntityAISpawnWhirlwind method updateTask.
@Override
public void updateTask() {
host.getLookHelper().setLookPositionWithEntity(host.getAttackTarget(), 30, 30);
if (host.getDistanceSqToEntity(host.getAttackTarget()) > 64) {
double deltaZ = host.getAttackTarget().posZ - host.posZ;
double deltaX = host.getAttackTarget().posX - host.posX;
double angle = -Math.atan2(deltaZ, deltaX);
double newX = host.getAttackTarget().posX + (Math.cos(angle) * 6);
double newZ = host.getAttackTarget().posZ + (Math.sin(angle) * 6);
host.getNavigator().tryMoveToXYZ(newX, host.getAttackTarget().posY, newZ, 0.5f);
} else if (!host.canEntityBeSeen(host.getAttackTarget())) {
host.getNavigator().tryMoveToEntityLiving(host.getAttackTarget(), 0.5f);
} else {
if (((IArsMagicaBoss) host).getCurrentAction() != BossActions.CASTING)
((IArsMagicaBoss) host).setCurrentAction(BossActions.CASTING);
windTicks++;
if (windTicks == 12 && !host.worldObj.isRemote) {
if (!host.worldObj.isRemote)
host.worldObj.playSoundAtEntity(host, ((IArsMagicaBoss) host).getAttackSound(), 1.0f, 1.0f);
EntityWhirlwind whirlwind = new EntityWhirlwind(host.worldObj);
whirlwind.setPosition(host.posX, host.posY + host.getEyeHeight(), host.posZ);
host.worldObj.spawnEntityInWorld(whirlwind);
}
}
if (windTicks >= 23) {
resetTask();
}
}
use of am2.bosses.IArsMagicaBoss in project ArsMagica2 by Mithion.
the class EntityAIFireRain method updateTask.
@Override
public void updateTask() {
if (((IArsMagicaBoss) host).getCurrentAction() != BossActions.CASTING)
((IArsMagicaBoss) host).setCurrentAction(BossActions.CASTING);
boltTicks++;
if (boltTicks == 12) {
if (!host.worldObj.isRemote) {
EntitySpellEffect fire = new EntitySpellEffect(host.worldObj);
fire.setPosition(host.posX, host.posY, host.posZ);
fire.setTicksToExist(300);
fire.setRainOfFire(true);
fire.setRadius(10);
fire.SetCasterAndStack(host, null);
host.worldObj.spawnEntityInWorld(fire);
}
}
if (boltTicks >= 23) {
resetTask();
}
}
Aggregations