Actor "Pulse Shotgun" : Weapon
{
Tag "Pulse Shotgun"
Weapon.AmmoType "NewCell"
Weapon.AmmoUse 10
Weapon.AmmoGive 80
Weapon.PreferredSkin "CombatSG-Marine"
Inventory.PickupMessage "Pulse Shotgun"
Obituary "%o spec of dust by %k's Pulse Shotgun"
AttackSound "plasmashotgun/fire"
Inventory.PickupSound "weapons/pulseshotgun/pump"
Weapon.Upsound "weapons/pulseshotgun/pump"
Decal DoomImpScorch
+WEAPON.NOAUTOAIM
+INVENTORY.UNDROPPABLE
States
{
  Spawn:
	STBE X -1
	Loop
  Ready:
    TNT1 A 0 A_JumpIfInventory("HandGrenadeAction",1,"GrenadeCheck")
	TNT1 A 0 A_JumpIfInventory("MineAction",1,"MineCheck")
	PSGA A 1 A_WeaponReady
	Loop
  Select:
    PSGA A 0 A_Raise
	PSGA A 1 A_Raise
	Loop
  Deselect:
	TNT1 A 0 A_PlayWeaponSound("weapons/weapondown")
	PSGA A 1 A_Lower
	Goto Deselect+1
  Fire:
    TNT1 A 0 A_GunFlash
	TNT1 A 0 A_PlaySound("weapons/pulseshotgun/add",7)
	TNT1 A 0 A_FireBullets(5,6,7,24,"ShotgunPlasmaPuff")
	TNT1 A 0 Radius_Quake(3,3,0,1,0)
	TNT1 A 0 A_Light1
	PSGF AB 1 Bright
	TNT1 A 0 A_Light0
	PSGF CDE 1
	PSGA A 3
	PSGR ABCDEFGHIJK 1
	TNT1 A 0 A_PlaySound("plasmashotgun/load")
	TNT1 A 0 A_PlaySound("weapons/pulseshotgun/pump",7)
	TNT1 A 0 A_SpawnItemEx("ShotgunCellCasing",30,-6,25,Random(2,4),Random(3,6),Random(3,6),0)
	PSGR LM 1
	PSGR N 2
	PSGR MLKJIHGFEDCBA 1
	Goto Ready
  GrenadeCheck:
	TNT1 A 0 A_JumpIfInventory("HandGrenadeAmmo",1,"GrenadeToss")
	TNT1 A 0 A_TakeInventory("HandGrenadeAction",1)
	Goto Ready
  GrenadeToss:
  	TNT1 A 0 A_PlayWeaponSound("weapons/weapondown") 
	PSGA A 1 Offset(0,30)
	PSGA A 1 Offset(0,40)
	PSGA A 1 Offset(0,50)
	PSGA A 1 Offset(0,60)
	PSGA A 1 Offset(0,70)
	TNT1 A 4 Offset(0,10)
	HGRN ABC 1 
	HGRN D 2
	HGRN EFG 1
	HGRN HI 2
	TNT1 A 15 A_PlayWeaponSound("weapons/hgrenadepin")
	TNT1 A 0 A_PlayWeaponSound("weapons/hgrenadethrow")
	TNT1 A 0 A_TakeInventory("HandGrenadeAmmo",1)
	HGNE A 1 A_FireCustomMissile("ThrownGrenade",0,0,0,0)
	HGRN J 1
	HGRN KLM 2
	HGRN NO 1
	TNT1 A 6
	TNT1 A 0 A_JumpIfInventory("HandGrenadeAmmo",1,2)
    TNT1 A 0 A_TakeInventory("Hand Grenade",1)
	TNT1 A 0 A_TakeInventory("HandGrenadeAction",1)
	TNT1 A 0
	PSGA A 1 Offset(0,70)
	PSGA A 1 Offset(0,60)
	PSGA A 1 Offset(0,50)
	PSGA A 1 Offset(0,40)
	PSGA A 1 Offset(0,30)
	Goto Ready
  MineCheck:
	TNT1 A 0 A_JumpIfInventory("MineAmmo",1,"MineToss")
	TNT1 A 0 A_TakeInventory("MineAction",1)
	Goto Ready
  MineToss:
  	TNT1 A 0 A_PlayWeaponSound("weapons/weapondown") 
	PSGA A 1 Offset(0,30)
	PSGA A 1 Offset(0,40)
	PSGA A 1 Offset(0,50)
	PSGA A 1 Offset(0,60)
	PSGA A 1 Offset(0,70)
	TNT1 A 8 Offset(0,10)
	TNT1 A 0 A_PlayWeaponSound("weapons/hgrenadethrow")
	MINE ABCDEF 1		
	TNT1 A 0 A_TakeInventory("MineAmmo",1)	  
	MINE G 1 A_FireCustomMissile("ThrownMine",0,0,0,0)
	MINE HI 1
	MINE JK 2
	TNT1 A 0 A_JumpIfInventory("MineAmmo",1,2)
    TNT1 A 0 A_TakeInventory("Land Mine",1)
	TNT1 A 0 A_TakeInventory("MineAction",1)
	TNT1 A 0
	TNT1 A 5
	PSGA A 1 Offset(0,70)
	PSGA A 1 Offset(0,60)
	PSGA A 1 Offset(0,50)
	PSGA A 1 Offset(0,40)
	PSGA A 1 Offset(0,30)
	Goto Ready	
	}
}

Actor ShotgunPlasmaPuff
{
  Radius 6
  Height 6
  +NOBLOCKMAP
  +NOGRAVITY
  +ACTIVATEIMPACT
  +ACTIVATEPCROSS
  +NOTELEPORT 
  +PUFFONACTORS
  +BLOODLESSIMPACT
  +FORCERADIUSDMG
  +ALWAYSPUFF
  Scale 0.5 
  Renderstyle Add
  Alpha 0.75
  Decal Bulletchip
  DamageType "Marine"
  States
  {
  Spawn:
	TNT1 A 0
    TNT1 A 0 A_SpawnItemEx("BlueParticleSpawner",0,0,0,0,0,0,0,128)
	TNT1 AAA 0 A_CustomMissile("Kaboom6", 0, 0, random(0,360), 2, random(0,360))
	TNT1 AAA 0 A_CustomMissile("SmokeFX4", 0, 0, random(0,360), 2, random(0,360))
    PSBO A 3 Bright A_Explode(4,64)
    PSBO BCDEF 3 Bright
    Stop
  }
}