//=============================================================================
// X_PowerUps.
//=============================================================================
class X_PowerUps expands PickupCharger
abstract;

//Model Import
#exec mesh import mesh=UTPowerUpBase2M anivfile=Models\UTPowerUpBase2M_a.3d datafile=Models\UTPowerUpBase2M_d.3d x=0 y=0 z=0 MLOD=0
#exec mesh origin mesh=UTPowerUpBase2M x=0 y=0 z=0.25
#exec mesh sequence mesh=UTPowerUpBase2M seq=All startframe=0 numframes=1

#exec meshmap new meshmap=UTPowerUpBase2M mesh=UTPowerUpBase2M
#exec meshmap scale meshmap=UTPowerUpBase2M x=0.07411 y=0.07411 z=0.14822

//Skins import
#exec TEXTURE IMPORT NAME=PPupSkin00 FILE=SKINS\NChargerT002.pcx GROUP=Skins FLAGS=2
#exec TEXTURE IMPORT NAME=PPupSkin00 FILE=SKINS\NChargerT002.pcx GROUP=Skins PALETTE=PPupSkin00
#exec MESHMAP SETTEXTURE MESHMAP=UTPowerUpBase2M NUM=0 TEXTURE=PPupSkin00

#exec TEXTURE IMPORT NAME=PPupSkin01 FILE=SKINS\NChargerT001.pcx GROUP=Skins FLAGS=2
#exec TEXTURE IMPORT NAME=PPupSkin01 FILE=SKINS\NChargerT001.pcx GROUP=Skins PALETTE=PPupSkin01
#exec MESHMAP SETTEXTURE MESHMAP=UTPowerUpBase2M NUM=1 TEXTURE=PPupSkin01

#exec TEXTURE IMPORT NAME=PPupSkin02 FILE=SKINS\NChargerT003.pcx GROUP=Skins FLAGS=2
#exec TEXTURE IMPORT NAME=PPupSkin02 FILE=SKINS\NChargerT003.pcx GROUP=Skins PALETTE=PPupSkin02
#exec MESHMAP SETTEXTURE MESHMAP=UTPowerUpBase2M NUM=2 TEXTURE=PPupSkin02

#exec TEXTURE IMPORT NAME=PPupSkin04 FILE=SKINS\PBbasBolts.pcx GROUP=Skins FLAGS=2
#exec TEXTURE IMPORT NAME=PPupSkin04 FILE=SKINS\PBbasBolts.pcx GROUP=Skins PALETTE=PPupSkin04
#exec MESHMAP SETTEXTURE MESHMAP=UTPowerUpBase2M NUM=4 TEXTURE=PPupSkin04

#exec TEXTURE IMPORT NAME=PBaseSkin07 FILE=SKINS\ChargerNewY.pcx GROUP=Skins FLAGS=2
#exec TEXTURE IMPORT NAME=PBaseSkin07 FILE=SKINS\ChargerNewY.pcx GROUP=Skins PALETTE=PBaseSkin07
#exec MESHMAP SETTEXTURE MESHMAP=UTPowerUpBase2M NUM=5 TEXTURE=PBaseSkin07

//----------------------
#exec TEXTURE IMPORT NAME=P01 FILE=SKINS\Dot_C.pcx GROUP=Particles FLAGS=2
#exec TEXTURE IMPORT NAME=P01 FILE=SKINS\Dot_C.pcx GROUP=Particles PALETTE=P01

#exec TEXTURE IMPORT NAME=P02 FILE=SKINS\TranglowP.pcx GROUP=Particles FLAGS=2
#exec TEXTURE IMPORT NAME=P02 FILE=SKINS\TranglowP.pcx GROUP=Particles PALETTE=P02


var() name WearedOffEvent;
var() name DroppedEvent;
var() name ReActivateEvent;

var() bool EnableRotWheel;

var() texture BrightFluid, DarkFluid, BrightSkin;
var() class<LightChargerOn> LightOn;

var() int PickupCharge;


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

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

	//Spawn base part
	PickB = Spawn(Class'PickupBasePower',,, 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.PickupCharge = PickupCharge;
	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.bNeverStays = bNeverStays;

	PickB.WearedOffEvent = WearedOffEvent;
	PickB.DroppedEvent = DroppedEvent;
	PickB.ReActivateEvent = ReActivateEvent;

	PickB.bWheel = EnableRotWheel;

	PickB.BrightFluid = BrightFluid;
	PickB.DarkFluid = DarkFluid;
	PickB.LightOn = LightOn;
	PickB.BrightSkin = BrightSkin;
	
	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();
}



defaultproperties
{
	bHaveParticles=True
	LODBias=2.000000
	AmbientGlow=0
	ScaleGlow=3.000000
	ParticlesEffects(0)=(bHaveThisParticle=True)
	Mesh=UTPowerUpBase2M
	EnableRotWheel=True
	PickupRespawnTime=27.000000
	PickupCharge=10
}