// ------------------------------------------------------------------
// ENERGY PACK
// can be used by any armor type and does not have to be activated
// increases the user's energy recharge rate

datablock ShapeBaseImageData(EnergyPackImage)
{
   shapeFile = "pack_upgrade_energy.dts";
   item = EnergyPack;

   mass = 5;

   mountPoint = 1;
   offset = "0 0 0";

   rechargeRateBoost = 0.15;

   stateName[0] = "default";
   stateSequence[0] = "activation";
};

datablock ItemData(EnergyPack)
{
   className = Pack;
   catagory = "Packs";

   shapeFile = "pack_upgrade_energy.dts";
   mass = 3;

   elasticity = 0.2;
   friction = 0.6;

   pickupRadius = 1.5;
   rotate = true;

   image = "EnergyPackImage";
   pickUpName = "an energy pack";

   computeCRC = true;

   heatsignature = 0;
};

function EnergyPackImage::onMount(%Data, %Player, %Node)
{
   %RechargeRate = %Player.getRechargeRate();

   %Player.setRechargeRate(%RechargeRate + %Data.rechargeRateBoost);
   %Player.hasEnergyPack = true;
}

function EnergyPackImage::onUnmount(%Data, %Player, %Node)
{
   %RechargeRate = %Player.getRechargeRate();

   %Player.setRechargeRate(%RechargeRate - %Data.rechargeRateBoost);

   %Player.hasEnergyPack = "";
}

function EnergyPack::onPickup(%this, %Player, %Shape, %Amount)
{
   // created to prevent console errors
}