package com.slugterra.entity.velocity;

import java.util.Random;

import com.slugterra.capabilities.ExtendedPlayer;
import com.slugterra.entity.protoform.EntityArmashelt;

import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.world.World;

public class EntityArmasheltVel extends EntityVel{

	private float damage = 6.0F;
	public static int power = 5;
	public static int min = 0;
	public static int max = 2;

	public EntityArmasheltVel(World p_i1776_1_) {
		super(p_i1776_1_);
	}

	public EntityArmasheltVel(World world, EntityLivingBase entity, int friend, String name)
	{
		this(world, entity);
		this.name = name;
		this.friendship = friend;
	}

	public EntityArmasheltVel(World world, EntityLivingBase entity)
	{
		super(world, entity);
		this.elementParticle = EnumParticleTypes.BLOCK_CRACK;
		if (this.name != null)
			this.protoform = new EntityArmashelt(world, this.name);
		else
			this.protoform = new EntityArmashelt(world);
	}

	@Override
	public void activateSlugAbility(boolean onGround){
		Random ability = new Random();
		int abilint = ability.nextInt(max + 1);
		if (onGround){
			//canonbolt ability
			if (abilint == 0){
				System.out.println("CanonBolt Activated!");
				this.worldObj.newExplosion(this, this.posX, this.posY, this.posZ, 1.0F, false, true);
			}

			//afterburner
			else if(abilint == 1){
				System.out.println("Afterburner Activated!");
				this.hitE.mountEntity(this);
				//this.riddenByEntity = this.hitE;
				this.motionY = 2.0f;
				this.killColl = false;
			}

			//sluglift
			else if(abilint == 2){
				System.out.println("SlugLift Activated!");
				EntityPlayerMP p = (EntityPlayerMP)this.worldObj.getClosestPlayerToEntity(this, 2.0F);
				if (p != this.shooter && p != null){
					ExtendedPlayer props = ExtendedPlayer.get(p);
					props.inventory.setInventorySlotContents(new Random().nextInt(5), null);
				}
			}
		}
		//bruise missile
		else{
			System.out.println("Bruise Missile Activated!");
			EntityPlayerMP enemy = (EntityPlayerMP)this.worldObj.getClosestPlayerToEntity(this, 20.0f);
			if (enemy != this.shooter){
				this.target = enemy;
				this.impactAbility = false;
			}
		}
	}
}

@@ -93,28 +93,79 @@
 ilities.
-ExtendedPlay
+ISlugInv;%0Aimport com.slugterra.capabilities.SlugInventoryProvid
 er;%0Aimpo
@@ -214,16 +214,62 @@
 mashelt;
+%0Aimport com.slugterra.inventory.InventorySlug;
 %0A%0Aimport
@@ -312,57 +312,8 @@
 se;%0A
-import net.minecraft.entity.player.EntityPlayer;%0A
 impo
@@ -359,16 +359,53 @@
 ayerMP;%0A
+import net.minecraft.item.ItemStack;%0A
 import n
@@ -1438,19 +1438,16 @@
 is.world
-Obj
 .newExpl
@@ -1628,19 +1628,19 @@
 itE.
-mountEntity
+startRiding
 (thi
@@ -1868,35 +1868,32 @@
 yerMP)this.world
-Obj
 .getClosestPlaye
@@ -1965,59 +1965,137 @@
 %09%09%09%09
-ExtendedPlayer props = ExtendedPlayer.get(p
+ISlugInv props = p.getCapability(SlugInventoryProvider.INV_CAP, null);%0A%09%09%09%09%09InventorySlug inventory = props.getInventory(
 );%0A%09%09%09%09%09
 prop
@@ -2090,22 +2090,16 @@
 );%0A%09%09%09%09%09
-props.
 inventor
@@ -2150,20 +2150,67 @@
 Int(5), 
-null
+ItemStack.EMPTY);%0A%09%09%09%09%09props.setInventory(inventory
 );%0A%09%09%09%09%7D
@@ -2354,11 +2354,8 @@
 orld
-Obj
 .get

Update Armashelt to Capabilities and update logic