ACTOR PicoAerosol : Weapon//  replaces Supershotgun
{
	Weapon.SelectionOrder 1300
	Weapon.AmmoUse 1
	Weapon.AmmoGive 16
	Weapon.AmmoType "PicoGas"
	Inventory.RestrictedTo "Pico"
	Obituary "%o got toasted by %k"
	Tag "Aerosol + lighter"
	+Weapon.ammo_optional
	+Weapon.NOALERT
	States
	{
	Ready:
		6PIA EFG 2 bright A_WeaponReady
		Loop
	Deselect:
		TNT1 a 0 a_STOPSOUND(4)
		6PIA EEFFGG 1 bright A_Lower
		Loop
	Select:
		TNT1 A 0 Offset(0, 32)
		6PIA AB 2  
		6PIA C 2 bright A_PlaySound("pico/PCACLF",chan_auto)
		6PIA D 2 bright
		Goto Ready
	Fire:
		P2FL A 0 A_Jumpifinventory("PicoGas",1,1)
		Goto Click
		TNT1 A 0 A_Alertmonsters
		6PIA h 2 bright
		tnt1 A 0 A_PlaySound("Pico/PCACSF",4,0.6,1)
	FireCan:
		P2FL A 0 A_Jumpifinventory("PicoGas",1,1)
		Goto Click
		6PIA I 2 Bright A_FireCustomMissile("PicoAerosolFire", random(-4,4), 1,0,0,0,random(-2,2))
		6PIA J 2 Bright 
		6PIA K 2 Bright A_FireCustomMissile("PicoAerosolFire2", random(-4,4), 1,0,0,0,random(-2,2))
		tnt1 a 0 a_REFIRE("FireCan")
		6PIA H 2 Bright a_STOPSOUND(4)
		Goto Ready
		Flash:
        TNT1 A 2 A_setpitch(pitch-2)
        tnt1 A 0 Bright A_Light2
        TNT1 AAAA 2 A_setpitch(pitch+0.5,SPF_INTERPOLATE)
        tnt1 B 3 Bright A_Light1
        Goto LightDone
	Spawn:
		SHOT A -1
		Stop
	Altfire:
		"####" "#" 0 A_jumpifInventory("PicoMeterCountdown",0,1)
		Goto Click
		"####" "#"1 Offset(4,34) 
		"####" "#"1 Offset(9,36)
		"####" "#"1 Offset(15,40)
		"####" "#"1 Offset(15,40)
		"####" "#"1 Offset(22,48)
		"####" "#"1 Offset(30,54)
		"####" "#"1 Offset(39,65)
		"####" "#"1 Offset(45,72)
	Weed:
		TNT1 A 0 Offset(-1,32)
		TNT1 A 0 A_takeinventory("PicoAnxyStack",100)
		TNT1 A 0 A_takeinventory("PowerSlowdown",1)
		TNT1 A 0 A_takeinventory("PowerSlowerdown",1)
		TNT1 A 0 A_takeinventory("PowerSlowestdown",1)
		TNT1 A 0 A_takeinventory("PowerPicoDamage",1)
		TNT1 A 0 A_takeinventory("PowerPicoDamage1",1)
		TNT1 A 0 A_takeinventory("PowerPicoDamage2",1)
		TNT1 A 0 A_takeinventory("PowerPicoVulnerability",1)
		TNT1 A 0 A_takeinventory("PowerPicoVulnerability1",1)
		TNT1 A 0 A_takeinventory("PowerPicoVulnerability2",1)
		TNT1 A 0 A_Giveinventory("PicoWeedCoolDown",1)
		P2WD A 1 OFFSET(0,36) A_takeinventory("PicoMeterCountdown",256)
		P2WD A 1 OFFSET(0,33) Healthing(15,100)
		P2WD A 2 OFFSET(0,32)
		P2WD BCD 4
		P2WD E 2
		P2WD E 1 Offset(0,34)
		P2WD E 1 Offset(0,38)
		Goto Select
	Click:
		6PIA B 1 OFFSET(0,48) A_playsound("Pico/WeaponClick")
		6PIA B 1 OFFset(0,47)
		6PIA B 1 OFFset(0,36)
		6PIA B 1 OFFset(0,32)
		6PIA B 5 A_weaponReady(WRF_NOFIRE)
		TNT1 A 0  A_PlaySound("characters/pico/PCACLF",chan_auto)
		6PIA CD 2 bright A_weaponReady
		6PIA D 2 bright 
		Goto Ready
	}
}
