Search in sources :

Example 1 with IArsMagicaBoss

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();
    }
}
Also used : Render(net.minecraft.client.renderer.entity.Render) IArsMagicaBoss(am2.bosses.IArsMagicaBoss) EntityFlicker(am2.entities.EntityFlicker)

Example 2 with IArsMagicaBoss

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;
}
Also used : AMVector3(am2.api.math.AMVector3) EntityLiving(net.minecraft.entity.EntityLiving) IArsMagicaBoss(am2.bosses.IArsMagicaBoss) EntityLivingBase(net.minecraft.entity.EntityLivingBase) EntityPlayer(net.minecraft.entity.player.EntityPlayer)

Example 3 with IArsMagicaBoss

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();
}
Also used : Vec3(net.minecraft.util.Vec3) EntityEnderGuardian(am2.bosses.EntityEnderGuardian)

Example 4 with IArsMagicaBoss

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);
            }
        }
    }
}
Also used : EntityShockwave(am2.entities.EntityShockwave) IArsMagicaBoss(am2.bosses.IArsMagicaBoss) EntityLivingBase(net.minecraft.entity.EntityLivingBase) EntityPlayer(net.minecraft.entity.player.EntityPlayer)

Example 5 with IArsMagicaBoss

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;
}
Also used : IArsMagicaBoss(am2.bosses.IArsMagicaBoss) EntityLivingBase(net.minecraft.entity.EntityLivingBase)

Aggregations

IArsMagicaBoss (am2.bosses.IArsMagicaBoss)19 EntityLivingBase (net.minecraft.entity.EntityLivingBase)15 EntityEnderGuardian (am2.bosses.EntityEnderGuardian)4 EntityPlayer (net.minecraft.entity.player.EntityPlayer)3 AMVector3 (am2.api.math.AMVector3)2 BuffEffectMagicShield (am2.buffs.BuffEffectMagicShield)1 BuffEffectShrink (am2.buffs.BuffEffectShrink)1 EntityFlicker (am2.entities.EntityFlicker)1 EntityShockwave (am2.entities.EntityShockwave)1 EntitySpellEffect (am2.entities.EntitySpellEffect)1 EntityThrownRock (am2.entities.EntityThrownRock)1 EntityWhirlwind (am2.entities.EntityWhirlwind)1 Constructor (java.lang.reflect.Constructor)1 Render (net.minecraft.client.renderer.entity.Render)1 Entity (net.minecraft.entity.Entity)1 EntityCreature (net.minecraft.entity.EntityCreature)1 EntityLiving (net.minecraft.entity.EntityLiving)1 PotionEffect (net.minecraft.potion.PotionEffect)1 TileEntity (net.minecraft.tileentity.TileEntity)1 Vec3 (net.minecraft.util.Vec3)1