//==========================BEAMS======================


//------------------------LONG BEAM------------------------
actor longbeampickup : custominventory replaces shotgun
{
	Inventory.PickupMessage "Longbeam acquired!"
	Inventory.PickupSound "items/ammo"
	Inventory.Amount 1
	+BRIGHT
	scale 1
	states
	{
	spawn:
		LBPU A 1
		LBPU B 1
		LBPU C 1
		LBPU D 1
		loop
	pickup:
		TNT1 A 0
		TNT1 A 0 a_jumpifinventory ("longbeammod", 1, "nohelp")
		TNT1 A 0 a_giveinventory ("longbeammod", 1)
		TNT1 A 0 a_print ("Beam range and damage increased")
		TNT1 A 0 a_playsound ("items/itemget",5)
		TNT1 A 1
	nohelp:
		TNT1 A 0 
		TNT1 A 0 a_giveinventory ("iceammo",5)
		TNT1 A 1
		stop
	}
}		

actor longbeammod : inventory
{inventory.maxamount 1}

actor droppedlongbeam : longbeampickup
{
	states
	{
	spawn:
		LBPU A 1
		loop
	}
}

//-------------------------ICE BEAM---------------------
actor icebeampickup : custominventory replaces supershotgun
{
	Inventory.PickupMessage "Ice beam acquired!"
	Inventory.PickupSound "items/ammo"
	Inventory.Amount 1
	+BRIGHT
	scale 1
	states
	{
	spawn:
		IBPU A 1
		IBPU B 1
		IBPU C 1
		IBPU D 1
		loop
	pickup:
		TNT1 A 0
		TNT1 A 0 a_jumpifinventory ("icebeammod", 1, "nohelp")
		TNT1 A 0 a_giveinventory ("icebeammod", 1)
		TNT1 A 0 a_print ("Beam damage increased, Frozen enemies explode into shrapnel")
		TNT1 A 0 a_playsound ("items/itemget",5)
		TNT1 A 1
	nohelp:
		TNT1 A 0 
		TNT1 A 0 a_giveinventory ("iceammo",15)
		TNT1 A 1
		stop
	}
}		

actor icebeammod : inventory
{inventory.maxamount 1}

//----------------------WAVE BEAM----------------------------
actor wavebeampickup : custominventory replaces chaingun
{
	Inventory.PickupMessage "Wavebeam acquired!"
	Inventory.PickupSound "items/ammo"
	Inventory.Amount 1
	+BRIGHT
	scale 1
	states
	{
	spawn:
		WBPU A 1
		WBPU B 1
		WBPU C 1
		WBPU D 1
		loop
	pickup:
		TNT1 A 0
		TNT1 A 0 a_jumpifinventory ("wavebeammod", 1, "nohelp")
		TNT1 A 0 a_giveinventory ("wavebeammod", 1)
		TNT1 A 0 a_print ("Automatic beam weapon, hold secondary to fire")
		TNT1 A 0 a_playsound ("items/itemget",5)
	nohelp:
		TNT1 A 0 
		TNT1 A 0 a_giveinventory ("waveammo",30)
		TNT1 A 1
		stop
	}
}		

actor wavebeammod : inventory
{inventory.maxamount 1}

actor droppedwavebeam : wavebeampickup
{
	states
	{
	spawn:
		WBPU A 1
		loop
	}
}

//--------------------------PLASMA BEAM----------------------------------

actor plasmabeampickup : custominventory replaces plasmarifle
{
	Inventory.PickupMessage "Plasma Beam acquired!"
	Inventory.PickupSound "items/ammo"
	Inventory.Amount 1
	+BRIGHT
	scale 1
	states
	{
	spawn:
		PBPU A 1
		PBPU B 1
		PBPU C 1
		PBPU D 1
		loop
	pickup:
		TNT1 A 0
		TNT1 A 0 a_jumpifinventory ("plasmabeammod", 1, "nohelp")
		TNT1 A 0 a_giveinventory ("plasmabeammod", 1)
		TNT1 A 0 a_print ("Powerful piercing beam weapon, use with secondary fire on missile mode")
		TNT1 A 0 a_playsound ("items/itemget",5)
	nohelp:
		TNT1 A 0 
		TNT1 A 0 a_giveinventory ("plasmaammo",15)
		TNT1 A 1
		stop
	}
}		

actor plasmabeammod : inventory
{inventory.maxamount 1}


//============================UPGRADES==================================

//----------------------BOMB UPGRADE------------------------

actor bombupgrade : custominventory replaces chainsaw
{
	Inventory.PickupMessage "Bomb upgrade acquired!"
	Inventory.PickupSound "items/ammo"
	Inventory.Amount 1
	+BRIGHT
	scale 1
	states
	{
	spawn:
		BMUG A 1
		BMUG B 1
		BMUG C 1
		BMUG D 1
		loop
	pickup:
		TNT1 A 0
		TNT1 A 0 a_jumpifinventory ("bombmod", 1, "restock")
		TNT1 A 0 a_giveinventory ("bombmod", 1)
		TNT1 A 0 a_print ("Hold reload to arm charge bomb attack. Press fire to throw. requires 3 bombs",6)
		TNT1 A 0 a_playsound ("items/itemget",5)
		TNT1 A 1
		goto nohelp
	restock:
		TNT1 A 0
		TNT1 A 0 a_jumpifinventory ("bombstock", 0, "nohelp")
		TNT1 A 0 a_giveinventory ("bombstock", 3)
		TNT1 A 0 a_print ("bomb supply restocked")
		TNT1 A 1
	nohelp:
		TNT1 A 0 
		TNT1 A 1
		stop
	}
}		

actor bombmod : inventory
{inventory.maxamount 1}




//----------------------MISSILE UPGRADE------------------------

actor missileupgrade : custominventory replaces rocketlauncher
{
	Inventory.PickupMessage "Missile upgrade acquired!"
	Inventory.PickupSound "items/ammo"
	Inventory.Amount 1
	+BRIGHT
	scale 1
	states
	{
	spawn:
		MUPG A 1
		MUPG B 1
		MUPG C 1
		MUPG D 1
		loop
	pickup:
		TNT1 A 0
		TNT1 A 0 a_jumpifinventory ("missilemod", 1, "restock")
		TNT1 A 0 a_giveinventory ("missilemod", 1)
		TNT1 A 0 a_print ("Missiles power up after enough travel time",6)
		TNT1 A 0 a_playsound ("items/itemget",5)
		TNT1 A 1
		goto nohelp
	restock:
		TNT1 A 0
		TNT1 A 0 a_giveinventory ("missileammo", 15)
		TNT1 A 0 a_print ("missile ammo granted")
		TNT1 A 1
	nohelp:
		TNT1 A 0 
		TNT1 A 1
		stop
	}
}		

actor missilemod : inventory
{inventory.maxamount 1}


//-------------------SCREW ATTACK-----------------------------
actor screwattackpickup : custominventory replaces BFG9000
{
	Inventory.PickupMessage "Screw attack acquired!"
	Inventory.PickupSound "items/ammo"
	Inventory.Amount 1
	+BRIGHT
	scale 1
	states
	{
	spawn:
		SAPU A 1
		SAPU B 1
		SAPU C 1
		SAPU D 1
		loop
	pickup:
		TNT1 A 0
		TNT1 A 0 a_jumpifinventory ("screwattackmod", 1, "restock")
		TNT1 A 0 a_giveinventory ("screwattackmod", 1)
		TNT1 A 0 a_print ("Press Zoom for a lunge attack. Use in the air for a double jump",5)
		TNT1 A 0 a_playsound ("items/itemget",5)
		TNT1 A 1
		goto nohelp
	restock:
		TNT1 A 0
		TNT1 A 0 a_giveinventory ("plasmaammo", 20)
		TNT1 A 0 a_print ("plasma charges granted")
		TNT1 A 1
	nohelp:
		TNT1 A 0 
		TNT1 A 1
		stop
	}
}		

actor screwattackmod : inventory
{inventory.maxamount 1}

actor screwcharge : inventory
{inventory.maxamount 10}



//------------------SPAZER------------------

actor spazer : custominventory replaces berserk
{
	+COUNTITEM
	+INVENTORY.ALWAYSPICKUP
	Inventory.PickupMessage "Spazer module!"
	inventory.pickupsound "items/armorrepair"
	+bright
	States
	{
	Spawn:
		SPZR A 1
		SPZR B 1
		SPZR C 1
		SPZR D 1
		loop
	Pickup:
		TNT1 A 0
		TNT1 A 0 a_jumpifinventory ("spazermod", 1, "restock")
		TNT1 A 0 A_GiveInventory("spazermod")
		TNT1 A 0 a_print ("beam output tripled!")
		TNT1 A 0 a_playsound ("items/itemget",5)
		TNT1 A 1 HealThing(100, 0)
		Stop
	restock:
		TNT1 A 0 a_print ("life restored")
		TNT1 A 1 HealThing(100, 0)
		Stop		
	}
}

actor spazermod : inventory
{inventory.maxamount 1}


//-----------------LIGHT AMP SCOPE---------------------

ACTOR Lightscope : PowerupGiver replaces infrared
{
	+COUNTITEM
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	+bright
	inventory.pickupsound "items/armorrepair"
	Inventory.MaxAmount 0
	Powerup.Type "LightAmp"
	Inventory.PickupMessage "Light Amplification scope!"
	States
	{
	Spawn:
		LASC A 1
		LASC B 1
		LASC C 1
		LASC D 1
		Loop
	}
}


//----------------------ALLMAP---------------------------

actor computermap : MapRevealer replaces allmap
{
	+COUNTITEM
	+INVENTORY.ALWAYSPICKUP
	+bright
	Inventory.MaxAmount 0
	inventory.pickupsound "items/armorrepair"
	Inventory.PickupMessage "Map information downloaded"
	States
	{
	Spawn:
		CPUM ABCD 6
		Loop
	}
}


//----------------HUNTER'S ESSENCE-----------------------

ACTOR HunterEssence : CustomInventory replaces megasphere
{
	+COUNTITEM
	+INVENTORY.ALWAYSPICKUP
	+bright
	scale 1.5
	Inventory.PickupMessage "Hunter's essence, health and armor restored"
	inventory.pickupsound "items/gravityarmor"
	States
	{
	Spawn:
		ESNC A 20
		ESNC BC 4
		ESNC DE 2
		Loop
	Pickup:
		TNT1 A 0 A_GiveInventory("BlueArmorForMegasphere", 1)
		TNT1 A 0 A_GiveInventory("MegasphereHealth", 1)
		Stop
	}
}


//---------------AMMO EXPANSION UNIT----------------------

ACTOR AmmoExpander : BackpackItem replaces backpack
{
	Height 26
	+bright
	Inventory.PickupMessage "Ammo expansion unit, ammo capacity increased!"
	inventory.pickupsound "items/armorrepair"
	States
	{
	Spawn:
		AMEX A 2
		AMEX B 2
		AMEX C 2
		loop
	}
}

//------------------METROID SHELL------------------------

ACTOR MetroidShell : PowerupGiver replaces InvulnerabilitySphere
{
	+COUNTITEM
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	+INVENTORY.BIGPOWERUP
	+bright
	Inventory.MaxAmount 0
	Powerup.Type "Invulnerable"
	Powerup.Color GoldMap
	inventory.pickupsound "items/invuln"
	Inventory.PickupMessage "Metroid Shell! Temporary invulnerability!"
	States
	{
	Spawn:
		MSHL A 30
		MSHL BC 5
		MSHL D 15
		MSHL E 4
		MSHL F 10
		MSHL E 4
		MSHL D 15
		MSHL CB 5
		MSHL A 30
		MSHL GH 5
		MSHL I 15
		MSHL J 4
		MSHL K 10
		MSHL J 4
		MSHL I 15
		MSHL HG 5
		Loop
	}
}


//---------------------------DRAGON FIRE----------------------------

actor dragonfire : custominventory replaces blursphere
{
	Inventory.PickupMessage "Dragon fire!"
	inventory.pickupsound "items/armorrepair"
	Inventory.Amount 1
	+BRIGHT
	scale 1
	states
	{
	spawn:
		DRFR A 3
		DRFR B 3
		DRFR C 3
		DRFR D 3
		loop
	pickup:
		TNT1 A 0
		TNT1 A 0 a_giveinventory ("dragonfiremod", 1)
		TNT1 A 0 a_print ("Cast flames when throwing bombs!")
		TNT1 A 1
		stop
	}
}		


actor dragonfiremod : inventory
{inventory.maxamount 1}


//-----------------------MISC-----------------------------

actor suitprotection : powerprotection
{
	damagefactor "slime", 0
	Powerup.Duration -0X7FFFFFFF
	Powerup.Color 0, 0, 0, 0
    inventory.maxamount 1
    inventory.icon ""
    +INVENTORY.AUTOACTIVATE
    +inventory.hubpower
	+INVENTORY.PERSISTENTPOWER	
}

actor suitfeet : powerironfeet	
{
	Powerup.Duration -0X7FFFFFFF
	Powerup.Color 0, 0, 0, 0
    inventory.maxamount 1
    inventory.icon ""
    +INVENTORY.AUTOACTIVATE
    +inventory.hubpower
	+INVENTORY.PERSISTENTPOWER	
}


actor droppeditemspawner : randomspawner
{
	dropitem "smallhealth", 30, 2
	dropitem "minihealth", 90, 3
	dropitem "singlemissile", 160, 3
}