//This is just cosmetic sprite replacements for ammo,
//everything still has vanilla values.

//------CLIPS----------

Actor CAClip : clip replaces clip
{
	Inventory.PickupMessage "Snagged a clip of bullets"
	scale 1
	inventory.pickupsound "misc/clipget"
	states
	{
	spawn:
		CABL A 8
		CABL A 8 Bright
		loop
	}
}

Actor CAClipBox : clipbox replaces clipbox
{
	Inventory.PickupMessage "Got a clip of clips! ...Wait, what?"
	scale 1
	inventory.pickupsound "misc/bigclip"
	states
	{
	spawn:
		CABL B 8
		CABL B 8 Bright
		loop
	}
}


actor CAPistolreplacer : clipbox replaces pistol
{
	Inventory.PickupMessage "Got a clip of clips! ...Wait, what?"
	scale 1.5
	inventory.pickupsound "misc/bigclip"
	states
	{
	spawn:
		CABL B 8
		CABL B 8 Bright
		loop
	}
}


//-----SHELLS------

Actor CAShell : shell replaces shell
{
	Inventory.PickupMessage "Bagged a handful of shells!"
	inventory.pickupsound "misc/shellget"
	scale 1
	states
	{
	spawn:
		CASL A 8
		CASL A 8 Bright
		loop
	}
}

Actor CAShellBox : shellbox replaces shellbox
{
	Inventory.PickupMessage "Scored a box of Shells! Rev up those barrels"
	inventory.pickupsound "misc/bigshell"
	scale 1
	states
	{
	spawn:
		CASL B 8
		CASL B 8 Bright
		loop
	}
}

//-----ROCKETS------

Actor CARocket : rocketammo replaces Rocketammo
{
	Inventory.PickupMessage "Found an all purpose rocket shell, blow somethin up!"
	inventory.pickupsound "misc/rocketget"
	scale 1
	states
	{
	spawn:
		CRK1 A 8
		CRK1 A 8 Bright
		loop
	}
}

Actor CARocketbox : rocketbox replaces rocketbox
{
	Inventory.PickupMessage "Got a clip of rocket shells! Blow more crap up!"
	inventory.pickupsound "misc/bigrocket"
	scale 1
	states
	{
	spawn:
		CRK1 B 8
		CRK1 B 8 Bright
		loop
	}
}


//-----CELLS------

Actor CACell : cell replaces cell
{
	Inventory.PickupMessage "Acquired a cell battery!"
	inventory.pickupsound "misc/cellget"
	scale 1
	states
	{
	spawn:
		CACL A 1
		TNT1 A 0 a_spawnitemex ("SmallCratePack",0,0,4,random(-2,2),random(-2,2),random(-2,2))
		CACL A 1
		goto spawnloop
	SpawnLoop:
		CACL ABCD 6 Bright
		CACL DCBA 6 Bright
		loop
	}
}

Actor CACellpack : cellpack replaces cellpack
{
	Inventory.PickupMessage "Found a super battery! Commence the light show!"
	inventory.pickupsound "misc/bigcell"
	scale 1
	states
	{
	spawn:
		CACL A 1
		TNT1 A 0 a_spawnitemex ("BigCratePack",0,0,4,random(-2,2),random(-2,2),random(-2,2))
		CACL E 1
		goto spawnloop
	SpawnLoop:
		CACL EFGH 6 bright
		loop
	}
}


//-----BACKPACK------

Actor CABackPack : backpack replaces backpack
{
	Inventory.PickupMessage "Got an ammo backpack! Now you can carry more crap!"
	inventory.pickupsound "misc/backpack"
	scale 1
	states
	{
	spawn:
		CABP A 8 Bright
		CABP A 6 
		loop
	}
}


//Special Ammo stuff
//Okay I lied looks like there's some unique ammo for this mod

//=================================================================
//=================================================================
//BLASTMASTER HEAT
//=================================================================
//=================================================================

actor BMheat : inventory
{
	Inventory.PickupMessage "Picked up some heat for the blastmaster Mk2 wait what"
	Inventory.PickupSound "items/ammo"
	Inventory.Amount 1
	Inventory.MaxAmount 200
	states
	{
	spawn:
		BAL1 A 1 bright
		loop
	}
}

//=================================================================
//=================================================================
//BLASTMASTER OVERHEAT
//=================================================================
//=================================================================

actor BMoverheat : inventory
{
	Inventory.PickupMessage "Picked up some overheat, okay stop that"
	Inventory.PickupSound "items/ammo"
	Inventory.Amount 1
	Inventory.MaxAmount 350
	states
	{
	spawn:
		BAL1 A 1 bright
		loop
	}
}


//=================================================================
//=================================================================
//BLASTMASTER FIRED TIMERS (ACS THING)
//=================================================================
//=================================================================

Actor BlastMasterFired : Powerup
{
  Powerup.Duration -5
}

Actor BlastMasterVented : Powerup
{
  Powerup.Duration -5
}



//Crate Energy

ACTOR CrateEnergy : Ammo
{
	Inventory.PickupMessage "You shouldn't see this!"
	Inventory.Amount 2
	Inventory.MaxAmount 200
	Ammo.BackpackAmount 50
	Ammo.BackpackMaxAmount 200
	Inventory.Icon "CLIPA0"
	States
	{
	Spawn:
		CLIP A -1
		Stop
	}
}


//Crate packs

actor SmallCratePack : custominventory
{
	Inventory.PickupMessage "Small Crate Charge"
	Inventory.PickupSound "Misc/CrateAmmo"
	scale 1
	states
	{
	spawn:
		CRA1 A 15
		CRA1 B 3
		CRA1 C 3 bright
		CRA1 D 35 bright
		CRA1 C 3 bright
		CRA1 B 3
		loop
	pickup:
		TNT1 A 0
		TNT1 A 1 a_giveinventory ("CrateEnergy", 10)
		stop
	}
}

actor BigCratePack : custominventory
{
	Inventory.PickupMessage "Big Crate charge"
	Inventory.PickupSound "Misc/BigCrateAmmo"
	scale 1
	states
	{
	spawn:
		CRA2 A 15
		CRA2 B 3
		CRA2 C 3 bright
		CRA2 D 35 bright
		CRA2 C 3 bright
		CRA2 B 3
		loop
	pickup:
		TNT1 A 0
		TNT1 A 1 a_giveinventory ("CrateEnergy", 35)
		stop
	}
}



actor CrateCurse : inventory
{
	Inventory.PickupMessage "Picked up crate curse energy, wtf are you doing spawning stuff"
	Inventory.PickupSound "items/ammo"
	Inventory.Amount 1
	Inventory.MaxAmount 400
	states
	{
	spawn:
		BAL1 A 1 bright
		loop
	}
}

actor Slowcurse : powerspeed
{
	Powerup.Duration -8
	Speed 0.6
}	

actor Weakcurse : powerprotection
{
	Powerup.Duration -8
	DamageFactor "Normal", 2.0
}

Actor CurseFXSpawner : CustomInventory
{ 
	States 
	{ 
	Pickup: 
		TNT1 A 0 
		TNT1 A 0 A_SpawnItemEx("CurseFX",frandom(-44.0,44.0),frandom(-44.0,44.0),frandom(50,56),0,0,-4,0,SXF_NOCHECKPOSITION | SXF_SETMASTER) 
		TNT1 A 0 A_SpawnItemEx("CurseFX",frandom(-46.0,36.0),frandom(-36.0,36.0),frandom(50,56),0,0,-4,0,SXF_NOCHECKPOSITION | SXF_SETMASTER) 
		TNT1 A 0 A_SpawnItemEx("CurseFX",frandom(-50.0,50.0),frandom(-50.0,50.0),frandom(50,56),0,0,-4,0,SXF_NOCHECKPOSITION | SXF_SETMASTER) 
		stop 
	}
}

Actor CurseFX 
{
	radius 3
	height 6
	speed .1
	renderstyle translucent
	Alpha 0.5
	Scale 1
	gravity 0.7
	+missile
	+FLOORCLIP
	+bright
	+DONTSPLASH
	+NOTELEPORT
	+clientsideonly
	states
	{
	spawn:
		CURS A 1
		loop
	death:
		TNT1 A 1
		stop
	}
}

