//=============================================================================
// PickupCharger.
//=============================================================================
class PickupCharger expands Inventory;

//Model Import
#exec mesh import mesh=UTPowerUpBase anivfile=Models\UTPowerUpBase_a.3d datafile=Models\UTPowerUpBase_d.3d x=0 y=0 z=0 MLOD=1 LODSTYLE=0
#exec MESH LODPARAMS MESH=UTPowerUpBase STRENGTH=0.25
#exec mesh origin mesh=UTPowerUpBase x=0 y=0 z=0
#exec mesh sequence mesh=UTPowerUpBase seq=All startframe=0 numframes=1

#exec meshmap new meshmap=UTPowerUpBase mesh=UTPowerUpBase
#exec meshmap scale meshmap=UTPowerUpBase x=0.12203 y=0.12203 z=0.24407

//Skins import
#exec TEXTURE IMPORT NAME=InvSkin05 FILE=SKINS\PBbas03HA.pcx GROUP=Skins FLAGS=2
#exec TEXTURE IMPORT NAME=InvSkin05 FILE=SKINS\PBbas03HA.pcx GROUP=Skins PALETTE=InvSkin05
#exec MESHMAP SETTEXTURE MESHMAP=UTPowerUpBase NUM=0 TEXTURE=InvSkin05

#exec TEXTURE IMPORT NAME=NVialSk04 FILE=SKINS\PBcel08CS.pcx GROUP=Skins FLAGS=2
#exec TEXTURE IMPORT NAME=NVialSk04 FILE=SKINS\PBcel08CS.pcx GROUP=Skins PALETTE=NVialSk04
#exec MESHMAP SETTEXTURE MESHMAP=UTPowerUpBase NUM=1 TEXTURE=NVialSk04

#exec TEXTURE IMPORT NAME=PBaseSkin02 FILE=SKINS\PBbas04AL.pcx GROUP=Skins FLAGS=2
#exec TEXTURE IMPORT NAME=PBaseSkin02 FILE=SKINS\PBbas04AL.pcx GROUP=Skins PALETTE=PBaseSkin02
#exec MESHMAP SETTEXTURE MESHMAP=UTPowerUpBase NUM=2 TEXTURE=PBaseSkin02

#exec TEXTURE IMPORT NAME=PBaseSkin03 FILE=SKINS\PBHourInduslight.pcx GROUP=Skins FLAGS=2
#exec TEXTURE IMPORT NAME=PBaseSkin03 FILE=SKINS\PBHourInduslight.pcx GROUP=Skins PALETTE=PBaseSkin03
#exec MESHMAP SETTEXTURE MESHMAP=UTPowerUpBase NUM=3 TEXTURE=PBaseSkin03

#exec TEXTURE IMPORT NAME=PBaseSkin04 FILE=SKINS\PBflr12CStop.pcx GROUP=Skins FLAGS=2
#exec TEXTURE IMPORT NAME=PBaseSkin04 FILE=SKINS\PBflr12CStop.pcx GROUP=Skins PALETTE=PBaseSkin04
#exec MESHMAP SETTEXTURE MESHMAP=UTPowerUpBase NUM=4 TEXTURE=PBaseSkin04

#exec TEXTURE IMPORT NAME=PBaseSkin05 FILE=SKINS\PBflr06bCS.pcx GROUP=Skins FLAGS=2
#exec TEXTURE IMPORT NAME=PBaseSkin05 FILE=SKINS\PBflr06bCS.pcx GROUP=Skins PALETTE=PBaseSkin05
#exec MESHMAP SETTEXTURE MESHMAP=UTPowerUpBase NUM=5 TEXTURE=PBaseSkin05

#exec TEXTURE IMPORT NAME=InvSkin04 FILE=SKINS\PBbas18AL.pcx GROUP=Skins FLAGS=2
#exec TEXTURE IMPORT NAME=InvSkin04 FILE=SKINS\PBbas18AL.pcx GROUP=Skins PALETTE=InvSkin04
#exec MESHMAP SETTEXTURE MESHMAP=UTPowerUpBase NUM=6 TEXTURE=InvSkin04

#exec TEXTURE IMPORT NAME=PBaseSkin07 FILE=SKINS\PBbas01AL.pcx GROUP=Skins FLAGS=2
#exec TEXTURE IMPORT NAME=PBaseSkin07 FILE=SKINS\PBbas01AL.pcx GROUP=Skins PALETTE=PBaseSkin07
#exec MESHMAP SETTEXTURE MESHMAP=UTPowerUpBase NUM=7 TEXTURE=PBaseSkin07

//-----------------------------------------------------------------------



var() class<Inventory> PickupClass;	//Pickup class to spawn
var() float BeginDelayTime;		//Time to wait after the begin of the game to spawn the pickup
var() vector SpawnOffset;		//Offset to spawn the pickup (NOT RELATIVE TO BASE ROTATION!)
var() bool bRotPickup;			//bRotationPickup equivalent
var() rotator PickupRotOffset;		//Pickup start rotation offset
var() float PickupRespawnTime;		//Custom respawn time
var() bool bAutoAlignPickup;		//Align pickup rotation to the charger rotation
var(Triggering) bool bSpawnTriggered;	//Trigger First Spawn
var(Triggering) bool bTriggerToggle;	//Activate or deactivate pickup
var(Triggering) name CollectedEvent;	//Collected Event
var(Triggering) name SpawnEvent;	//Spawn Event
var(Triggering) bool bSpawnEventOnce;	//Spawn Event only at first spawn?
var(Triggering) float RetriggerWaitTime;//Time to wait until next triggered spawn, set to 0 to make the pickup charger triggerable only once
var(Triggering) bool bTriggeredMachine; //Trigger a spawn of a pickup, but like if the pickup was a soda xD (once picked up, it won't respawn until you trigger this again)


var(PickupParticles) bool bHaveParticles;		//Have particles effects

var enum EParticleType 		//Choose the particle type animation
{
	PT_Default,
	PT_CylinderRotation,
	PT_CylinderRotation2,
	PT_CubeRotation,
	PT_CubeRotation2,
	PT_SphereRotation,
	PT_WhirlPlaneOut,
	PT_WhirlPlaneIn,
	PT_WhirlHoleOut,
	PT_WhirlHoleIn,
	PT_Custom
} PT;

var enum EAnimStyle
{
	AS_LoopNormal,
	AS_LoopSpecial
} AS;

struct PickupParticles
{
	//Main particles side
	var() bool bHaveThisParticle;			//Use these particles
	var() texture ParticleTex;			//Particles texture
	var() float ParticlesDrawScale, ParticleSpeed;	//Particles size and speed of anim
	var() vector ParticlesOffset;			//Offset from the charger
	var() EParticleType ParticleType;		//Particle base vertex mesh

	var() rotator ParticlesRotation;		//Particles custom rotation
	var() bool bRotating;				//Rotating vertex mesh
	var() rotator ParticlesRotationRate;		//Above, rotation rate

	//Sound
	var() Sound PSound;				//Particles ambient sound
	var() byte PSoundPitch, 			//Sound Pitch
		PSoundVolume, 				//Volume
		PSoundRadius;				//Radius

	//Custom vertex mesh side
	var() mesh VertexMesh;				//New particle vertex mesh if ParticleType=PT_Custom
	var() name VertexAnim;				//In the above case, this is what where the Anim Loop will be defined, it won't animate if None
	var() bool bSpecialLoop;			//Used in PT_Custom once again, when False is executed with tween anim for last>first
								// frames (normal), while when True it has a tween time of 0, and it's executed in a special way
};

var(PickupParticles) PickupParticles ParticlesEffects[4];
var(PickupParticles) bool bStay;	//When True, particles will stay even when the Pickup is there


var(WildCard) bool bRandom;
var(WildCard) Class<Inventory> RandomPickups[16];
var(WildCard) float RandRespawnTime;			//Static respawn time
var(WildCard) bool bUseRandomRespawnTime;
var(WildCard) float RandRespawnTimeMin;
var(WildCard) float RandRespawnTimeMax;

var(Weapons) bool bWeaponStay;	//Only for weapons
var(Weapons) bool bNeverStays;	//Set this for super weapons

var(SinglePlayer) bool bSPMode;

var PickupBase MarkedPick;
var bool bForceRot;


function PostBeginPlay()
{
	AutoXReplace();
}

//Deco base and particle handling
function PreBeginPlay()
{

local PickupBase PickB;
local PickParticles pp;
local int i;
local vector X, Y, Z;

	//Spawn base part
	PickB = Spawn(Class'PickupBase',,, Location, Rotation);
	PickB.Mesh = Mesh;
	
	For( i=0; i<8; i++)
	{
		PickB.MultiSkins[i] = MultiSkins[i];
	}

	For( i=0; i<16; i++)
	{
		if (RandomPickups[i] != None && Class<PickupCharger>(RandomPickups[i]) != None)
			PickB.RandomPickups[i] = Class<PickupCharger>(RandomPickups[i]).default.PickupClass;
		else
			PickB.RandomPickups[i] = RandomPickups[i];
	}

	PickB.SpawnOffset = SpawnOffset;
	PickB.bRotPickup = bRotPickup;
	PickB.AmbientGlow = AmbientGlow;
	PickB.DrawScale = DrawScale;
	PickB.bStay = bStay;
	PickB.ScaleGlow = ScaleGlow;
	PickB.AmbientGlow = AmbientGlow;
	PickB.LODBias = LODBias;
	PickB.PickupRotOffset = PickupRotOffset;
	PickB.Tag = Tag;
	PickB.bSpawnTriggered = bSpawnTriggered;
	PickB.bTriggerToggle = bTriggerToggle;
	PickB.bRandom = bRandom;
	PickB.RandRespawnTime = RandRespawnTime;
	PickB.CollectedEvent = CollectedEvent;
	PickB.SpawnEvent = SpawnEvent;
	PickB.bSpawnEventOnce = bSpawnEventOnce;
	PickB.RetriggerWaitTime = RetriggerWaitTime;
	PickB.bTriggeredMachine = bTriggeredMachine;
	PickB.RandRespawnTimeMin = RandRespawnTimeMin;
	PickB.RandRespawnTimeMax = RandRespawnTimeMax;
	PickB.bUseRandomRespawnTime = bUseRandomRespawnTime;
	PickB.bAutoAlignPickup = bAutoAlignPickup;
	PickB.Texture = Texture;
	PickB.bSPMode = bSPMode;
	PickB.bWeaponStay = bWeaponStay;
	PickB.bNeverStays = bNeverStays;

	SetTimer(0.1, False);
	MarkedPick = PickB;
	

	//Particles part
	if (bHaveParticles)
	{
		For (i=0; i<4; i++)
		{
		
		if (ParticlesEffects[i].bHaveThisParticle)
		{
			GetAxes(Rotation, X, Y, Z);

			pp = Spawn(Class'PickParticles',,, Location + (ParticlesEffects[i].ParticlesOffset.X * X + ParticlesEffects[i].ParticlesOffset.Y * Y + ParticlesEffects[i].ParticlesOffset.Z * Z), Rotation + ParticlesEffects[i].ParticlesRotation);
			pp.DrawScale = ParticlesEffects[i].ParticlesDrawScale;
			pp.Rate = ParticlesEffects[i].ParticleSpeed;
			pp.Texture = ParticlesEffects[i].ParticleTex;
			pp.VertexMesh = ParticlesEffects[i].VertexMesh;
			pp.VertexAnim = ParticlesEffects[i].VertexAnim;
			pp.bSpecialLoop = ParticlesEffects[i].bSpecialLoop;
			PickB.XParticles[i] = pp;

			pp.AmbientSound = ParticlesEffects[i].PSound;
			pp.SoundPitch = ParticlesEffects[i].PSoundPitch;
			pp.SoundVolume = ParticlesEffects[i].PSoundVolume;
			pp.SoundRadius = ParticlesEffects[i].PSoundRadius;
			pp.Tag = Tag;

			if (ParticlesEffects[i].bRotating)
			{
				pp.RotationRate = ParticlesEffects[i].ParticlesRotationRate;
				pp.SetPhysics(PHYS_Rotating);
			}

			switch (ParticlesEffects[i].ParticleType)
			{
				case PT_Default:
					pp.ParticleType = 0;
					break;
				case PT_CylinderRotation:
					pp.ParticleType = 1;
					break;
				case PT_CylinderRotation2:
					pp.ParticleType = 2;
					break;
				case PT_CubeRotation:
					pp.ParticleType = 3;
					break;
				case PT_CubeRotation2:
					pp.ParticleType = 4;
					break;
				case PT_SphereRotation:
					pp.ParticleType = 5;
					break;
				case PT_WhirlPlaneOut:
					pp.ParticleType = 6;
					break;
				case PT_WhirlPlaneIn:
					pp.ParticleType = 7;
					break;
				case PT_WhirlHoleOut:
					pp.ParticleType = 8;
					break;
				case PT_WhirlHoleIn:
					pp.ParticleType = 9;
					break;
				case PT_Custom:
					pp.ParticleType = 10;
					break;
				default:
					break;
			}

		}

		}
	}

	//Destroy();
}


function AutoXReplace()
{
local Inventory Inv, NewInv;
local Pawn P;
local PickupCharger Pkc;
local XReplacer XRep;
local XPickNotifier XPn;

	ForEach AllActors(Class'XReplacer', XRep)
	{
		if (XRep != None)
			return;
	}

	//Find first PickupCharger in the list and proceed
	ForEach AllActors(Class'PickupCharger', Pkc)
	{
		if (Pkc != Self)
			return;
		else
			break;
	}

	ForEach AllActors(Class'XPickNotifier', XPn)
	{
		if (XPn != None)
			return;
	}

	if (class'XReplacer'.default.bAddAllChargers)
	{
		Level.Game.BaseMutator.AddMutator(Spawn(Class'XPickInternalMut'));
		return;
	}

	ForEach AllActors(Class'Inventory', Inv)
	{
		If (Inv.IsA('ImpactHammer') && !Inv.IsA('UBersImpactHammer'))
		{
			NewInv = Spawn(Class'UBersImpactHammer',,, Inv.Location, Inv.Rotation);
			NewInv.bRotatingPickup = Inv.bRotatingPickup;
		}
		else If (Inv.IsA('ChainSaw') && !Inv.IsA('BersChainSaw'))
		{
			NewInv = Spawn(Class'BersChainSaw',,, Inv.Location, Inv.Rotation);
			NewInv.bRotatingPickup = Inv.bRotatingPickup;
		}
		else If (Inv.IsA('Enforcer') && !Inv.IsA('UBersEnforcer'))
		{
			NewInv = Spawn(Class'UBersEnforcer',,, Inv.Location, Inv.Rotation);
			NewInv.bRotatingPickup = Inv.bRotatingPickup;
		}
		else If (Inv.IsA('UT_BioRifle') && !Inv.IsA('UBersUT_BioRifle'))
		{
			NewInv = Spawn(Class'UBersUT_BioRifle',,, Inv.Location, Inv.Rotation);
			NewInv.bRotatingPickup = Inv.bRotatingPickup;
		}
		else If (Inv.IsA('ShockRifle') && !Inv.IsA('UBersShockRifle') && !Inv.IsA('SuperShockRifle'))
		{
			NewInv = Spawn(Class'UBersShockRifle',,, Inv.Location, Inv.Rotation);
			NewInv.bRotatingPickup = Inv.bRotatingPickup;
		}
		else If (Inv.IsA('SuperShockRifle') && !Inv.IsA('UBersSuperShockRifle'))
		{
			NewInv = Spawn(Class'UBersSuperShockRifle',,, Inv.Location, Inv.Rotation);
			NewInv.bRotatingPickup = Inv.bRotatingPickup;
		}
		else If (Inv.IsA('PulseGun') && !Inv.IsA('UBersPulseGun'))
		{
			NewInv = Spawn(Class'UBersPulseGun',,, Inv.Location, Inv.Rotation);
			NewInv.bRotatingPickup = Inv.bRotatingPickup;
		}
		else If (Inv.IsA('Ripper') && !Inv.IsA('UBersRipper'))
		{
			NewInv = Spawn(Class'UBersRipper',,, Inv.Location, Inv.Rotation);
			NewInv.bRotatingPickup = Inv.bRotatingPickup;
		}
		else If (Inv.IsA('minigun2') && !Inv.IsA('UBersMinigun2'))
		{
			NewInv = Spawn(Class'UBersMinigun2',,, Inv.Location, Inv.Rotation);
			NewInv.bRotatingPickup = Inv.bRotatingPickup;
		}
		else If (Inv.IsA('UT_FlakCannon') && !Inv.IsA('UBersUT_FlakCannon'))
		{
			NewInv = Spawn(Class'UBersUT_FlakCannon',,, Inv.Location, Inv.Rotation);
			NewInv.bRotatingPickup = Inv.bRotatingPickup;
		}
		else If (Inv.IsA('UT_EightBall') && !Inv.IsA('UBersUT_EightBall'))
		{
			NewInv = Spawn(Class'UBersUT_EightBall',,, Inv.Location, Inv.Rotation);
			NewInv.bRotatingPickup = Inv.bRotatingPickup;
		}
		else If (Inv.IsA('SniperRifle') && !Inv.IsA('UBersSniperRifle'))
		{
			NewInv = Spawn(Class'UBersSniperRifle',,, Inv.Location, Inv.Rotation);
			NewInv.bRotatingPickup = Inv.bRotatingPickup;
		}
		else If (Inv.IsA('WarHeadLauncher') && !Inv.IsA('UBersWarHeadLauncher'))
		{
			NewInv = Spawn(Class'UBersWarHeadLauncher',,, Inv.Location, Inv.Rotation);
			NewInv.bRotatingPickup = Inv.bRotatingPickup;
		}
		else If (Inv.IsA('Translocator') && !Inv.IsA('UBersTranslocator'))
		{
			NewInv = Spawn(Class'UBersTranslocator',,, Inv.Location, Inv.Rotation);
			NewInv.bRotatingPickup = Inv.bRotatingPickup;
		}
		else If (Inv.IsA('UDamage') && !Inv.IsA('UBersUDamage'))
		{
			NewInv = Spawn(Class'UBersUDamage',,, Inv.Location, Inv.Rotation);
			NewInv.bRotatingPickup = Inv.bRotatingPickup;
		}
		else If (Inv.IsA('UT_Invisibility') && !Inv.IsA('UBersInvisibility'))
		{
			NewInv = Spawn(Class'UBersInvisibility',,, Inv.Location, Inv.Rotation);
			NewInv.bRotatingPickup = Inv.bRotatingPickup;
		}
		else If (Inv.IsA('Armor2') && !Inv.IsA('UBersArmor'))
		{
			NewInv = Spawn(Class'UBersArmor',,, Inv.Location, Inv.Rotation);
			NewInv.bRotatingPickup = Inv.bRotatingPickup;
		}
		else If (Inv.IsA('UT_ShieldBelt') && !Inv.IsA('UBers_ShieldBelt'))
		{
			NewInv = Spawn(Class'UBers_ShieldBelt',,, Inv.Location, Inv.Rotation);
			NewInv.bRotatingPickup = Inv.bRotatingPickup;
		}
		else If (Inv.IsA('ThighPads') && !Inv.IsA('UBersThighPads'))
		{
			NewInv = Spawn(Class'UBersThighPads',,, Inv.Location, Inv.Rotation);
			NewInv.bRotatingPickup = Inv.bRotatingPickup;
		}
		/*else If (Inv.IsA('HealthVial') && !Inv.IsA('NewVial'))
		{
			NewInv = Spawn(Class'NewVial',,, Inv.Location, Inv.Rotation);
			NewInv.bRotatingPickup = Inv.bRotatingPickup;
		}*/
		else If (Inv.IsA('HealthVial'))
			Inv.RespawnTime = 27.0;
		else If (Inv.IsA('MedBox') && !Inv.IsA('UBersHealthPack'))
		{
			NewInv = Spawn(Class'UBersHealthPack',,, Inv.Location, Inv.Rotation);
			NewInv.bRotatingPickup = Inv.bRotatingPickup;
		}
		else If (Inv.IsA('HealthPack') && !Inv.IsA('UBersSuperHealth'))
		{
			NewInv = Spawn(Class'UBersSuperHealth',,, Inv.Location, Inv.Rotation);
			NewInv.bRotatingPickup = Inv.bRotatingPickup;
		}
		else If (Inv.IsA('UT_JumpBoots') && !Inv.IsA('UBersJumpBoots'))
		{
			NewInv = Spawn(Class'UBersJumpBoots',,, Inv.Location, Inv.Rotation);
			NewInv.bRotatingPickup = Inv.bRotatingPickup;
		}

		else If (Inv.IsA('BulletBox') && !Inv.IsA('BulletBoxB') && !Inv.IsA('RifleShell'))
		{
			NewInv = Spawn(Class'BulletBoxB',,, Inv.Location, Inv.Rotation);
			NewInv.bRotatingPickup = Inv.bRotatingPickup;
		}
		else If (Inv.IsA('BioAmmo') && !Inv.IsA('BioAmmoB'))
		{
			NewInv = Spawn(Class'BioAmmoB',,, Inv.Location, Inv.Rotation);
			NewInv.bRotatingPickup = Inv.bRotatingPickup;
		}
		else If (Inv.IsA('ShockCore') && !Inv.IsA('ShockCoreB') && !Inv.IsA('SuperShockCore') && !Inv.IsA('USUSuperShockCore'))
		{
			NewInv = Spawn(Class'ShockCoreB',,, Inv.Location, Inv.Rotation);
			NewInv.bRotatingPickup = Inv.bRotatingPickup;
		}
		else If (Inv.IsA('PAmmo') && !Inv.IsA('PAmmoB'))
		{
			NewInv = Spawn(Class'PAmmoB',,, Inv.Location, Inv.Rotation);
			NewInv.bRotatingPickup = Inv.bRotatingPickup;
		}
		else If (Inv.IsA('BladeHopper') && !Inv.IsA('BladeHopperB'))
		{
			NewInv = Spawn(Class'BladeHopperB',,, Inv.Location, Inv.Rotation);
			NewInv.bRotatingPickup = Inv.bRotatingPickup;
		}
		else If (Inv.IsA('EClip') && !Inv.IsA('EClipB'))
		{
			NewInv = Spawn(Class'EClipB',,, Inv.Location, Inv.Rotation);
			NewInv.bRotatingPickup = Inv.bRotatingPickup;
		}
		else If (Inv.IsA('Miniammo') && !Inv.IsA('MiniammoB') && !Inv.IsA('EClip'))
		{
			NewInv = Spawn(Class'MiniammoB',,, Inv.Location, Inv.Rotation);
			NewInv.bRotatingPickup = Inv.bRotatingPickup;
		}
		else If (Inv.IsA('FlakAmmo') && !Inv.IsA('FlakAmmoB'))
		{
			NewInv = Spawn(Class'FlakAmmoB',,, Inv.Location, Inv.Rotation);
			NewInv.bRotatingPickup = Inv.bRotatingPickup;
		}
		else If (Inv.IsA('RocketPack') && !Inv.IsA('RocketPackB'))
		{
			NewInv = Spawn(Class'RocketPackB',,, Inv.Location, Inv.Rotation);
			NewInv.bRotatingPickup = Inv.bRotatingPickup;
		}

		if (Inv.MyMarker != None && NewInv != None)
		{
			NewInv.MyMarker = Inv.MyMarker;
			NewInv.MyMarker.markedItem = NewInv;
			NewInv = None;
			Inv.MyMarker = None;
			Inv.Destroy();
		}

		
	}	

	Level.Game.BaseMutator.AddMutator(Spawn(Class'UBersDefault'));
}


function Timer()
{
	if (MarkedPick != None)
	{
		MarkedPick.bForceRot = bForceRot;
		MarkedPick.PickupRespawnTime = PickupRespawnTime;
		MarkedPick.BeginDelayTime = BeginDelayTime;
		MarkedPick.PickupClass = PickupClass;

		if (CollectedEvent == '' && Event != '')
			MarkedPick.CollectedEvent = Event;

		if (MyMarker != None)
		{
			MarkedPick.PMarker = MyMarker;
			MyMarker.Tag = Tag;
		}
	}

	Destroy();
}

//---------------------------------------------------------------
//Cancel several inventory functions
//---------------------------------------------------------------

function BecomePickup(){}

function BecomeItem(){}

function GiveTo( pawn Other ){}

function inventory SpawnCopy( pawn Other ){}

function SetRespawn(){}

function Activate(){}

event TravelPreAccept(){}

function bool HandlePickupQuery( inventory Item ){}

function Inventory SelectNext(){}

function DropFrom(vector StartLocation){}


event float BotDesireability( pawn Bot )
{
	local Inventory AlreadyHas;
	local float desire;
	local bool bChecked;

	desire = MaxDesireability;

	if ( RespawnTime < 10 )
	{
		bChecked = true;
		AlreadyHas = Bot.FindInventoryType(PickupClass); 
		if ( (AlreadyHas != None) 
			&& (AlreadyHas.Charge >= Charge) )
				return -1;
	}

	if( bIsAnArmor )
	{
		if ( !bChecked )
			AlreadyHas = Bot.FindInventoryType(PickupClass); 
		if ( AlreadyHas != None )
			desire *= (1 - AlreadyHas.Charge * AlreadyHas.ArmorAbsorption * 0.00003);
		
		desire *= (Charge * 0.005);
		desire *= (ArmorAbsorption * 0.01);
		return desire;
	}
	else return desire;
}




auto state Pickup
{

ignores ZoneChange, Touch, Landed, Timer, BeginState, EndState;

function bool ValidTouch( actor Other ){}

function CheckTouching(){}

Begin:
GotoState('');

}

state Activated
{
	function BeginState(){}

	function EndState(){}

	function Activate(){}

Begin:
}
State Sleeping
{
Begin:
}

function ActivateTranslator(bool bHint){}


defaultproperties
{
	SpawnOffset=(X=0,Y=0,Z=48)
	bRotPickup=True
	ParticlesEffects(0)=(ParticleType=PT_Default,ParticleSpeed=1.000000,ParticlesDrawScale=0.200000,ParticlesOffset=(X=0,Y=0,Z=32))
	ParticlesEffects(1)=(ParticleType=PT_Default,ParticleSpeed=1.000000,ParticlesDrawScale=0.200000,ParticlesOffset=(X=0,Y=0,Z=32))
	ParticlesEffects(2)=(ParticleType=PT_Default,ParticleSpeed=1.000000,ParticlesDrawScale=0.200000,ParticlesOffset=(X=0,Y=0,Z=32))
	ParticlesEffects(3)=(ParticleType=PT_Default,ParticleSpeed=1.000000,ParticlesDrawScale=0.200000,ParticlesOffset=(X=0,Y=0,Z=32))
	bRotatingPickup=False
	Mesh=Mesh'XPickups.UTPowerUpBase'
	BeginDelayTime=2.000000
	bTravel=False
	bStasis=False
	RemoteRole=ROLE_DumbProxy
	bCollideActors=False
	RandRespawnTime=30.000000
	RandRespawnTimeMin=28.000000
	RandRespawnTimeMax=50.000000
	bAutoAlignPickup=True
	AmbientGlow=0
	PickupRespawnTime=20.000000
}