//Items
Actor Backpack3 : Backpack replaces ArtiBoostMana
{
  Inventory.PickupMessage "Picked up backpack full of!... well, mana!"
  Inventory.PickupSound "Backpack/Pickup"
}

//Torch, Wings, and the Urn got replaced in Heretic, so it affects it here, too.
Actor AmuletOfWardingSpawner : RandomSpawner replaces AmuletOfWarding { DropItem "SecurityVest" }
Actor PlatinumHelmSpawner : RandomSpawner replaces PlatinumHelm { DropItem "SecurityVest" }
Actor MeshArmorSpawner : BodyArmor replaces MeshArmor { DropItem "BodyArmor" }
Actor FalconShieldSpawner : RandomSpawner replaces FalconShield { DropItem "BodyArmor" }

Actor ArtiBoostArmorSpawner  : RandomSpawner replaces ArtiBoostArmor { DropItem "BodyArmor" }
Actor ArtiInvulnerability2Spawner : RandomSpawner replaces ArtiInvulnerability2 { DropItem "InvulnerabilitySphere2" }
Actor ArtiSpeedBootsSpawner : RandomSpawner replaces ArtiSpeedBoots { DropItem "BlazingSphere" }
Actor ArtiPorkSpawner : RandomSpawner replaces ArtiPork { DropItem "MacheteAmmo" }

//Items without any replacements
Actor ArtiBlastRadiusSpawner : RandomSpawner replaces ArtiBlastRadius {}
Actor ArtiArtiTeleportSpawner : RandomSpawner replaces ArtiTeleport {}
Actor ArtiArtiTeleportOtherSpawner : RandomSpawner replaces ArtiTeleportOther {}
Actor ArtiDarkServantSpawner : RandomSpawner replaces ArtiDarkServant {}

Actor ArtiHealingRadiusSpawner : RandomSpawner replaces ArtiHealingRadius
{
	DropItem "Berserk2" 255 1
	DropItem "BlazingSphere" 255 1
	DropItem "Whiskey" 255 1
	DropItem "Soulsphere2" 255 1
}

ACTOR BlueMana : Ammo replaces Mana1
{
  Radius 8
  Height 8
  Inventory.Amount 25
  Inventory.MaxAmount 500
  Ammo.BackpackAmount 100
  Ammo.BackpackMaxAmount 1000
  Inventory.PickupMessage "Blue stuff that powers your guns!"
  Inventory.Icon "MAN1I0"
  +FLOATBOB
  +NOGRAVITY
  States
  {
  Spawn:
    MAN1 ABCDEFGHI 2 Bright
    Loop
  }
}

ACTOR GreenMana : Ammo replaces Mana2
{
  Radius 8
  Height 8
  Inventory.Amount 25
  Inventory.MaxAmount 500
  Ammo.BackpackAmount 100
  Ammo.BackpackMaxAmount 1000
  Inventory.PickupMessage "Green stuff that powers your guns!"
  Inventory.Icon "MAN2G0"
  +FLOATBOB
  +NOGRAVITY
  States
  {
  Spawn:
    MAN2 ABCDEFGHIJKLMNOP 2 Bright
    Loop
  }
}

//Now 100% more endlessly annoying during invasion-style levels, doctor Freeman.
ACTOR CombineMana : CustomInventory replaces Mana3
{
  Radius 8
  Height 8
  Inventory.PickupMessage "Holy shit, it's red stuff that powers your guns!"
  +FLOATBOB
  States
  {
  Spawn:
    MAN3 ABCDEFGHIJKLMNOP 2 Bright
    Loop
  Pickup:
    TNT1 A 0 A_GiveInventory("BlueMana", 25)
    TNT1 A 0 A_GiveInventory("GreenMana", 25)
    Stop
  }
}

//Weapons

actor Sidekick2 : Sidekick
{
  Weapon.AmmoType2 "BlueMana"
  Tag "Sidekick"
  States
  {
  ZoomedReload:
    SDKZ A 0 A_PlaySound("Sights/Weapon",5,0.8)
	SDKZ A 0 A_ZoomFactor(1)
    SDKZ FEDCBA 1
    SDKG A 2 A_TakeInventory("SidekickZoomed",1)
    SDKG A 0 A_GiveInventory("SidekickZoomReload",1)
  Reload:
    SDKG A 0 A_JumpIfInventory("SidekickZoomed",1,"ZoomedReload")
	SDKG A 0 A_JumpIfInventory("SidekickClip",0,"ReadyMain")
	SDKG A 0 A_JumpIfInventory("BlueMana",1,1)
	Goto ReadyMain
	SDKG A 0 A_JumpIfInventory("SidekickClip",1,"ReloadMain")
  GetToDaChoppa:
	SDKG A 0 A_GiveInventory("SidekickEmptiedToken",1)
  ReloadMain:
	SDKG A 0 A_PlaySound("Sidekick/Out",4)
	//SDKO ABCDEF 1
	//SDKO G 5 A_SpawnItemEx("SidekickClipDrop",0,0,20)
	/*SDKC ABCDEFGHIJKLMNOPQ 1
	SDKN ABCDEFGHIJ 1*/
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	SDKN A 1 A_JumpIf(Health<75,2)
	SDKN BC 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	SDKN D 1 A_JumpIf(Health<50,2)
	SDKN E 1
	SDKN F 1 A_SpawnItemEx("SidekickClipDrop",0,0,20)
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	SDKN G 1 A_JumpIf(Health<25,2)
	SDKN HI 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	SDKN J 1 A_JumpIf(Health<75,2)
	SDKN K 1
	SDKL A 0 A_PlaySound("Sidekick/In",4)
	SDKL A 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	SDKL B 1 A_JumpIf(Health<50,2)
	SDKL CD 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	SDKL E 1 A_JumpIf(Health<25,2)
	SDKL F 1
  ReloadWorking:
	TNT1 A 0 A_TakeInventory("BlueMana",1,TIF_NOTAKEINFINITE)
	TNT1 A 0 A_GiveInventory("SidekickClip",1)
	TNT1 A 0 A_JumpIfInventory("SidekickClip",0,2)
	TNT1 A 0 A_JumpIfInventory("BlueMana",1,2)
	TNT1 A 0
	Goto ReloadFinish
	TNT1 A 0
	Goto ReloadWorking
  ReloadFinish:
	SDKL FGHIJ 1
	SDKG A 0 A_JumpIfInventory("SidekickEmptiedToken",1,"Kaczink")
	SDKG A 2
    SDKG A 0 A_JumpIfInventory("SidekickZoomReload",1,"Derp")
	Goto ReadyMain
  Kaczink:
    FMGG A 0 A_TakeInventory("SidekickEmptiedToken",1)
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	SDKS A 1 A_JumpIf(Health<75,2)
	SDKS BC 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	SDKS D 1 A_JumpIf(Health<50,2)
	SDKS EF 1
	SDKS F 0 A_PlaySound("Sidekick/Cock",4)
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	SDKS G 1 A_JumpIf(Health<25,2)
	SDKS HI 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	SDKS J 1 A_JumpIf(Health<75,2)
	SDKS KL 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	SDKS M 1 A_JumpIf(Health<50,2)
	SDKS NO 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	SDKG A 1 A_JumpIf(Health<25,1)
	SDKG A 1
    FMGF A 0 A_JumpifInventory("SidekickZoomReload",1,"Derp")
	Goto ReadyMain
  }
}

actor CWeapStaffSpawner : RandomSpawner replaces CWeapStaff
{
  DropItem "Colts"
}

ACTOR FWeapAxe_Spawner replaces FWeapAxe
{
	+NOINTERACTION
	+NOGRAVITY
	States
	{
	Spawn:
	TNT1 A 3 NoDelay A_JumpIf(CallACS("CheckMode"), "DualPickup") //So much for instant dual-wield in multi.
	TNT1 A 0 A_SpawnItemEx("Fleshrend2Pickup")
	Stop
	DualPickup:
	TNT1 A 0 A_SpawnItemEx("Fleshrend2_DualSpawner",0,0,0,0,0,0,0,SXF_TRANSFERSPECIAL,0)
	Stop
	}
}

ACTOR Fleshrend2_DualSpawner : RandomSpawner
{
	DropItem "Fleshrend2_Dual"
}

ACTOR Fleshrend2_Dual : WeaponGiver
{
	Inventory.PickupMessage "Obtained a pair of really damn stylish ''Fleshrend'' sawed-offs! Peeling off the skins - multiple enemies at a time! (3)"
	DropItem "Fleshrend2"
	States
	{
	Spawn:
	RND2 X -1
	Stop
	}
}

ACTOR Fleshrend2Pickup : CustomInventory
{
	Inventory.PickupSound "misc/w_pkup"
	Inventory.PickupMessage "Obtained a really damn stylish ''Fleshrend'' sawed-off! Peeling off the skins - multiple enemies at a time! (3)"
	States
	{
		Spawn:
		RNDG X -1
		Stop
		Pickup:
		TNT1 A 0 A_JumpIfInventory("FleshrendPickupCounter",2,"CheckAmmo")
		Goto GiveItNevertheless
		CheckAmmo:
		TNT1 A 0 A_JumpIfInventory("BlueMana",0,"Bailure")
		GiveItNevertheless:
		TNT1 A 0 A_GiveInventory("Fleshrend2")
		TNT1 A 0 A_GiveInventory("FleshrendPickupCounter")
		Stop
		Bailure:
		RNDG X 1
		Fail
	}
}

actor Fleshrend2 : Fleshrend
{
  Weapon.AmmoType "BlueMana"
  Weapon.AmmoType2 "BlueMana"
  Weapon.AmmoUse 4
  Weapon.AmmoUse2 4
  Weapon.AmmoGive 24
  Tag "Fleshrend"
  States
  {
  Fire:
	TNT1 A 0
	Stop
  SingleLFire:
    RNDF A 0 A_JumpIfInventory("BlueMana",4,1)
	Goto Nope
	RNDF A 0 A_PlaySound("Fleshrend/Fire",1,0.7)
	RNDF A 0 A_PlaySound("Fleshrend/Add",5,0.6)
	RNDF A 0 A_FireCustomMissile("GunsmokeSpawner_Medium",0,0,12,0)
    RNDF A 0 A_FireBullets(8.0, 2.0, 16, 5, "BulletPuff")
	RNDF A 0 A_AlertMonsters
	RNDF A 0 A_Recoil(2)
	RNDF A 0 A_Light1
    RNDF A 1 Bright A_SetPitch(pitch-2.5)
	RNDF B 1 Bright A_SetPitch(pitch-1.25)
	RNDF A 0 A_Light2
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	RNDR A 1 A_JumpIf(Health<75,2)
	RNDR BC 1
	RNDR C 0 A_Light0
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	RNDR D 1 A_JumpIf(Health<50,2)
	RNDR EFG 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	RNDR H 1 A_JumpIf(Health<25,2)
	RNDR I 1
	RNDR I 0 A_PlaySound("Fleshrend/Out",4,0.6)
	RNDR JJ 0 A_FireCustomMissile("FleshyCasingSpawner",0,0,-1,2)
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	RNDR J 1 A_JumpIf(Health<75,2)
	RNDR KL 1
	RNDR O 0 A_PlaySound("Fleshrend/In",4,0.5)
	RNDR MNO 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	RNDR P 1 A_JumpIf(Health<50,2)
	RNDR QRST 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	RNDR U 1 A_JumpIf(Health<25,2)
	RNDG A 2
	RNDR A 0 A_JumpIfInventory("SynthFireLeft",1,"SingleLFire")
	Goto RightIdle
  Nope:
	RNDT A 0 A_PlaySound("Fleshrend/Dry",5,0.8)
	RNDT ABC 1
	RNDG A 8
    Goto RightIdle
  RightIdle:
	RNDG A 1
	RNDG A 0 A_JumpIfInventory("MacheteGoesFast",1,"SingleCaberToss")
	RNDG A 0 A_JumpIfInventory("FleshRendPickupCounter", 2, "FlashRestart") // Can't believe it was actually this stupidly simple.
	RNDG A 0 A_JumpIfInventory("SynthFireLeft",1,"SingleLFire")
	Loop
  FlashRestart: // The reason both guns fire is because the right gunflash is still checking for the left token! Restart and everything's great.
	TNT1 A 0 A_Gunflash("Dualwelding",GFF_NOEXTCHANGE)
	Stop
  SingleCaberToss:
	RNDN CBA 1

	TNT1 A 6
    MC4S A 0 A_PlaySound("Machete1/Slash",1,0.9)
    MC4S A 0 A_PlaySound("Machete2/Slash",5,0.2)
	MCHT ABC 1
	TNT1 A 0 A_JumpIfInventory("PowerStrength2",1,3)
	MCHT A 0 A_SpawnItemEX("MacheterangProjectile",cos(-pitch)*48,0,32+(sin(-pitch)*48),cos(-pitch)*35,0,sin(-pitch)*35,0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
	TNT1 A 0 A_Jump(256,2)
	MCHT A 0 A_SpawnItemEX("MacheterangBerserkProjectile",cos(-pitch)*48,0,32+(sin(-pitch)*48),cos(-pitch)*25,0,sin(-pitch)*25,0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
	// This solution is ten times better. Just let it bouncecount out.
    TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	MCHT D 1 A_JumpIf(Health<75,1)
	MCHT E 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	MCHT F 1 A_JumpIf(Health<50,1)
	MCHT G 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	MCHT H 1 A_JumpIf(Health<25,1)
	MCHT I 1
	TNT1 A 3
	MCHT A 0 A_TakeInventory("MacheteAmmo")

	RNDN ABC 1
	Goto RightIdle

  LFire:
    RNDF A 0 A_JumpIfInventory("BlueMana",4,1)
	Goto LNope
	RNDF A 0 A_PlaySound("Fleshrend/Fire",1,0.7)
	RNDF A 0 A_PlaySound("Fleshrend/Add",5,0.6)
	RNDF A 0 A_FireCustomMissile("GunsmokeSpawner_Medium",0,0,-14,0)
    RNDF A 0 A_FireBullets(8.0, 2.0, 16, 5, "BulletPuff")
	RNDF A 0 A_AlertMonsters
	RNDF A 0 A_Recoil(2)
	RNDF A 0 A_Light1
    RNDF C 1 Bright A_SetPitch(pitch-2.5)
	RNDF D 1 Bright A_SetPitch(pitch-1.25)
	RNDF D 0 A_Light2
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	RNDL A 1 A_JumpIf(Health<75,2)
	RNDL BC 1
	RNDL C 0 A_Light0
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	RNDL D 1 A_JumpIf(Health<50,2)
	RNDL EFG 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	RNDL H 1 A_JumpIf(Health<25,2)
	RNDL I 1
	RNDL I 0 A_PlaySound("Fleshrend/Out",6,0.6)
	RNDR JJ 0 A_FireCustomMissile("FleshyCasingSpawnerReversed",0,0,-1,2)
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	RNDL J 1 A_JumpIf(Health<75,2)
	RNDL KL 1
	RNDL O 0 A_PlaySound("Fleshrend/In",6,0.5)
	RNDL MNO 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	RNDL P 1 A_JumpIf(Health<50,2)
	RNDL QRST 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	RNDL U 1 A_JumpIf(Health<25,2)
	RNDG B 2
	RNDR A 0 A_JumpIfInventory("SynthFireLeft",1,"LFire")
	Goto LIdle
  LNope:
	RNDT A 0 A_PlaySound("Fleshrend/Dry",5,0.8)
	RNDT DEF 1
	RNDG B 8
    Goto LIdle
  NullFlash:
    TNT1 A 0
	Stop
  Dualwelding:
    RNDG A 0 A_JumpIfInventory("FleshrendPickupCounter",2,"Ridle")
	TNT1 A 0 A_JumpIfInventory("SynthFireActive",1,1)
	Stop
	TNT1 A 0 A_Light0
	Goto RightIdle
  RIdle:
	RNDG A 1
	RNDG A 0 A_JumpIfInventory("MacheteGoesFast",1,"CaberToss")
	RNDG A 0 A_JumpIfInventory("SynthFireRight",1,"RFire")
    Loop
  RFire:
    RNDF A 0 A_JumpIfInventory("BlueMana",4,1)
	Goto RNope
	RNDF A 0 A_PlaySound("Fleshrend/Fire",1,0.7)
	RNDF A 0 A_PlaySound("Fleshrend/Add",5,0.6)
	RNDF A 0 A_FireCustomMissile("GunsmokeSpawner_Medium",0,0,14,0)
    RNDF A 0 A_FireBullets(8.0, 2.0, 16, 5, "BulletPuff")
	RNDF A 0 A_AlertMonsters
	RNDF A 0 A_Recoil(2)
	RNDF A 0 A_Light1
    RNDF A 1 Bright A_SetPitch(pitch-2.5)
	RNDF B 1 Bright A_SetPitch(pitch-1.25)
	RNDF A 0 A_Light2
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	RNDR A 1 A_JumpIf(Health<75,2)
	RNDR BC 1
	RNDR C 0 A_Light0
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	RNDR D 1 A_JumpIf(Health<50,2)
	RNDR EFG 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	RNDR H 1 A_JumpIf(Health<25,2)
	RNDR I 1
	RNDR I 0 A_PlaySound("Fleshrend/Out",4,0.6)
	RNDR JJ 0 A_FireCustomMissile("FleshyCasingSpawner",0,0,-1,2)
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	RNDR J 1 A_JumpIf(Health<75,2)
	RNDR KL 1
	RNDR O 0 A_PlaySound("Fleshrend/In",4,0.5)
	RNDR MNO 1 
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	RNDR P 1 A_JumpIf(Health<50,2)
	RNDR QRST 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	RNDR U 1 A_JumpIf(Health<25,2)
	RNDG A 2
	RNDL A 0 A_JumpIfInventory("SynthFireRight",1,"RFire")
	Goto RIdle
  RNope:
	RNDT D 0 A_PlaySound("Fleshrend/Dry",4,0.8)
	RNDT ABC 1
	RNDG A 8
    Goto RIdle
  CaberToss:
	RNDN CBA 1

	TNT1 A 6
    MC4S A 0 A_PlaySound("Machete1/Slash",1,0.9)
    MC4S A 0 A_PlaySound("Machete2/Slash",5,0.2)
	MCHT ABC 1
	TNT1 A 0 A_JumpIfInventory("PowerStrength2",1,3)
	MCHT A 0 A_SpawnItemEX("MacheterangProjectile",cos(-pitch)*48,0,32+(sin(-pitch)*48),cos(-pitch)*35,0,sin(-pitch)*35,0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
	TNT1 A 0 A_Jump(256,2)
	MCHT A 0 A_SpawnItemEX("MacheterangBerserkProjectile",cos(-pitch)*48,0,32+(sin(-pitch)*48),cos(-pitch)*25,0,sin(-pitch)*25,0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
	// This solution is ten times better. Just let it bouncecount out.
    TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	MCHT D 1 A_JumpIf(Health<75,1)
	MCHT E 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	MCHT F 1 A_JumpIf(Health<50,1)
	MCHT G 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	MCHT H 1 A_JumpIf(Health<25,1)
	MCHT I 1
	TNT1 A 3
	MCHT A 0 A_TakeInventory("MacheteAmmo")

	RNDN ABC 1
	Goto RIdle
  }
}

actor ChromeJustice2 : ChromeJustice replaces FWeapHammer
{
  Weapon.AmmoGive2 64
  Weapon.AmmoType2 "GreenMana"
  Tag "Chrome Justice"
  States
  {
  Reload:
	TNT1 A 0 A_JumpIfInventory("IsReloading2",1,"Reload2")
	TNT1 A 0 A_JumpIfInventory("ChromeJusticeClip",0,"ReadyMain")
	TNT1 A 0 A_JumpIfInventory("GreenMana",8,1)
	Goto ReadyMain
  ReloadMain:
    PCFG B 0 A_JumpIfInventory("ChromeJusticeClip",1,"ReloadMainie")
	Goto DriedToBoot
  DriedToBoot:
    PCFG B 0 A_GiveInventory("DryToken",1)
	Goto ReloadMainie
  ReloadMainie:
	TNT1 A 0 A_GiveInventory("IsReloading",1)
	PCFP A 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	PCFP B 1 A_JumpIf(Health<75,2)
	PCFP CDEF 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	PCFP G 1 A_JumpIf(Health<50,2)
	PCFP HI 1
	PCFH CE 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	PCFH G 1 A_JumpIf(Health<25,2)
	PCFH HJK 1
	PCFH L 4
  ReloadWorking:
    PCFR A 0 A_PlaySound("ChromeJustice/Load",4)
	SDKU A 0 A_GiveInventory("ZoomReFire",1)
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	PCFR E 1 A_JumpIf(Health<50,2)
	PCFR FHI 1
	TNT1 A 0 A_TakeInventory("GreenMana",8,TIF_NOTAKEINFINITE)
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	PCFR K 1 A_JumpIf(Health<25,2)
	PCFR LM 1
	TNT1 A 0 A_GiveInventory("ChromeJusticeClip",1)
	PCFH L 3 A_WeaponReady(WRF_NOBOB|WRF_NOSWITCH|WRF_ALLOWZOOM)
	SDKU A 0 A_TakeInventory("ZoomReFire",1)
	TNT1 A 0 A_JumpIfInventory("ChromeJusticeClip",0,"ReloadFinish")
	TNT1 A 0 A_JumpIfInventory("GreenMana",8,"ReloadWorking")
	Goto ReloadFinish
  Reload2:
    PCFR A 0 A_TakeInventory("IsReloading2",1)
	TNT1 A 0 A_JumpIfInventory("ChromeJusticeClip",0,"ReloadFinish")
	TNT1 A 0 A_JumpIfInventory("GreenMana",8,"ReloadWorking")
	Goto ReloadFinish
  ReloadFinish:
	FMGU A 0 A_TakeInventory("ZoomReFire",1)
    PCFH L 1 A_TakeInventory("IsReloading",1)
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,4)
	PCFH L 0 A_JumpIf(Health<50,3)
	PCFH LKJH 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	PCFH G 1 A_JumpIf(Health<25,2)
	PCFH EC 1
	PCFH A 0 A_JumpIfInventory("DryToken",1,"Kaczink")
	TNT1 A 0 A_Jump(256,"GoingBackToMacDonalds")
	Goto GoingBackToMacDonalds
	}
}

ACTOR MWeapLightning_Spawner replaces MWeapFrost
{
	+NOINTERACTION
	+NOGRAVITY
	States
	{
	Spawn:
	TNT1 A 3 NoDelay A_JumpIf(CallACS("CheckMode"), "DualPickup")
	TNT1 A 0 A_SpawnItemEx("Leadspitter2Pickup")
	Stop
	DualPickup:
	TNT1 A 0 A_SpawnItemEx("Leadspitter2_DualSpawner",0,0,0,0,0,0,0,SXF_TRANSFERSPECIAL,0)
	Stop
	}
}

ACTOR Leadspitter2_SingleSpawner : RandomSpawner
{
	DropItem "Leadspitter2"
}

ACTOR Leadspitter2_DualSpawner : RandomSpawner
{
	DropItem "Leadspitter2_Dual"
}

ACTOR Leadspitter2_Dual : WeaponGiver
{
	Inventory.PickupMessage "Grabbed a pair of SC-P30 ''Leadspitter'' uzis! Let there be firefight, till they all fall to the ground! (4)"
	DropItem "Leadspitter2"
	States
	{
	Spawn:
	UZI2 X -1
	Stop
	}
}

ACTOR Leadspitter2Pickup : CustomInventory
{
	Inventory.PickupSound "misc/w_pkup"
	Scale 0.85
	States
	{
		Spawn:
		UZIG X -1
		Stop
		Pickup:
		TNT1 A 0 A_JumpIfInventory("LeadspitPickupCounter",2,"CheckAmmo")
		Goto GiveItNevertheless
		CheckAmmo:
		TNT1 A 0 A_JumpIfInventory("BlueMana",0,"Bailure")
		GiveItNevertheless:
		TNT1 A 0 A_GiveInventory("Leadspitter2")
		TNT1 A 0 A_GiveInventory("LeadspitPickupCounter")
		TNT1 A 0 A_GiveInventory("BlueMana",60)
		Stop
		Bailure:
		UZIG X 1
		Fail
	}
}

actor Leadspitter2 : Leadspitter
{
  Weapon.AmmoGive2 0
  Weapon.AmmoType2 "BlueMana"
  Tag "Leadspitter"
  States
  {
  Reload:
	UZIG A 0 A_JumpIfInventory("LeadspitPickupCounter",2,"TwinReload")
	UZIG A 0 A_GiveInventory("IsReloading",1)
	Goto SingleLIdle
  SingleLIdle:
    TNT1 A 0 A_JumpIfInventory("LeadspitPickupCounter",2,"LIdle")
	TNT1 A 0 A_JumpIfInventory("SynthFireZoom",1,"Punch")
    TNT1 A 1 A_WeaponReady(WRF_NOFIRE|WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
	Loop
  RightIdle:
	UZIG A 1
	RNDG A 0 A_JumpIfInventory("LeadspitPickupCounter", 2, "FlashRestart")
    RNDG A 0 A_JumpIfInventory("MacheteGoesFast",1,"SingleCaberToss")
	RNDG A 0 A_JumpIfInventory("IsReloading",1,"SingleReload")
	RNDG A 0 A_JumpIfInventory("SynthFireLeft",1,"SingleLFire")
	Loop
  SingleReload:
    UZIG A 0 A_TakeInventory("IsReloading",1)
	UZIG A 0 A_JumpIfInventory("UziClipRight",0,"RightIdle")
	UZ2G A 0 A_JumpIfInventory("BlueMana",1,1)
	Goto RightIdle
	UZIO A 0 A_PlaySound("Uzi/Out",5,0.7)
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	UZIO A 1 A_JumpIf(Health<75,2)
	UZIO BC 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	UZIO D 1 A_JumpIf(Health<50,2)
	UZIO EF 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	UZIO G 1 A_JumpIf(Health<25,2)
	UZIO HI 1
	UZIO J 0 A_SpawnItemEx("UziClipDrop",0,0,20,0,1)
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	UZIO J 5 A_JumpIf(Health<75,1)
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	UZIO J 5 A_JumpIf(Health<50,1)
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	UZIO J 5 A_JumpIf(Health<25,1)
	UZIR A 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	UZIR B 1 A_JumpIf(Health<75,1)
	UZIR C 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	UZIR D 1 A_JumpIf(Health<50,1)
	UZIR E 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	UZIR F 1 A_JumpIf(Health<25,1)
	UZIR A 0 A_PlaySound("Uzi/In",5,0.7)
	UZIR GHI 1
	/*Before punching was added, there was a handed reload, but suddenly growing 3rd hand doesn't make sense... unless you are James Bond. (not that those uzis aren't reference to certain infamous machineguns from certain game, heh.)
	
	UZIO A 0 A_PlaySound("Uzi/Out",5,0.7)
	UZIO ABCDEFGHI 1
	UZIO J 20 A_SpawnItemEx("UziClipDrop",0,0,20,0,1)
	UZII ABCDEF 1
	UZII A 0 A_PlaySound("Uzi/In",5,0.7)
	UZII GHI 1*/
  Start:
	TNT1 A 0 A_JumpIfInventory("UziClipRight",0,"End")
	TNT1 A 0 A_JumpIfInventory("BlueMana",1,1)
	Goto End
	TNT1 A 0 A_TakeInventory("BlueMana",1,1)
	TNT1 A 0 A_GiveInventory("UziClipRight",1)
	goto Start
  End:
	/*UZII JKLMNOP 1
	UZIO CBA 1
	UZIG A 3*/
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	UZIR J 1 A_JumpIf(Health<75,1)
	UZIR K 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	UZIR L 1 A_JumpIf(Health<50,1)
	UZIR M 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	UZIR N 1 A_JumpIf(Health<25,1)
	UZIR O 1
	UZIR P 1
	UZIO CBA 1
	UZIG A 3 A_TakeInventory("IsReloading",1)
	Goto RightIdle
  FlashRestart:
	TNT1 A 0 A_Gunflash("Dualwelding",GFF_NOEXTCHANGE)
	Stop
  SingleCaberToss:
    UZIG A 1 A_JumpIfInventory("MacheteAmmo",1,1)
	Goto RightIdle
	UZIU CBA 1

	TNT1 A 6
    MC4S A 0 A_PlaySound("Machete1/Slash",1,0.9)
    MC4S A 0 A_PlaySound("Machete2/Slash",5,0.2)
	MCHT ABC 1
	TNT1 A 0 A_JumpIfInventory("PowerStrength2",1,3)
	MCHT A 0 A_SpawnItemEX("MacheterangProjectile",cos(-pitch)*48,0,32+(sin(-pitch)*48),cos(-pitch)*35,0,sin(-pitch)*35,0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
	TNT1 A 0 A_Jump(256,2)
	MCHT A 0 A_SpawnItemEX("MacheterangBerserkProjectile",cos(-pitch)*48,0,32+(sin(-pitch)*48),cos(-pitch)*25,0,sin(-pitch)*25,0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
	// This solution is ten times better. Just let it bouncecount out.
    TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	MCHT D 1 A_JumpIf(Health<75,1)
	MCHT E 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	MCHT F 1 A_JumpIf(Health<50,1)
	MCHT G 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	MCHT H 1 A_JumpIf(Health<25,1)
	MCHT I 1
	TNT1 A 3
	MCHT A 0 A_TakeInventory("MacheteAmmo")

	UZIU ABC 1
	Goto RightIdle
	
  TwinReload:
	UZ2G A 0 A_GiveInventory("IsReloading",1)
	Goto LIdle
  LIdle:
	UZ2G A 0 A_JumpIfInventory("SynthFireLeft",1,"LFire")
	UZ2G A 0 A_JumpIfInventory("SynthFireZoom",1,"Punch")
	UZ2G A 0 A_JumpIfInventory("IsReloading",1,"LReload")
    UZ2G A 1 A_WeaponReady(WRF_NOFIRE|WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Loop
  LReload:
	UZ2G A 0 A_JumpIfInventory("UziClipLeft",0,"LBack")
	UZ2G A 0 A_JumpIfInventory("BlueMana",1,1)
	Goto LNope
	UZ2O A 0 A_PlaySound("Uzi/Out",5,0.7)
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	UZ2O A 1 A_JumpIf(Health<75,2)
	UZ2O BC 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	UZ2O D 1 A_JumpIf(Health<50,2)
	UZ2O EF 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	UZ2O G 1 A_JumpIf(Health<25,2)
	UZ2O HI 1
	UZ2O J 0 A_SpawnItemEx("UziClipDrop2",0,0,20,0,1)
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	UZ2O J 5 A_JumpIf(Health<75,1)
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	UZ2O J 5 A_JumpIf(Health<50,1)
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	UZ2O J 5 A_JumpIf(Health<25,1)
	UZ2R A 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	UZ2R B 1 A_JumpIf(Health<75,1)
	UZ2R C 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	UZ2R D 1 A_JumpIf(Health<50,1)
	UZ2R E 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	UZ2R F 1 A_JumpIf(Health<25,1)
	UZ2R A 0 A_PlaySound("Uzi/In",5,0.7)
	UZ2R GHI 1
  LStart:
	TNT1 A 0 A_JumpIfInventory("UziClipLeft",0,"LEnd")
	TNT1 A 0 A_JumpIfInventory("BlueMana",1,1)
	Goto LEnd
	TNT1 A 0 A_TakeInventory("BlueMana",1,1)
	TNT1 A 0 A_GiveInventory("UziClipLeft",1)
	goto LStart
   LEnd:
   TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	UZ2R J 1 A_JumpIf(Health<75,1)
	UZ2R K 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	UZ2R L 1 A_JumpIf(Health<50,1)
	UZ2R M 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	UZ2R N 1 A_JumpIf(Health<25,1)
	UZ2R O 1
	UZ2R P 1
	UZ2O CBA 1
	UZ2G A 3 A_TakeInventory("IsReloading",1)
	Goto LIdle
  LBack:
	UZ2G A 2
	UZ2G A 0 A_TakeInventory("IsReloading",1)
	Goto LIdle
	
  RIdle:
	UZIG A 0 A_JumpIfInventory("MacheteGoesFast",1,"CaberToss")
	UZIG A 0 A_JumpIfInventory("SynthFireRight",1,"RFire")
    UZIG A 0 A_JumpIfInventory("IsReloading",1,"RReload")
	UZIG A 1
    Loop
  RReload:
	UZIG A 0 A_JumpIfInventory("UziClipRight",0,"RBack")
	UZIG A 0 A_JumpIfInventory("BlueMana",1,1)
	Goto RNope
	UZIO A 0 A_PlaySound("Uzi/Out",5,0.7)
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	UZIO A 1 A_JumpIf(Health<75,2)
	UZIO BC 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	UZIO D 1 A_JumpIf(Health<50,2)
	UZIO EF 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	UZIO G 1 A_JumpIf(Health<25,2)
	UZIO HI 1
	UZIO J 0 A_SpawnItemEx("UziClipDrop",0,0,20,0,1)
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	UZIO J 5 A_JumpIf(Health<75,1)
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	UZIO J 5 A_JumpIf(Health<50,1)
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	UZIO J 5 A_JumpIf(Health<25,1)
	UZIR A 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	UZIR B 1 A_JumpIf(Health<75,1)
	UZIR C 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	UZIR D 1 A_JumpIf(Health<50,1)
	UZIR E 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	UZIR F 1 A_JumpIf(Health<25,1)
	UZIR A 0 A_PlaySound("Uzi/In",5,0.7)
	UZIR GHI 1
  RStart:
	TNT1 A 0 A_JumpIfInventory("UziClipRight",0,"REnd")
	TNT1 A 0 A_JumpIfInventory("BlueMana",1,1)
	Goto REnd
	TNT1 A 0 A_TakeInventory("BlueMana",1,1)
	TNT1 A 0 A_GiveInventory("UziClipRight",1)
	goto RStart
  REnd:
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	UZIR J 1 A_JumpIf(Health<75,1)
	UZIR K 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	UZIR L 1 A_JumpIf(Health<50,1)
	UZIR M 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	UZIR N 1 A_JumpIf(Health<25,1)
	UZIR O 1
	UZIR P 1
	UZIO CBA 1
	UZIG A 3 A_TakeInventory("IsReloading",1)
	Goto RIdle
  RBack:
	UZ2G A 0 A_TakeInventory("IsReloading",1)
	Goto RIdle
  CaberToss:
    UZIG A 1 A_JumpIfInventory("MacheteAmmo",1,1)
	Goto RIdle
	UZIU CBA 1

	TNT1 A 6
    MC4S A 0 A_PlaySound("Machete1/Slash",1,0.9)
    MC4S A 0 A_PlaySound("Machete2/Slash",5,0.2)
	MCHT ABC 1
	TNT1 A 0 A_JumpIfInventory("PowerStrength2",1,3)
	MCHT A 0 A_SpawnItemEX("MacheterangProjectile",cos(-pitch)*48,0,32+(sin(-pitch)*48),cos(-pitch)*35,0,sin(-pitch)*35,0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
	TNT1 A 0 A_Jump(256,2)
	MCHT A 0 A_SpawnItemEX("MacheterangBerserkProjectile",cos(-pitch)*48,0,32+(sin(-pitch)*48),cos(-pitch)*25,0,sin(-pitch)*25,0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
	// This solution is ten times better. Just let it bouncecount out.
    TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	MCHT D 1 A_JumpIf(Health<75,1)
	MCHT E 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	MCHT F 1 A_JumpIf(Health<50,1)
	MCHT G 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	MCHT H 1 A_JumpIf(Health<25,1)
	MCHT I 1
	TNT1 A 3
	MCHT A 0 A_TakeInventory("MacheteAmmo")

	UZIU ABC 1
	Goto RIdle
  }
}

actor FMG2 : FMG replaces MWeapLightning
{
  Weapon.AmmoGive2 70
  Weapon.AmmoType2 "BlueMana"
  Tag "Fucking Machine Gun"
  States
  {
  ZoomedReload:
    FMIU A 0 A_PlaySound("Sights/Weapon",5,0.8)
	FMIU A 0 A_ZoomFactor(1)
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
    FMIU F 1 A_JumpIf(Health<75,2)
	FMIU ED 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	FMIU C 1 A_JumpIf(Health<50,2)
	FMIU BA 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	FMGG A 1 A_JumpIf(Health<25,2)
	FMGG AA 1
    FMGG A 1 A_TakeInventory("FMGZoomed",1)
    FMGF A 0 A_GiveInventory("FMGZoomReload",1)
  Reload:
    FMGG A 0 A_JumpIfInventory("FMGZoomed",1,"ZoomedReload")
	TNT1 A 0 A_JumpIfInventory("FMGClip",0,"ReadyMain")
	TNT1 A 0 A_JumpIfInventory("BlueMana",1,1)
	Goto ReadyMain
  ReloadCheckForDry:
    FMGG A 0 A_JumpIfInventory("FMGClip",1,2)
	FMGG A 0 A_GiveInventory("FMGEmptiedToken",1)
  ReloadMain:
	FMGH A 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	FMGH C 1 A_JumpIf(Health<75,2)
	FMGH EFG 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	FMGH H 1 A_JumpIf(Health<50,2)
	FMGH IJ 1

	FMGC A 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	FMGC B 1 A_JumpIf(Health<25,2)
	FMGC CDE 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	FMGC F 1 A_JumpIf(Health<75,2)
	FMGC H 1
	FMGC H 0 A_PlaySound("FMG/Out",5)

	FMGC IJ 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	FMGC K 1 A_JumpIf(Health<50,2)
	FMGC LNO 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	FMGC P 1 A_JumpIf(Health<25,2)
	FMGC QR 1
	FMGC T 0 A_SpawnItemEx("FMGClipDrop",0,0,20)
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	FMGC T 0 A_JumpIf(Health<75,2)
	FMGC T 2
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	FMGC T 0 A_JumpIf(Health<50,2)
	FMGC T 2
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,3)
	FMGC T 0 A_JumpIf(Health<25,2)
	FMGC T 2
	FMGC T 2
	FMGI BCDFGHI 1 A_SetAngle(angle-0.2)
  ReloadWorking:
	TNT1 A 0 A_TakeInventory("BlueMana",1,TIF_NOTAKEINFINITE)
	TNT1 A 0 A_GiveInventory("FMGClip", 1)
	TNT1 A 0 A_JumpIfInventory("FMGClip",0,2)
	TNT1 A 0 A_JumpIfInventory("BlueMana",1,2)
	TNT1 A 0 A_Jump(256,"ReloadFinish")
	TNT1 A 0 A_Jump(256,"ReloadWorking")
	Goto ReloadWorking
  }
}

actor Patriarch2 : Patriarch replaces CWeapFlame
{
  Weapon.AmmoGive2 120
  Weapon.AmmoType2 "GreenMana"
  Tag "Patriarch"
  States
  {
  Reload:
	TNT1 A 0 A_JumpIfInventory("PatriarchClip",0,"ReadyMain")
	TNT1 A 0 A_JumpIfInventory("GreenMana",10,1)
	Goto ReadyMain
  ReloadMain:
    PCFG B 0 A_JumpIfInventory("PatriarchClip",1,"ReloadMainie")
	Goto DriedToBoot
  DriedToBoot:
    PCFG B 0 A_GiveInventory("DryToken",1)
	Goto ReloadMainie
  ReloadMainie:
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	PTRH A 1 A_JumpIf(Health<75,1)
	PTRH B 1
	PTRH C 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	PTRH D 1 A_JumpIf(Health<50,1)
	PTRH E 1
	PTRH F 1
	PTRH G 2
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	PTRO A 1 A_JumpIf(Health<25,1)
	PTRO B 1
	PTRO C 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	PTRO D 1 A_JumpIf(Health<75,1)
	PTRO E 1 
	PTRO F 1
	PTRO G 0 A_PlaySound("Patriarch/Out",4)
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	PTRO G 1 A_JumpIf(Health<50,1)
	PTRO H 1
	PTRO I 1
	PTRO J 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	PTRO K 1 A_JumpIf(Health<25,1)
	PTRO L 1
	PTRO M 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	PTRO N 1 A_JumpIf(Health<75,1)
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	PTRO N 1 A_JumpIf(Health<50,1)
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	PTRO N 1 A_JumpIf(Health<25,1)
	PTRO N 5
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	PTRI A 1 A_JumpIf(Health<75,1)
	PTRI BCD 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	PTRI E 1 A_JumpIf(Health<50,1)
	PTRI FG 1
	PTRO G 0 A_PlaySound("Patriarch/In",4)
	PTRI H 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	PTRI I 1 A_JumpIf(Health<25,1)
	PTRI JK 1
	PTRI Z 0 A_SpawnItemEx("PatriarchClipDrop",0,0,20)
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	PTRI Z 1 A_JumpIf(Health<75,1)
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	PTRI Z 1 A_JumpIf(Health<50,1)
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	PTRI Z 1 A_JumpIf(Health<25,1)
	PTRI Z 5
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	PTRI L 1 A_JumpIf(Health<75,1)
	PTRI M 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	PTRI N 1 A_JumpIf(Health<50,1)
	PTRI O 1
	PTRO P 0 A_PlaySound("Patriarch/In2",4)
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	PTRI P 1 A_JumpIf(Health<25,1)
	PTRI Q 1
	PTRI R 1
  ReloadWorking:
	TNT1 A 0 A_TakeInventory("GreenMana",10,TIF_NOTAKEINFINITE)
	TNT1 A 0 A_GiveInventory("PatriarchClip",1)
	TNT1 A 0 A_JumpIfInventory("PatriarchClip",0,"ReloadFinish")
	TNT1 A 0 A_JumpIfInventory("GreenMana",10,"ReloadWorking")
	TNT1 A 0 A_Jump(256,"ReloadFinish")
	Goto ReloadFinish
  }
}

actor Bitchmaker2 : Bitchmaker
{
  Health 3
  Weapon.AmmoGive2 72
  Weapon.AmmoType2 "GreenMana"
  Inventory.PickupMessage "''Bitchmaker'' assembled! Who looks like a bitch now? (5)"
  Tag "Bitchmaker"
  States
  {
    Reload:
	TNT1 A 0 A_JumpIfInventory("MagnumClip",0,"ReadyMain")
	TNT1 A 0 A_JumpIfInventory("GreenMana",12,1)
	Goto ReadyMain
  ReloadMain:
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	BITO A 1 A_JumpIf(Health<75,1)
	BITO B 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	BITO C 1 A_JumpIf(Health<50,1)
	BITO D 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	BITO E 1 A_JumpIf(Health<25,1)
	BITO F 1
	BITO F 0 A_PlaySound("Magnum/Open",5,0.75)
	BITO GH 1
	BITO IJ 1 A_FireCustomMissile("BuellerCasingSpawner2",0,0,1,2)
	BITO KKKK 1 A_FireCustomMissile("BuellerCasingSpawner2",0,0,1,2)
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	BITO K 2 A_JumpIf(Health<75,1)
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	BITO K 2 A_JumpIf(Health<50,1)
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	BITO K 2 A_JumpIf(Health<25,1)
	BITO K 2
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	BITL A 1 A_JumpIf(Health<75,1)
	BITL B 1
	BITL C 0 A_PlaySound("Magnum/Load",5)
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	BITL C 1 A_JumpIf(Health<50,1)
	BITL D 1
	TNT1 A 0 A_JumpIfInventory("PowerBlazing",1,2)
	BITL E 1 A_JumpIf(Health<25,1)
	BITL FG 1
  ReloadWorking:
	TNT1 A 0 A_TakeInventory("GreenMana",12,TIF_NOTAKEINFINITE)
	TNT1 A 0 A_GiveInventory("MagnumClip", 1)
	TNT1 A 0 A_JumpIfInventory("MagnumClip",0,2)
	TNT1 A 0 A_JumpIfInventory("GreenMana",12,2)
	TNT1 A 0 A_Jump(256,"ReloadFinish")
	TNT1 A 0 A_Jump(256,"ReloadWorking")
  }
}

ACTOR BitchmakerPiece : WeaponPiece
{
  Inventory.PickupSound "misc/w_pkup"
  WeaponPiece.Weapon "Bitchmaker2"
  +FLOATBOB
  +NOGRAVITY
}

ACTOR BitchmakerPiece1 : BitchmakerPiece replaces MWeaponPiece1
{
  WeaponPiece.Number 1
  Inventory.PickupMessage "Obtained Bitchmaker's grip!"
  States
  {
  Spawn:
    BTHP A -1 Bright
    Stop
  } 
}

ACTOR BitchmakerPiece2 : BitchmakerPiece replaces MWeaponPiece2
{
  WeaponPiece.Number 2
  Inventory.PickupMessage "Obtained Bitchmaker's cylinder!"
  States
  {
  Spawn:
    BTHP B -1 Bright
    Stop
  } 
}

ACTOR BitchmakerPiece3 : BitchmakerPiece replaces MWeaponPiece3
{
  WeaponPiece.Number 3
  Inventory.PickupMessage "Obtained Bitchmaker's barrel!"
  States
  {
  Spawn:
    BTHP C -1 Bright
    Stop
  } 
}

actor Skullthrottle2 : Skullthrottle
{
  Health 3
  Weapon.AmmoUse1 1
  Weapon.AmmoUse2 1
  Weapon.AmmoGive1 50
  Weapon.AmmoGive2 50
  Weapon.AmmoType1 "GreenMana"
  Weapon.AmmoType2 "BlueMana"
  Inventory.PickupMessage "''Skullthrottle'' assembled! Shreds like John Petrucci! (6)"
  Tag "Skullthrottle"
  +WEAPON.PRIMARY_USES_BOTH
}

ACTOR SkullthrottlePiece : WeaponPiece
{
  Inventory.PickupSound "misc/w_pkup"
  WeaponPiece.Weapon "Skullthrottle2"
  +FLOATBOB
  +NOGRAVITY
}

ACTOR SkullthrottlePiece1 : SkullthrottlePiece replaces CWeaponPiece1
{
  WeaponPiece.Number 1
  Inventory.PickupMessage "Obtained Skullthrottle's handle!"
  States
  {
  Spawn:
    SKLP A -1 Bright
    Stop
  } 
}

ACTOR SkullthrottlePiece2 : SkullthrottlePiece replaces CWeaponPiece2
{
  WeaponPiece.Number 2
  Inventory.PickupMessage "Obtained Skullthrottle's main body!"
  States
  {
  Spawn:
    SKLP B -1 Bright
    Stop
  } 
}

ACTOR SkullthrottlePiece3 : SkullthrottlePiece replaces CWeaponPiece3
{
  WeaponPiece.Number 3
  Inventory.PickupMessage "Obtained Skullthrottle's barrels!"
  States
  {
  Spawn:
    SKLP C -1 Bright
    Stop
  } 
}

actor Nutcracker2 : Nutcracker
{
  Health 3
  Inventory.PickupMessage "''Nutcracker'' assembled! Balls of steel? Well, we'll see about that. (7)"
  Weapon.AmmoUse1 60
  Weapon.AmmoGive1 60
  Weapon.AmmoType1 "BlueMana"
  Weapon.AmmoUse2 60
  Weapon.AmmoGive2 60
  Weapon.AmmoType2 "GreenMana"
  Tag "Nutcracker"
  +WEAPON.PRIMARY_USES_BOTH
}

ACTOR NutcrackerPiece : WeaponPiece
{
  Inventory.PickupSound "misc/w_pkup"
  WeaponPiece.Weapon "Nutcracker2"
  +FLOATBOB
  +NOGRAVITY
}

ACTOR NutcrackerPiece1 : NutcrackerPiece replaces FWeaponPiece1
{
  WeaponPiece.Number 1
  Inventory.PickupMessage "Obtained Nutcracker's stock!"
  States
  {
  Spawn:
    NUTP A -1 Bright
    Stop
  } 
}

ACTOR NutcrackerPiece2 : NutcrackerPiece replaces FWeaponPiece2
{
  WeaponPiece.Number 2
  Inventory.PickupMessage "Obtained Nutcracker's rear barrel part!"
  States
  {
  Spawn:
    NUTP B -1 Bright
    Stop
  } 
}

ACTOR NutcrackerPiece3 : NutcrackerPiece replaces FWeaponPiece3
{
  WeaponPiece.Number 3
  Inventory.PickupMessage "Obtained Nutcracker's front barrel part!"
  States
  {
  Spawn:
    NUTP C -1 Bright
    Stop
  } 
}

ACTOR BlazerPoisonBag : ArtiPoisonBag3 replaces ArtiPoisonBag
{
  Inventory.PickupFlash "none"
  Inventory.UseSound "Flechette/Throw"
  Inventory.MaxAmount 25
  Inventory.PickupMessage "Obtained an explosive flask."
  Tag "Bottle of C4-orium"
  -FANCYPICKUPSOUND
  States
  {
  Spawn:
    PSBG A 1 //A_SpawnItemEx("GreenParticle",frandom(6.0,-6.0),frandom(6.0,-6.0),16+frandom(15.0,2.0),frandom(0.2,-0.2),frandom(0.2,-0.2),frandom(1.6,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	Loop
  }
}

ACTOR ThrowingBomb2 : ThrowingBomb replaces ThrowingBomb
{
  DeathSound ""
  DamageType "Patriarch"
  Speed 20
  +FOILINVUL
  +DONTREFLECT
  States
  {
  Spawn:
    THRW A 4 A_CheckThrowBomb
    THRW BCDE 3 A_CheckThrowBomb
    THRW F 3 A_CheckThrowBomb2
    Loop
    THRW G 6 A_CheckThrowBomb
    THRW F 4 A_CheckThrowBomb
    THRW H 6 A_CheckThrowBomb
    THRW F 4 A_CheckThrowBomb
    THRW G 6 A_CheckThrowBomb
    THRW F 3 A_CheckThrowBomb
    Wait
  Death:
    TNT1 A 0 A_NoGravity
    TNT1 A 0 A_AlertMonsters
    TNT1 A 0 A_PlaySound("Explosion/Init",5,0.8)
    TNT1 A 0 A_PlaySound("Explosion/Main",6,0.8)
    TNT1 A 0 A_PlaySound("Explosion/Layer",4,0.8)
    TNT1 A 0 A_PlaySound("Explosion/Flavor",7,0.8)
    TNT1 A 0 A_SpawnItemEx("Patriarch_Main",0,0,0,0,0,0,SXF_CLIENTSIDE,0)
	TNT1 A 0 A_Explode(200,164)
	TNT1 A 28 A_Quake(3,12,0,512,"none")
    Stop
  }
}