actor SSTShotgun : Shotgun Replaces Shotgun
{
  Game Doom
  SpawnID 27
  Weapon.SelectionOrder 1299
  Weapon.AmmoUse 1
  Weapon.AmmoGive 8
  Weapon.AmmoType "Shell"
  Weapon.AmmoUse2 1
  Weapon.AmmoGive2 0
  Weapon.AmmoType2 "Shell"
  //+NOAUTOFIRE
  Inventory.PickupMessage "You got the shotgun!"
  Obituary "%o was pelted by %k's shotgun."
  Decal "bulletchip"
  //Scale 0.5
  Attacksound "misc/null"
  Weapon.preferredSkin "ShotgunSkin"
  +NOALERT
	+FORCEXYBILLBOARD
  States
  {
  Ready:
    TNT1 A 0 A_ZoomFactor(1.0)
    TNT1 A 0 A_JumpIfInventory("InstantSwitch",1, "ActualReady")
    SAWD DD 1
  ActualReady:
    SAWD A 1 A_WeaponReady
    Loop
  Deselect:
    TNT1 A 0 ACS_ExecuteAlways(779,0, 2,0,0)
    SAWD DE 1
  DeselectContinued:
    SAWD E 1 A_Lower
    SAWD E 0 A_Lower
    Loop
  Select:
    TNT1 A 0 A_JumpIfInventory("InstantSwitch",1, "ActualReady")
    TNT1 A 0 ACS_ExecuteAlways(779,0, 1,0,0)
    TNT1 A 0
    SAWD E 0 A_Raise
    SAWD E 1 A_Raise
    Goto Select+3
  Fire:
    SAWD A 1
    SHTG A 0 A_GunFlash
	TNT1 A 0 Radius_Quake(2,4,0,1, 0)
    SHT2 A 0 A_PlaySoundEx("weapons/shotgf", "SoundSlot5")
    SAWD BC 2 BRIGHT
    RLGG E 0 A_AlertMonsters
    SAWD E 2
    SAWD D 1
    SAWD A 3

    SAWD FGHI 1
    SAWD J 3
    SAWD KLMN 1
	BERT B 0 A_FireCustomMissile("ShellCasingSpawner",0,0,-4,-1)
    SAWD R 4
    SAWD MK 1
    SAWD J 2
    SAWD IHGFA 1

    SAWD A 0 A_ReFire
    Goto ActualReady
  AltFire:
    SAWD A 1
	TNT1 AAAAAAAAAA 0 A_FireCustomMissile ("TracerRoundShotgun", random(-8,8)*0.4, 0, 0, -2, 0, random(-8,8)*0.4)
    SAWD A 0 A_FireBullets (8, 8, 10, 4, "SSTWeakShotgunPuff", 1) //nerfed from 5 DMG to 4
    NULL A 0 A_SpawnItemEx ("ShotgunEcho", 0,0,0, 0,0,0, 0, 160)
	TNT1 A 0 Radius_Quake(2,4,0,1, 0)
    SHT2 A 0 A_PlaySoundEx("weapons/slamfire", "SoundSlot5")
    SAWD C 0 BRIGHT A_Light2
    SAWD B 1 BRIGHT A_ZoomFactor(0.98)
    SAWD B 1 BRIGHT A_ZoomFactor(0.93)
    TNT1 A 0 ACS_ExecuteAlways(925,0, random(200,600),0,0)
    SAWD B 0 BRIGHT A_Light1
    SAWD C 1 BRIGHT 
    SAWD C 1 BRIGHT 
    RLGG E 0 A_AlertMonsters
    SAWD A 0 A_Light0

    SAWD E 2
    SAWD Q 1
    SAWD Q 1 A_ZoomFactor(0.93)//P
    SAWD Q 1 A_ZoomFactor(0.94)
	BERT B 0 A_FireCustomMissile("ShellCasingSpawner",0,0,0,-2)
    SAWD Q 1 A_ZoomFactor(0.95)
    SAWD Q 1 A_ZoomFactor(0.97)
    SAWD P 1 A_ZoomFactor(0.99)
    SAWD P 1 A_ZoomFactor(1.0)
    SAWD O 1
    SAWD O 1
    SAWD E 1
    SAWD E 1
    SAWD D 1//DD

    SAWD A 0 A_ReFire
    Goto ActualReady
  Flash:
    NULL A 0 A_SpawnItemEx ("ShotgunEcho", 0,0,0, 0,0,0, 0, 160)
    TNT1 A 0 A_Jump(104, "Flash2")
    SAWD A 0 A_FireBullets (2, 2.5, 1, random(4,6), "SSTShotgunPuff",0) 
    SAWD A 0 A_FireBullets (2, 2.5, 2, random(5,6), "SSTShotgunPuff",0) 
    SAWD A 0 A_FireBullets (2.2, random(3,3.75), 1, random(5,6), "SSTShotgunPuff",0)
    SAWD A 0 A_FireBullets (2.2, random(2.8,3.3), 1, random(6,7), "SSTShotgunPuff",0) 
    SAWD A 0 A_FireBullets (3, random(3,4), 2, random(3,4), "SSTShotgunPuff",0) 
    SAWD A 0 A_FireBullets (3, random(3.5,4.4), 3, random(2,3), "SSTShotgunPuff",1) 
	TNT1 AAAAAAAAAA 0 A_FireCustomMissile ("TracerRoundShotgun", random(-3,3)*0.4, 0, 0, -2, 0, random(-4,4)*0.4)
    Goto FlashEnd
  Flash2:
    TNT1 A 0 A_Jump(64, "Flash3")
    TNT1 A 0
    SAWD A 0 A_FireBullets (2.75, 2.75, 10, 5, "SSTShotgunPuff", 1)
	TNT1 AAAAAAAAAA 0 A_FireCustomMissile ("TracerRoundShotgun", random(-2.75,2.75)*0.4, 0, 0, -2, 0, random(-2.75,2.75)*0.4)
    Goto FlashEnd
  Flash3:
    TNT1 A 0
    SAWD A 0 A_FireBullets (1.75, 1.75, random(4,5), 5, "SSTShotgunPuff", 0)
    SAWD A 0 A_FireBullets (2.75, 2.75, 5, 5, "SSTShotgunPuff", 1)
	TNT1 AAAAAAAAAA 0 A_FireCustomMissile ("TracerRoundShotgun", random(-2.75,2.75)*0.4, 0, 0, -2, 0, random(-2.75,2.75)*0.4)
    Goto FlashEnd
  FlashEnd:
    TNT1 A 0    
	//TNT1 A 0 A_SetAngle(angle+random(-1,1))
    TNT1 A 1 A_SetPitch(pitch-3)
    TNT1 A 1 A_Light2 //2tics
    TNT1 A 1 A_Light1
    //TNT1 A 0 ACS_ExecuteAlways(925,0, 425,0,0)//375

	TNT1 A 1 
	TNT1 A 1 A_SetPitch(pitch+0.5)
	TNT1 A 1 A_SetPitch(pitch+1)
	TNT1 A 1 A_SetPitch(pitch+1)
	TNT1 A 1 A_SetPitch(pitch+0.5)
	TNT1 A 2 A_Light0
    Goto LightDone
  Spawn:
    SHOT B -1
    //SHOT A -1
    Stop
  }
}
