// Some pickups changed so they play a new sound/behave differently

Actor NewMegaSphere : Megasphere replaces Megasphere
{
	-NOGRAVITY
}

Actor NewSoulSphere : Soulsphere replaces Soulsphere
{
	-NOGRAVITY
}

Actor NewTurboSphere : Turbosphere replaces Turbosphere
{
	-NOGRAVITY
}

Actor NewDoomSphere : Doomsphere replaces Doomsphere
{
	-NOGRAVITY
}

Actor NewGuardSphere : Guardsphere replaces Guardsphere
{
	-NOGRAVITY
}

Actor NewGreenArmor : GreenArmor replaces GreenArmor
{
	inventory.pickupsound "Pickups/Armor"
	Scale 1.15
}

Actor NewBlueArmor : BlueArmor replaces BlueArmor
{
	inventory.pickupsound "Pickups/Armor"
	Scale 1.15
}

Actor NewStimpack : Stimpack replaces Stimpack
{
	inventory.pickupsound "Pickups/Stimpack"
}

Actor NewMedikit : Medikit replaces Medikit
{
	inventory.pickupsound "Pickups/Medikit"
}

Actor NewCell : Cell replaces Cell
{
	inventory.pickupsound "Pickups/AmmoPick"
}

Actor NewCellPack : Cellpack replaces Cellpack
{
	inventory.pickupsound "Pickups/AmmoPick"
}

Actor NewClip : Clip replaces Clip
{
	inventory.pickupsound "Pickups/AmmoPick"
}

Actor NewClipbox : Clipbox replaces Clipbox
{
	inventory.pickupsound "Pickups/AmmoPick"
}

Actor NewRocketAmmo : RocketAmmo replaces RocketAmmo
{
	inventory.pickupsound "Pickups/Ammopick"
}

Actor NewRocketBox : RocketBox replaces RocketBox
{
	inventory.pickupsound "Pickups/Ammopick"
}

Actor NewShell : Shell replaces Shell
{
	inventory.pickupsound "Pickups/Ammopick"
}

Actor NewShellBox : ShellBox replaces ShellBox
{
	inventory.pickupsound "Pickups/Ammopick"
}

/*
Actor NewBackPack : Backpack replaces Backpack
{
	inventory.pickupsound "Pickups/Backpack"
}
*/

Actor LifeBoost : Health 11000
{
	Inventory.Amount 15
    Inventory.MaxAmount 200
	inventory.pickupsound "Pickups/LifeBoost"
	Translation "192:207=112:127", "240:247=120:127"
	  +COUNTITEM
	  +INVENTORY.AUTOACTIVATE
	  +INVENTORY.ALWAYSPICKUP
	  +FLOATBOB
	  Inventory.PickupMessage "You received a soul boost !"
	  States
	  {
	  Spawn:
		LBOO A -1 Bright
		Stop
	  }
}

Actor NewRedArmor : BasicArmorpickup 11001
{
	inventory.pickupsound "Pickups/Armor"
	Scale 1.15
	SpawnID 168
	Radius 20
	Height 16
	Armor.Savepercent 66.66666
	Armor.Saveamount 250
	Inventory.Icon "ARMRA0"
	Inventory.Pickupmessage "$PICKUP_REDARMOR"
	DamageFactor "Fire", 0.0
	DamageFactor "Rocket", 0.1
	DamageFactor "Grenade", 0.1
	DamageFactor "Inferno", 0.0
	States
	{
	Spawn:
		ARMR A 6
		ARMR B 6 bright
		goto Spawn
	}
}

Actor TechArmor : CustomInventory 11002
{
  Inventory.Amount 1
  Inventory.PickupSound "misc/p_pkup"
  Inventory.DefMaxAmount
  Inventory.PickupMessage "You got a Psi Armor ! Use 100 cells to activate it !"
  Inventory.Icon ARM4B0
  +Inventory.InvBar
  +FloorClip
  States
  {
  Spawn:
    ARM4 A -1
    Loop
  Use:
	TNT1 A 0 A_JumpIfInventory("Cell", 50, "Succeed")
	TNT1 A 0 A_Print("You need at least 50 cells to use this")
  Fail
  Succeed:
    TNT1 A 0 A_PlaySound("Pickups/TechArmor")
	TNT1 A 0 ACS_ExecuteAlways(605, 0)
    Stop
  }
}

Actor TechArmorProtection : BasicArmorPickup
{
  Inventory.Icon "ARM4A0"
  Armor.SaveAmount 1
  Armor.SavePercent 100
  States
  {
  Spawn:
    TNT1 A 1
    Fail
  }
}

Actor Ankhs : Inventory
{
	inventory.amount 1
	inventory.maxamount 99
	+IGNORESKILL
}

Actor AnkhLvL1 : CustomInventory 15000
{
	inventory.amount 0
	inventory.maxamount 100
	inventory.pickupsound "Pickups/Ankh"
	inventory.pickupmessage "You got an Ankh ! Collect 99 to become invulnerable !"
	-Inventory.INVBAR
	Radius 20
	Height 18
	Scale 0.7
	+NOGRAVITY
	+COUNTITEM
	+IGNORESKILL
	+AUTOACTIVATE
	
	States
	{
		Spawn:
			LIF1 ABCDEFGH 3 Bright
		Loop
		Use:
			TNT1 A 1
			TNT1 A 0 A_GiveInventory("Ankhs", 1)
			TNT1 A 0 A_JumpIfInventory("Ankhs", 99, 1)
		Stop
			TNT1 A 0 A_GiveInventory("InvulnerabilitySphere", 1)
			TNT1 A 0 A_PlaySound("Player/Haha")
			TNT1 A 0 A_TakeInventory("Ankhs", 999)
		Stop
	}
}

Actor AnkhLvL2 : AnkhLvL1 15001
{
	States
	{
		Spawn:
			LIF2 ABCDEFGH 3 Bright
		Loop
		Use:
			TNT1 A 1
			TNT1 A 0 A_GiveInventory("Ankhs", 5)
			TNT1 A 0 A_JumpIfInventory("Ankhs", 99, 1)
		Stop
			TNT1 A 0 A_GiveInventory("InvulnerabilitySphere", 1)
			TNT1 A 0 A_PlaySound("Player/Haha")
			TNT1 A 0 A_TakeInventory("Ankhs", 999)
		Stop
	}
}

Actor AnkhLvL3 : AnkhLvL1 15002
{
	States
	{
		Spawn:
			LIF3 ABCDEFGH 3 Bright
		Loop
		Use:
			TNT1 A 1
			TNT1 A 0 A_GiveInventory("Ankhs", 10)
			TNT1 A 0 A_JumpIfInventory("Ankhs", 99, 1)
		Stop
			TNT1 A 0 A_GiveInventory("InvulnerabilitySphere", 1)
			TNT1 A 0 A_PlaySound("Player/Haha")
			TNT1 A 0 A_TakeInventory("Ankhs", 999)
		Stop
	}
}

Actor AnkhLvL4 : AnkhLvL1 15003
{
	States
	{
		Spawn:
			LIF4 ABCDEFGHIJKLMNO 3 Bright
		Loop
		Use:
			TNT1 A 1
			TNT1 A 0 A_GiveInventory("Ankhs", 25)
			TNT1 A 0 A_JumpIfInventory("Ankhs", 99, 1)
		Stop
			TNT1 A 0 A_GiveInventory("InvulnerabilitySphere", 1)
			TNT1 A 0 A_PlaySound("Player/Haha")
			TNT1 A 0 A_TakeInventory("Ankhs", 999)
		Stop
	}
}
			
// Our favorite weapons do more damage for the sake of DEATHMATCHHHHHHHH

Actor GodFist : Fist
{
	Weapon.SelectionOrder 3700
	Weapon.SlotNumber 1
	
	States
	{
		  Fire:
			PUNG B 4
			PUNG C 4 A_CustomPunch(100*random(6, 18), 1, 0, "PunchPuff", 78)
			PUNG D 5
			PUNG C 4
			PUNG B 5 A_ReFire
		  Goto Ready
	}
}

ACTOR DChainsaw : Chainsaw replaces Chainsaw
{
  Weapon.Kickback 0
  Weapon.SlotNumber 1
  Weapon.SelectionOrder 2200
  Weapon.UpSound "weapons/sawup"
  Weapon.ReadySound "weapons/sawidle"
  Inventory.PickupMessage "$GOTCHAINSAW"
  Obituary "$OB_MPCHAINSAW"
  Tag "$TAG_CHAINSAW"
  Decal "BulletChip"
  +WEAPON.MELEEWEAPON
  States
  {
  Ready:
    SAWG CD 4 A_WeaponReady
    Loop
  Deselect:
    SAWG C 1 A_Lower
    Loop
  Select:
    SAWG C 1 A_Raise
    Loop
  Fire:
    SAWG AB 4 A_Saw("weapons/sawfull", "weapons/sawhit", 9)
    SAWG B 0 A_ReFire
    Goto Ready
  Spawn:
    CSAW A -1
    Stop
  }
}

Actor NewPistol : Pistol replaces Pistol
{
	Weapon.SlotNumber 2
	Weapon.SelectionOrder 1900
	attacksound ""
	Decal "BulletChip"
	States
	{
	  Ready:
		COLT A 1 A_WeaponReady
		Loop
	  Deselect:
		COLT A 1 A_Lower
		Loop
	  Select:
		COLT A 1 A_Raise
		Loop
	  Fire:
		COLT A 0
		COLF A 1 Bright A_FireBullets(1.0,0,1,7)
		TNT1 A 0 A_Playsound("Weapons/NewPist", CHAN_WEAPON)
		COLF A 1 Bright A_Light2
		COLF A 1 Bright A_Light1
		COLT B 3 A_Light0
		COLT CDE 3
		COLT B 3 A_ReFire
		Goto Ready
	  Flash:
		COLF A 3 Bright A_Light1
		COLF A 3 Bright A_Light0
		Goto LightDone
	}
}

Actor NewShotgun : Shotgun replaces Shotgun 
{
	Weapon.SlotNumber 3
	Weapon.SelectionOrder 1300
	Inventory.PickupSound "Pickups/WeaponPick"
	Decal "BulletChip"
	States
	{
	 Fire:
		 SHTG A 0 A_FireBullets (5.6, 1.6, 9, 5) 
		 SHTG A 5 A_GunFlash
		 PKSG B 2 
		 PKSG C 1
		 PKSG D 2
		 PKSG E 3 
		 PKSG F 4
		 PKSG G 1
		 PKSG H 3
		 PKSG GFEDCB 2
		 SHTG A 2 
		 SHTG A 1 A_ReFire
	 Goto Ready
	 Flash:
		 SHTF B 3 Bright A_Light2
		 SHTF A 2 Bright A_Light1
	 Goto LightDone
	}
}

Actor NewSuperShotgun : Weapon replaces SuperShotgun
{
  Weapon.SlotNumber 3
  Weapon.SelectionOrder 400
  Weapon.AmmoUse 2
  Weapon.AmmoGive 8
  Weapon.AmmoType "Shell"
  Inventory.PickupMessage "$GOTSHOTGUN2" // "You got the super shotgun!"
  Obituary "$OB_MPSSHOTGUN" // "%o was splattered by %k's super shotgun."  
  attacksound "weapons/newssgf"
  Inventory.PickupSound "Pickups/WeaponPick"
  Decal "BulletChip"
  States
  {
  Ready:
    SHT2 A 1 A_WeaponReady
    Loop
  Deselect:
    SHT2 A 1 A_Lower
    Loop
  Select:
    SHT2 A 1 A_Raise
    Loop  
  Fire:
    SHT2 A 3
    TNT1 A 0 A_FireBullets (10.6, 6.4, 20, 6)
    SHT2 A 7 A_GunFlash
    SHT2 B 7
    SHT2 C 7 A_CheckReload
    SHT2 D 7 A_PlaySoundEx ("weapons/sshoto", CHAN_BODY)
    SHT2 E 7
    SHT2 F 7 A_PlaySoundEx ("weapons/sshotl", CHAN_BODY)
    SHT2 G 6
	TNT1 A 0 A_PlaySoundEx ("weapons/sshotc", CHAN_BODY)
    SHT2 H 6 A_Refire
    SHT2 A 5 A_Refire
    Goto Ready
  Flash:
    SHT2 I 4 Bright A_Light1
    SHT2 J 3 Bright A_Light2
    Goto LightDone
  Spawn:
    SGN2 A -1
    Stop	
  }  
}

Actor NewChaingun : Chaingun replaces Chaingun
{
	Weapon.SlotNumber 4
	Weapon.SelectionOrder 700
	attacksound ""
	Inventory.PickupSound "Pickups/WeaponPick"
	Decal "BulletChip"
	States
	{
	Fire:
		CHGG A 0 A_FireBullets (4.8, 0.8, 1, random(6,7), "BulletPuff")
		TNT1 A 0 A_PlaySound("Weapons/NewCGF", CHAN_WEAPON)
		CHGG B 4 Bright A_GunFlash
		TNT1 A 0 A_PlaySound("Weapons/NewCGF", CHAN_WEAPON)
		CHGG C 4 Bright A_FireBullets (4.8, 0.8, 1, random(6,7), "BulletPuff")
		CHGG B 0 A_ReFire
		Goto Ready
	Flash:
		TNT1 A 4 bright A_Light1
		TNT1 B 5 bright A_Light2
		CHGF A 0 bright A_Light0
		stop
	}
}

Actor SuperMinigun : Minigun replaces Minigun
{
    Weapon.Selectionorder 700
	Weapon.SlotNumber 4
	attacksound ""
	Inventory.PickupSound "Pickups/WeaponPick"
	Decal "BulletChip"
	XScale 1.25
	YScale 1.1
	 States
	 {
	  Spawn:
		MINP A -1
		Loop
	  Ready:
		MINI A 1 A_WeaponReady
		Loop
	  Deselect:
		MINI A 1 A_Lower
		Loop
	  Select: 
		MINI A 1 A_Raise 
		Loop  
	  Fire:
		MINI A 2
		TNT1 A 0 A_PlaySound("Weapons/MinigunWindup", CHAN_WEAPON)
		MINI AB 4
		MINI AB 3
		MINI AB 2
	  Goto Hold
	  Hold:
		TNT1 A 0 A_GunFlash
		TNT1 A 0 A_PlaySound("Weapons/MinigunFire", 5)
		MINI A 2 A_FireBullets(5.2, 0.5, 1, 6, "BulletPuff")
		TNT1 A 0 A_PlaySound("Weapons/MinigunFire", 5)
		MINI B 2 A_FireBullets(5.2, 0.5, 1, 6, "BulletPuff")
		TNT1 A 0 A_PlaySound("Weapons/MinigunFire", 5)
		MINI A 2 A_FireBullets(5.2, 0.5, 1, 6, "BulletPuff")
		TNT1 A 0 A_PlaySound("Weapons/MinigunFire", 5)
		MINI B 2 A_FireBullets(5.2, 0.5, 1, 6, "BulletPuff")
		MINI A 2 A_ReFire
		TNT1 A 0 A_PlaySound("Weapons/MinigunWindDown", CHAN_WEAPON)
		MINI BA 2
		MINI BA 3
		MINI BA 4
	  Goto Ready 
	  Flash: 
		MINI C 3 BRIGHT A_Light1
		MINI DE 2 BRIGHT
		MINI F 3 BRIGHT A_Light0
	  Stop 
	}
}

Actor NewRocketLauncher : RocketLauncher replaces RocketLauncher
{
	Weapon.SlotNumber 5
	Weapon.SelectionOrder 2500
	Inventory.PickupSound "Pickups/WeaponPick"
	States
	{
	Fire:
		PKRL A 2 
		PKRL A 4 A_GunFlash
		PKRL B 2
		PKRL D 3 A_FireCustomMissile("NewRocket")
		PKRL C 3
		PKRL BE 2
		PKRL FG 1
		PKRL A 0 A_ReFire
		Goto Ready
	Flash:
		PKRF A 3 Bright A_Light1
		PKRF B 2 Bright
		PKRF C 2 Bright A_Light2
		PKRF DE 3 Bright
		Goto LightDone
	}
}

Actor NewRocket : Rocket
{
	Speed 32
	Decal "Scorch"
}

Actor NewGrenadeLauncher : GrenadeLauncher replaces GrenadeLauncher
{
	Weapon.SlotNumber 5
	Weapon.SelectionOrder 2500
	Inventory.PickupSound "Pickups/WeaponPick"
	Attacksound ""
	XScale 1.25
	YScale 1.15
	States
	{
		Ready:
			GLAN I -1
			Stop
		  Ready:
			GLAN A 1 A_WeaponReady
			Loop
		  Deselect:
			GLAN A 1 A_Lower
			Loop
		  Select: 
			GLAN A 1 A_Raise
			Loop
		  Fire: 
			GLAN B 4 Bright
			TNT1 A 0 A_FireCustomMissile ("NewGrenade", 0, 1, 0, 0, 0, 4.2 )
			TNT1 A 0 A_PlayWeaponSound("Weapons/NewGrenadeFire")
			GLAN CD 4
			GLAN EF 5
			TNT1 A 0 A_PlaySound("Weapons/NewGrenadeOut")
			GLAN H 5
			TNT1 A 0 A_PlaySound("Weapons/NewGrenadeLoad")
			GLAN A 2 A_ReFire
			Goto Ready 
		Spawn:
			GLAN P -1
			Stop
    }
}

Actor NewGrenade : Grenade
{
	speed 29
	Damage (random(80, 160))
	SeeSound ""
	Scale 0.6
	Radius 16
	Height 12
	Gravity 0.3
	DeathSound "Weapons/NewGrenadeExplode"
	States
	{
		Spawn:
			GREN A 1
		Loop
		Death:
			MISL B 8 Bright A_Explode(144, 144)
			MISL C 6 Bright
			MISL D 4 Bright	
		Stop
	}
}
	
Actor NewPlasmaRifle : PlasmaRifle replaces PlasmaRifle
{
	Weapon.SlotNumber 6
	Weapon.SelectionOrder 100
	Inventory.PickupSound "Pickups/WeaponPick"
	States
	{
	Fire:
		PKPL A 3 A_FirePlasma
		PKPL B 1 A_ReFire
		PKPL DEF 1
		PKPL GF 3
		PKPL EDCBA 2
		Goto Ready
	Flash:
		PLSF B 2 Bright A_Light1
		PLSF A 2 Bright A_Light1
		Goto LightDone
		PLSF C 2 Bright A_Light1
		PLSF D 2 Bright A_Light1
		Goto LightDone
	}
}


Actor NewPlasmaBall : PlasmaBall replaces PlasmaBall
{
	Damage (random(15,40))
	Decal "PlasmaScorch"
}

Actor RailCounter : Inventory
{
	inventory.amount 1
	inventory.maxamount 1
}

Actor RailgunFlasher
{
	Height 1
	Radius 1
	States
	{
		Spawn:
			TNT1 A 6
		Stop
	}
}

ACTOR NewRailgun : Weapon replaces Railgun
{
  Radius 22
  Height 18
  Weapon.Selectionorder 100
  Weapon.AmmoUse 10
  Weapon.AmmoGive 40
  Weapon.AmmoType "Cell"
  Weapon.SlotNumber 6
  Inventory.Pickupmessage "$PICKUP_RAILGUN"
  Obituary "$OB_RAILGUN"
  Inventory.PickupSound "Pickups/WeaponPick"
  Scale 1.1
  Decal "RailScorchX"
  States
  {
  Ready:
    TNT1 A 0 A_PlayWeaponsound("Weapons/NewRailgunLoop")
    NRAI L 30 A_WeaponReady
    Loop
  Deselect:
    NRAI L 1 A_Lower
    Loop
  Select:
    NRAI L 1 A_Raise
    Loop
  Fire:
	TNT1 A 0 A_JumpIfInventory("RailCounter", 1, "Fire2")
	TNT1 A 0 A_GiveInventory("RailCounter", 1)  
    NRAI A 2 Bright
	TNT1 A 0 A_RailAttack(100, 0, 1, "RoyalBlue", "LightSlateBlue") // names found from the zdoom lump xg11rgb
	TNT1 A 0 A_GunFlash
	TNT1 A 0 A_PlaySound("Weapons/NewRailgunFire")
	NRAI A 2 Bright
    NRAI B 4 Bright
  Goto RailCool
  Fire2:
    NRAI C 2 Bright
	TNT1 A 0 A_RailAttack(100, 0, 1, "RoyalBlue", "LightSlateBlue")
	TNT1 A 0 A_GunFlash
	TNT1 A 0 A_PlaySound("Weapons/NewRailgunFire")
	NRAI C 2 Bright
	NRAI D 4 Bright
	TNT1 A 0 A_TakeInventory("RailCounter", 1)
  RailCool:
	NRAI FG 3
	NRAI H 5
	NRAI I 6
	NRAI H 4
	NRAI GF 3
	NRAI J 5
  Goto Ready
  Flash:
	TNT1 A 0 A_SpawnItemEx("RailgunFlasher")
    TNT1 A 5 bright A_Light1
    TNT1 A 5 bright A_Light2
    TNT1 A 0 bright A_Light0
    Goto LightDone
  Spawn:
    NRAI E -1
    Stop
  }
}

Actor "BFG9000 " : BFG9000 replaces BFG9000
{
	Weapon.SelectionOrder 2800
	Weapon.SlotNumber 7
	Inventory.PickupSound "Pickups/WeaponPick"
}

Actor NewBFGBall : BFGBall replaces BFGBall
{
	Damage (random(400, 800))
	Decal "BFGScorch"
	Decal "BFGLightning"
}

// PLAYER CLASS

actor Doomguy : DoomPlayer replaces DoomPlayer {
	player.displayname "Doomguy"
	Player.StartItem "NewPistol"
    Player.StartItem "Fist"
    Player.StartItem "Clip", 50	
	Player.WeaponSlot 2, NewPistol
	States
	{
	  Death:
		PLAY H 0 A_PlayerSkinCheck("AltSkinDeath")
	  Death1:
		PLAY H 10
		PLAY I 10 A_PlayerScream
		PLAY J 10 A_NoBlocking
		PLAY KLM 10
		PLAY N -1
		Stop
	  XDeath:
		PLAY O 0 A_PlayerSkinCheck("AltSkinXDeath")
	  XDeath1:
		PLAY O 5
		PLAY P 5 A_XScream
		PLAY Q 5 A_NoBlocking
		PLAY RSTUV 5
		PLAY W -1
		Stop
	  AltSkinDeath:
		PLAY H 6
		PLAY I 6 A_PlayerScream
		PLAY JK 6
		PLAY L 6 A_NoBlocking
		PLAY MNO 6
		PLAY P -1
		Stop
	  AltSkinXDeath:
		PLAY Q 5 A_PlayerScream
		PLAY R 0 A_NoBlocking
		PLAY R 5 A_SkullPop
		PLAY STUVWX 5
		PLAY Y -1
		Stop	
	  Death.RottGodBall:
		TNT1 A 0 A_NoBlocking
		TNT1 A 0 A_PlayerScream
		TNT1 A 1 A_SpawnItem("RGodModeDeath")
		BLAN A -1 // Workaround for "ghost players" bug
		Stop
	  Death.Inferno:
		TNT1 A 0 A_GiveToTarget("FakeBurner", 10)
	  Death.FireWallFlame:
		TNT1 A 1
		TNT1 AA 0 A_PlaySoundEx("Burned", 5)
		TNT1 A 0 A_SpawnItem("HumanFireSpawner")
		BLAN A -1
	  Stop
	}
}

// AND SOME NEW WEAPONS TO SPICE THINGS UP !

actor Riotgun : Weapon 10020
{ 
  weapon.selectionorder 407
  weapon.slotnumber 3
  Weapon.AmmoUse2 0
  Weapon.AmmoGive2 8
  Weapon.AmmoType2 "Shell"
  +WEAPON.ALT_AMMO_OPTIONAL
  +WEAPON.AMMO_OPTIONAL
  +WEAPON.NOAUTOFIRE // this gotta be removed
  Weapon.AmmoUse1 1
  Weapon.AmmoGive1 4
  Weapon.AmmoType1 "RiotIn"
  Obituary "%o was blown new holes by %k's riotgun."
  attacksound "Weapons/RiotgunFire"
  inventory.pickupmessage "You got the riot gun"
  Inventory.PickupSound "Pickups/WeaponPick"
  Radius 24
  Height 16
  Decal "BulletChip"
  States
  {
  Ready:
    TNT1 A 0 A_JumpIfInventory("RiotMode",1,"ModeReady") // RIOT A 1
    RIOT A 1 A_WeaponReady
    Loop
  ModeReady:
	RITO A 1 A_WeaponReady
	Loop
  Deselect:
	TNT1 A 0 A_JumpIfInventory("RiotMode",1,2)
    RIOT A 1 A_Lower
    Loop
	RITO A 1 A_Lower
	Goto Deselect+2
  Select:
    TNT1 A 0 A_PlaySound("Weapons/RiotgunUp")
	TNT1 A 0 A_JumpIfInventory("RiotMode",1,2)
    RIOT A 1 A_Raise
    Goto Select+2
	RITO A 1 A_Raise
	Goto Select+3
  Fire:
	RIOT A 0 A_JumpIfNoAmmo("Reload")
    RIOT A 0 A_JumpIfInventory("RiotMode",1,"RiotFast")
	RIOT D 3 Bright A_FireBullets (4.0, 3.2, 5, 5)
	RIOT EKL 1 Bright
	RIOT F 2
	RIOT ABCJ 4
	RIOT A 0 A_JumpIfNoAmmo("Reload")
	RIOT A 0 A_ReFire
    Goto Ready
  RiotFast:
    RIOT A 0 A_JumpIfInventory("RiotIn",4,"Fire1")
    RIOT A 0 A_JumpIfInventory("RiotIn",3,"Fire2")
    RIOT A 0 A_JumpIfInventory("RiotIn",2,"Fire3")
    RIOT A 0 A_JumpIfInventory("RiotIn",1,"Fire4")
	Goto Reload
  Fire1:
	RITO D 2 Bright A_FireBullets (5.6,5.6,random(5,6), 5)
	RITO E 2 Bright
	RITO F 2
	RITO D 2 Bright A_FireBullets (5.6,5.6,random(5,6), 5)
	RITO E 2 Bright
	RITO F 2
	RITO D 2 Bright A_FireBullets (5.6,5.6,random(5,6), 5)
	RITO E 2 Bright
	RITO F 2
	RITO D 2 Bright A_FireBullets (5.6,5.6,random(5,6), 5)
	RITO E 2 Bright
	RITO F 2
	RITO A 0 A_JumpIfNoAmmo("Reload2")
    Goto Ready
  Fire2:
	RITO D 2 Bright A_FireBullets (5.6,5.6,random(5,6), 5)
	RITO E 2 Bright
	RITO F 2
	RITO D 2 Bright A_FireBullets (5.6,5.6,random(5,6), 5)
	RITO E 2 Bright
	RITO F 2
	RITO D 2 Bright A_FireBullets (5.6,5.6,random(5,6), 5)
	RITO E 2 Bright
	RITO F 2
	RITO A 0 A_JumpIfNoAmmo("Reload2")
    Goto Ready
  Fire3:
	RITO D 2 Bright A_FireBullets (5.6,5.6,random(5,6), 5)
	RITO E 2 Bright
	RITO F 2
	RITO D 2 Bright A_FireBullets (5.6,5.6,random(5,6), 5)
	RITO E 2 Bright
	RITO F 2
	RITO A 0 A_JumpIfNoAmmo("Reload2")
    Goto Ready
  Fire4:
	RITO D 2 Bright A_FireBullets (5.6,5.6,random(5,6), 5)
	RITO E 2 Bright
	RITO F 2
	RITO A 0 A_JumpIfNoAmmo("Reload2")
    Goto Ready
  Reload:
    RIOT A 0 A_JumpIfInventory("Shell",1,1)
	Goto Ready
    RIOT AGH 3
	TNT1 A 0 A_PlaySound("Weapons/RiotgunUp")
	RIOT I 9
	TNT1 A 0 ACS_ExecuteAlways(601, 0, 1)
	RIOT I 9
	RIOT H 3
	TNT1 A 0 A_PlaySound("Weapons/RiotgunLoad")
	RIOT G 3
	RITO K 3
	Goto Ready
  Reload2:
    RIOT A 0 A_JumpIfInventory("Shell",1,1)
	Goto Ready
	RIOT GH 4
	TNT1 A 0 A_PlaySound("Weapons/RiotgunUp")
	RIOT I 9
	TNT1 A 0 ACS_ExecuteAlways(601, 0, 1)
	RIOT I 9
	RIOT H 3
	TNT1 A 0 A_PlaySound("Weapons/RiotgunLoad")
	RIOT G 3
	RITO K 3
	Goto Ready 
  AltFire:
    RIOT A 0 A_PlaySound("Weapons/RiotgunLoad")
    RIOT A 1
    RIOT A 0 A_JumpIfInventory("RiotMode",1,"RiotOff")
    RIOT A 6 A_GiveInventory("RiotMode",99)
	Goto Ready
  RiotOff:
    RIOT A 9 A_TakeInventory("RiotMode",99)
	Goto Ready
  Spawn:
    SSTG A -1
    Stop
  }
}

ACTOR RiotMode : Ammo
{
  Inventory.PickupMessage "Wut?"
  Inventory.Amount 0
  Inventory.MaxAmount 1
  Inventory.Icon "TNT1A0"
  States
  {
  Spawn:
    TNT1 A 1
    Stop
  }
}

ACTOR RiotIn : Ammo
{
  Inventory.PickupMessage "Wut?"
  Inventory.Amount 4
  Inventory.MaxAmount 4
  +IGNORESKILL // Caused you to get more ammo despite having lesser shells
  States
  {
  Spawn:
    TNT1 A -1
    loop
  }
}

Actor PlasmaParticle
{
	Speed 21
	Height 24
	Radius 24
	Damage (random(56,72))
	Decal "BigPlasmaScorch"
	Projectile
	+NOTARGET
	Alpha 0.85
	Renderstyle Add
	States
	{
		Spawn:
			PBAL A 2 Bright A_Explode(random(6,12), 40, 0)
			TNT1 A 0 A_JumpIfInTargetInventory("Detonated", 1, "Death2")
			PBAL B 2 Bright A_Explode(random(6,12), 40, 0)
			TNT1 A 0 A_JumpIfInTargetInventory("Detonated", 1, "Death2")
			PBAL C 2 Bright A_Explode(random(6,12), 40, 0)
			TNT1 A 0 A_JumpIfInTargetInventory("Detonated", 1, "Death2")
			PBAL D 2 Bright A_Explode(random(6,12), 40, 0)
			TNT1 A 0 A_JumpIfInTargetInventory("Detonated", 1, "Death2")
			PBAL E 2 Bright A_Explode(random(6,12), 40, 0)
			TNT1 A 0 A_JumpIfInTargetInventory("Detonated", 1, "Death2")
			PBAL F 2 Bright A_Explode(random(6,12), 40, 0)
			TNT1 A 0 A_JumpIfInTargetInventory("Detonated", 1, "Death2")
			PBAL G 2 Bright A_Explode(random(6,12), 40, 0)
			TNT1 A 0 A_JumpIfInTargetInventory("Detonated", 1, "Death2")
			PBAL H 2 Bright A_Explode(random(6,12), 40, 0)
			TNT1 A 0 A_JumpIfInTargetInventory("Detonated", 1, "Death2")
			PBAL I 2 Bright A_Explode(random(6,12), 40, 0)
			TNT1 A 0 A_JumpIfInTargetInventory("Detonated", 1, "Death2")
			PBAL J 2 Bright A_Explode(random(6,12), 40, 0)
			TNT1 A 0 A_JumpIfInTargetInventory("Detonated", 1, "Death2")
			PBAL ABCDEFGHIJABCD 1 Bright A_ScaleVelocity(1.085)
			TNT1 A 0 A_Stop
		Goto BigBoom
		Death:
			TNT1 A 0 A_PlaySound("Weapons/PlasmaCannonBoom")
			PBAB ABCDEFGHIJK 2 Bright A_FadeOut(0.06)
		Stop
		BigBoom:
			TNT1 A 1 A_SpawnItem("PlasmaVortex")
			TNT1 AAAAAAAAAAAA 2 A_Explode(184, 184, 0)
		Stop
		Death2:
			TNT1 A 0 A_Stop
			TNT1 A 1 A_SpawnItem("PlasmaVortex")
			TNT1 AAAAAAAAAAAA 2 A_Explode(184, 168, 1)
		Stop
	}
}

Actor PlasmaVortex
{
	Height 32
	Radius 32
	Alpha 0.85
	Scale 1.5
	RenderStyle Add
	+NOGRAVITY
	States
	{
		Spawn:
			TNT1 A 0 
			TNT1 A 0 A_PlaySound("Weapons/PlasmaCannonBigBoom")
			VORT ABCDEFGHIJKLMNOPQRSTUVWXY 1 Bright A_FadeOut(0.02)
			/*
			VORT AB 1 Bright A_FadeOut(0.02)
			TNT1 A 0 A_SetScale(1.53, 1.53)
			VORT CD 1 Bright A_FadeOut(0.02)
			TNT1 A 0 A_SetScale(1.56, 1.56)
			VORT EF 1 Bright A_FadeOut(0.02)
			TNT1 A 0 A_SetScale(1.62, 1.62)
			VORT GH 1 Bright A_FadeOut(0.02)
			TNT1 A 0 A_SetScale(1.65, 1.65)
			VORT IJ 1 Bright A_FadeOut(0.02)
			TNT1 A 0 A_SetScale(1.7, 1.8)
			VORT KL 1 Bright A_FadeOut(0.02)
			TNT1 A 0 A_SetScale(1.65, 1.65)
			VORT MN 1 Bright A_FadeOut(0.02)
			TNT1 A 0 A_SetScale(1.6, 1.6)
			VORT OP 1 Bright A_FadeOut(0.02)
			TNT1 A 0 A_SetScale(1.55, 1.55)
			VORT QR 1 Bright A_FadeOut(0.02)
			TNT1 A 0 A_SetScale(1.5, 1.5)
			VORT ST 1 Bright A_FadeOut(0.02)
			TNT1 A 0 A_SetScale(1.45, 1.45)
			VORT UV 1 Bright A_FadeOut(0.02)
			TNT1 A 0 A_SetScale(1.4, 1.4)
			VORT WX 1 Bright A_FadeOut(0.02)
			TNT1 A 0 A_SetScale(1.35, 1.35)
			VORT Y 1 Bright A_FadeOut(0.02)
			*/
		Stop
	}
}

Actor PlasmaCannon : Weapon  10021
{
  weapon.selectionorder 90
  weapon.slotnumber 6
  Weapon.AmmoUse 10
  Weapon.AmmoGive 40
  Weapon.AmmoType "Cell"
  Obituary "%o was evaporated by %k's Plasma Cannon."
  inventory.pickupmessage "You got the plasma cannon !"
  Inventory.PickupSound "Pickups/WeaponPick"
  Radius 32
  Height 20
  Scale 0.8
  States
  {
	  Spawn:
		  PCAN A -1
	  Stop
	  Ready:
		  PCAN B 1 A_WeaponReady
	  Loop
	  Select:
		  PCAN B 1 A_Raise
	  Loop
	  Deselect:
		  PCAN B 1 A_Lower
	  Loop
	  Fire:
		PCAN C 2 Bright
		TNT1 A 0 A_PlaySound("Weapons/PlasmaCannonFire", CHAN_WEAPON)
		TNT1 A 0 A_FireCustomMissile("PlasmaParticle")
		PCAN C 5 Bright
		PCAN DE 6 Bright
		PCAN F 7
		PCAN B 5
	  Goto Ready
  }
}

Actor Detonated : Inventory
{
	inventory.amount 1
	inventory.maxamount 1
}

Actor RGodModePickup : CustomInventory 10023 // so that this powerup can actually respawn
{
	inventory.amount 1
	Inventory.PickupMessage "You are now a GOD ! Wreak HAVOC !"
	Inventory.PickupSound "God/Pickup"
    Scale 0.6
	Height 32
	Radius 18	
	States
	{
        Spawn:
			GITM ABCDEFGH 4
        Loop	
		Pickup:
			TNT1 A 0 A_ChangeFlag("PICKUP", 0)
			TNT1 A 0 A_TakeInventory("GodFist", 999)
			TNT1 A 0 A_TakeInventory("Fist",999)
			TNT1 A 0 A_TakeInventory("Chainsaw",999)
			TNT1 A 0 A_TakeInventory("NewPistol",999)
			TNT1 A 0 A_TakeInventory("NewShotgun",999)
			TNT1 A 0 A_TakeInventory("NewSuperShotgun",999)
			TNT1 A 0 A_TakeInventory("NewChaingun",999)
			TNT1 A 0 A_TakeInventory("SuperMinigun",999)
			TNT1 A 0 A_TakeInventory("NewRocketLauncher",999)
			TNT1 A 0 A_TakeInventory("NewGrenadeLauncher",999)
			TNT1 A 0 A_TakeInventory("NewPlasmaRifle",999)
			TNT1 A 0 A_TakeInventory("NewRailGun",999)
			TNT1 A 0 A_TakeInventory("BFG9000",999)
			TNT1 A 0 A_TakeInventory("BFG10K",999)
			TNT1 A 0 A_TakeInventory("Riotgun",999)
			TNT1 A 0 A_TakeInventory("PlasmaCannon",999)
			TNT1 A 0 A_TakeInventory("Hellgate", 999)
			TNT1 A 0 A_TakeInventory("RPG", 999)
			TNT1 A 0 A_TakeInventory("HeavyShotgun", 999)
			TNT1 A 0 A_TakeInventory("RipperCannon", 999)
			TNT1 A 0 A_TakeInventory("Devastator", 999)
			TNT1 A 0 A_TakeInventory("LifeLeech", 999)
			TNT1 A 0 A_TakeInventory("MissileLauncher", 999)
			TNT1 A 0 A_TakeInventory("FlameWall", 999)
			TNT1 A 0 A_TakeInventory("Bazooka", 999)
			TNT1 A 0 A_TakeInventory(" Drunk Missile Launcher ", 999)
			TNT1 A 0 A_TakeInventory("FireBomb", 999)
			TNT1 A 0 A_GiveInventory("RGodMode", 1)
			TNT1 A 0 A_GiveInventory("GodModePowerX")
			TNT1 A 0 A_GiveInventory("GodModeSounder", 1)
		Stop
	}
}

Actor GodModeSounder : CustomInventory
{
	inventory.amount 1
	inventory.maxamount 1
	+Inventory.AUTOACTIVATE
	
	States
	{
		Use:
			TNT1 A 0 ACS_ExecuteAlways(604, 0)
		Stop
	}
}

Actor PickupRevert : CustomInventory
{
	inventory.amount 1
	inventory.maxamount 1
	+Inventory.AUTOACTIVATE
	
	States
	{
		Use:
			TNT1 A 0 A_ChangeFlag("PICKUP", 1)
		Stop
	}
}

Actor HaloSpawner : CustomInventory
{
 Inventory.Amount 1
 Inventory.MaxAmount 0
 +INVENTORY.AUTOACTIVATE
 +INVENTORY.ALWAYSPICKUP
 +INVENTORY.UNDROPPABLE
 -INVENTORY.INVBAR
 States
 {
   Spawn:
	TNT1 A 1
	Wait

   Use:
	TNT1 A 1 A_SpawnItemEx("Halo", 0, 0, 0, 0, 0, 0, 0, SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	Stop
 }
}

Actor Halo
{
	Radius 4
	Height 32
	+NOBLOCKMAP
	+NOCLIP
	+NOGRAVITY
	+CLIENTSIDEONLY
	-SOLID
	-SHOOTABLE
	+DROPOFF
	+NOTELEPORT
	
	States
	{
		Spawn:
			HALO A 2 Bright
		Stop
	}
}
	
ACTOR RGodMode : Weapon 10022
{
    Inventory.PickupMessage "You are now a GOD ! Wreak HAVOC !"
    Inventory.PickupSound "God/Pickup"
    Weapon.SelectionOrder 1
    AttackSound ""
//    +EXTREMEDEATH
    Scale 0.6
	Height 32
	Radius 18
    States
    {
      Spawn:
        GITM ABCDEFGH 3 Bright
        Loop
      Ready:
        GHND A 16 A_WeaponReady
        Loop
      Deselect:
        GHND A 0
        GHND A 1
        goto Ready
      Select:
        GHND A 0
        GHND A 0 ACS_Execute(599,0)
        GHND A 1 A_Raise
        Loop
      Fire:
        GHND B 6 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
		GHND CD 5 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
        TNT1 A 0 A_PlayWeaponSound("GodFire")
		TNT1 A 0 A_FireCustomMissile("RGodBall")
        GHND E 5 Bright A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
        GHND F 5 Bright A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
        GHND G 6 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
        Goto Ready
    }
}

Actor GodModePowerX : PowerProtection
{
	damagefactor "normal", 0.0
	DamageFactor "RottGodBall", 1.0
	powerup.duration 0x7FFFFFFF
}

actor RGodBall
{
    Radius 10
    Height 10
    Speed 20
    Damage 100
	DamageType "RottGodBall"
	Decal "Scorch"
    RenderStyle ADD
    Alpha 0.67
    +SEEKERMISSILE
    +NOGRAVITY
    +THRUGHOST
    +Ripper
    +DontSplash
    +LookAllAround
    +SPECTRAL
    ReactionTime 175
    Projectile
    DontHurtShooter
    DeathSound "GodFire/See"
    SeeSound "GodSpawn"
	Obituary "%o met %p maker."
    States
    {
      Spawn:
        GOD1 ABCD 4 Bright A_SeekerMissile (90,90)
	  Loop
      Death:
        REXP A 3 Bright A_Explode(200, 128, 0)
		REXP BCDEFGHIJKLMNOPQRST 3 Bright
        Stop
    }
}

Actor RGodSparkle
{
	Height 1
	Radius 1
	Speed 4
	Damage 0
	Alpha 0.9
	Scale 0.75
	Renderstyle Add
	-SOLID
	-SHOOTABLE
	+NOGRAVITY
	+RIPPER
	+BLOODLESSIMPACT
	
	States
	{
		Spawn:
			VAPO J 4 Bright A_FadeOut(0.075)
		Wait
	}
}	

Actor RGodSparkleSpawner
{
	Speed 0
	Damage 0
	-SOLID
	-SHOOTABLE
	-TELESTOMP
	+NOGRAVITY
	
	States
	{
		Spawn:
			TNT1 AAAAAA 2 A_SpawnItemEx("RGodSparkle", random(-8,8), random(-8,8), random(-8,8), random(-6,6), random(-6,6), random(0,6))
		Stop
	}
}

Actor RGodBigSparkle : RGodSparkle
{	
	States
	{
		Spawn:
			VAPO IIIIIII 4 Bright ThrustThingZ(0, 4, 0, 1)
			VAPO I 4 Bright A_FadeOut(0.1)
		Goto Spawn+7
	}
}
		
Actor RGodModeDeath
{
	Radius 8
	Height 8
	Scale 0.65
	-SHOOTABLE
	-TELESTOMP
	-SOLID
	
	States
	{
		Spawn:
			VAPO ABCD 3 Bright A_SpawnItem("RGodSparkleSpawner", 0, 12)
			VAPO E 4 Bright A_SpawnItem("RGodbigSparkle", 12)
			VAPO FG 3 Bright A_SpawnItem("RGodSparkleSpawner", 0, 12)
		Stop
	}
}

ACTOR HellGate : Weapon 10024
{	
   Inventory.PickupMessage "You got a strange artifact."
   Obituary "%o was roasted by %k's Hell Gate."
   Weapon.AmmoType "Burner"
   Weapon.AmmoGive 25
   Weapon.SelectionOrder 50
   Weapon.Slotnumber 6
   Weapon.AmmoUse 1
   Radius 24
   Inventory.PickupSound "Pickups/WeaponPick"
   States
   {
   Spawn:
      WINC A -1
      Loop
   Ready:
      TNT1 A 0 A_TakeInventory("FireCounter", 999)
	  TNT1 A 0 A_TakeInventory("Charged", 1)
      INCG BCDEDC 5 A_weaponReady
   Loop
   Deselect:
      TNT1 A 0 A_TakeInventory("FireCounter", 999)
	  TNT1 A 0 A_TakeInventory("Charged", 1)
      INCG A 1 A_Lower
      Loop
   Select:
      TNT1 A 0 A_TakeInventory("FireCounter", 999)
	  TNT1 A 0 A_TakeInventory("Charged", 1)
      INCG A 1 A_Raise
      Loop
   Fire:
	  TNT1 A 0 A_JumpIfInventory("FireCounter", 15, "FireMore")
      INCG NOP 2 Bright A_FireCustomMissile("BBQFlame",0,1,0,0)
	  TNT1 A 0 A_GiveInventory("FireCounter", 1)
      INCG E 5 Bright A_Refire
	  TNT1 A 0 A_TakeInventory("FireCounter", 999)
	  TNT1 A 0 A_TakeInventory("Charged", 1)
      INCG DCB 5 Bright
      Goto Ready
   FireMore:
	  TNT1 A 0 A_JumpIfInventory("Charged", 1, 3)
	  TNT1 A 0 A_PlayWeaponSound("Weapons/HellGateCharged")
	  TNT1 A 0 A_GiveInventory("Charged", 1)
	  INCG FGHIJKL 3 Bright
   Goto Hold2
   Hold2:
	  INCG QRS 2 Bright A_FireCustomMissile("BBQFlame", 0, 1, 0, 0)
	  TNT1 AAAA 0 A_FireCustomMissile("BBQFlame", random(-4,4))
	  TNT1 A 0 A_FireCustomMissile("BBQSkull")
	  TNT1 A 0 A_FireCustomMissile("BBQSkull", 16)
	  TNT1 A 0 A_FireCustomMissile("BBQSkull", -16)
	  INCG TU 2 Bright A_FireCustomMissile("BBQFlame", 0, 1, 0, 0)
	  INCG L 4 Bright A_Refire
	  INCG KJIHGF 4 Bright
	  TNT1 A 0 A_TakeInventory("FireCounter", 999)
	  TNT1 A 0 A_TakeInventory("Charged", 1)
   Goto Ready
   }
}

ACTOR BBQFlame
{
   Radius 3
   Height 4
   Speed 20
   Damage (random(4,9))
   PROJECTILE
   RENDERSTYLE ADD
   DamageType "Inferno"
   ALPHA 0.67
   Scale 0.67
   SeeSound "weapons/flamer"
   DeathSound "weapons/scorch"
   +THRUGHOST
   +FORCEXYBILLBOARD
   States
   {
   Spawn:
      TNT1 A 2 Bright
      FRFX ABCD 2 Bright A_Explode(5,8,0)
      FRFX D 0 Bright A_Lowgravity
      FRFX EFG 2 Bright A_Explode(5,16,0)
      FRFX HIJ 2 Bright A_Explode(5,32,0)
      FRFX KLM 2 Bright A_Explode(5,64,0)
      FRFX NO 2 Bright
      stop
   Death:
      FRFX HIJ 2 Bright A_Explode(5,32,0)
      FRFX KLM 2 Bright A_Explode(5,64,0)
      FRFX NO 2 Bright
      stop
   }
}

ACTOR BBQSkull 
{
   Radius 8
   Height 11
   Speed 18
   Damage (random(6,18))
   ReactionTime 85
   PROJECTILE
   Damagetype "Inferno"
   +SEEKERMISSILE
   +THRUGHOST
   +FORCEXYBILLBOARD
   +LOOKALLAROUND
   -EXTREMEDEATH
   SeeSound "weapons/bwoosh"
   DeathSound "weapons/boom1"
   States
   {
   Spawn:
      IFX1 A 1 Bright A_SpawnItemEx("BBQTrail1",0,0,0,0,0,0,0,128,0)
      IFX1 A 0 Bright A_SeekerMissile (10,25)
      IFX1 B 1 Bright A_SpawnItemEx("BBQTrail1",0,0,0,0,0,0,0,128,0)
      IFX1 B 0 Bright A_SeekerMissile (10,25)
      IFX1 B 0 Bright A_CountDown
      loop
   Death:
      IFX1 I 0 Bright A_SetTranslucent(0.67,1)
      IFX1 I 3 A_Explode(64,64,0)
      IFX1 JKL 3 Bright 
      stop
   }
}

ACTOR BBQTrail1
{
   Radius 1
   Height 1
   RenderStyle ADD
   Alpha 0.67
   +NOGRAVITY
   +NOBLOCKMAP
   +FORCEXYBILLBOARD
   States
   {
   Spawn:
      IFX1 CDEFGH 3 Bright
      stop
   }
}

ACTOR Burner : Ammo 11003
{
     Inventory.Amount 10
     Inventory.MaxAmount 175
     Ammo.BackpackAmount 5
     Ammo.BackpackMaxAmount 350
	 RENDERSTYLE ADD
	 ALPHA 0.9
	 Inventory.PickupMessage "You picked up a Hellfire Orb."
	 Inventory.Icon AMM1A0
	 States
	 {
	   Spawn:
		  AMM1 ABC 4 Bright
		  Loop
	 }	 
}

Actor BigBurner : Burner 11004
{
	inventory.amount 20
	States
	{
		Spawn:
			AMM1 DEF 4 Bright
		Loop
	}
}

Actor FakeBurner : Burner
{
	+IGNORESKILL
}

Actor FireCounter : Inventory
{
	inventory.amount 1
	inventory.maxamount 20
	+IGNORESKILL
}

Actor Charged : Inventory
{
	inventory.amount 1
	inventory.maxamount 1
}

Actor HumanFireSpawner
{
	Radius 20
	Height 50
	Scale 0.68
	+NOBLOCKMAP
	States 
	{
	Spawn:
		BFOH ABCDEFGHIJKLMNOPQRSTUVWXYZ 3 Bright
		TNT1 A 0 A_SpawnItem("HumanSkeletonSpawner")
		Stop
	}
}

Actor HumanSkeletonSpawner
{
	Radius 20
	Height 50
	Scale 0.68
	+NOBLOCKMAP
	States 
	{
	Spawn:
		BCOH ABCDEFGHIJKLMNO 3 Bright
		TNT1 AAA 0 A_PlaySound("SkeletonFall")
		BCOH PQRSTU 2
		BCOH V -1
		Stop
	}
}

Actor DukePuff : BulletPuff
{
	Scale 0.69
	States
	{
	  Spawn:
		DPUF A 4 Bright
		DPUF B 4
		Melee:
		DPUF CD 4
		Stop
	}
}

actor RPGRocket
{
  Radius 11
  Height 8
  Speed 32
  Damage (random(100,180))
  Decal "Scorch"
  Projectile
  +ROCKETTRAIL
  +SEEKERMISSILE
  Obituary "%o failed to evade %k's seeker rocket."
  SeeSound "Weapons/DukeRPGFire"
  States
  {
  Spawn:
    RPGR A 15 bright
    //fall through
  Seek:
    RPGR A 3 bright A_SeekerMissile (5, 10)
    loop
  Death:
	TNT1 A 0 A_Explode(128, 128)
    TNT1 A 1 A_SpawnItem("RPGExplosion")
    stop
  }
}

Actor DevastatorRocket : RPGRocket
{
	Radius 8
	Height 5
	Speed 53
	Damage (random(11,22))
	Scale 0.4
	-SEEKERMISSILE
	Obituary "%o was devastated by %k's devastator."
	States
	{
		Spawn:
		    RPGR A 1 Bright
	    Loop
		Death:
			TNT1 A 0 A_Explode(36, 42)
			TNT1 A 1 A_SpawnItem("DevastatorExplosion")
		Stop
	}
}

Actor RPGExplosion
{
	Radius 2
	Height 2
	-SOLID
	+NOGRAVITY
	RenderStyle Add
	Alpha 0.9
	States
	{
		Spawn:
			TNT1 A 0
			TNT1 A 0 A_PlaySoundEx("Weapons/DukeExplosion", CHAN_BODY)
			NKXP BCDEFGHIJKLMNOPQRSTUV 3 Bright A_FadeOut(0.05)
		Stop
	}
}

Actor DukeExplosionX : RPGExplosion
{
	Scale 2.25
}

Actor DevastatorExplosion : RPGExplosion
{	
	Scale 0.4
}

ACTOR RPG : Weapon 10025
{
   Inventory.PickupMessage "You got the RPG."
   Obituary "%o was removed from existence by %k's RPG."
   Weapon.AmmoType "RocketAmmo"
   Weapon.AmmoGive 5
   Weapon.SelectionOrder 1000
   Weapon.Slotnumber 5
   Weapon.AmmoUse 1
   Radius 18
   Scale 0.75
   Inventory.PickupSound "Pickups/WeaponPick"
   States
   {
   Spawn:
      DPRG P -1
      Loop
   Ready:
      DRPG A 1 A_WeaponReady
   Loop
   Deselect:
      DRPG A 1 A_Lower
      Loop
   Select:
      DRPG A 1 A_Raise
      Loop
   Fire:
      DRPG B 1 Bright
	  TNT1 A 0 A_FireCustomMissile("RPGRocket", 0, 1)
	  DRPG BC 1 Bright
	  DRPG DE 2 Bright
	  DRPG FGH 1
	  DRPG IHGFJKLM 2
      Goto Ready
   }
}

Actor HeavyShotgun : SuperShotgun 10026
{
  Weapon.SlotNumber 3
  Weapon.SelectionOrder 420
  attacksound ""
  Weapon.AmmoUse 1
  Obituary "%o was mutilated by %k's steel shotgun."
  Inventory.PickupSound "Pickups/WeaponPick"
  Scale 0.75
  Decal "BulletChip"
  States
  {
	  Spawn:
		DSGU A -1
	  Stop
	  Ready:
	    REMG A 1 A_WeaponReady
	  Loop
	  Deselect:
		REMG A 1 A_Lower
	  Loop
	  Select:
		REMG A 1 A_Raise
	  Loop
	  Fire:
		REMG B 2 Bright
		TNT1 A 0 A_FireBullets (7.2, 4.8, 10, 6, "DukePuff")
		TNT1 A 0 A_PlaySoundEx("Weapons/DukeShotgunFire", CHAN_WEAPON)
		REMG X 2 Bright
		REMG C 4
		REMG D 5
		REMG E 4
		TNT1 A 0 A_PlaySoundEx("Weapons/DukeShotgunCock", CHAN_BODY)
		REMG FE 4
		REMG D 5
		REMG C 4
		REMG A 2
		Goto Ready
  }  
}

Actor RipperCannon : Weapon 10027
{
   Inventory.PickupMessage "You got the Ripper Cannon."
   Obituary "%o was blown new holes by %k's ripper."
   Weapon.AmmoType "Clip"
   Weapon.AmmoGive 75
   Weapon.SelectionOrder 750
   Weapon.Slotnumber 4
   Weapon.AmmoUse 1
   Radius 28
   AttackSound "Weapons/DukeRipperFire"
   Inventory.PickupSound "Pickups/WeaponPick"
   Scale 0.75
   Decal "BulletChip"
    States
    {
		Spawn:
			RIPP X -1
		Stop
		Ready:
			RIPP A 1 A_WeaponReady
		Loop
		Deselect:
			RIPP A 1 A_Lower
		Loop
		Select:
			RIPP A 1 A_Raise
		Loop
		Fire:
			RIPP B 2 Bright A_FireBullets(4.8, 2.4, 1, 7, "DukePuff")
			RIPP C 2 Bright
			RIPP D 2 Bright A_FireBullets(4.8, 2.4, 2, 7, "DukePuff")
			RIPP E 2 Bright
			RIPP F 2 Bright A_FireBullets(4.8, 2.4, 1, 7, "DukePuff")
			RIPP G 2 Bright A_Refire
		Goto Ready
	}
}

Actor DevastatorAmmo : Ammo 11005
{
	inventory.amount 15
	inventory.maxamount 99
	inventory.pickupsound "Pickups/Ammopick"
	inventory.pickupmessage "You picked up Devastator Ammo"
	ammo.backpackamount 5
	ammo.backpackmaxamount 198
	Scale 0.85
	Radius 16
	Height 12
	States
	{
		Spawn:
			DEVP A -1
		Stop
	}
}

ACTOR Devastator : Weapon 10028
{	
   Inventory.PickupMessage "You got the Devastator !"
   Obituary "%o was devastated by %k's devastator."
   Weapon.AmmoType "DevastatorAmmo"
   Weapon.AmmoGive 10
   Weapon.SelectionOrder 650
   Weapon.Slotnumber 8
   Weapon.AmmoUse 1
   Radius 24
   Scale 0.75
   Inventory.PickupSound "Pickups/WeaponPick"
   States
   {
   Spawn:
      DEVA A -1
      Loop
   Ready:
      DDEV A 1 A_WeaponReady
   Loop
   Deselect:
      DDEV A 1 A_Lower
      Loop
   Select:
      DDEV A 1 A_Raise
      Loop
   Fire:
	  TNT1 A 0 A_JumpIfInventory("DevastatorCounter", 1, "FireLeft")
      DDEV HIJ 1 Bright
	  TNT1 A 0 A_FireCustomMissile("DevastatorRocket", 0, 1, random(2, 16), random(-8,0))
	  TNT1 A 0 A_FireCustomMissile("DevastatorRocket", 0, 1, random(2, 8), random(-2,0))
	  TNT1 A 0 A_GiveInventory("DevastatorCounter", 1)
	  DDEV KL 2 Bright
	  DDEV M 1 Bright
      Goto Ready
   FireLeft:
      DDEV BCD 1 Bright
	  TNT1 A 0 A_FireCustomMissile("DevastatorRocket", 0, 1, random(-16, -2), random(-8,0))
	  TNT1 A 0 A_FireCustomMissile("DevastatorRocket", 0, 1, random(-8,-2), random(-2,0))
	  TNT1 A 0 A_TakeInventory("DevastatorCounter", 1)
	  DDEV EF 2 Bright
	  DDEV G 1 Bright
      Goto Ready   
   }
}

Actor DevastatorCounter : Inventory
{
	inventory.amount 1
	inventory.maxamount 1
}

actor LifeLeech : weapon 10030
{
	inventory.pickupmessage "You found the Life Leech!"
	Obituary "%o had %p soul sucked dry by %k."
	DamageType "LifeLeechFlame"
	radius 20
	height 16
	weapon.selectionorder 709
	Weapon.SlotNumber 8
	weapon.kickback 100
	weapon.ammotype1 "EssencePower"
	weapon.ammouse1 0
	weapon.ammouse2 0
	weapon.ammogive 18
	attacksound "LLFireInitiate"
	Inventory.PickupSound "Pickups/WeaponPick"
	+WEAPON.NOAUTOAIM
	Scale 0.7
	states
	{
		Spawn:
		  LLWP A -1
		 Loop
		Ready:
		  LLST A 1 A_WeaponReady
		 loop
		Select:
		  TNT1 A 0 ACS_ExecuteAlways(602, 0, 0)
		  LLST A 1 A_RAISE
		 Loop
		Deselect:
		  TNT1 A 0 ACS_ExecuteAlways(602, 0, 1)
		  LLST A 1 A_LOWER
		 Loop
		Fire:
		  TNT1 A 0 A_PlayWeaponSound("LLFireInitiate")
		  LLSL ABCDE 2
		  LLST B 3
		  LLST M 3
		  LLST M 0 A_PlaySoundEx("LLFire", 5)
		  LLST M 0 ACS_ExecuteAlways(603, 0)
		  LLST M 0 A_SpawnItemEx("LifeLeechLightSpawner2", 0, 0, 0)
		  TNT1 A 0 A_GunFlash
		  LLST M 0 A_FireCustomMissile("LifeLeechShot", random(-8,8), 1, 5, 3, 0, random(-4,4)) 
		  LLST M 0 A_FireCustomMissile("LifeLeechSmallFire", random(-8,8), 1, 5, 3, 0, random(-4,4))
		  LLST C 0 A_FireCustomMissile("LifeLeechSmallFire2", random(-12,12), 1, 5, 3, 0, random(-8,8))
		  LLST F 3
		  LLST C 3 bright
		  LLST C 0 ACS_ExecuteAlways(603, 0)
		  LLST M 0 A_SpawnItemEx("LifeLeechLightSpawner2", 0, 0, 0)
		  TNT1 A 0 A_GunFlash
		  LLST C 0 A_FireCustomMissile("LifeLeechShot", random(-8,8), 1, 5, 3, 0, random(-4,4)) 
		  LLST C 0 A_FireCustomMissile("LifeLeechSmallFire2", random(-8,8), 1, 5, 3, 0, random(-4,4))
		  LLST C 0 A_FireCustomMissile("LifeLeechSmallFire", random(-12,12), 1, 5, 3, 0, random(-8,8))
		  LLST G 3 bright
		  LLST G 0 ACS_ExecuteAlways(603, 0)
		  LLST M 0 A_SpawnItemEx("LifeLeechLightSpawner2", 0, 0, 0)
		  TNT1 A 0 A_GunFlash
		  LLST G 0 A_FireCustomMissile("LifeLeechShot", random(-8,8), 1, 5, 3, 0, random(-4,4)) 
		  LLST G 0 A_FireCustomMissile("LifeLeechSmallFire", random(-8,8), 1, 5, 3, 0, random(-4,4))
		  LLST C 0 A_FireCustomMissile("LifeLeechSmallFire2", random(-12,12), 1, 5, 3, 0, random(-8,8))
		  LLST H 3 
		  LLST K 3 bright
		  LLST K 0 ACS_ExecuteAlways(603, 0)
		  LLST M 0 A_SpawnItemEx("LifeLeechLightSpawner2", 0, 0, 0)
		  TNT1 A 0 A_GunFlash
		  LLST K 0 A_FireCustomMissile("LifeLeechShot", random(-8,8), 1, 5, 3, 0, random(-4,4)) 
		  LLST K 0 A_FireCustomMissile("LifeLeechSmallFire2", random(-8,8), 1, 5, 3, 0, random(-4,4))
		  LLST C 0 A_FireCustomMissile("LifeLeechSmallFire", random(-12,12), 1, 5, 3, 0, random(-8,8))
		  LLST J 3 
		  LLST G 3 bright
		  LLST G 0 ACS_ExecuteAlways(603, 0)
		  LLST M 0 A_SpawnItemEx("LifeLeechLightSpawner2", 0, 0, 0)
		  TNT1 A 0 A_GunFlash
		  LLST G 0 A_FireCustomMissile("LifeLeechShot", random(-8,8), 1, 5, 3, 0, random(-4,4)) 
		  LLST G 0 A_FireCustomMissile("LifeLeechSmallFire", random(-8,8), 1, 5, 3, 0, random(-4,4))
		  LLST C 0 A_FireCustomMissile("LifeLeechSmallFire2", random(-12,12), 1, 5, 3, 0, random(-8,8))
		  LLST O 3 
		  LLST L 3 bright
		  LLST L 0 ACS_ExecuteAlways(603, 0)
		  LLST M 0 A_SpawnItemEx("LifeLeechLightSpawner2", 0, 0, 0)
		  TNT1 A 0 A_GunFlash
		  LLST LL 0 A_FireCustomMissile("LifeLeechShot", random(-8,8), 1, 5, 3, 0, random(-4,4)) 
		  LLST L 0 A_FireCustomMissile("LifeLeechSmallFire2", random(-8,8), 1, 5, 3, 0, random(-4,4))
		  LLST C 0 A_FireCustomMissile("LifeLeechSmallFire", random(-12,12), 1, 5, 3, 0, random(-8,8))
          LLST E 3 
		  LLST P 3 bright
		  LLST P 0 ACS_ExecuteAlways(603, 0)
		  LLST M 0 A_SpawnItemEx("LifeLeechLightSpawner2", 0, 0, 0)
		  TNT1 A 0 A_GunFlash
		  LLST P 0 A_FireCustomMissile("LifeLeechShot", random(-8,8), 1, 5, 3, 0, random(-4,4)) 
		  LLST P 0 A_FireCustomMissile("LifeLeechSmallFire", random(-8,8), 1, 5, 3, 0, random(-4,4))
		  LLST C 0 A_FireCustomMissile("LifeLeechSmallFire2", random(-12,12), 1, 5, 3, 0, random(-8,8))
		  LLST E 3
		  LLST G 3 bright
		  LLST G 0 ACS_ExecuteAlways(603, 0)
		  LLST M 0 A_SpawnItemEx("LifeLeechLightSpawner2", 0, 0, 0)
		  TNT1 A 0 A_GunFlash
		  LLST G 0 A_FireCustomMissile("LifeLeechShot", random(-8,8), 1, 5, 3, 0, random(-4,4)) 
		  LLST G 0 A_FireCustomMissile("LifeLeechSmallFire2", random(-8,8), 1, 5, 3, 0, random(-4,4))
		  LLST C 0 A_FireCustomMissile("LifeLeechSmallFire", random(-12,12), 1, 5, 3, 0, random(-8,8))
		  LLST QRS 3 bright
		  LLST Q 0 ACS_ExecuteAlways(603, 0)
		  LLST M 0 A_SpawnItemEx("LifeLeechLightSpawner3", 0, 0, 0)
		  TNT1 A 0 A_GunFlash
		  LLST QQ 0 A_FireCustomMissile("LifeLeechShot", random(-8,8), 1, 5, 3, 0, random(-4,4)) 
		  LLST Q 0 A_FireCustomMissile("LifeLeechSmallFire", random(-8,8), 1, 5, 3, 0, random(-4,4))
		  LLST C 0 A_FireCustomMissile("LifeLeechSmallFire2", random(-12,12), 1, 5, 3, 0, random(-8,8))
		  LLST TU 3 bright
		  LLST D 0 ACS_ExecuteAlways(603, 0)
		  LLST M 0 A_SpawnItemEx("LifeLeechLightSpawner3", 0, 0, 0)
		  TNT1 A 0 A_GunFlash
		  LLST DD 0 A_FireCustomMissile("LifeLeechShot", random(-8,8), 1, 5, 3, 0, random(-4,4)) 
		  LLST D 0 A_FireCustomMissile("LifeLeechSmallFire2", random(-8,8), 1, 5, 3, 0, random(-4,4))
		  LLST C 0 A_FireCustomMissile("LifeLeechSmallFire", random(-12,12), 1, 5, 3, 0, random(-8,8))
		  LLST XTY 3 bright
		  LLST Q 0 ACS_ExecuteAlways(603, 0)
		  LLST M 0 A_SpawnItemEx("LifeLeechLightSpawner3", 0, 0, 0)
		  TNT1 A 0 A_GunFlash
		  LLST Q 0 A_FireCustomMissile("LifeLeechShot", random(-8,8), 1, 5, 3, 0, random(-4,4)) 
		  LLST QQ 0 A_FireCustomMissile("LifeLeechSmallFire", random(-8,8), 1, 5, 3, 0, random(-4,4))
		  LLST CC 0 A_FireCustomMissile("LifeLeechSmallFire2", random(-12,12), 1, 5, 3, 0, random(-8,8))
		  LLST W 3 bright
		  LLS2 CG 3 bright
		  LLST G 0 ACS_ExecuteAlways(603, 0)
		  LLST M 0 A_SpawnItemEx("LifeLeechLightSpawner2", 0, 0, 0)
		  TNT1 A 0 A_GunFlash
		  LLST G 0 A_FireCustomMissile("LifeLeechShot", random(-8,8), 1, 5, 3, 0, random(-4,4)) 
		  LLST GG 0 A_FireCustomMissile("LifeLeechSmallFire2", random(-8,8), 1, 5, 3, 0, random(-4,4))
		  LLST CC 0 A_FireCustomMissile("LifeLeechSmallFire", random(-12,12), 1, 5, 3, 0, random(-8,8))
		  LLST Z 3
		  LLST F 3
		  LLST E 3
		  LLST B 3
		  LLSL EDCBA 2
		  LLST A 4 A_Refire
		 goto ready
	}
}

actor LifeLeechLightSpawner
{
	Radius 8
	Height 8
	Scale 0.5
	States
	{
		Spawn:
			OMGW A 12
			OMGW A 1
		Stop
	}
}

actor LifeLeechLightSpawner2
{
	Radius 8
	Height 8
	Scale 0.5
	States
	{
		Spawn:
		OMG2 A 4
		OMG2 A 1
		Stop
	}
}

actor LifeLeechLightSpawner3
{
	Radius 8
	Height 8
	Scale 0.5
	States
	{
		Spawn:
		OMG3 A 4
		OMG3 A 1
		Stop
	}
}

actor LifeLeechShot
{
  PROJECTILE
  +BRIGHT
  Damage(random(17,23))
  Obituary "%o had %p soul sucked dry by %k."
  DamageType "LifeLeechFlame"
  DeathSound "LLFireExplode"
  Height 8
  Radius 8
  SeeSound ""
  RenderStyle Add
  alpha 0.5
  scale 0.6
  speed 40
  Decal none
  -EXTREMEDEATH
  +PIERCEARMOR
  States
  {
	  Spawn: 
		LLSS A 4 bright A_SpawnItemEx("LifeLeechTrail",0,0,0,random(-4,4),random(-4,4),random(-4,4),random(1,360))
		Loop
		death:
		TNT1 A 0 A_Explode(random(8,16), 24, 0)
		LLSX A 0 A_SpawnItem("FloorFlameSpawner")
		LLSX ABCDEFGHIJK 2 bright
		Stop
  }
}

Actor LifeLeechTrail
{
	Projectile
	Damage (random(6,7))
	DamageType "LifeLeechFlame"
    Obituary "%o had %p soul sucked dry by %k."	
	+RIPPER
	+BLOODLESSIMPACT
	+NOGRAVITY
	Speed 0
	Radius 12
	Height 12
	Scale 0.15
	RenderStyle Add
	Alpha 0.9
	States
	{
		Spawn:
		  ESST ABCDEFGHI 1 bright A_FadeOut
		wait
	}
}

Actor LifeLeechSmallFire
{
	Projectile
	Damage(5)
	DamageType "LifeLeechFlame"
	Obituary "%o was incinerated by %k."
	+RIPPER
	+BLOODLESSIMPACT
	+NOGRAVITY
	Speed 40
	Radius 12
	Height 12
	Scale 0.75
	RenderStyle Add
	Alpha 0.9
	States
	{
		Spawn:
		  SFIR ABCDEFGH 3 bright A_FadeOut
		wait
	}
}

Actor LifeLeechSmallFire2 : LifeLeechSmallFire
{
	States
	{
		Spawn:
			SFIR IJKLMNOP 3 Bright A_FadeOut
		wait
	}
}

Actor FloorFlameSpawner
{
    Radius 10
	Height 10
	Scale 0.5
	mass 50
	Alpha 0.5
	Damage 0
	RenderStyle Add
	DamageType "LifeLeechFlameGround"
	Obituary "%o was incinerated by %k."
	States
	{
		Spawn:
		  ESST HGFEDCBA 5 Bright A_JumpIf(z - floorz == 0, "SpawnFire")
		stop
		SpawnFire:
		  	GFIR A 3 Bright A_FadeOut(0.05)
			TNT1 A 0 A_Explode(4, 32, 0)
			GFIR B 3 Bright A_FadeOut(0.05)
			TNT1 A 0 A_Explode(4, 32, 0)
			GFIR C 3 Bright A_FadeOut(0.05)
			TNT1 A 0 A_Explode(4, 32, 0)
			GFIR D 3 Bright A_FadeOut(0.05)
			TNT1 A 0 A_Explode(4, 32, 0)
			GFIR E 3 Bright A_FadeOut(0.05)
			TNT1 A 0 A_Explode(4, 32, 0)
			GFIR F 3 Bright A_FadeOut(0.05)
			TNT1 A 0 A_Explode(4, 32, 0)
			GFIR G 3 Bright A_FadeOut(0.05)
			TNT1 A 0 A_Explode(4, 32, 0)
			GFIR H 3 Bright A_FadeOut(0.05)
			TNT1 A 0 A_Explode(4, 32, 0)
			GFIR I 3 Bright A_FadeOut(0.05)
			TNT1 A 0 A_Explode(4, 32, 0)			
			GFIR J 3 Bright A_FadeOut(0.05)
			TNT1 A 0 A_Explode(4, 32, 0)
			GFIR K 3 Bright A_FadeOut(0.05)
			TNT1 A 0 A_Explode(4, 32, 0)
			GFIR L 3 Bright A_FadeOut(0.05)
			TNT1 A 0 A_Explode(4, 32, 0)
			GFIR M 3 Bright A_FadeOut(0.05)
			TNT1 A 0 A_Explode(4, 32, 0)
			GFIR N 3 Bright A_FadeOut(0.05)
			TNT1 A 0 A_Explode(4, 32, 0)
			GFIR A 3 Bright A_FadeOut(0.05)
			TNT1 A 0 A_Explode(4, 32, 0)
			GFIR B 3 Bright A_FadeOut(0.05)
			TNT1 A 0 A_Explode(4, 32, 0)
			GFIR C 3 Bright A_FadeOut(0.05)
			TNT1 A 0 A_Explode(4, 32, 0)
			GFIR D 3 Bright A_FadeOut(0.05)
			TNT1 A 0 A_Explode(4, 32, 0)
			GFIR E 3 Bright A_FadeOut(0.05)
			TNT1 A 0 A_Explode(4, 32, 0)
			GFIR F 3 Bright A_FadeOut(0.05)
			TNT1 A 0 A_Explode(4, 32, 0)
			GFIR G 3 Bright A_FadeOut(0.05)
			TNT1 A 0 A_Explode(4, 32, 0)
			GFIR H 3 Bright A_FadeOut(0.05)
			TNT1 A 0 A_Explode(4, 32, 0)
			GFIR I 3 Bright A_FadeOut(0.05)
			TNT1 A 0 A_Explode(4, 32, 0)
			GFIR J 3 Bright A_FadeOut(0.05)
			TNT1 A 0 A_Explode(4, 32, 0)
			GFIR K 3 Bright A_FadeOut(0.05)
			TNT1 A 0 A_Explode(4, 32, 0)
			GFIR L 3 Bright A_FadeOut(0.05)
			TNT1 A 0 A_Explode(4, 32, 0)
			GFIR M 3 Bright A_FadeOut(0.05)
			TNT1 A 0 A_Explode(4, 32, 0)
			GFIR N 3 Bright A_FadeOut(0.05)
			TNT1 A 0 A_Explode(4, 32, 0)
			Wait
	}
}

ACTOR EssencePower : Ammo
{
	+INVENTORY.IGNORESKILL
   Radius 10
   Inventory.Amount 15
   Inventory.MaxAmount 99
   Ammo.BackpackAmount 10
   scale 0.3
   RenderStyle Translucent
   Alpha 0.9
   Ammo.BackpackMaxAmount 99
   Inventory.PickupMessage "Picked up a poor soul."
   States
   {
   Spawn:
      ESSS A 1
      Loop
   }
}

ACTOR LifeLeechDrain : PowerDrain
{
    Powerup.Duration 0x7FFFFFFF
}

actor "  Chaingun  " : Weapon 10031
{
  spawnid 28
  obituary "%o was mowed down by %k's chaingun."
  radius 20
  height 16
  attacksound "Chaingun"
  inventory.pickupmessage "You got the chaingun. Load up the belts!"
  weapon.selectionorder 666
  Weapon.SlotNumber 4
  weapon.kickback 100
  weapon.ammotype "Clip"
  weapon.ammouse 1
  weapon.ammogive 20
  Decal "BulletChip"
  states
  {
  Ready:
    CHGX A 1 A_WeaponReady
    loop
  Deselect: 
    CHGX A 1 A_Lower
    loop
  Select:
    CHGX A 1 A_Raise
    loop
  Fire:
	CHGX A 0 A_FireBullets(5.6, 0, 1, 9, "BulletPuff")
	CHXF A 1 A_GunFlash
	CHGX BCD 1
	TNT1 A 0 A_Firecustommissile("50CaseSpawn",0,0,-12,-18)
	CHGX A 0 A_FireBullets(5.6, 0, 1, 9, "BulletPuff")
	CHXF A 1 A_GunFlash
	CHGX BCD 1
	TNT1 A 0 A_Firecustommissile("50CaseSpawn",0,0,-12,-18)
	CHGX A 1 A_Refire
	CHGX B 2 A_Weaponready
	CHGX C 3 A_Weaponready
	CHGX D 3 A_Weaponready
	Goto Ready
  Flash:
	CHXF A 2 Bright A_Light1
	CHXF B 1 Bright A_Light1
	TNT1 A 2 A_Light1
	Goto LightDone
  Spawn:
    MGUX A -1
    stop
  }

}

ACTOR 50CaseSpawn
{
	Speed 20
	PROJECTILE
	+NOCLIP
	+CLIENTSIDEONLY
	States
	{
	Spawn:
        TNT1 A 0
		TNT1 A 1 A_CustomMissile("EmptyBrass",-2,20,random(270,245),2,random(40,80))
		Stop
	}
}

ACTOR EmptyBrass
{
   Height 2
   Radius 2
   Speed 6
   Scale 0.25
   +DOOMBOUNCE
   - NOGRAVITY
   +WINDTHRUST
   +CLIENTSIDEONLY
   +MOVEWITHSECTOR
   +MISSILE
   +NOBLOCKMAP
   -DROPOFF
   +NOTELEPORT
   +FORCEXYBILLBOARD
   +NOTDMATCH
   +GHOST
   SeeSound "weapons/casing"
   States
   {
   Spawn:
      CAS3 ABCDEFGH 3
      Loop

   Death:
      LCPJ A 0 A_Jump(256,"Rest1","Rest2","Rest3","Rest4","Rest5","Rest6","Rest7","Rest8")
      Goto Rest1
    Rest1:
      CAS3 I 250
    Goto Vanish
    Rest2:
      CAS3 J 250
    Goto Vanish
    Rest3:
      CAS3 K 250
    Goto Vanish
    Rest4:
      CAS3 L 250
    Goto Vanish
    Rest5:
      CAS3 M 250
    Goto Vanish
    Rest6:
      CAS3 I 250
    Goto Vanish
    Rest7:
      CAS3 J 250
    Goto Vanish
    Rest8:
      CAS3 K 250
    Goto Vanish
     Vanish:
     TNT1 A 0
     Stop
   }
}

Actor HeatSeekerCharge : Inventory
{
	inventory.amount 1
	inventory.maxamount 5
	+IGNORESKILL
}

Actor GotNuke : Inventory
{
	inventory.amount 1
	inventory.maxamount 1
}

Actor NukePrepared : GotNuke { }

Actor MissileMode : GotNuke 
{
	inventory.amount 1
	inventory.maxamount 2
}

Actor MissileLauncher : RocketLauncher 10032
{
	Weapon.SlotNumber 5
	Weapon.SelectionOrder 600
	Inventory.PickupSound "Pickups/WeaponPick"
	Weapon.AmmoType "Missiles"
	Weapon.AmmoGive 5
	inventory.pickupmessage "You got the Missile Launcher !"
	Radius 16
	States
	{
		Spawn:
			SWMS A -1
		Stop
		Select:
			TNT1 A 0 A_PlaySound("Weapons/RiotgunUp")
			SWFR A 1 A_Raise
		Goto Select+1
		Deselect:
			SWFR A 1 A_Lower
		Loop
		Ready:
			TNT1 A 0 A_JumpIfInventory("NukePrepared", 1, "Ready.Nuke")
			TNT1 A 0 A_JumpIfInventory("MissileMode", 2, "NukeCheck")
			TNT1 A 0 A_JumpIfInventory("MissileMode", 1, 2)
			SWLA A 1 A_WeaponReady
		Loop
			TNT1 A 0 A_JumpIfInventory("HeatSeekerCharge", 5, 5)
			TNT1 A 0 A_JumpIfInventory("HeatSeekerCharge", 4, 5)
			TNT1 A 0 A_JumpIfInventory("HeatSeekerCharge", 3, 5)
			TNT1 A 0 A_JumpIfInventory("HeatSeekerCharge", 2, 5)
			TNT1 A 0 A_JumpIfInventory("HeatSeekerCharge", 1, 5)
		Goto NoCharges
			SWLH F 1 A_WeaponReady
		Goto Ready
			SWLH E 1 A_WeaponReady
		Goto Ready
			SWLH D 1 A_WeaponReady
		Goto Ready	
			SWLH C 1 A_WeaponReady
		Goto Ready
			SWLH B 1 A_WeaponReady
		Goto Ready
			SWLH A 1 A_WeaponReady
		Goto Ready
		NoCharges:
			TNT1 A 0 A_JumpIfInventory("GotNuke", 1, 2)
			TNT1 A 0 A_TakeInventory("MissileMode", 2)
//			TNT1 A 0 A_GiveInventory("MissileMode", 2)
			TNT1 A 0
		Goto Ready+3
		NukeCheck:
			TNT1 A 0 A_JumpIfInventory("GotNuke", 1, "PrepareNuke")
		Goto Ready+3
		Ready.Nuke:
			SWLN A 1 A_WeaponReady
		Goto Ready
		PrepareNuke:
			TNT1 A 0 A_PlayWeaponSound("Weapons/NukeStandBy")
			SWLN A 50
			TNT1 A 0 A_PlayWeaponSound("Weapons/NukeCount")
			SWLN A 105
			TNT1 A 0 A_PlayWeaponSound("Weapons/NukeReady")
			SWLN A 70
			TNT1 A 0 A_GiveInventory("NukePrepared", 1)
			TNT1 A 0 A_GiveInventory("MissileMode", 2)
		Goto Ready
		Fire:
			TNT1 A 0 A_JumpIfInventory("NukePrepared", 1, "FireNuke")
			TNT1 A 0 A_JumpIfInventory("MissileMode", 2, 2) // If you got a nuke already, this won't happen since the one above prevents it. This is to prevent the heat seekers getting into way.
			TNT1 A 0 A_JumpIfInventory("MissileMode", 1, "FireDecide")
			TNT1 A 0 A_TakeInventory("MissileMode", 2)
			SWLF A 3 Bright A_GunFlash
			SWLF B 3 Bright
			TNT1 A 0 A_FireCustomMissile("HeavyMissile")
			TNT1 A 0 A_SetPitch(pitch-7)
			TNT1 A 0 A_Recoil(4.8)
			TNT1 A 0 A_PlayWeaponSound("Weapons/MissileLaunch")
			SWLF CCDD 1 Bright A_SetPitch(pitch+0.7)
			SWLF EEEFFF 1 A_SetPitch(pitch+0.7)
			SWLF GHIJK 2
			SWLA A 5 A_Refire
		Goto Ready
		FireDecide:
			TNT1 A 0 A_JumpIfInventory("HeatSeekerCharge", 5, "Fire5")
			TNT1 A 0 A_JumpIfInventory("HeatSeekerCharge", 4, "Fire4")
			TNT1 A 0 A_JumpIfInventory("HeatSeekerCharge", 3, "Fire3")
			TNT1 A 0 A_JumpIfInventory("HeatSeekerCharge", 2, "Fire2")
			TNT1 A 0 A_JumpIfInventory("HeatSeekerCharge", 1, "Fire1")
			SWLA A 2 A_TakeInventory("MissileMode", 2)
		Goto Fire+2
		Fire5:
			SWFH A 3 Bright A_GunFlash
			SWFH B 3 Bright
			TNT1 A 0 A_FireCustomMissile("HeavyMissileGuided", 0, 1)
			TNT1 A 0 A_TakeInventory("HeatSeekerCharge", 1)
			TNT1 A 0 A_SetPitch(pitch-7)
			TNT1 A 0 A_Recoil(4.8)
			TNT1 A 0 A_PlayWeaponSound("Weapons/MissileLaunch")
			SWFH CCDD 1 Bright A_SetPitch(pitch+0.7)
			SWFH EEEFFF 1 A_SetPitch(pitch+0.7)
			SWLH GHIJK 2
		Goto Ready
		Fire4:
			SWF4 A 3 Bright A_GunFlash
			SWF4 B 3 Bright
			TNT1 A 0 A_FireCustomMissile("HeavyMissileGuided", 0, 1)
			TNT1 A 0 A_TakeInventory("HeatSeekerCharge", 1)
			TNT1 A 0 A_SetPitch(pitch-7)
			TNT1 A 0 A_Recoil(4.8)
			TNT1 A 0 A_PlayWeaponSound("Weapons/MissileLaunch")
			SWF4 CCDD 1 Bright A_SetPitch(pitch+0.7)
			SWF4 EEEFFF 1 A_SetPitch(pitch+0.7)
			SWF4 GHIJK 2
		Goto Ready
		Fire3:
			SWF3 A 3 Bright A_GunFlash
			SWF3 B 3 Bright
			TNT1 A 0 A_FireCustomMissile("HeavyMissileGuided", 0, 1)
			TNT1 A 0 A_TakeInventory("HeatSeekerCharge", 1)
			TNT1 A 0 A_SetPitch(pitch-7)
			TNT1 A 0 A_Recoil(4.8)
			TNT1 A 0 A_PlayWeaponSound("Weapons/MissileLaunch")
			SWF3 CCDD 1 Bright A_SetPitch(pitch+0.7)
			SWF3 EEEFFF 1 A_SetPitch(pitch+0.7)
			SWF3 GHIJK 2
		Goto Ready
		Fire2:
			SWF2 A 3 Bright A_GunFlash
			SWF2 B 3 Bright
			TNT1 A 0 A_FireCustomMissile("HeavyMissileGuided", 0, 1)
			TNT1 A 0 A_TakeInventory("HeatSeekerCharge", 1)
			TNT1 A 0 A_SetPitch(pitch-7)
			TNT1 A 0 A_Recoil(4.8)
			TNT1 A 0 A_PlayWeaponSound("Weapons/MissileLaunch")
			SWF2 CCDD 1 Bright A_SetPitch(pitch+0.7)
			SWF2 EEEFFF 1 A_SetPitch(pitch+0.7)
			SWF2 GHIJK 2
		Goto Ready
		Fire1:
			SWF1 A 3 Bright A_GunFlash
			SWF1 B 3 Bright
			TNT1 A 0 A_FireCustomMissile("HeavyMissileGuided", 0, 1)
			TNT1 A 0 A_TakeInventory("HeatSeekerCharge", 1)
			TNT1 A 0 A_SetPitch(pitch-7)
			TNT1 A 0 A_Recoil(4.8)
			TNT1 A 0 A_PlayWeaponSound("Weapons/MissileLaunch")
			SWF1 CCDD 1 Bright A_SetPitch(pitch+0.7)
			SWF1 EEEFFF 1 A_SetPitch(pitch+0.7)
			SWF1 GHIJK 2
		Goto Ready
		FireNuke:
			SWLN A 3 Bright A_GunFlash
			SWLN B 3 Bright
			TNT1 A 0 A_FireCustomMissile("NukeMissile", 0, 0)
			TNT1 A 0 A_SetPitch(pitch-10)
			TNT1 A 0 A_Recoil(9.6)
			TNT1 A 0 A_PlayWeaponSound("Weapons/MissileLaunch")
			TNT1 A 0 A_TakeInventory("NukePrepared", 1)
			TNT1 A 0 A_TakeInventory("MissileMode", 2)
			TNT1 A 0 A_TakeInventory("GotNuke", 1)
			SWLN CCDD 1 Bright A_SetPitch(pitch+1)
			SWLN EEEFFF 1 A_SetPitch(pitch+1)
			SWLN GHIJK 2
		Goto Ready
		Flash:
			TNT1 A 0
		Stop
		AltFire:
			SWFR A 5
			TNT1 A 0 A_PlaySound("Weapons/RiotgunUp")
			TNT1 A 0 A_JumpIfInventory("MissileMode", 2, 2)
			TNT1 A 0 A_GiveInventory("MissileMode", 1)
		Goto Ready
			TNT1 A 0 A_TakeInventory("MissileMode", 2)
		Goto Ready
	}
}

Actor HeavyRocketTrail
{
	Speed 0
	Height 1
	Radius 1
	Damage 0
	Alpha 0.85
	Scale 0.8
	Renderstyle Add
	-TELESTOMP
	+NOGRAVITY
	
	States
	{
		Spawn:
			DPUF ABCD 3 ThrustThingZ(0, 8, 0, 1)
		Stop
	}
}

Actor HeavyMissile : Rocket
{
	Damage (random(128, 160))
	Radius 16
	Height 12
	Speed 24
	Scale 1.15
	Decal "Scorch"
	SeeSound ""
	DeathSound ""
	Obituary "%o's gibs splattered all over the place by %k's missiles."
	-ROCKETTRAIL
	
	States
	{
		Spawn:
			HROC A 3 Bright A_SpawnItemEx("HeavyRocketTrail", -4, 0, 2)
			TNT1 A 0 A_ScaleVelocity(1.085)
		Loop
		Death:
			TNT1 A 0 A_Explode(128, 160)
			TNT1 A 1 A_PlaySound("Weapons/MissileHitX")
			TNT1 A 0 A_SpawnItem("BigMissileExplosion")
		Stop
	}
}

Actor HeavyMissileGuided : HeavyMissile
{
	Speed 42
	Obituary "%o couldn't escape %k's homing missiles."
	+SEEKERMISSILE
	
	States
	{
		Spawn:
			TNT1 A 0 A_PlaySound("Weapons/MissileBeep")
			HROC A 2 A_SeekerMissile (10, 20)
			TNT1 A 0 A_SpawnItemEx("HeavyRocketTrail", -4, 0, 2)
			HROC A 2 A_SeekerMissile (10, 20)
			TNT1 A 0 A_SpawnItemEx("HeavyRocketTrail", -4, 0, 2)
			HROC A 2 A_SeekerMissile (10, 20)
			TNT1 A 0 A_SpawnItemEx("HeavyRocketTrail", -4, 0, 2)
		Loop
	}
}

Actor NukeMissile : HeavyMissile
{
	Speed 20
	Damage 200
	Radius 20
	Height 16
	Scale 1.31
	Decal "Scorch"
	Decal "BFGLightning"
	Obituary "%o got MOTHER FUCKIN' ANNIHILATED by %k's nuke !"

	States
	{
		Spawn:
			HROC A 1 Bright
		Loop
		Death:
			TNT1 A 0 A_Explode(1024, 1560)
			TNT1 A 1 A_PlaySound("Weapons/NukeBlowZ")
			TNT1 A 0 A_SpawnItem("NukeExplosion")
		Stop
	}
}

Actor BigMissileExplosion
{
	Height 1
	Radius 1
	Scale 0.9
	Alpha 0.95
	RenderStyle Add
	+NOGRAVITY
	
	States
	{
		Spawn:
			MEXP ABCDEFGHIJKLMNOP 2 Bright A_FadeOut(0.08)
		Stop
	}
}

Actor NukeExplosion
{
	Height 1
	Radius 1
	Scale 4.5
	Alpha 0.9
	Renderstyle Add
	+NOGRAVITY
	
	States
	{
		Spawn:
			NUEX ABCDEFGHIJKLMNOPQRSTU 9 Bright A_Explode(random(16, 24), 576)
		Stop
	}
}

Actor Missiles : Ammo 11006
{
     Inventory.Amount 5
     Inventory.MaxAmount 50
     Ammo.BackpackAmount 2
     Ammo.BackpackMaxAmount 100
	 Inventory.PickupMessage "You picked up some missiles."
	 inventory.pickupsound "Pickups/Ammopick"
	 Inventory.Icon MISPA0
	 +IGNORESKILL
	 States
	 {
	    Spawn:
		  MISP A -1
	    Stop
	 }	 
}

Actor HeatSeekingCard : CustomInventory 11007
{
	inventory.amount 1
	inventory.maxamount 1
	inventory.pickupmessage "You picked up Heat-Seeker charges !"
	inventory.pickupsound "Pickups/Ammopick"
	+AUTOACTIVATE
	
	States
	{
		Spawn:
			HEAT A -1
		Stop
		Use:
			TNT1 A 0 A_JumpIfInventory("HeatSeekerCharge", 5, 2)
			TNT1 A 0 A_GiveInventory("HeatSeekerCharge", 5)
		Stop
			TNT1 A 1
		Fail
	}
}

Actor Nuke : CustomInventory 11008
{
	inventory.amount 1
	inventory.maxamount 1
	inventory.pickupmessage "You picked up a mother fucking Nuclear Warhead !"
	inventory.pickupsound "Pickups/Ammopick"
	+AUTOACTIVATE

	States
	{
		Spawn:
			NUKE A -1
		Stop
		Use:
			TNT1 A 0 A_JumpIfInventory("GotNuke", 1, 2)
			TNT1 A 0 A_GiveInventory("GotNuke", 1)
			TNT1 A 0 ACS_ExecuteAlways(606, 0)
		Stop
			TNT1 A 1
		Fail
	}
}
// MAP OBJECTS

actor TREE 10242
{
  height 210
  radius 10
  +SOLID
  states
  {
  Spawn:
    PALM A -1
    Stop
  }
}

ACTOR FireHydrant 10243
{
  Height 40
  Radius 16
  +SOLID
  States
  {
  Spawn:
    MYHD A -1
    Stop
  }
}

ACTOR TrashCan 10244
{
  Height 40
  Radius 16
  +SOLID
  States
  {
  Spawn:
    TRCN A -1
    Stop
  }
}

Actor DukeBlimp 16000
{
	Health 500
	Radius 92
	Height 64
	Scale 1.3
	Mass 9999999
	+NOGRAVITY
	+SOLID
	+SHOOTABLE
	+NOBLOOD
	-PUSHABLE
	
	States
	{
		Spawn:
			BLIM A -1
		Stop
		Death:
			TNT1 A 0 A_SpawnItemEx("DukeExplosionX")
			TNT1 AA 0 A_PlaySoundEx("Weapons/DukeExplosion", CHAN_BODY)
			TNT1 AAAAAAAAAA 0 A_SpawnItemEx("Cell", random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(0, 360))
			TNT1 AAAAAAAAAA 0 A_SpawnItemEx("Shell", random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(0, 360))
			TNT1 AAAAAAAAAA 0 A_SpawnItemEx("Clip", random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(0, 360))
			TNT1 AAAAAAAAAA 0 A_SpawnItemEx("RocketAmmo", random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(0, 360))
			TNT1 AAAAAAAAAA 0 A_SpawnItemEx("Clipbox", random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(0, 360))
			TNT1 AAAAAAAAAA 0 A_SpawnItemEx("ShellBox", random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(0, 360))
			TNT1 AAAAAAAAAA 0 A_SpawnItemEx("RocketBox", random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(0, 360))
			TNT1 AAAAAAAAAA 0 A_SpawnItemEx("Cellpack", random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(0, 360))
			TNT1 AAAAAAAAAA 0 A_SpawnItemEx("Stimpack", random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(0, 360))
			TNT1 AAAAAAAAAA 0 A_SpawnItemEx("Medikit", random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(0, 360))
			TNT1 AAAAAAAAAA 0 A_SpawnItemEx("DevastatorAmmo", random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(0, 360))
			TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("ArmorBonus", random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(0, 360))
			TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("MaxArmorBonus", random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(0, 360))			
			TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("HealthBonus", random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(0, 360))
			TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("MaxHealthBonus", random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(0, 360))			
			TNT1 AAAAAAAA 0 A_SpawnItemEx("GreenArmor", random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(0, 360))
			TNT1 AAA 0 A_SpawnItemEx("BlueArmor", random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(0, 360))
			TNT1 AA 0 A_SpawnItemEx("NewRedArmor", random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(0, 360))			
			TNT1 A 0 A_SpawnItemEx("Megasphere", random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(0, 360))
			TNT1 A 0 A_SpawnItemEx("SoulSphere", random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(0, 360))
			TNT1 A 0 A_SpawnItemEx("TurboSphere", random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(0, 360))
			TNT1 A 0 A_SpawnItemEx("DoomSphere", random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(0, 360))
			TNT1 A 0 A_SpawnItemEx("GuardSphere", random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(0, 360))
			TNT1 AAAA 0 A_SpawnItemEx("Berserk", random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(0, 360))
			TNT1 AAA 0 A_SpawnItemEx("HeavyShotgun", random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(0, 360))
			TNT1 AAA 0 A_SpawnItemEx("RipperCannon", random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(0, 360))
			TNT1 AAA 0 A_spawnItemEx("Devastator", random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(0, 360))
			TNT1 AAA 0 A_SpawnItemEx("minigun", random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(0, 360))
			TNT1 AAA 0 A_spawnItemex("grenadelauncher", random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(0, 360))
			TNT1 AAA 0 A_SpawnItemEx("plasmacannon", random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(0, 360))
			TNT1 AAA 0 A_SpawnItemEx("Chainsaw", random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(0, 360))
			TNT1 AAA 0 A_SpawnItemEx("RPG", random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(0, 360))
			TNT1 A 0 A_SpawnItemEx("BFG9000", random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(0, 360))
			TNT1 A 0 A_SpawnItemEx("BFG10K", random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(-32,32), random(0, 360))
		Stop
	}
}

Actor FloatingSkullNoGrav : FloatingSkull 16001
{
	Radius 20
	+NOGRAVITY
}

Actor ReactorCore 16002
{
	Radius 48
	Height 48
	Scale 0.85
	+INVULNERABLE
	+SOLID
	
	States
	{
		Spawn:
			REAC ABCD 3 Bright A_Explode(2, 80)
		Loop
	}
}

Actor ReactorCoreFlip : ReactorCore 16003
{
	+NOGRAVITY
	
	States
	{
		Spawn:
			REAF ABCD 3 Bright A_Explode(2, 80, 0)
		Loop
	}
}

Actor ReactorBolt 16004
{
	Radius 1
	Height 1
	+NOGRAVITY
	+FORCEYBILLBOARD
	+NOCLIP
	XScale 0.85
	YScale 1.0
	States
	{
		Spawn:
			RBOL ABCD 3 Bright A_Explode(2, 80)
		Loop
	}
}

Actor ReactorBoltLong : ReactorBolt 16005
{
	States
	{
		Spawn:
			LBOL ABCD 3 Bright
		Loop
	}
}

Actor FireEffect 16006
{
    Radius 10
	Height 10
	Scale 0.75
	Alpha 0.75
	RenderStyle Add
	States
	{
		Spawn:
		  	GFIR ABCDEFGHIJKLMN 3 Bright A_Explode(4, 36)
		Loop
	}
}

Actor ObstacleCheck : BulletPuff
{
	Radius 16
	height 16
	Speed 16
	PROJECTILE
	+PUFFGETSOWNER
	+BLOODLESSIMPACT
	States
	{
		Spawn:
			TNT1 A 2
		Stop
		Death:
			TNT1 A 1 A_GiveToTarget("StopCharge", 1)
		Stop
	}
}

Actor ObstacleCheck2 : ObstacleCheck { }

Actor StopCharge : Inventory
{
	inventory.amount 1
}

Actor StopCharge2 : StopCharge { }

ACTOR Fwalling // So much effort to recrate the FireWall from RoTT... and all because we dont have one flag. STEPMISSILE!!! This is basically a monster made to act like a projectile, but it's very choppy and walls tend to push it at times... somewhat.
{
	 MONSTER
	 -SHOOTABLE
	 -SOLID
	 -COUNTKILL
     +DROPOFF
     +FOILINVUL
     +RANDOMIZE
     +RIPPER
	 MaxStepHeight 16
//     +STEPMISSILE
     Scale 0.6
	 Radius 4
	 Height 4
     speed 0
     DamageType "FireWallFlame"
     RenderStyle Add
     Alpha 0.95
     DeathSound "FireWallHit"
	 Gravity 5000.0 // Necessary so that even if the projectile goes too high, the main spawner, this will immediately fall.
     States
     {
     Spawn:
          FWAL A 1 Bright A_CustomMissile("ObstacleCheck", 8)
		  TNT1 A 0 A_JumpIfInventory("StopCharge", 1, "Death")
		  TNT1 A 0 A_Explode(400, 16, 0)
		  TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		  TNT1 A 0 ThrustThing(angle*256/360, 4, 0, 0)
		  FWAL A 1 Bright A_CustomMissile("ObstacleCheck", 8)
		  TNT1 A 0 A_JumpIfInventory("StopCharge", 1, "Death")
		  TNT1 A 0 A_Explode(400, 16, 0)
		  TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		  TNT1 A 0 ThrustThing(angle*256/360, 4, 0, 0)
		  FWAL A 1 Bright A_CustomMissile("ObstacleCheck", 8)
		  TNT1 A 0 A_JumpIfInventory("StopCharge", 1, "Death")
		  TNT1 A 0 A_Explode(400, 16, 0)
		  TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		  TNT1 A 0 ThrustThing(angle*256/360, 4, 0, 0)
		  FWAL A 1 Bright A_CustomMissile("ObstacleCheck", 8)
		  TNT1 A 0 A_JumpIfInventory("StopCharge", 1, "Death")
		  TNT1 A 0 A_Explode(400, 16, 0)
		  TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		  TNT1 A 0 ThrustThing(angle*256/360, 4, 0, 0)
          FWAL C 1 Bright A_CustomMissile("ObstacleCheck", 8)
		  TNT1 A 0 A_JumpIfInventory("StopCharge", 1, "Death")
		  TNT1 A 0 A_Explode(400, 16, 0)
		  TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		  TNT1 A 0 ThrustThing(angle*256/360, 4, 0, 0)
		  FWAL C 1 Bright A_CustomMissile("ObstacleCheck", 8)
		  TNT1 A 0 A_JumpIfInventory("StopCharge", 1, "Death")
		  TNT1 A 0 A_Explode(400, 16, 0)
		  TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		  TNT1 A 0 ThrustThing(angle*256/360, 4, 0, 0)
		  FWAL D 1 Bright A_CustomMissile("ObstacleCheck", 8)
		  TNT1 A 0 A_JumpIfInventory("StopCharge", 1, "Death")
		  TNT1 A 0 A_Explode(400, 16, 0)
		  TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		  TNT1 A 0 ThrustThing(angle*256/360, 4, 0, 0)
		  FWAL D 1 Bright A_CustomMissile("ObstacleCheck", 8)
		  TNT1 A 0 A_JumpIfInventory("StopCharge", 1, "Death")
		  TNT1 A 0 A_Explode(400, 16, 0)
		  TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		  TNT1 A 0 ThrustThing(angle*256/360, 4, 0, 0)
		  FWAL E 1 Bright A_CustomMissile("ObstacleCheck", 8)
		  TNT1 A 0 A_JumpIfInventory("StopCharge", 1, "Death")
		  TNT1 A 0 A_Explode(400, 16, 0)
		  TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		  TNT1 A 0 ThrustThing(angle*256/360, 4, 0, 0)
		  FWAL E 1 Bright A_CustomMissile("ObstacleCheck", 8)
		  TNT1 A 0 A_JumpIfInventory("StopCharge", 1, "Death")
		  TNT1 A 0 A_Explode(400, 16, 0)
		  TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		  TNT1 A 0 ThrustThing(angle*256/360, 4, 0, 0)
		  FWAL F 1 Bright A_CustomMissile("ObstacleCheck", 8)
		  TNT1 A 0 A_JumpIfInventory("StopCharge", 1, "Death")
		  TNT1 A 0 A_Explode(400, 16, 0)
		  TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		  TNT1 A 0 ThrustThing(angle*256/360, 4, 0, 0)
		  FWAL F 1 Bright A_CustomMissile("ObstacleCheck", 8)
		  TNT1 A 0 A_JumpIfInventory("StopCharge", 1, "Death")
		  TNT1 A 0 A_Explode(400, 16, 0)
		  TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		  TNT1 A 0 ThrustThing(angle*256/360, 4, 0, 0)
		  FWAL G 1 Bright A_CustomMissile("ObstacleCheck", 8)
		  TNT1 A 0 A_JumpIfInventory("StopCharge", 1, "Death")
		  TNT1 A 0 A_Explode(400, 16, 0)
		  TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		  TNT1 A 0 ThrustThing(angle*256/360, 4, 0, 0)
		  FWAL G 1 Bright A_CustomMissile("ObstacleCheck", 8)
		  TNT1 A 0 A_JumpIfInventory("StopCharge", 1, "Death")
		  TNT1 A 0 A_Explode(400, 16, 0)
		  TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		  TNT1 A 0 ThrustThing(angle*256/360, 4, 0, 0)
		  FWAL H 1 Bright A_CustomMissile("ObstacleCheck", 8)
		  TNT1 A 0 A_JumpIfInventory("StopCharge", 1, "Death")
		  TNT1 A 0 A_Explode(400, 16, 0)
		  TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		  TNT1 A 0 ThrustThing(angle*256/360, 4, 0, 0)
		  FWAL H 1 Bright A_CustomMissile("ObstacleCheck", 8)
		  TNT1 A 0 A_JumpIfInventory("StopCharge", 1, "Death")
		  TNT1 A 0 A_Explode(400, 16, 0)
		  TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		  TNT1 A 0 ThrustThing(angle*256/360, 4, 0, 0)
		  FWAL I 1 Bright A_CustomMissile("ObstacleCheck", 8)
		  TNT1 A 0 A_JumpIfInventory("StopCharge", 1, "Death")
		  TNT1 A 0 A_Explode(400, 16, 0)
		  TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		  TNT1 A 0 ThrustThing(angle*256/360, 4, 0, 0)
		  FWAL I 1 Bright A_CustomMissile("ObstacleCheck", 8)
		  TNT1 A 0 A_JumpIfInventory("StopCharge", 1, "Death")
		  TNT1 A 0 A_Explode(400, 16, 0)
		  TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		  TNT1 A 0 ThrustThing(angle*256/360, 4, 0, 0)
		  FWAL J 1 Bright A_CustomMissile("ObstacleCheck", 8)
		  TNT1 A 0 A_JumpIfInventory("StopCharge", 1, "Death")
		  TNT1 A 0 A_Explode(400, 16, 0)
		  TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		  TNT1 A 0 ThrustThing(angle*256/360, 4, 0, 0)
		  FWAL J 1 Bright A_CustomMissile("ObstacleCheck", 8)
		  TNT1 A 0 A_JumpIfInventory("StopCharge", 1, "Death")
		  TNT1 A 0 A_Explode(400, 16, 0)
		  TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		  TNT1 A 0 ThrustThing(angle*256/360, 4, 0, 0)
		  FWAL K 1 Bright A_CustomMissile("ObstacleCheck", 8)
		  TNT1 A 0 A_JumpIfInventory("StopCharge", 1, "Death")
		  TNT1 A 0 A_Explode(400, 16, 0)
		  TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		  TNT1 A 0 ThrustThing(angle*256/360, 4, 0, 0)
		  FWAL K 1 Bright A_CustomMissile("ObstacleCheck", 8)
		  TNT1 A 0 A_JumpIfInventory("StopCharge", 1, "Death")
		  TNT1 A 0 A_Explode(400, 16, 0)
		  TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		  TNT1 A 0 ThrustThing(angle*256/360, 4, 0, 0)
		  FWAL L 1 Bright A_CustomMissile("ObstacleCheck", 8)
		  TNT1 A 0 A_JumpIfInventory("StopCharge", 1, "Death")
		  TNT1 A 0 A_Explode(400, 16, 0)
		  TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		  TNT1 A 0 ThrustThing(angle*256/360, 4, 0, 0)
		  FWAL L 1 Bright A_CustomMissile("ObstacleCheck", 8)
		  TNT1 A 0 A_JumpIfInventory("StopCharge", 1, "Death")
		  TNT1 A 0 A_Explode(400, 16, 0)
		  TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		  TNT1 A 0 ThrustThing(angle*256/360, 4, 0, 0)
		  FWAL M 1 Bright A_CustomMissile("ObstacleCheck", 8)
		  TNT1 A 0 A_JumpIfInventory("StopCharge", 1, "Death")
		  TNT1 A 0 A_Explode(400, 16, 0)
		  TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		  TNT1 A 0 ThrustThing(angle*256/360, 4, 0, 0)
		  FWAL M 1 Bright A_CustomMissile("ObstacleCheck", 8)
		  TNT1 A 0 A_JumpIfInventory("StopCharge", 1, "Death")
		  TNT1 A 0 A_Explode(400, 16, 0)
		  TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		  TNT1 A 0 ThrustThing(angle*256/360, 4, 0, 0)
          Loop
     Death:  
		TNT1 A 0 A_Stop
        BOMB ABCDEFGHIJKLMOPQRST 2 Bright
        stop
     }
}

ACTOR Fwaller
{
	 +MISSILE
     +DROPOFF
     +FOILINVUL
     +RANDOMIZE
     +RIPPER
     +NOEXPLODEFLOOR
	 +FLOORHUGGER
	 MaxStepHeight 16
//     +STEPMISSILE
     Scale 0.6
     Damage 0
	 DamageType "FireWallFlame"
     States
     {
     Spawn:
	      TNT1 AA 0 A_playsound("FireWallBurn")
          TNT1 A 1 ThrustThing(angle*256/360, 8, 0, 0) // Cant have speed since it needs A_SpawnItem
		  TNT1 A 0 Bright A_CustomMissile("Fwalling", 0, 0, 0, 2, 0)
          TNT1 A 2 ThrustThing(angle*256/360, 8, 0, 0)
		  TNT1 A 0 Bright A_CustomMissile("Fwalling", 0, 32, 0, 2, 0)
          TNT1 A 0 Bright A_CustomMissile("Fwalling", 0, -32, 0, 2, 0)
          TNT1 A 2 ThrustThing(angle*256/360, 8, 0, 0)
		  TNT1 A 0 Bright A_CustomMissile("Fwalling", 0, 64, 0, 2, 0)
          TNT1 A 0 Bright A_CustomMissile("Fwalling", 0, -64, 0, 2, 0)
          TNT1 A 2 ThrustThing(angle*256/360, 8, 0, 0)
		  TNT1 A 0 Bright A_CustomMissile("Fwalling", 0, 96, 0, 2, 0)
          TNT1 A 0 Bright A_CustomMissile("Fwalling", 0, -96, 0, 2, 0)
          TNT1 A 2 ThrustThing(angle*256/360, 8, 0, 0)
		  TNT1 A 0 Bright A_CustomMissile("Fwalling", 0, 128, 0, 2, 0)
          TNT1 A 0 Bright A_CustomMissile("Fwalling", 0, -128, 0, 2, 0)
          TNT1 A 2 ThrustThing(angle*256/360, 8, 0, 0)
		  TNT1 A 0 Bright A_CustomMissile("Fwalling", 0, 160, 0, 2, 0)
          TNT1 A 0 Bright A_CustomMissile("Fwalling", 0, -160, 0, 2, 0)
          TNT1 A 2 ThrustThing(angle*256/360, 8, 0, 0)
		  TNT1 A 0 Bright A_CustomMissile("Fwalling", 0, 192, 0, 2, 0)
          TNT1 A 0 Bright A_CustomMissile("Fwalling", 0, -192, 0, 2, 0)
          stop
     Crash:
	  stop     
     Death:  
		TNT1 A 1
          stop
     }
}
  
actor Fwall
{
    Radius 11
    Height 6
    Speed 30
    Damage 60
    Mass 5000
    SCALE 0.50
    PROJECTILE
    +FOILINVUL
    +corpse
    DamageType Fire
    DeathSound "FireWallHit"
    States
    {
    Spawn:
        FMIS A 4      
        FMIS A 2 A_Gravity
        Loop
   
         crash:
		  TNT1 A 0 A_JumpIf(waterlevel > 1, 3)
          TNT1 A 0 A_SpawnItem("Fwaller")
		  TNT1 A 0
        Stop

	DEATH:
        TNT1 A 1 A_NOGRAVITY
	EXPL A 1 a_explode(32,64)
        REXP BCDEFGHIJKLMOPQRST 1 Bright
	stop

	XDEATH:
        TNT1 A 1 A_NOGRAVITY
	EXPL A 1 a_explode(32,64)
        REXP BCDEFGHIJKLMOPQRST 1 Bright
	stop
    }
}

ACTOR FlameWall : Weapon 10033 // Thanks to the RoTT TC for the code/sprite offsets
{
	 Weapon.SlotNumber 7
     Weapon.SelectionOrder 10
     Inventory.PickupSound "Pickups/WeaponPick"
     Inventory.Pickupmessage "You filched a flamewall!"
     Weapon.AmmoType "FWMissiles"
     Weapon.AmmoGive 5
     Weapon.AmmoUse 1
     XSCALE 0.75
	 YSCALE 0.68
     +NOAUTOAIM 
     +NOGRAVITY
     Obituary "%o is nice and crispy, thanks to %k."

     States 
     { 
     Spawn: 
        PFWL A -1 
        LOOP 
     Ready: 
        FIRW A 1 A_WeaponReady 
        LOOP 
     Deselect: 
        FIRW A 1 A_Lower 
        LOOP 
     Select:
        FIRW A 1 A_Raise
        LOOP
       FIRE: 
        FIRW A 1 Offset(0,36) A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
		TNT1 A 0 A_PlayWeaponSound("FireWallFire")
        FIRW A 1 Offset(0,38) A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
		TNT1 A 0 A_FireCustomMissile("Fwall",0,1,0,-16)
        FIRW B 2 Offset(0,42) A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
        FIRW C 1 Offset(0,40) A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
        FIRW C 1 Offset(0,38) A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
        FIRW A 1 Offset(0,36) A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
        FIRW A 1 Offset(0,34) A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
        FIRW A 1 Offset(0,32) A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
        FIRW A 8 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
        FIRW A 0 a_refire
        Goto Ready
     } 
}  

ACTOR FWMissiles : Ammo
{
   Inventory.MaxAmount 5
   Ammo.BackpackAmount 1
   Ammo.BackpackMaxAmount 5
   inventory.icon "FWAMA0"
}

ACTOR BMissiles : Ammo
{
   Inventory.MaxAmount 10
   Ammo.BackpackAmount 2
   Ammo.BackpackMaxAmount 10
   inventory.icon "BAAMA0"
}

ACTOR Bazooka : weapon 10034 
{
     SCALE 0.6
	 Weapon.SlotNumber 5
     Weapon.SelectionOrder 10
     Inventory.PickupSound "Pickups/WeaponPick"
     Inventory.Pickupmessage "You Bagged a Bazooka!"
     Weapon.AmmoGive 10
     Weapon.AmmoUse 1
     +NOAUTOAIM 
     +NOGRAVITY
	 +IGNORESKILL
     Weapon.AmmoType "BMissiles"
     Obituary "%o was on the wrong end of %k's bazooka."
     States 

     { 
     Spawn: 
        PBAZ A -1 
        LOOP 
     Ready: 
        BAZO A 1 A_WeaponReady 
        LOOP 
     Deselect: 
        BAZO A 1 A_Lower 
        LOOP 
     Select:
      	BAZO A 1 A_Raise 
        LOOP 
        
         Fire: 
        BAZO A 1 Offset(0,36) A_PlaySound("BazookaFire")
        BAZO A 1 Offset(0,38) A_FireCustomMissile("BazookaRocket",0,8,0,-16)
        BAZO A 1 Offset(0,42) 
        BAZO B 2 Offset(0,40) Bright
        BAZO C 2 Offset(0,38) Bright
        BAZO D 2 Offset(0,36) Bright
        BAZO A 1 Offset(0,34)
        BAZO A 1 Offset(0,32)
        BAZO A 5 
        BAZO A 0 a_refire
        Goto Ready
     } 
}  
  
actor BazookaRocket
{
    Radius 11
    Height 8
    Speed 36
    Damage 20
    SCALE 0.65
    PROJECTILE
    +EXTREMEDEATH 
    +FOILINVUL
    +BRIGHT
    damagetype fire
    DeathSound "FireWallHit"
    States
    {
    Spawn:
        TNT1 A 0 a_playsound("BazookaFly")
        FMIS AAAAAAAAAAAAAA 1 A_CustomMissile("BazookaRocketTrail",0,0,0,0)     
        Loop
    Death:  
    	BOMB A 1 Bright A_Explode(96, 128)
        BOMB BCDEFGHIJKLMOPQRST 1 Bright
        Stop
    }
}


ACTOR BazookaRocketTrail
{
  Radius 2
  Height 2
  Speed 0
  Scale 0.65
  PROJECTILE
  +NOGRAVITY
  +BRIGHT
  +RANDOMIZE
  States
  {
  Spawn:
     TNT1 A 4
     MTRL AAAA 1 
     goto misc
     
  MISC:   
     MTRL BBCCDD 1 A_fadeout
     stop
   
  }
}

actor DrunkM
{
    
    Radius 11
    Height 6
    Speed 24
    Damage 9
    SCALE 0.50
    PROJECTILE
    +SEEKERMISSILE
    +EXTREMEDEATH
    +FOILINVUL
	+LOOKALLAROUND
    +BRIGHT
     damagetype Fire
     DeathSound "FireWallHit"
     Obituary "%o sobered up once %k drunk missiled %h."

    States
    {
    Spawn:
        FMIS A 1 A_CustomMissile("BazookaRocketTrail",0,0,0,0)
        FMIS A 1 A_CustomMissile("BazookaRocketTrail",0,0,0,0)
        FMIS A 1 A_CustomMissile("BazookaRocketTrail",0,0,0,0)
        FMIS A 0 a_playsound("BazookaFly", CHAN_WEAPON, 1.0, 1, ATTN_NORM)
        FMIS A 1 A_ChangeVelocity (5.0, random(-2.5,2.5), random(0.0,3.5),1) 
        FMIS A 0 a_seekermissile(5,20)
        FMIS A 1 A_CustomMissile("BazookaRocketTrail",0,0,0,0)
        FMIS A 1 A_CustomMissile("BazookaRocketTrail",0,0,0,0)
        FMIS A 1 A_CustomMissile("BazookaRocketTrail",0,0,0,0)
        FMIS A 0 a_playsound("BazookaFly", CHAN_WEAPON, 1.0, 1, ATTN_NORM)
        FMIS A 0 a_seekermissile(5,20)
        FMIS A 1 A_ChangeVelocity (5.0, random(-2.5,2.5), random(-1.0,2.5),1) 
        FMIS A 1 A_CustomMissile("BazookaRocketTrail",0,0,0,0)
        FMIS A 1 A_CustomMissile("BazookaRocketTrail",0,0,0,0)
        FMIS A 1 A_CustomMissile("BazookaRocketTrail",0,0,0,0)
        FMIS A 0 a_playsound("BazookaFly", CHAN_WEAPON, 1.0, 1, ATTN_NORM)
        FMIS A 0 a_seekermissile(5,20)
        FMIS A 1 A_ChangeVelocity (5.0, random(-2.5,2.5), random(-2.5,2.5),1) 
        goto flight
      Flight:
        FMIS A 0 a_seekermissile(5,20)
        FMIS A 1 A_ChangeVelocity (5.0, random(-2.5,2.5), random(-2.5,2.5),1) 
        FMIS A 0 a_playsound("BazookaFly", CHAN_WEAPON, 1.0, 1, ATTN_NORM)
        FMIS A 1 A_CustomMissile("BazookaRocketTrail",0,0,0,0)
        FMIS A 1 A_CustomMissile("BazookaRocketTrail",0,0,0,0)
        FMIS A 0 a_seekermissile(10,20)
        FMIS A 1 A_CustomMissile("BazookaRocketTrail",0,0,0,0)
		FMIS A 1 A_CustomMissile("BazookaRocketTrail",0,0,0,0)
        loop
    Death:
    	TNT1 A 0 A_Explode(30)
        BOMB ABCDEFGHIJKLMOPQRST 1 Bright
        Stop
    }
}
 
ACTOR " Drunk Missile Launcher " : Weapon 10035
{
	 Weapon.SlotNumber 5
     Weapon.SelectionOrder 10
     Inventory.PickupSound "Pickups/WeaponPick"
     Inventory.Pickupmessage "You recovered a drunk missile!"
     Weapon.AmmoGive 7
     Weapon.AmmoUse 1
     Weapon.AmmoType "DMissiles"
     +NOAUTOAIM 
     +NOGRAVITY
     SCALE 0.6
     AttackSound ""

     States
     { 
     Spawn: 
        PDNK A -1 
        LOOP 
     Ready: 
        DRNK A 1 A_WeaponReady 
        LOOP 
     Deselect: 
        DRNK A 1 A_Lower 
        LOOP 
     Select:
        DRNK A 1 A_Raise
        LOOP 
       Fire: 
        DRNK A 1 Offset(0,36) A_GunFlash
        DRNK A 1 Offset(0,38) 
        DRNK A 1 Offset(0,42) 
        DRNK B 2 Offset(0,40)
        DRNK C 2 Offset(0,38) 
        DRNK D 2 Offset(0,36) 
        DRNK A 1 Offset(0,34)
        DRNK A 1 Offset(0,32)
        DRNK A 7
        DRNK A 0 a_refire
        Goto Ready
	
	 Flash:
        TNT1 A 0 A_PlaySound("DrunkFire")
        TNT1 A 0 A_FireCustomMissile(DrunkM,0,1,1,-8,0)
        TNT1 A 0 A_FireCustomMissile(DrunkM,0,0,1,-8,0)
        TNT1 A 0 A_FireCustomMissile(DrunkM,0,0,1,-8,0)
        TNT1 A 0 A_FireCustomMissile(DrunkM,0,0,1,-8,0)
        TNT1 A 0 A_FireCustomMissile(DrunkM,0,0,1,-8,0)
      stop 
     } 
}  
  
ACTOR DMissiles : Ammo
{
   Inventory.MaxAmount 7
   Ammo.BackpackAmount 1
   Ammo.BackpackMaxAmount 7
   inventory.icon "DUAMA0"
}

ACTOR FBMissiles : Ammo
{
   Inventory.MaxAmount 5
   Ammo.BackpackAmount 1
   Ammo.BackpackMaxAmount 5
   inventory.icon "FBAMA0"
}

ACTOR " Firebomb " : Weapon 10036
{
	 Weapon.SlotNumber 5
     Weapon.SelectionOrder 10
     Inventory.PickupSound "Pickups/WeaponPick"
     Inventory.Pickupmessage "You found a firebomb!"
     Weapon.AmmoGive 5
     Weapon.AmmoUse 1
     Weapon.AmmoType "FBMissiles"
     SCALE 0.666
     +NOAUTOAIM 
     +NOGRAVITY
     Obituary "%k firebombed %o - 'oh the humanity!'"
     States 
     { 
     Spawn: 
        PFBM A -1 
        LOOP 
     Ready: 
        FBOM A 1 A_WeaponReady 
        LOOP 
     Deselect: 
        FBOM A 1 A_Lower 
        LOOP 
     Select:
        FBOM A 1 A_Raise
        LOOP 
     Fire: 
        FBOM A 1 Offset(0,36) A_PlaySound("FirebombFire")
        FBOM A 1 Offset(0,38) A_FireCustomMissile("Fbomb",0,1,0,-16)
        FBOM A 1 Offset(0,42) 
        FBOM B 2 Offset(0,40)
        FBOM C 1 Offset(0,38) 
        FBOM D 1 Offset(0,36) 
        FBOM A 1 Offset(0,34)
        FBOM A 1 Offset(0,32)
        FBOM A 10 
        FBOM A 0 a_refire
        Goto Ready 
     } 
}  
  
actor Fbomb
{ 
    Radius 20
    Height 6
    Speed 32
    Damage 20
    damagetype Fire
    SCALE 0.55 
    PROJECTILE
    +EXTREMEDEATH
    +dontfall
    +FOILINVUL
    DeathSound "FireBombExplode2"
    States
    {
    Spawn:
        FMIS A 0 a_playsound("BazookaFly")
        FMIS AAAAAAAAAAAAAA 1 A_CustomMissile("BazookaRocketTrail",0,0,0,0)    
        Loop
    Death:
          TNT1 A 0 A_NoGravity
		TNT1 A 0 A_Explode
          TNT1 A 2 Radius_Quake(5, 60,0, 16, 0)
          TNT1 A 0 A_CustomMissile("Fbomber", 8, 0, 0,6)
          TNT1 A 0 A_CustomMissile("Fbomber", 8, 0, 90,6)
          TNT1 A 0 A_CustomMissile("Fbomber", 8, 0, 180,6)
          TNT1 A 0 A_CustomMissile("Fbomber", 8, 0, 270,6)
		TNT1 A 0 A_CustomMissile("FbombEffect", 8)
        Stop
    }
}

Actor FbombEffect
{
	PROJECTILE
	+RIPPER
	Damage 0
	Scale 0.55
	Speed 0
	
	States
	{
		Spawn:
			TNT1 A 0 
          BOMB B 2 Bright
		TNT1 A 0 A_PlaySound ("FireBombExplode1",CHAN_AUTO,1.0)
          BOMB C 2 Bright
		TNT1 A 0 A_PlaySound ("FireBombExplode2",CHAN_AUTO,1.0)
          BOMB D 2 Bright
		TNT1 A 0 A_PlaySound ("FireBombExplode1",CHAN_AUTO,1.0)
          BOMB E 2 Bright
		TNT1 A 0 A_PlaySound ("FireBombExplode2",CHAN_AUTO,1.0)
          BOMB F 2 Bright
		TNT1 A 0 A_PlaySound ("FireBombExplode1",CHAN_AUTO,1.0)
		  BOMB GHIJKLMOPQRST 2 Bright
		 Stop
	}
}

ACTOR Fbomber
{
      Height 6
     +NOGRAVITY
     +FOILINVUL
     +NOEXPLODEFLOOR
     +RIPPER
	 +NOBLOCKMAP
	 +MISSILE
     Speed 28
     States
     {
     Spawn:
	  
          TNT1 A 2 A_CustomMissile("Fboming", 1, 0, 0,6)
          TNT1 A 2 A_CustomMissile("Fboming", 1, 0, 0,6)
          TNT1 A 2 A_CustomMissile("Fboming", 1, 0, 0,6)
          TNT1 A 2 A_CustomMissile("Fboming", 1, 0, 0,6)
          TNT1 A 2 A_CustomMissile("Fboming", 1, 0, 0,6)
          Stop
     }
}

ACTOR Fboming
{
    Radius 11
    Height 6
    Speed 0
    Scale 0.6
    damagetype Fire
     MONSTER
	 -SHOOTABLE
	 -SOLID
	 -COUNTKILL
     +NOGRAVITY
     +FOILINVUL
     +RANDOMIZE
     +NOEXPLODEFLOOR
	 +NOBLOCKMAP
     States
     {
     Spawn:
		TNT1 A 0
     goto death
     Death:
          BOMB A 0 A_explode(96,128)
          BOMB ABCDEFGHIJKLMOPQRST  2 Bright
          Stop
     }
}