use of am2.bosses.IArsMagicaBoss in project ArsMagica2 by Mithion.
the class GuiArcaneCompendium method renderEntityIntoUI.
private void renderEntityIntoUI() {
Render render = (Render) RenderManager.instance.entityRenderMap.get(entryEntity.getClass());
if (render != null) {
GL11.glPushMatrix();
if (entryEntity instanceof IArsMagicaBoss) {
float scaleFactorX = (1 / entryEntity.width);
float scaleFactorY = (2 / entryEntity.height);
GL11.glScalef(scaleFactorX, scaleFactorY, scaleFactorX);
} else if (entryEntity instanceof EntityFlicker) {
GL11.glTranslatef(0, 1.3f, 0);
}
GL11.glRotatef(curRotationH, 0, 1, 0);
// entity, x, y, z, yaw, partialtick
render.doRender(entryEntity, 0, 0, 0, 90, 0);
GL11.glPopMatrix();
}
}
use of am2.bosses.IArsMagicaBoss in project ArsMagica2 by Mithion.
the class EntityAIHurricane method continueExecuting.
@Override
public boolean continueExecuting() {
EntityLivingBase AITarget = ((EntityLiving) host).getAttackTarget();
if (host.hitCount >= 10) {
((IArsMagicaBoss) host).setCurrentAction(BossActions.IDLE);
cooldownTicks = 20;
return false;
}
if (AITarget == null || AITarget.isDead || ((IArsMagicaBoss) host).getTicksInCurrentAction() > BossActions.SPINNING.getMaxActionTime()) {
if (!host.worldObj.isRemote) {
int y = (int) host.posY + 1;
for (int x = -1; x <= 1; ++x) {
for (int z = -1; z <= 1; ++z) {
while (!host.worldObj.canBlockSeeTheSky((int) host.posX + x, y, (int) host.posZ + z) && host.worldObj.getBlock((int) host.posX + x, y, (int) host.posZ + z) != Blocks.bedrock) {
host.worldObj.func_147478_e((int) host.posX + x, y++, (int) host.posZ + z, true);
}
y = (int) host.posY + 2;
}
}
}
List<EntityLivingBase> nearbyEntities = host.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, host.boundingBox.expand(2, 2, 2));
for (EntityLivingBase ent : nearbyEntities) {
if (ent == host)
continue;
AMVector3 movement = MathUtilities.GetMovementVectorBetweenPoints(new AMVector3(host), new AMVector3(ent));
float factor = 2.15f;
double x = -(movement.x * factor);
double y = 2.5f;
double z = -(movement.z * factor);
ent.attackEntityFrom(DamageSources.causeEntityWindDamage(host), 12);
ent.addVelocity(x, y, z);
if (ent instanceof EntityPlayer) {
AMNetHandler.INSTANCE.sendVelocityAddPacket(host.worldObj, ent, x, y, z);
}
ent.fallDistance = 0f;
}
((IArsMagicaBoss) host).setCurrentAction(BossActions.IDLE);
cooldownTicks = 20;
return false;
}
return true;
}
use of am2.bosses.IArsMagicaBoss 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();
}
use of am2.bosses.IArsMagicaBoss in project ArsMagica2 by Mithion.
the class EntityAISmash method updateTask.
@Override
public void updateTask() {
host.getLookHelper().setLookPositionWithEntity(host.getAttackTarget(), 30, 30);
host.getNavigator().tryMoveToEntityLiving(target, moveSpeed);
if (host.getDistanceSqToEntity(target) < 16)
if (((IArsMagicaBoss) host).getCurrentAction() != BossActions.SMASH)
((IArsMagicaBoss) host).setCurrentAction(BossActions.SMASH);
if (((IArsMagicaBoss) host).getCurrentAction() == BossActions.SMASH && ((IArsMagicaBoss) host).getTicksInCurrentAction() == 18) {
if (!host.worldObj.isRemote)
host.worldObj.playSoundAtEntity(host, ((IArsMagicaBoss) host).getAttackSound(), 1.0f, 1.0f);
List<EntityLivingBase> aoeEntities = host.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, host.boundingBox.expand(4, 2, 4));
for (EntityLivingBase ent : aoeEntities) {
if (ent == host)
continue;
ent.attackEntityFrom(DamageSources.causeDamage(damageType, host, true), 8);
if (ent instanceof EntityPlayer) {
AMNetHandler.INSTANCE.sendVelocityAddPacket(host.worldObj, ent, 0, 1.3f, 0);
} else {
ent.addVelocity(0, 1.4f, 0);
}
}
if (!host.worldObj.isRemote) {
for (int i = 0; i < 4; ++i) {
EntityShockwave shockwave = new EntityShockwave(host.worldObj);
shockwave.setPosition(host.posX, host.posY, host.posZ);
shockwave.setMoveSpeedAndAngle(0.5f, MathHelper.wrapAngleTo180_float(host.rotationYaw + (90 * i)));
host.worldObj.spawnEntityInWorld(shockwave);
}
}
}
}
use of am2.bosses.IArsMagicaBoss in project ArsMagica2 by Mithion.
the class EntityAISpinAttack 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;
}
Aggregations