ACTOR Malefactor : Weapon Replaces Shotgun 25003
{
  Tag "D-666A Malefactor"
  Weapon.SelectionOrder 64
  Weapon.AmmoUse 1
  Weapon.AmmoGive2 14
  Weapon.PreferredSkin "Shotgun"
  Weapon.UpSound "Weapons/MalefactorUp"
  Weapon.AmmoType "MalefactorShells"
  Weapon.AmmoType2 "Shotgun_Ammo_X"
  decal "BlazeChip"
  Weapon.SlotNumber 3
  Scale 0.8
  weapon.bobstyle inversesmooth
   weapon.bobrangeX 0.4
   weapon.bobrangeY 0.6
   weapon.bobspeed 2.5
  Inventory.PickupMessage "You got the D-666A Malefactor Shotgun! Want it dead? Blast it in the face."
  Obituary "%k flattened %o with the Malefactor."
  +WEAPON.AMMO_OPTIONAL
  +NOAUTOFIRE
  +NOALERT
  +NOAUTOAIM
  States
  {
  Ready:
    D3SG A 1 A_WeaponReady(WRF_ALLOWRELOAD)
    loop
  Deselect:
    TNT1 A 0 SetPlayerProperty(0,1,2)
	TNT1 A 0 A_SetCrosshair(1)
	D3SS ABCDE 1
	Goto DeselectLoop
  DeselectLoop:
    TNT1 A 1 A_Lower
    Loop
  Select:
	TNT1 A 0 A_JumpIfInventory("ShotgunToken",1,"Select3")
    D3SG A 0 A_JumpIfInventory("MalefactorFirstTime",1,1)
	goto Select2
	TNT1 A 0 A_PlaySoundEx("Weapons/MalefactorFirst","WeaponPickedUp",0,0)
    TNT1 A 0 SetPlayerProperty(0,0,2)
	TNT1 A 0 A_SetCrosshair(5)
    D3SS EDCBA 1
	TNT1 A 0 A_TakeInventory("MalefactorFirstTime",1)
    Goto SelectLoop
  Select2:
    TNT1 A 0 SetPlayerProperty(0,0,2)
	TNT1 A 0 A_SetCrosshair(5)
    D3SS EDCBA 1
    Goto SelectLoop
  Select3:
    TNT1 A 0 SetPlayerProperty(0,0,2)
	TNT1 A 0 A_SetCrosshair(15)
    D3SS EDCBA 1
    Goto SelectLoop
  SelectLoop:
    D3SG A 1 A_Raise
	Loop
 Fire:
	TNT1 A 0 A_JumpIfInventory("ShotgunToken", 1, "FireAlt")
 FireNormal:
	D3SG A 0 A_JumpIfInventory("MalefactorShells",2,1)
    Goto FireNormalLast
	D3SG A 0 A_JumpIfInventory("MalefactorShells",1,1)
    Goto DryFire
	TNT1 A 0 A_AlertMonsters
	TNT1 A 0 A_SetPitch(pitch - 3.0)
    D3SG B 0 A_PlaySound("D3SG/Fire",86,0.99,0,1)
	TNT1 A 0 A_PlaySound("D3SG/FireAdd",87,0.88,0,1)
	TNT1 A 0 A_SpawnItem("Lightprojectile",0,0,0,0)
	TNT1 AAAAA 0 A_FireCustomMissile("gausssmoke_spawner2",0,0,3,4,0)		
    TNT1 A 0 A_FireCustomMissile("p_pellet_tracer", random(-8, 8), 1, 2.5, 5, 0,random(-5, 5))
	TNT1 AAAAAAAAAAAAAAAAAAAAAAAA 0 A_FireCustomMissile("p_pellet_tracer", random(-8, 8), 0, 2.5, 5, 0,random(-5, 5))
	D3SG B 0 A_ZoomFactor(0.99)
    D3SF A 1 Bright A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG B 1 Bright A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG B 0 A_ZoomFactor(0.97)
    D3SG C 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG B 0 A_ZoomFactor(0.95)
    D3SG D 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG B 0 A_ZoomFactor(0.96)
	D3SG E 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG B 0 A_ZoomFactor(0.97)
	D3SG E 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG B 0 A_ZoomFactor(0.98)
	D3SG EE 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG B 0 A_ZoomFactor(0.99)
	D3SG E 2 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG B 0 A_ZoomFactor(1.00)
	D3SG DC 2 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG A 2 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG A 0 A_PlaySound("D3SGPumpback",88,1.0,0,1)
	D3SG FGH 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG H 0 A_FireCustomMissile("SCMITRCasing_Spawner",0,0,0,3,0)
	D3SG IJKL 2 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG A 0 A_PlaySound("D3SGPumpForward",89,1.0,0,1)
	D3SG MNOP 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG A 2 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG A 0 A_Refire
    Goto Ready
  FireNormalLast:
	D3SG A 0 A_JumpIfInventory("MalefactorShells",1,1)
    Goto DryFire
	TNT1 A 0 A_AlertMonsters
	TNT1 A 0 A_SetPitch(pitch - 3.0)
	TNT1 A 0 A_SetAngle(angle + (frandom(-0.9,0.9)))
    D3SG B 0 A_PlaySound("D3SG/Fire",86,0.99,0,1)
	TNT1 A 0 A_PlaySound("D3SG/FireAdd",87,0.88,0,1)
	TNT1 A 0 A_SpawnItem("Lightprojectile",0,0,0,0)
	TNT1 AAAAA 0 A_FireCustomMissile("gausssmoke_spawner2",0,0,3,4,0)		
    TNT1 A 0 A_FireCustomMissile("p_pellet_tracer", random(-8, 8), 1, 2.5, 5, 0,random(-5, 5))
	TNT1 AAAAAAAAAAAAAAAAAAAAAAAA 0 A_FireCustomMissile("p_pellet_tracer", random(-8, 8), 0, 2.5, 5, 0,random(-5, 5))
	D3SG B 0 A_ZoomFactor(0.99)
    D3SF A 1 Bright A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG B 1 Bright A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG B 0 A_ZoomFactor(0.97)
    D3SG C 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG B 0 A_ZoomFactor(0.95)
    D3SG D 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG B 0 A_ZoomFactor(0.96)
	D3SG E 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG B 0 A_ZoomFactor(0.97)
	D3SG E 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG B 0 A_ZoomFactor(0.98)
	D3SG EE 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG B 0 A_ZoomFactor(0.99)
	D3SG E 2 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG B 0 A_ZoomFactor(1.00)
	D3SG DC 2 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG A 2 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG A 0 A_Refire
    Goto Ready
  FireAlt:
    D3SG A 0 A_JumpIfInventory("MalefactorShells",2,1)
    Goto FireAltLast
	D3SG A 0 A_JumpIfInventory("MalefactorShells",1,1)
    Goto DryFire
	TNT1 A 0 A_AlertMonsters
	TNT1 A 0 A_SetPitch(pitch -3.0)
    D3SG B 0 A_PlaySound("D3SG/Fire",86,0.99,0,1)
	TNT1 A 0 A_PlaySound("D3SG/FireAdd",87,0.99,0,1)
	TNT1 A 0 A_SpawnItem("Lightprojectile",0,0,0,0)
	TNT1 AAAAA 0 A_FireCustomMissile("gausssmoke_spawner2",0,0,3,4,0)		
    TNT1 A 0 A_FireCustomMissile("LoudmouthProjectile", random(-8, 8), 1, 2.5, 5, 0,random(-5, 5))
	TNT1 AAAAAAAAAAAAAAAAAAAAAAAA 0 A_FireCustomMissile("LoudmouthProjectile", random(-8, 8), 0, 2.5, 5, 0,random(-5, 5))
	D3SG B 0 A_ZoomFactor(0.99)
    D3SF A 1 Bright A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG B 1 Bright A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG B 0 A_ZoomFactor(0.97)
    D3SG C 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG B 0 A_ZoomFactor(0.95)
    D3SG D 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG B 0 A_ZoomFactor(0.96)
	D3SG E 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG B 0 A_ZoomFactor(0.97)
	D3SG E 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG B 0 A_ZoomFactor(0.98)
	D3SG EE 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG B 0 A_ZoomFactor(0.99)
	D3SG E 2 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG B 0 A_ZoomFactor(1.00)
	D3SG DC 2 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG A 2 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG A 0 A_PlaySound("D3SGPumpback",88,1.0,0,1)
	D3SG FGH 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG H 0 A_FireCustomMissile("SCMITRCasing_Spawner",0,0,0,3,0)
	D3SG IJKL 2 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG A 0 A_PlaySound("D3SGPumpForward",89,1.0,0,1)
	D3SG MNOP 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG A 2 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG A 0 A_Refire
    Goto Ready
  FireAltLast:
	D3SG A 0 A_JumpIfInventory("MalefactorShells",1,1)
    Goto DryFire
	TNT1 A 0 A_AlertMonsters
	TNT1 A 0 A_SetPitch(pitch - 3.0)
	TNT1 A 0 A_SetAngle(angle + (frandom(-0.9,0.9)))
    D3SG B 0 A_PlaySound("D3SG/Fire",86,0.99,0,1)
	TNT1 A 0 A_PlaySound("D3SG/FireAdd",87,0.99,0,1)
	TNT1 A 0 A_SpawnItem("Lightprojectile",0,0,0,0)
	TNT1 AAAAA 0 A_FireCustomMissile("gausssmoke_spawner2",0,0,3,4,0)		
    TNT1 A 0 A_FireCustomMissile("LoudmouthProjectile", random(-8, 8), 1, 2.5, 5, 0,random(-5, 5))
	TNT1 AAAAAAAAAAAAAAAAAAAAAAAA 0 A_FireCustomMissile("LoudmouthProjectile", random(-8, 8), 0, 2.5, 5, 0,random(-5, 5))
    D3SG B 0 A_ZoomFactor(0.99)
    D3SF A 1 Bright A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG B 1 Bright A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG B 0 A_ZoomFactor(0.97)
    D3SG C 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG B 0 A_ZoomFactor(0.95)
    D3SG D 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG B 0 A_ZoomFactor(0.96)
	D3SG E 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG B 0 A_ZoomFactor(0.97)
	D3SG E 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG B 0 A_ZoomFactor(0.98)
	D3SG EE 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG B 0 A_ZoomFactor(0.99)
	D3SG E 2 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG B 0 A_ZoomFactor(1.00)
	D3SG DC 2 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG A 2 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG A 0 A_Refire
    Goto Ready
  AltFire: //Does checks, if you have no dummy actors, select hellfire shells
	TNT1 A 0 A_PlaySoundEX("Weapons/FireSelector","Body",0,0)
	TNT1 A 0 A_JumpIfInventory("ShotgunToken", 1, "AltFire2")
	TNT1 A 0 A_GiveInventory("ShotgunToken", 1)
	TNT1 A 0 A_SetCrosshair(15)
	D3SG A 10 A_WeaponReady(WRF_NOFIRE)
	Goto Ready
  AltFire2: //Clears dummy actors, to use regular buckshot
	TNT1 A 0 A_PlaySoundEX("Weapons/FireSelector","Body",0,0)
	TNT1 A 0 A_TakeInventory("ShotgunToken", 1)
	TNT1 A 0 A_SetCrosshair(5)
	D3SG A 10 A_WeaponReady(WRF_NOFIRE)
	Goto Ready
  DryFire:
	D3SG A 0 A_PlaySound("Shotgun/Empty",199,1.0,0,1) // Play the clicky noise.
	D3SG A 5 A_WeaponReady(WRF_NOFIRE)
	Goto Ready
  Reload:
  ReloadBegin:
    TNT1 A 0 A_JumpIfInventory("Shotgun_Ammo_X",1,1)
    Goto DryFire
    TNT1 A 0 A_JumpIfInventory("MalefactorShells",7,"Ready")
	TNT1 A 0 A_JumpIfInventory("MalefactorShells",1,"ReloadLoop")
    D3SR ABCD 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SR A 0 A_PlaySound("D3SGLoadShell")
	D3SR EFGHI 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
    TNT1 A 0 A_TakeInventory("Shotgun_Ammo_X", 1)
    TNT1 A 0 A_GiveInventory("MalefactorShells", 1)
	D3SR JKLMN 2 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SR OPQR 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG A 5 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG A 0 A_PlaySound("D3SGPumpback",88,1.0,0,1)
	D3SG FGH 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG H 0 A_FireCustomMissile("SCMITRCasing_Spawner",0,0,0,3,0)
	D3SG IJKL 2 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG A 0 A_PlaySound("D3SGPumpForward",89,1.0,0,1)
	D3SG MNOP 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG A 5 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
    Goto Ready
	goto ReloadLoop
  ReloadLoop:
    TNT1 A 0 A_JumpIfInventory("Shotgun_Ammo_X",1,1)
	Goto EndReloading
	D3SR A 0 A_PlaySound("D3SGLoadShell",87,1.0,0,1)
	D3SR EFGHI 1 A_WeaponReady(WRF_NOSWITCH)
    TNT1 A 0 A_TakeInventory("Shotgun_Ammo_X", 1)
    TNT1 A 0 A_GiveInventory("MalefactorShells", 1)
	D3SR JKLMN 2 A_WeaponReady(WRF_NOSWITCH)
	TNT1 A 0 A_JumpIfInventory("MalefactorShells",7,"EndReloading")
	Loop
 EndReloading:
    D3SR A 0 A_PlaySound("D3SGHandling",88,1.0,0,1)
	D3SR OPQR 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	D3SG A 5 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	Goto Ready
  Spawn:
    D3SP X -1
	Stop
  }
}

ACTOR ShotgunToken : Inventory {Inventory.MaxAmount 1}

ACTOR MalefactorFirstTime : Inventory {Inventory.MaxAmount 1 Inventory.InterHubAmount 1}

ACTOR MalefactorShells : Ammo
{
  Inventory.PickupMessage "You shouldn't see this!"
  Inventory.Amount 0
  Inventory.MaxAmount 7
  Ammo.BackpackAmount 0
  Ammo.BackpackMaxAmount 7
  States
  {
  Spawn:
    TNT1 A -1
    Stop
  }
}

ACTOR Shotgun_Ammo_X : Ammo
{
	Inventory.PickupMessage ""
	Inventory.Amount 1
	Inventory.MaxAmount 42
	Ammo.BackpackAmount 12
	Ammo.BackpackMaxAmount 84
	States
	{
	Spawn:
		TNT1 A -1
		Stop
	}
}

ACTOR 12ShellsX : Shotgun_Ammo_X
{
  Game Doom
  ConversationID 502
  Inventory.PickupMessage "Picked up a box of Blackheart Shells."
  Inventory.PickupSound "items/shellbox"
  Inventory.Amount 12
  Scale 0.30
  States
  {
  Spawn:
    XSHL A -1
    Stop
  }
}


ACTOR 4ShellsX : Shotgun_Ammo_X
{

  Inventory.PickupMessage "Picked up some Blackheart Shells."
  Inventory.PickupSound "items/shell"
  Inventory.Amount 4
  Scale 0.30
  States
  {
  Spawn:
    XSHL B -1
    Stop
  }
}

ACTOR 3ShellsX : Shotgun_Ammo_X
{

  Inventory.PickupMessage "Picked up a few Blackheart Shells."
  Inventory.PickupSound "items/shell"
  Inventory.Amount 3
  Scale 0.30
  States
  {
  Spawn:
    XSHL C -1
    Stop
  }
}

ACTOR 2ShellsX : Shotgun_Ammo_X
{

  Inventory.PickupMessage "Picked up a pair of Blackheart Shells."
  Inventory.PickupSound "items/shell"
  Inventory.Amount 2
  Scale 0.30
  States
  {
  Spawn:
    XSHL D -1
    Stop
  }
}

ACTOR 1ShellsX : Shotgun_Ammo_X
{

  Inventory.PickupMessage "Picked up a Blackheart Shell."
  Inventory.PickupSound "items/shell"
  Inventory.Amount 1
  Scale 0.30
  States
  {
  Spawn:
    XSHL E -1
    Stop
  }
}

ACTOR SCMITRCasing_Spawner
{
    Radius 1
    Height 1
    Speed 18
    PROJECTILE
	+NOCLIP
	+CLIENTSIDEONLY
    States
    {
    Spawn:
        TNT1 A 1
        TNT1 A 0 A_Die
        Goto Death
    Death:
        TNT1 A 0 A_SpawnItemEx("scmitrshell_casing", 0, 10, -4, random(-3,0), random(-7,-5), random(0,1), 0)
        Stop
    }
}

ACTOR SCMITRShell_Casing
{
   Radius 2
   Height 4
   Speed 8
   Scale 0.16
   BounceSound "Weapons/ShellCasing"
   PROJECTILE
   -NOGRAVITY
   +BOUNCEONACTORS
   +BOUNCEONCEILINGS
   +DONTSPLASH
   +CLIENTSIDEONLY
   Gravity 0.75
   BounceType Doom
   BounceCount 6
   BounceFactor 0.6
   DamageType Nope
   States
   {
   Spawn:
	  TNT1 A 0 ThrustThingZ(0, Random(6, 16), 0, 1)
      BSHC ABCDEFG 1
      Goto Roflcopter
   Roflcopter:
      PBCS A 0 A_Jump(128,1,3,5,7)
      BSHC ABCDEFG 1
      Loop
   Death:
      PBCS A 0 A_SpawnItemEx("SCMITRShell_Casing_Liedown")
      stop
   }
}

actor SCMITRShell_Casing_Liedown
{
	-NOGRAVITY
    Scale 0.16
	States
	{
	Spawn:
	  TNT1 A 0
	  TNT1 A 0 A_Jump(255,"Spawn1","Spawn2","Spawn3")
	  stop
	Spawn1:
	  BSHC C 1
	  Goto Ded
	Spawn2:
	  BSHC D 1
	  Goto Ded
	Spawn3:
	  BSHC G 1
	  Goto Ded
	Ded:
	  "####" "#" 210 A_CheckSight("Fadying")
	  Loop
	Fadying:
	  "####" "#" 1 A_FadeOut(0.1)
	  Wait
   }
}

ACTOR LoudmouthProjectile : FastProjectile
{
	Damage (15*frandom(2.0,3.0))
	Radius 5
	Height 3
	Speed 200
	MissileHeight 3
	MissileType "LoudmouthTrailer"
	Decal "BlazeChip"
	Damagetype "Fire"
	PROJECTILE
	+BLOODSPLATTER
	+NOEXTREMEDEATH
	+DONTREFLECT
	States
	{
	Spawn:
		TNT1 AA 0 A_ScaleVelocity(frandom(0.9,1.1))
		TNT1 A 0 A_SetScale(frandom(0.07,0.05))
		TNT1 A 1 ThrustThingZ(0,random(10,14),0,1)
	Looplet:
		TNT1 A 1 Bright ThrustThingZ(0,frandom(-5.0,-3.0),0,1)
		Loop
	Death:
		TNT1 A 1 A_SpawnItemEx("BulletImpact",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
		TNT1 A 0 A_Explode(10,36,0)
		TNT1 A 0 A_SpawnItemEx("LoudmouthFX",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
		TNT1 A 1 A_SpawnItemEx("LoudmouthImpact",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
		Stop
	XDeath:
		TNT1 A 0 A_Explode(10,36,0)
		TNT1 A 0 A_SpawnItemEx("LoudmouthFX",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
		TNT1 A 1 A_SpawnItemEx("LoudmouthImpact",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
		Stop
	}
}

//Basis

ACTOR LoudmouthBasis
{
	+NOINTERACTION
	+NOGRAVITY
	+CLIENTSIDEONLY
	Renderstyle Add
	Alpha 0
	Scale 0
}

ACTOR LoudmouthSpawnerBasis
{
	+NOINTERACTION
	+NOGRAVITY
	+CLIENTSIDEONLY
}

//GLDEF

ACTOR LoudmouthFX : LoudmouthSpawnerBasis
{
	States
	{
	Spawn:
	TNT1 A 25
	Stop
	}
}

//Partecleeeeees

ACTOR LoudmouthFlare : LoudmouthBasis
{
	States
	{
	Spawn:
		TNT1 AA 0 A_FadeIn(frandom(0.9,0.99))
		TNT1 A 0 A_SetScale(frandom(0.15,0.2))
		TNT1 A 0 A_Jump(256,"SpriteA","SpriteB","SpriteC","SpriteD")
	SpriteA:
		FLFR A 0
		Goto MolotovVodkail
	SpriteB:
		FLFR B 0
		Goto MolotovVodkail
	SpriteC:
		FLFR C 0
		Goto MolotovVodkail
	SpriteD:
		FLFR D 0
	MolotovVodkail:
		"####" "#" 0 A_JumpIf(ScaleX <= 0,"NULL")
		"####" "#" 0 A_SetScale(ScaleX - frandom(0.03,0.04))
		"####" "#" 1 Bright A_FadeOut(frandom(0.1,0.05))
		Loop
	}
}

ACTOR LoudmouthImpactFlare : LoudmouthBasis
{
	States
	{
	Spawn:
		TNT1 AA 0 A_SetScale(frandom(0.03,0.045))
		TNT1 A 0 A_Jump(256,"SpriteA","SpriteB","SpriteC","SpriteD")
	SpriteA:
		FLFR A 0
		Goto PierdolStudiaZostanStudentem
	SpriteB:
		FLFR B 0
		Goto PierdolStudiaZostanStudentem
	SpriteC:
		FLFR C 0
		Goto PierdolStudiaZostanStudentem
	SpriteD:
		FLFR D 0
	PierdolStudiaZostanStudentem:
		"####" "#" 1 Bright A_JumpIf(Alpha >= 0.95, "MojaBabciaLepiejOgarniaDecorateNizTy")
		"####" "#" 0 A_FadeIn(frandom(0.15,0.2))
		"####" "#" 0 A_SetScale(ScaleX + frandom(0.075,0.05))
		Loop
	MojaBabciaLepiejOgarniaDecorateNizTy:
		"####" "#" 1 Bright A_SetScale(ScaleX - frandom(0.005,0.01))
		"####" "#" 0 A_JumpIf(ScaleX <= 0, "NULL")
		"####" "#" 0 A_FadeOut(frandom(0.05,0.075))
		Loop
	}
}

ACTOR LoudmouthTrail : LoudmouthBasis
{
	States
	{
	Spawn:
		TNT1 AA 0 A_SetScale(frandom(0.03,0.045),ScaleX)
		TNT1 A 0 A_Jump(256,"SpriteA","SpriteB","SpriteC","SpriteD",
		"SpriteE","SpriteF","SpriteG","SpriteH")
	SpriteA:
		FLTR A 0
		Goto CornishGaben
	SpriteB:
		FLTR B 0
		Goto CornishGaben
	SpriteC:
		FLTR C 0
		Goto CornishGaben
	SpriteD:
		FLTR D 0
		Goto CornishGaben
	SpriteE:
		FLTR E 0
		Goto CornishGaben
	SpriteF:
		FLTR F 0
		Goto CornishGaben
	SpriteG:
		FLTR G 0
		Goto CornishGaben
	SpriteH:
		FLTR H 0
	CornishGaben:
		"####" "#" 1 Bright A_JumpIf(Alpha >= 0.7, "SergeantHastagaspacho")
		"####" "#" 0 A_FadeIn(frandom(0.05,0.075))
		"####" "#" 0 A_ChangeVelocity(Velx * 0.975, Vely * 0.975, Velz * 1.05,
		CVF_REPLACE)
		"####" "#" 0 A_SetScale(ScaleX + frandom(0.0015,0.0025),ScaleX)
		Loop
	SergeantHastagaspacho:
		"####" "###" 1 Bright A_SetScale(ScaleX + frandom(0.0015,0.0025),ScaleX)
		"####" "#" 0 A_ChangeVelocity(Velx * 0.975, Vely * 0.975, Velz * 1.05,
		CVF_REPLACE)
		"####" "#" 0 A_Jump(192,"GoingBackToMacDonalds")
		Loop
	GoingBackToMacDonalds:
		"####" "#" 1 Bright A_SetScale(ScaleX + frandom(0.0015,0.0025),ScaleX)
		"####" "#" 0 A_ChangeVelocity(Velx * 0.975, Vely * 0.975, Velz * 1.05,
		CVF_REPLACE)
		"####" "#" 0 A_FadeOut(frandom(0.05,0.075))
		Loop
	}
}

ACTOR LoudmouthSmoke : LoudmouthBasis
{
	Renderstyle Translucent
	Alpha 0.50
	States
	{
	Spawn:
		TNT1 AA 0 A_SetScale(frandom(0.03,0.045),ScaleX)
		TNT1 A 0 A_Jump(256,"SpriteA","SpriteB","SpriteC","SpriteD",
		"SpriteE","SpriteF","SpriteG","SpriteH")
	SpriteA:
		FLST A 0
		Goto CornishGaben
	SpriteB:
		FLST B 0
		Goto CornishGaben
	SpriteC:
		FLST C 0
		Goto CornishGaben
	SpriteD:
		FLST D 0
		Goto CornishGaben
	SpriteE:
		FLST E 0
		Goto CornishGaben
	SpriteF:
		FLST F 0
		Goto CornishGaben
	SpriteG:
		FLST G 0
		Goto CornishGaben
	SpriteH:
		FLST H 0
	CornishGaben:
		"####" "#" 1 Bright A_JumpIf(Alpha >= 0.7, "SergeantHastagaspacho")
		"####" "#" 0 A_FadeIn(frandom(0.05,0.075))
		"####" "#" 0 A_ChangeVelocity(Velx * 0.975, Vely * 0.975, Velz * 1.05,
		CVF_REPLACE)
		"####" "#" 0 A_SetScale(ScaleX + frandom(0.0015,0.0025),ScaleX)
		Loop
	SergeantHastagaspacho:
		"####" "###" 1 Bright A_SetScale(ScaleX + frandom(0.0015,0.0025),ScaleX)
		"####" "#" 0 A_ChangeVelocity(Velx * 0.975, Vely * 0.975, Velz * 1.05,
		CVF_REPLACE)
		"####" "#" 0 A_Jump(192,"GoingBackToMacDonalds")
		Loop
	GoingBackToMacDonalds:
		"####" "#" 1 Bright A_SetScale(ScaleX + frandom(0.0015,0.0025),ScaleX)
		"####" "#" 0 A_ChangeVelocity(Velx * 0.975, Vely * 0.975, Velz * 1.05,
		CVF_REPLACE)
		"####" "#" 0 A_FadeOut(frandom(0.05,0.075))
		Loop
	}
}

ACTOR LoudmouthParticle : LoudmouthBasis
{
	States
	{
	Spawn:
		TNT1 AA 0 //A_SetScale(frandom(0.015,0.035),ScaleX)
		TNT1 A 0 A_Jump(256,"SpriteA","SpriteB","SpriteC","SpriteD",
		"SpriteE","SpriteF","SpriteG","SpriteH")
	SpriteA:
		FLEM A 0
		Goto CornishGaben
	SpriteB:
		FLEM B 0
		Goto CornishGaben
	SpriteC:
		FLEM C 0
		Goto CornishGaben
	SpriteD:
		FLEM D 0
		Goto CornishGaben
	SpriteE:
		FLEM E 0
		Goto CornishGaben
	SpriteF:
		FLEM F 0
		Goto CornishGaben
	SpriteG:
		FLEM G 0
		Goto CornishGaben
	SpriteH:
		FLEM H 0
	CornishGaben:
		"####" "#" 1 Bright A_JumpIf(Alpha >= 0.95, "FelisNavidad")
		"####" "#" 0 A_FadeIn(frandom(0.05,0.075))
		"####" "#" 0 A_ChangeVelocity(0,0,frandom(-0.1,-0.15),0)
		"####" "#" 0 A_SetScale(ScaleX + frandom(0.0015,0.0025),ScaleX)
		Loop
	FelisNavidad:
		"####" "###" 1 Bright
		"####" "#" 0 A_ChangeVelocity(0,0,frandom(-0.1,-0.15),0)
		"####" "#" 0 A_Jump(192,"HastaLaVista")
		Loop
	HastaLaVista:
		"####" "#" 1 Bright A_SetScale(ScaleX - frandom(0.0015,0.0025),ScaleX)
		"####" "#" 0 A_ChangeVelocity(0,0,frandom(-0.1,-0.15),0)
		"####" "#" 0 A_JumpIf(ScaleX <= 0,"NULL")
		"####" "#" 0 A_FadeOut(frandom(0.1,0.05))
		Loop
	}
}

ACTOR LoudmouthSmokeTrail : LoudmouthBasis
{
	Renderstyle Translucent
	States
	{
	Spawn:
		TNT1 AA 0 A_SetScale(frandom(0.03,0.045),ScaleX)
		TNT1 A 0 A_Jump(256,"SpriteA","SpriteB","SpriteC","SpriteD",
		"SpriteE","SpriteF","SpriteG","SpriteH")
	SpriteA:
		DYMI I 0
		Goto CornishGaben
	SpriteB:
		DYMI J 0
		Goto CornishGaben
	SpriteC:
		DYMI K 0
		Goto CornishGaben
	SpriteD:
		DYMI L 0
		Goto CornishGaben
	SpriteE:
		DYMI E 0
		Goto CornishGaben
	SpriteF:
		DYMI F 0
		Goto CornishGaben
	SpriteG:
		DYMI G 0
		Goto CornishGaben
	SpriteH:
		DYMI H 0
	CornishGaben:
		"####" "#" 1 A_JumpIf(Alpha >= 0.35, "Must.Think.About.Mustard")
		"####" "#" 0 A_FadeIn(frandom(0.05,0.075))
		"####" "#" 0 A_ChangeVelocity(Velx * 0.975, Vely * 0.975, Velz * 1.05,
		CVF_REPLACE)
		"####" "#" 0 A_SetScale(ScaleX + frandom(0.0015,0.0025),ScaleX)
		Loop
	Must.Think.About.Mustard:
		"####" "###" 1 A_SetScale(ScaleX + frandom(0.0015,0.0025),ScaleX)
		"####" "#" 0 A_ChangeVelocity(Velx * 0.975, Vely * 0.975, Velz * 1.05,
		CVF_REPLACE)
		"####" "#" 0 A_Jump(192,"WeHaveNoMoniesHere")
		Loop
	WeHaveNoMoniesHere:
		"####" "#" 1 A_SetScale(ScaleX + frandom(0.002,0.0025),ScaleX)
		"####" "#" 0 A_ChangeVelocity(Velx * 0.975, Vely * 0.975, Velz * 1.05,
		CVF_REPLACE)
		"####" "#" 0 A_FadeOut(frandom(0.0175,0.015))
		Loop
	}
}

//Spawners

ACTOR LoudmouthTrailer : LoudmouthSpawnerBasis
{
	States
	{
	Spawn:
		TNT1 AA 0 A_SpawnItemEx("LoudmouthFlare",frandom(-0.5,0.5),frandom(-0.5,0.5),frandom(-0.5,0.5),0,0,0,0,SXF_CLIENTSIDE,30)
		TNT1 A 0 A_SpawnItemEx("LoudmouthParticle",frandom(-0.5,0.5),frandom(-0.5,0.5),
		frandom(-0.5,0.5),frandom(0.4,0.6),frandom(0.4,0.6),frandom(0.9,1.4),
		frandom(270.0,135.0),SXF_CLIENTSIDE,220)
		TNT1 A random(5,7) A_SpawnItemEx("LoudmouthTrail",frandom(-0.5,0.5),frandom(-0.5,0.5),
		frandom(-0.5,0.5),frandom(0.1,0.2),frandom(0.1,0.2),frandom(0.1,0.2),
		frandom(270.0,135.0),SXF_CLIENTSIDE,150)
		TNT1 A random(5,7) A_SpawnItemEx("LoudmouthSmoke",frandom(-0.5,0.5),frandom(-0.5,0.5),
		frandom(-0.5,0.5),frandom(0.1,0.2),frandom(0.1,0.2),frandom(0.1,0.2),
		frandom(270.0,135.0),SXF_CLIENTSIDE,150)
		TNT1 A 1 A_SpawnItemEx("LoudmouthSmokeTrail",frandom(-0.5,0.5),frandom(-0.5,0.5),
		frandom(-0.5,0.5),frandom(0.1,0.15),frandom(0.1,0.15),frandom(0.1,0.2),
		frandom(270.0,135.0),SXF_CLIENTSIDE,150)
		Stop
	}
}

ACTOR LoudmouthImpact : LoudmouthSpawnerBasis
{
	var int user_count;
	States
	{
	Spawn:
		TNT1 AA 0 A_SetUserVar("user_count", 4)
		TNT1 A 0 A_SpawnItemEx("LoudmouthImpactFlare",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
	CapotaineVodkaSupreme:
		TNT1 AA 0 A_SpawnItemEx("LoudmouthParticle",frandom(-1.5,1.5),frandom(-1.5,1.5),
		frandom(-1.5,1.5),frandom(1.0,1.6),frandom(1.0,1.6),frandom(2.0,2.6),
		frandom(360.0,0.0),SXF_CLIENTSIDE,100)
		TNT1 AAAAA 0 A_SpawnItemEx("LoudmouthTrail",frandom(-1.5,0.5),frandom(-1.5,1.5),
		frandom(-1.5,1.5),frandom(0.4,0.2),frandom(0.4,0.2),frandom(0.4,0.2),
		frandom(360.0,0.0),SXF_CLIENTSIDE,60)
		TNT1 AAAA 0 A_SpawnItemEx("LoudmouthSmokeTrail",frandom(-1.5,1.5),frandom(-1.5,1.5),
		frandom(-1.5,1.5),frandom(0.3,0.15),frandom(0.3,0.15),frandom(0.4,0.2),
		frandom(360.0,0.0),SXF_CLIENTSIDE,60)
		TNT1 A 0 A_SetUserVar("user_count", user_count - 1)
		TNT1 A random(1,2) A_JumpIf(user_count <= 0, "NULL")
		Loop
	}
}