Actor Sawedoff : Weapon
{
  radius 20
  height 16
  Weapon.SlotNumber 9
  weapon.selectionorder 6666
  weapon.kickback 100
  obituary "%o was wiped off the face of earth by %k's sawedoff."
  Inventory.PickupSound "weapons/pickup"
  inventory.pickupmessage "\ccWeapon Pickup : \c[Y5]Sawedoff - 9"
  weapon.ammotype "SawedoffShell"
  weapon.ammotype2 "SawedoffCounter"
  weapon.ammouse 0
  weapon.ammouse2 0
  weapon.ammogive 0
  weapon.ammogive2 0
  Decal "BulletChip"
  YScale 0.59
  XScale 0.4
  +INVENTORY.UNDROPPABLE
  Weapon.BobStyle InverseSmooth
  Weapon.BobSpeed 2.1
  Weapon.BobRangeY 0.4
  Weapon.BobRangeX 0.7
  states
  {
  Remove:
    TSWN A 1 Offset(0, 40)
	TSWN A 1 Offset(0, 48)
	TSWN A 1 Offset(0, 56)
	TSWN A 1 Offset(0, 64)
	TSWN A 1 Offset(0, 72)
	TSWN A 1 Offset(0, 80)
	TSWN A 1 Offset(0, 88)
	TNT1 A 0 A_JumpIfInventory("SawedoffShell", 1, "RiseBack")
	TSWN A 1 Offset(0, 96)
	TNT1 A 0 A_TakeInventory("ForceWeaponRemove", 1)
    TNT1 A 0 A_TakeInventory("SawedOffCounter", 2)
	TNT1 A 0 A_TakeInventory("SawedoffShell", 0)
	TNT1 A 0 A_TakeInventory("H_WeaponSlot9", 1)
	TNT1 A 0 A_TakeInventory("Sawedoff", 1)
	TNT1 A 1
  Stop
  RiseBack:
    TSWN A 1 Offset(0, 88)
	TSWN A 1 Offset(0, 80)
	TSWN A 1 Offset(0, 72)
	TSWN A 1 Offset(0, 64)
	TSWN A 1 Offset(0, 56)
	TSWN A 1 Offset(0, 48)
	TSWN A 1 Offset(0, 40)
  Goto Ready
  Spawn:
    TSWP A -1
    stop
  Ready:
	TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
    TNT1 A 0 A_JumpIfInventory("SawedoffShell", 1, "NoRemove")
  Goto Remove
  NoRemove:
    TNT1 A 0 A_GiveInventory("TempWeaponReady", 1)
    TSWN A 1 A_WeaponReady
    Goto Ready
  Deselect: 
	TNT1 A 0 A_TakeInventory("TempWeaponReady", 1)
    TNT1 A 0 A_TakeInventory("H_WeaponSlot9", 1)
  DeselectLoop:
    TSWN A 1 A_Lower
	TNT1 A 0 A_Lower
    loop
  Select:
    TNT1 A 0 A_TakeInventory("TempWeaponReady", 1)
    TNT1 A 0 A_GiveInventory("H_WeaponSlot9", 1)
	TNT1 A 0 A_TakeInventory("ForceWeaponRemove", 1)
	TNT1 A 0 A_TakeInventory("DnD_WeaponID", 0x7FFFFFFF)
	TNT1 A 0 A_GiveInventory("DnD_WeaponID", DND_WEAPON_SAWEDOFF)
	TNT1 A 0 ACS_NamedExecuteAlways("DND Weapon Damage Cache", 0, DND_DMGID_0, 15)
SelectLoop:
    TSWN A 1 A_Raise
	TNT1 A 0 A_Raise
    Loop
  Fire:
	  TNT1 A 0 A_TakeInventory("TempWeaponReady", 1)
	  TNT1 A 0 A_JumpIfInventory("SawedoffCounter", 2, "FireEnd")
      TNT1 A 0 A_JumpIfInventory("SawedoffShell", 1, "ContinueNorm")
  Goto Remove
  ContinueNorm:
	  TSW1 A 1 Bright
      TNT1 A 0 A_GunFlash
      TSW1 B 1 Bright
	  TNT1 A 0 A_PlayWeaponSound("Sawedoff/Fire1")
	  TNT1 A 0 A_GiveInventory("SawedoffCounter", 1)
	  TNT1 AAAA 0 A_FireCustomMissile("SGTracer", frandom(-6, 6), 0, 0, frandom(-6, 6))
	  TNT1 A 0 A_SpawnItemEx("GunSmokeSmaller", 18 * cos(-pitch), 2, 32 * (1 + sin(-pitch)), 2, 0, 1)
	  TNT1 A 0 A_GiveInventory("SawedOffShooter", 1)
	  TNT1 A 0 A_SetPitch(pitch - 3.0)
	  TSW1 CDEF 1 Bright A_SetPitch(pitch + 0.5)
	  TSW1 GH 1 A_SetPitch(pitch + 0.5)
	  TSW1 I 1
	  TSWN A 2
	  TNT1 A 0 A_JumpIfInventory("SawedoffCounter", 2, "FireEnd")
	  Goto Ready
	FireEnd:
	  TNT1 A 0 A_JumpIfInventory("SawedOffShell", 1, "Keep")
	Goto Ready
	Keep:
	  TNT1 A 0 A_JumpIfInventory("Ability_Reloader", 1, "ReloadFaster")
	  TSWN KLM 2
	  TNT1 A 0 A_TakeInventory("SawedoffCounter", 2)
	  TNT1 AA 0 A_SpawnItemEx ("shotguncasing",cos(-pitch)*36,8,26+(sin(-pitch)*36),cos(-pitch)*0,random(5, 8), random(0, 1),0,0,0)
	  TSWN NOPQRS 1
	  TNT1 A 0 A_PlaySound("Sawedoff/Load")
	  TSWN TUVX 1
	  TSWN MLK 2
      TSWN A 1 A_ReFire	
	  Goto Ready
	ReloadFaster:
	  TSWN KLM 1
	  TNT1 A 0 A_TakeInventory("SawedoffCounter", 2)
	  TNT1 AA 0 A_SpawnItemEx ("shotguncasing",cos(-pitch)*36,8,26+(sin(-pitch)*36),cos(-pitch)*0,random(5, 8), random(0, 1),0,0,0)
	  TSWN NPRS 1
	  TNT1 A 0 A_PlaySound("Sawedoff/Load")
	  TSWN TUVX 1
	  TSWN MLK 1
      TSWN A 1 A_ReFire	
	  Goto Ready
	AltFire:
	  TNT1 A 0 A_TakeInventory("TempWeaponReady", 1)
	  TNT1 A 0 A_JumpIfInventory("SawedoffCounter", 1, "Fire")
	  TNT1 A 0 A_JumpIfInventory("SawedoffShell", 2, "Continue")
	  TSWN A 1
	Goto Fire
	Continue:
	  TSWN B 1 Bright
      TNT1 A 0 A_GunFlash
      TSWN C 1 Bright
	  TNT1 A 0 A_PlayWeaponSound("Sawedoff/Fire2")
	  TNT1 A 0 A_GiveInventory("SawedoffCounter", 2)
	  TNT1 AAAAAAAA 0 A_FireCustomMissile("SGTracer", frandom(-6, 6), 0, 0, frandom(-6, 6))
	  TNT1 A 0 A_SpawnItemEx("GunSmoke", 18 * cos(-pitch), 4, 32 * (1 + sin(-pitch)), 2, 0, 1)
	  TNT1 A 0 A_GiveInventory("SawedoffAltShooter", 1)
	  TNT1 A 0 A_SetPitch(pitch - 6.0)
	  TSWN DEFG 1 Bright A_SetPitch(pitch + 0.6)
	  TSWN HIJ 1 A_SetPitch(pitch + 0.6)
	  TSWX ABC 1 A_SetPitch(pitch + 0.6)
	  TSWN A 2
	  Goto FireEnd
	Flash:
	  TNT1 A 4 bright A_Light1
	  TNT1 A 3 bright A_Light2
	  TNT1 A 0 bright A_Light0
	  stop
    }
}

Actor SawedOffShooter : DnD_Activator {
	states {
		Use:
			TNT1 A 0 A_TakeInventory("SawedoffShell", 1)
			TNT1 A 0 A_JumpIfInventory("NetherCheck", 1, "Full")
			TNT1 A 0 A_FireBullets (3.6, 2.8, 10, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_BALLISTIC, DND_ISBOOMSTICK), "NewBulletPuff", FBF_NORANDOM | FBF_USEAMMO)
		Stop
		Full:
			TNT1 A 0 A_FireBullets (3.6, 2.8, 10, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_BALLISTIC, DND_ISBOOMSTICK), "NewBulletPuff_FullDMG", FBF_NORANDOM | FBF_USEAMMO)
		Stop
	}
}

Actor SawedOffAltShooter : DnD_Activator {
	states {
		Use:
			TNT1 A 0 A_TakeInventory("SawedoffShell", 2)
			TNT1 A 0 A_JumpIfInventory("NetherCheck", 1, "Full")
			TNT1 A 0 A_FireBullets (7.2, 5.6, 20, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_BALLISTIC, DND_ISBOOMSTICK), "NewBulletPuff", FBF_NORANDOM | FBF_USEAMMO)
		Stop
		Full:
			TNT1 A 0 A_FireBullets (7.2, 5.6, 20, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_BALLISTIC, DND_ISBOOMSTICK), "NewBulletPuff_FullDMG", FBF_NORANDOM | FBF_USEAMMO)
		Stop
	}
}

Actor SawedoffPickup : CustomInventory
{
	Radius 16
	Height 24
	YScale 0.59
    XScale 0.4
	Inventory.PickupSound "weapons/pickup"
    Inventory.pickupmessage "\ccWeapon Pickup : \c[Y5]Sawedoff - 9\c-"
	States
	{
		Spawn:
			TSWP A -1
		Stop
		Pickup:
			TNT1 A 0 A_JumpIf(1 == ACS_ExecuteWithResult(986, DND_WEAPON_SAWEDOFF), "Success")
		Fail
		Success:
			TNT1 A 0 A_GiveInventory("Sawedoff", 1)
			TNT1 A 0 A_GiveInventory("SawedoffShell", random(6, 16) + ACS_ExecuteWithResult(918, 0, 1, random(6, 16)))
			TNT1 A 0 A_JumpIfInventory("Ability_Temporal", 1, "GiveMore")
		Stop
		GiveMore:
			TNT1 A 0 A_GiveInventory("SawedoffShell", random(3, 8))
		Stop
	}
}

Actor SawedOffMsg : CustomInventory {
	States {
		Pickup:
			TNT1 A 0 ACS_ExecuteAlways(985, 0, 0, DND_WEAPON_SAWEDOFF)
			TNT1 A 0 A_PlaySound("weapons/pickup", 6)
			TNT1 A 0 A_SetBlend("25 99 25", 0.6, 17)
		Stop
	}
}

Actor SawedOffPickup_D : DND_DroppedItem {
	Radius 16
	Height 24
	YScale 0.59
    XScale 0.4
	States {
		Spawn:
			TSWP A 17
		SpawnLoop:
			TSWP A 1 A_LookEx(LOF_NOSOUNDCHECK, 0, 28, 0, 360, "CheckPickup")
		Loop
		
		See:
		CheckPickup:
			TSWP A 1 A_JumpIfCloser(32, "Pickup")
		goto SpawnLoop

		Pickup:
			TSWP A 1 A_JumpIf(1 == ACS_ExecuteWithResult(986, DND_WEAPON_SAWEDOFF, 1), "PickupSuccess")
		goto PickupFail

		PickupFail:
			TSWP A 1
		goto SpawnLoop

		PickupSuccess:
			TNT1 A 0 A_GiveToTarget("Sawedoff", 1)
			TNT1 A 0 A_GiveToTarget("SawedoffShell", mass)
			TNT1 A 0 A_GiveToTarget("SawedOffMsg", 1)
		stop
	}
}

ACTOR "Soul Render" : Weapon
{
   Inventory.PickupMessage "You got the Soul Render!"
   Obituary "%k sliced and diced %o to pieces."
   Weapon.AmmoType "BladeCharge"
   Weapon.SelectionOrder 6666
   Weapon.AmmoUse 100
   +WEAPON.AXEBLOOD
   +AMMO_OPTIONAL
   +ALT_AMMO_OPTIONAL
   +WEAPON.NOALERT
   Weapon.AmmoUse 0
   Weapon.AmmoGive 0
   Weapon.AmmoType "BladeCharge"
   Weapon.AmmoType2 "BladeHits"
   Weapon.AmmoGive2 0
   Weapon.AmmoUse2 0
   Weapon.Slotnumber 9
   AttackSound "weapons/vblhit"
   +INVENTORY.UNDROPPABLE
    Weapon.BobStyle InverseSmooth
    Weapon.BobSpeed 2.1
    Weapon.BobRangeY 0.4
    Weapon.BobRangeX 0.7
   States
   {
   Spawn:
      WVBL A -1 Bright
      Stop
  Remove:
      VBLG A 1 Offset(0, 40)
	  VBLG A 1 Offset(0, 48)
	  VBLG A 1 Offset(0, 56)
	  VBLG A 1 Offset(0, 64)
	  VBLG A 1 Offset(0, 72)
	  VBLG A 1 Offset(0, 80)
	  VBLG A 1 Offset(0, 88)
	  TNT1 A 0 A_JumpIfInventory("BladeHits", 100, "RemoveCont") 
   Goto RiseBack
   RemoveCont:
	  VBLG A 1 Offset(0, 96)
	  TNT1 A 0 A_TakeInventory("ForceWeaponRemove", 1)
      TNT1 A 0 A_TakeInventory("BladeCharge", 100)
	  TNT1 A 0 A_TakeInventory("BladeHits", 100)
	  TNT1 A 0 A_TakeInventory("H_WeaponSlot9", 1)
	  TNT1 A 0 A_TakeInventory("Soul Render", 1)
	  TNT1 A 1
      Stop	  
	RiseBack:
		VBLG A 1 Offset(0, 88)
		VBLG A 1 Offset(0, 80)
		VBLG A 1 Offset(0, 72)
		VBLG A 1 Offset(0, 64)
		VBLG A 1 Offset(0, 56)
		VBLG A 1 Offset(0, 48)
		VBLG A 1 Offset(0, 40)
    Goto Ready
   Ready:
	  TNT1 A 0 A_GiveInventory("TaltosChecker", 1)
      TNT1 A 0 A_JumpIfInventory("BladeHits", 100, "Remove")
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
	  TNT1 A 0 A_GiveInventory("TempWeaponReady", 1)
      TNT1 A 0 A_JumpIfInventory("BladeCharge", 100, "ChargeReady")
	  TNT1 A 0 A_JumpIfInventory("DrainMode", 1, "DrainReady")
      VBLG A 1 A_WeaponReady
      Loop
   DrainReady:
      TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
      VB2G A 1 Bright A_WeaponReady
      TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
      VB2G A 1 Bright A_WeaponReady
      TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
      VB2G A 1 Bright A_WeaponReady
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
	  VB2G B 1 Bright A_WeaponReady
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
	  VB2G B 1 Bright A_WeaponReady
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
	  VB2G B 1 Bright A_WeaponReady
      Loop
   ChargeReady:
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
      VB3G A 1 Bright A_WeaponReady
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
      VB3G A 1 Bright A_WeaponReady
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
      VB3G A 1 Bright A_WeaponReady
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
	  VB3G B 1 Bright A_WeaponReady
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
	  VB3G B 1 Bright A_WeaponReady
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
	  VB3G B 1 Bright A_WeaponReady
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
	  VB3G C 1 Bright A_WeaponReady
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
	  VB3G C 1 Bright A_WeaponReady
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
	  VB3G C 1 Bright A_WeaponReady
      Loop
   Deselect:
	  TNT1 A 0 A_GiveInventory("TaltosTaker", 1)
   DeselectLoop:
	  TNT1 A 0 A_TakeInventory("TempWeaponReady", 1)
      TNT1 A 0 A_TakeInventory("H_WeaponSlot9", 1)
      VBLG A 1 A_Lower
	  TNT1 A 0 A_Lower
      Loop
   Select:
	  TNT1 A 0 A_GiveInventory("TaltosChecker", 1)
	  TNT1 A 0 A_TakeInventory("ForceWeaponRemove", 1)
	  TNT1 A 0 A_TakeInventory("DnD_WeaponID", 0x7FFFFFFF)
	  TNT1 A 0 A_GiveInventory("DnD_WeaponID", DND_WEAPON_SOULRENDER)
	  TNT1 A 0 ACS_NamedExecuteAlways("DND Weapon Damage Cache", 0, DND_DMGID_0, 40, 3 | (4 << 16))
	  TNT1 A 0 ACS_NamedExecuteAlways("DND Weapon Damage Cache", 0, DND_DMGID_1, 40, 6 | (8 << 16))
	  TNT1 A 0 ACS_NamedExecuteAlways("DND Weapon Damage Cache", 0, DND_DMGID_2, 20, 1 | (8 << 16))
	  TNT1 A 0 ACS_NamedExecuteAlways("DND Weapon Damage Cache", 0, DND_DMGID_3, 75)
	SelectLoop:
      TNT1 A 0 A_TakeInventory("TempWeaponReady", 1)
      TNT1 A 0 A_GiveInventory("H_WeaponSlot9", 1)
      VBLG A 1 A_Raise
	  TNT1 A 0 A_Raise
      Loop
   Fire:
	  TNT1 A 0 A_TakeInventory("TempWeaponReady", 1)
      // This fixes the A_Refire not making you go to Ready for the removal of the weapon
	  TNT1 A 0 A_JumpIfInventory("BladeHits", 100, "Remove")
      TNT1 A 0 A_JumpIfInventory("BladeCharge",100,"Fire2")
	  TNT1 A 0 A_JumpIfInventory("DrainMode", 1, "DrainFire")
      VBLG B 3 A_AlertMonsters
      VBLG C 1 A_PlayWeaponSound("weapons/hamswg")
	  VBLX AB 1
      VBLG D 1 
	  VBLX CD 1
	  TNT1 A 0 A_JumpIfInventory("PowerInvulnerable", 1, 3)
	  TNT1 A 0 A_JumpIfInventory("ShieldPowerupGiver", 1, 2)
      TNT1 A 0 A_SetInvulnerable
      VBLG E 1 A_GiveInventory("SoulRenderShooter1", 1)
	  VBLX EF 1
      VBLG F 1 
	  VBLX GH 1
	  TNT1 A 0 A_JumpIfInventory("PowerInvulnerable", 1, 3)
	  TNT1 A 0 A_JumpIfInventory("ShieldPowerupGiver", 1, 2)
      TNT1 A 0  A_UnSetInvulnerable
      VBLG G 3 
      TNT1 A 4 
      TNT1 A 0 A_ReFire
      VBLG A 1 Offset (0,80)
      VBLG A 1 Offset (0,72)
      VBLG A 1 Offset (0,64)
      VBLG A 1 Offset (0,56)
      VBLG A 1 Offset (0,48)
	  VBLG A 1 Offset (0,40)
      Goto Ready
   Fire2:
      VB3G D 3 Bright A_AlertMonsters
      VB3G E 1 Bright A_PlayWeaponSound("weapons/vblswg")
	  VB3X AB 1 Bright
      VB3G F 1 Bright
	  VB3X CD 1 Bright
	  TNT1 A 0 A_JumpIfInventory("PowerInvulnerable", 1, 3)
	  TNT1 A 0 A_JumpIfInventory("ShieldPowerupGiver", 1, 2)
      TNT1 A 0 A_SetInvulnerable
	  TNT1 A 0 A_GiveInventory("BladeHits", 15)
	  TNT1 A 0 A_TakeInventory("BladeCharge", 100)
	  TNT1 A 0 Radius_Quake(6,6,0,1,0)
      VB3G G 1 Bright A_GiveInventory("SoulRenderShooter3", 1)
	  VB3X EF 1 Bright
      VB3G H 1 Bright 
	  VB3X GH 1 Bright
	  TNT1 A 0 A_JumpIfInventory("PowerInvulnerable", 1, 3)
	  TNT1 A 0 A_JumpIfInventory("ShieldPowerupGiver", 1, 2)
      TNT1 A 0 A_UnSetInvulnerable
      VB3G I 3 Bright
      TNT1 A 4
      TNT1 A 0 A_ReFire
	  TNT1 A 0 A_JumpIfInventory("BladeCharge", 100, "RaiseFlame")
	  TNT1 A 0 A_JumpIfInventory("DrainMode", 1, "RaiseDrain")
      VBLG A 1 Offset (0,80)
      VBLG A 1 Offset (0,72)
      VBLG A 1 Offset (0,64)
      VBLG A 1 Offset (0,56)
      VBLG A 1 Offset (0,48)
	  VBLG A 1 Offset (0,40)
      Goto Ready
   AltFire:
      TNT1 A 0 A_TakeInventory("TempWeaponReady", 1)
	  TNT1 A 0 A_JumpIfInventory("DrainMode", 1, "TakeDrain")
	  TNT1 A 0 A_GiveInventory("DrainMode", 1)
	  VB2G AB 3 Bright
   Goto Ready
   TakeDrain:
	  TNT1 A 0 A_TakeInventory("DrainMode", 1)
	  VBLG A 6
   Goto Ready
   DrainFire:
      TNT1 A 0 A_JumpIfInventory("BladeCharge",100,"Fire2")
      VB2G C 3 Bright A_AlertMonsters
      VB2G D 1 Bright A_PlayWeaponSound("weapons/hamswg")
	  VB2X AB 1 Bright
      VB2G E 1 Bright 
	  VB2X CD 1 Bright
	  TNT1 A 0 A_JumpIfInventory("PowerInvulnerable", 1, 3)
	  TNT1 A 0 A_JumpIfInventory("ShieldPowerupGiver", 1, 2)
      TNT1 A 0 A_SetInvulnerable
      VB2G F 1 Bright A_GiveInventory("SoulRenderShooter2", 1)
	  VB2X EF 1 Bright
      VB2G G 1 Bright 
	  VB2X GH 1 Bright
	  TNT1 A 0 A_JumpIfInventory("PowerInvulnerable", 1, 3)
	  TNT1 A 0 A_JumpIfInventory("ShieldPowerupGiver", 1, 2)
      TNT1 A 0 A_UnSetInvulnerable
      VB2G H 3 Bright 
      TNT1 A 4
      TNT1 A 0 A_ReFire
	  TNT1 A 0 A_JumpIfInventory("BladeCharge", 100, "RaiseFlame")
   RaiseDrain:
      VB2G A 1 Bright Offset (0,80)
      VB2G B 1 Bright Offset (0,72)
      VB2G A 1 Bright Offset (0,64)
      VB2G B 1 Bright Offset (0,56)
      VB2G A 1 Bright Offset (0,48)
	  VB2G B 1 Bright Offset (0,40)
      Goto Ready
   RaiseFlame:
      VB3G B 1 Bright Offset (0,80)
      VB3G B 1 Bright Offset (0,72)
      VB3G B 1 Bright Offset (0,64)
      VB3G C 1 Bright Offset (0,56)
      VB3G C 1 Bright Offset (0,48)
	  VB3G C 1 Bright Offset (0,40)  
      Goto Ready
   }
}

Actor SoulRenderShooter1 : DnD_Activator {
	States {
		Pickup:
			TNT1 A 0 A_JumpIfInventory("DnD_QuestReward_DreamingGodBonus", 1, "Full")
			TNT1 A 0 A_JumpIfInventory("NetherCheck", 1, "Full")
			TNT1 A 0 A_CustomPunch(ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_MELEE, DND_ISOCCULT),1,0,"BladePuff1",96)
		Stop
		Full:
			TNT1 A 0 A_CustomPunch(ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_MELEE, DND_ISOCCULT),1,0,"BladePuff1_FullDMG",96)
		Stop
	}
}

Actor SoulRenderShooter2 : DnD_Activator {
	States {
		Pickup:
			TNT1 A 0 A_JumpIfInventory("DnD_QuestReward_DreamingGodBonus", 1, "Full")
			TNT1 A 0 A_JumpIfInventory("NetherCheck", 1, "Full")
			TNT1 A 0 A_CustomPunch(ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_MELEE, DND_ISOCCULT),1,0,"BladePuff2",96)
		Stop
		Full:
			TNT1 A 0 A_CustomPunch(ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_MELEE, DND_ISOCCULT),1,0,"BladePuff2_FullDMG",96)
		Stop
	}
}

Actor SoulRenderShooter3 : DnD_Activator {
	States {
		Pickup:
			TNT1 A 0 A_JumpIfInventory("DnD_QuestReward_DreamingGodBonus", 1, "Full")
			TNT1 A 0 A_JumpIfInventory("NetherCheck", 1, "Full")
			TNT1 A 0 A_FireCustomMissile("BladeSlash",0,1,0,0)
			TNT1 A 0 A_CustomPunch(ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_1, TALENT_MELEE, DND_ISOCCULT),1,0,"BladePuff3",96)
		Stop
		Full:
			TNT1 A 0 A_FireCustomMissile("BladeSlash_FullDMG",0,1,0,0)
			TNT1 A 0 A_CustomPunch(ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_1, TALENT_MELEE, DND_ISOCCULT),1,0,"BladePuff3_FullDMG",96)
		Stop
	}
}

Actor DrainMode : DND_Boolean { }

ACTOR BladeSlash
{
   Radius 8
   Height 16
   Speed 25
   Damage (ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_2, TALENT_MELEE, DND_ISOCCULT | DND_USETARGET))
   PROJECTILE
   RENDERSTYLE ADD
   ALPHA 0.75
   Damagetype "Magic"
   +RIPPER
   +EXTREMEDEATH
   +MTHRUSPECIES
   +FOILINVUL
   +DONTBLAST
   +DONTREFLECT
   States
   {
   Spawn:
      VFX4 A 1 Bright A_SpawnItem("SlashTrail",0,0)
      VFX4 A 0 Bright A_Explode(ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_3, TALENT_MELEE, DND_ISOCCULT | DND_USETARGET), 128, 0)
      VFX4 A 1 Bright A_SpawnItem("SlashTrail",0,0)
      VFX4 A 0 Bright A_Explode(ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_3, TALENT_MELEE, DND_ISOCCULT | DND_USETARGET), 128, 0)
      VFX4 A 1 Bright A_SpawnItem("SlashTrail",0,0)
      VFX4 A 0 Bright A_Explode(ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_3, TALENT_MELEE, DND_ISOCCULT | DND_USETARGET), 128, 0)
      VFX4 A 1 Bright A_SpawnItem("SlashTrail",0,0)
      VFX4 A 0 Bright A_Explode(ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_3, TALENT_MELEE, DND_ISOCCULT | DND_USETARGET), 128, 0)
      VFX4 A 1 Bright A_SpawnItem("SlashTrail",0,0)
      VFX4 A 0 Bright A_Explode(ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_3, TALENT_MELEE, DND_ISOCCULT | DND_USETARGET), 128, 0)
      VFX4 A 1 Bright A_SpawnItem("SlashTrail",0,0)
      VFX4 A 0 Bright A_Explode(ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_3, TALENT_MELEE, DND_ISOCCULT | DND_USETARGET), 128, 0)
      VFX4 A 1 Bright A_SpawnItem("SlashTrail",0,0)
      VFX4 A 0 Bright A_Explode(ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_3, TALENT_MELEE, DND_ISOCCULT | DND_USETARGET), 128, 0)
      VFX4 A 1 Bright A_SpawnItem("SlashTrail",0,0)
      VFX4 A 0 Bright A_Explode(ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_3, TALENT_MELEE, DND_ISOCCULT | DND_USETARGET), 128, 0)
      VFX4 A 1 Bright A_SpawnItem("SlashTrail",0,0)
      VFX4 A 0 Bright A_Explode(ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_3, TALENT_MELEE, DND_ISOCCULT | DND_USETARGET), 128, 0)
      VFX4 A 1 Bright A_SpawnItem("SlashTrail",0,0)
      VFX4 A 0 Bright A_Explode(ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_3, TALENT_MELEE, DND_ISOCCULT | DND_USETARGET), 128, 0)
      VFX4 A 1 Bright A_SpawnItem("SlashTrail",0,0)
      VFX4 A 0 Bright A_Explode(ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_3, TALENT_MELEE, DND_ISOCCULT | DND_USETARGET), 128, 0)
      VFX4 A 1 Bright A_SpawnItem("SlashTrail",0,0)
      VFX4 A 0 Bright A_Explode(ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_3, TALENT_MELEE, DND_ISOCCULT | DND_USETARGET), 128, 0)
      VFX4 A 1 Bright A_SpawnItem("SlashTrail",0,0)
      VFX4 A 0 Bright A_Explode(ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_3, TALENT_MELEE, DND_ISOCCULT | DND_USETARGET), 128, 0)
      VFX4 A 1 Bright A_SpawnItem("SlashTrail",0,0)
      VFX4 A 0 Bright A_Explode(ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_3, TALENT_MELEE, DND_ISOCCULT | DND_USETARGET), 128, 0)
      VFX4 A 1 Bright A_SpawnItem("SlashTrail",0,0)
      VFX4 A 0 Bright A_Explode(ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_3, TALENT_MELEE, DND_ISOCCULT | DND_USETARGET), 128, 0)
      Stop
   }
}

Actor BladeSlash_FullDMG : BladeSlash {
	DamageType "MagicFull"
	+FORCERADIUSDMG
	+THRUACTORS
   States
   {
   Spawn:
      VFX4 A 1 Bright A_SpawnItem("SlashTrail",0,0)
      VFX4 A 0 Bright A_Explode(ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_3, TALENT_MELEE, DND_ISOCCULT | DND_USETARGET), 128, 0)
      VFX4 A 1 Bright A_SpawnItem("SlashTrail",0,0)
      VFX4 A 0 Bright A_Explode(ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_3, TALENT_MELEE, DND_ISOCCULT | DND_USETARGET), 128, 0)
      VFX4 A 1 Bright A_SpawnItem("SlashTrail",0,0)
      VFX4 A 0 Bright A_Explode(ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_3, TALENT_MELEE, DND_ISOCCULT | DND_USETARGET), 128, 0)
      VFX4 A 1 Bright A_SpawnItem("SlashTrail",0,0)
      VFX4 A 0 Bright A_Explode(ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_3, TALENT_MELEE, DND_ISOCCULT | DND_USETARGET), 128, 0)
      VFX4 A 1 Bright A_SpawnItem("SlashTrail",0,0)
      VFX4 A 0 Bright A_Explode(ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_3, TALENT_MELEE, DND_ISOCCULT | DND_USETARGET), 128, 0)
      VFX4 A 1 Bright A_SpawnItem("SlashTrail",0,0)
      VFX4 A 0 Bright A_Explode(ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_3, TALENT_MELEE, DND_ISOCCULT | DND_USETARGET), 128, 0)
      VFX4 A 1 Bright A_SpawnItem("SlashTrail",0,0)
      VFX4 A 0 Bright A_Explode(ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_3, TALENT_MELEE, DND_ISOCCULT | DND_USETARGET), 128, 0)
      VFX4 A 1 Bright A_SpawnItem("SlashTrail",0,0)
      VFX4 A 0 Bright A_Explode(ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_3, TALENT_MELEE, DND_ISOCCULT | DND_USETARGET), 128, 0)
      VFX4 A 1 Bright A_SpawnItem("SlashTrail",0,0)
      VFX4 A 0 Bright A_Explode(ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_3, TALENT_MELEE, DND_ISOCCULT | DND_USETARGET), 128, 0)
      VFX4 A 1 Bright A_SpawnItem("SlashTrail",0,0)
      VFX4 A 0 Bright A_Explode(ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_3, TALENT_MELEE, DND_ISOCCULT | DND_USETARGET), 128, 0)
      VFX4 A 1 Bright A_SpawnItem("SlashTrail",0,0)
      VFX4 A 0 Bright A_Explode(ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_3, TALENT_MELEE, DND_ISOCCULT | DND_USETARGET), 128, 0)
      VFX4 A 1 Bright A_SpawnItem("SlashTrail",0,0)
      VFX4 A 0 Bright A_Explode(ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_3, TALENT_MELEE, DND_ISOCCULT | DND_USETARGET), 128, 0)
      VFX4 A 1 Bright A_SpawnItem("SlashTrail",0,0)
      VFX4 A 0 Bright A_Explode(ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_3, TALENT_MELEE, DND_ISOCCULT | DND_USETARGET), 128, 0)
      VFX4 A 1 Bright A_SpawnItem("SlashTrail",0,0)
      VFX4 A 0 Bright A_Explode(ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_3, TALENT_MELEE, DND_ISOCCULT | DND_USETARGET), 128, 0)
      VFX4 A 1 Bright A_SpawnItem("SlashTrail",0,0)
      VFX4 A 0 Bright A_Explode(ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_3, TALENT_MELEE, DND_ISOCCULT | DND_USETARGET), 128, 0)
      Stop
   }
}

ACTOR SlashTrail
{
   Radius 3
   Height 3
   PROJECTILE
   RENDERSTYLE ADD
   ALPHA 0.80
   States
   {
   Spawn:
      TNT1 A 1
      VFX4 A 2 Bright A_FadeOut(0.10)
      Goto Spawn+1
   }
}

ACTOR SwordFXGreen
{
		Radius 1
		Height 1
		Speed 3
		Damage 0
		Scale 1.4
		PROJECTILE
		+NOGRAVITY
		+CLIENTSIDEONLY
		States
		{
		Spawn:
			SWFX A 14 BRIGHT
			SWFX B 14 BRIGHT
			Stop
		}
}

ACTOR SwordFXRed
{
		Radius 1
		Height 1
		Speed 3
		Damage 0
		Scale 1.4
		PROJECTILE
		+NOGRAVITY
		+CLIENTSIDEONLY
		States
		{
		Spawn:
			KN2M F 14 BRIGHT
			KN2M G 14 BRIGHT
			Stop
		}
}

ACTOR BladePuff1
{
   Damagetype "Melee"
   Radius 0
   Height 1
   PROJECTILE
   RENDERSTYLE Translucent
   ALPHA 0.50
   +PUFFONACTORS
   +PUFFGETSOWNER
   +LOOKALLAROUND
   +FORCEXYBILLBOARD
   States
   {
   Spawn:
      VFX2 A 0
      VFX2 A 1 A_PlaySound("weapons/vblhit")
      VFX2 A 2 A_GiveToTarget("BladeCharge", 5)
      VFX2 BCDE 3
      Stop
   Crash:
      VFX2 A 0
	  TNT1 AAAAAA 0 A_CustomMissile ("MeleeSmoke", 0, 0, random (0, 360), 2, random (0, 360))
      VFX2 A 3 A_PlaySound("weapons/vblwal")
      VFX2 BCDE 3
      Stop
   }
}

Actor BladePuff1_FullDMG : BladePuff1 {
	DamageType "MeleeFull"
}

ACTOR BladePuff2
{
   Damagetype "Melee_Magic"   
   Radius 0
   Height 1
   PROJECTILE
   RENDERSTYLE ADD
   ALPHA 0.85
   +PUFFONACTORS
   +PUFFGETSOWNER
   +LOOKALLAROUND
   +FORCEXYBILLBOARD
   States
   {
   Spawn:
      VFX3 A 0 
      VFX3 A 1 Bright A_PlaySound("weapons/vblhi2")
      TNT1 A 0 A_GivetoTarget("SoulRenderHealerWeak", 1)
      VFX3 A 2 Bright A_GiveToTarget("BladeCharge", 15)
	  TNT1 AAAAAAAAAAAAAAA 0 A_CustomMissile("SwordFXGreen", random(0, 8), random(-4, 4), random(0, 360), 0, random(-16, 16))
      VFX3 BCDEFGHIJ 3 Bright
      Stop
   Crash:
      VFX1 A 0
	  TNT1 AAAAAA 0 A_CustomMissile ("MeleeSmoke", 0, 0, random (0, 360), 2, random (0, 360))
      VFX1 A 3 Bright A_PlaySound("weapons/vblwa2")
      VFX1 BCDEFG 3 Bright
      Stop
   }
}

Actor BladePuff2_FullDMG : BladePuff2 {
	DamageType "Melee_MagicFull"
}


ACTOR BladePuff3 : BladePuff2
{
   Damagetype "Melee_Magic"   
   States
   {
   Spawn:
      VFX6 A 0 
      VFX6 A 1 Bright A_PlaySound("weapons/vblhi3")
      TNT1 A 0 A_GivetoTarget("SoulRenderHealer", 1)
      VFX6 A 2 Bright A_GiveToTarget("BladeCharge", 15)
	  TNT1 AAAAAAAAAAAAAAA 0 A_CustomMissile("SwordFXRed", random(0, 8), random(-4, 4), random(0, 360), 0, random(-16, 16))
      VFX6 BCDE 3 Bright
      Stop
   Crash:
      TNT1 A 0
	  TNT1 AAAAAA 0 A_CustomMissile ("MeleeSmoke", 0, 0, random (0, 360), 2, random (0, 360))
      HADE R 3 Bright A_PlaySound("weapons/vblwa2")
      HADE STUVWX 3 Bright
      Stop
   }
}

Actor BladePuff3_FullDMG : BladePuff3 {
	DamageType "Melee_MagicFull"
}


Actor SoulRenderHealerWeak : CustomInventory
{
	inventory.maxamount 2
	States
	{
		Pickup:
			TNT1 A 0 ACS_ExecuteAlways(818, 0, 10)
		Stop
	}
}

Actor SoulRenderHealer: SoulRenderHealerWeak
{
	States
	{
		Pickup:
			TNT1 A 0 A_GiveInventory("Souls", 2)
			TNT1 A 0 ACS_ExecuteAlways(818, 0, 30)
		Stop
	}
}

Actor SoulRenderPickup : CustomInventory
{
	Radius 16
	Height 24
    Inventory.PickupSound "weapons/pickup"
    Inventory.pickupmessage "\ccWeapon Pickup : \c[Y5]Soul Render - 9\c-"	
	States
	{
		Spawn:
			WVBL A -1
		Stop
		Pickup:
			TNT1 A 0 A_JumpIf(1 == ACS_ExecuteWithResult(986, DND_WEAPON_SOULRENDER), "Success")
		Fail
		Success:
			TNT1 A 0 A_GiveInventory("Soul Render", 1)
			TNT1 A 0 A_TakeInventory("BladeHits", 100)
			TNT1 A 0 A_GiveInventory("BladeHits", 15*random(0,3))
			TNT1 A 0 A_JumpIfInventory("Ability_Temporal", 1, "GiveMore")
		Stop
		GiveMore:
			TNT1 A 0 A_TakeInventory("BladeHits", 15*random(1, 2))
		Stop
	}
}

Actor SoulRenderMsg : CustomInventory {
	States {
		Pickup:
			TNT1 A 0 ACS_ExecuteAlways(985, 0, 0, DND_WEAPON_SOULRENDER)
			TNT1 A 0 A_PlaySound("weapons/pickup", 6)
			TNT1 A 0 A_SetBlend("25 99 25", 0.6, 17)
		Stop
	}
}

Actor SoulRenderPickup_D : DND_DroppedItem {
	Radius 16
	Height 24
	States {
		Spawn:
			WVBL A 17
		SpawnLoop:
			WVBL A 1 A_LookEx(LOF_NOSOUNDCHECK, 0, 28, 0, 0, "CheckPickup")
		Loop
		
		See:
		CheckPickup:
			WVBL A 1 A_JumpIfCloser(32, "Pickup")
		goto SpawnLoop

		Pickup:
			WVBL A 1 A_JumpIf(1 == ACS_ExecuteWithResult(986, DND_WEAPON_SOULRENDER, 1), "PickupSuccess")
		goto PickupFail

		PickupFail:
			WVBL A 1
		goto SpawnLoop

		PickupSuccess:
			TNT1 A 0 A_GiveToTarget("Soul Render", 1)
			TNT1 A 0 A_GiveToTarget("BladeHits", mass)
			TNT1 A 0 A_GiveToTarget("SoulRenderMsg", 1)
		stop
	}
}

actor "SMG" : Weapon
{
  Weapon.SelectionOrder 6666
  Weapon.Slotnumber 9
  Weapon.AmmoUse 1
  Weapon.AmmoGive 0
  Scale 0.65
  Weapon.AmmoType "SmgAmmo"
  Obituary  "%o was blasted by %k's smg"
  Inventory.PickupMessage "Picked up an smg"
  +AMMO_OPTIONAL
  Scale 0.65
  +INVENTORY.UNDROPPABLE
  Decal "BulletChip"
  Weapon.BobStyle InverseSmooth
  Weapon.BobSpeed 2.0
  Weapon.BobRangeY 0.3
  Weapon.BobRangeX 0.6
  States
  {
  Remove:
    NAMG A 1 Offset(0, 40)
	NAMG A 1 Offset(0, 48)
	NAMG A 1 Offset(0, 56)
	NAMG A 1 Offset(0, 64)
	NAMG A 1 Offset(0, 72)
	NAMG A 1 Offset(0, 80)
	NAMG A 1 Offset(0, 88)
	TNT1 A 0 A_JumpIfInventory("SMGAmmo", 1, "RiseBack")
	NAMG A 1 Offset(0, 96)
	TNT1 A 0 A_TakeInventory("ForceWeaponRemove", 1)
	TNT1 A 0 A_TakeInventory("SMGAmmo", 0)
	TNT1 A 0 A_TakeInventory("H_WeaponSlot9", 1)
    TNT1 A 0 A_TakeInventory("SMG", 1)
	TNT1 A 1
  Stop
  RiseBack:
    NAMG A 1 Offset(0, 88)
	NAMG A 1 Offset(0, 80)
	NAMG A 1 Offset(0, 72)
	NAMG A 1 Offset(0, 64)
	NAMG A 1 Offset(0, 56)
	NAMG A 1 Offset(0, 48)
	NAMG A 1 Offset(0, 40)
  Goto Ready
  Ready:
	TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
    TNT1 A 0 A_JumpIfInventory("SMGAmmo", 1, "NoRemove")
  Goto Remove
  NoRemove:
	TNT1 A 0 A_GiveInventory("TempWeaponReady", 1)
    NAMG A 1 A_WeaponReady
    Goto Ready
  Deselect:
    TNT1 A 0 A_TakeInventory("TempWeaponReady", 1)
    TNT1 A 0 A_TakeInventory("H_WeaponSlot9", 1)
    NAMG A 1 A_Lower
	TNT1 A 0 A_Lower
	Loop
  Select:
    TNT1 A 0 A_TakeInventory("TempWeaponReady", 1)
	TNT1 A 0 A_TakeInventory("ForceWeaponRemove", 1)
    TNT1 A 0 A_GiveInventory("H_WeaponSlot9", 1)
	TNT1 A 0 A_TakeInventory("DnD_WeaponID", 0x7FFFFFFF)
	TNT1 A 0 A_GiveInventory("DnD_WeaponID", DND_WEAPON_SMG)
	TNT1 A 0 ACS_NamedExecuteAlways("DND Weapon Damage Cache", 0, DND_DMGID_0, 15)
SelectLoop:
	NAMG A 1 A_Raise
	TNT1 A 0 A_Raise
    Loop
  Fire:
	TNT1 A 0 A_TakeInventory("TempWeaponReady", 1)
    TNT1 A 0 A_JumpIfInventory("SMGAmmo", 1, "Continue")
	NAMG A 1
  Goto Ready
  Continue:
    NAMG A 1 Bright
	TNT1 A 0 A_PlaySound("weapons/smg")
	TNT1 A 0 A_FireCustomMissile("Tracer", frandom(-8.0, 8.0), 0, 0, frandom(-1.2, 1.2))
	TNT1 A 0 A_SpawnItemEx("GunSmokeSmaller", 18 * cos(-pitch), 6, 32 * (1 + sin(-pitch)), 2, 0, 1)
    NAUZ Z 1 bright A_GiveInventory("SMGShooter", 1)
  FireEnd:
    TNT1 A 0 A_GunFlash
	TNT1 A 0 A_SpawnItemEx ("chaingunsmoke",cos(-pitch)*20,5,36+(sin(-pitch)*20),cos(-pitch)*0,0,2,0,0,0)
    NAUZ X 1 bright A_SpawnItemEx ("pistolcasing",cos(pitch)*20,8,32+(sin(pitch)*20),0,8,random(4,8),0,0,0)
	TNT1 A 0 A_JumpIfInventory("SMGAmmo", 1, 1)
	Goto Ready
	TNT1 A 0
	TNT1 A 0 A_ReFire
  Goto Ready
  Flash:
	TNT1 A 2 Bright A_Light1
	TNT1 A 2 Bright A_Light0
  Stop  
  Spawn:
    MPPU A -1
    Stop
  }
}

Actor SMGShooter : DnD_Activator {
	states {
	Use:
		TNT1 A 0 A_JumpIfInventory("NetherCheck", 1, "Full")
		TNT1 A 0 A_FireBullets(8, 1.2, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_BALLISTIC), "NewBulletPuff", FBF_NORANDOM | FBF_USEAMMO)
		Stop
	Full:
		TNT1 A 0 A_FireBullets(8, 1.2, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_BALLISTIC), "NewBulletPuff_FullDMG", FBF_NORANDOM | FBF_USEAMMO)
		Stop
	}
}

Actor SMGPickup : CustomInventory
{
	Radius 16
	Height 24
	Scale 0.65
    Inventory.PickupSound "weapons/pickup"
    Inventory.pickupmessage "\ccWeapon Pickup : \c[Y5]Submachine Gun - 9"	
	States
	{
		Spawn:
			MPPU A -1
		Stop
		Pickup:
			TNT1 A 0 A_JumpIf(1 == ACS_ExecuteWithResult(986, DND_WEAPON_SMG), "Success")
		Fail
		Success:
			TNT1 A 0 A_GiveInventory("SMG", 1)
			TNT1 A 0 A_GiveInventory("SMGAmmo", random(35, 80) + ACS_ExecuteWithResult(918, 0, 1, random(35, 80)))
			TNT1 A 0 A_JumpIfInventory("Ability_Temporal", 1, "GiveMore")
		Stop
		GiveMore:
			TNT1 A 0 A_GiveInventory("SMGAmmo", random(17, 40))
		Stop
	}
}

Actor SMGMsg : CustomInventory {
	States {
		Pickup:
			TNT1 A 0 ACS_ExecuteAlways(985, 0, 0, DND_WEAPON_SMG)
			TNT1 A 0 A_PlaySound("weapons/pickup", 6)
			TNT1 A 0 A_SetBlend("25 99 25", 0.6, 17)
		Stop
	}
}

Actor SMGPickup_D : DND_DroppedItem {
	Radius 16
	Height 24
	Scale 0.65
	States {
		Spawn:
			MPPU A 8
		SpawnLoop:
			MPPU A 1 A_LookEx(LOF_NOSOUNDCHECK, 0, 28, 0, 0, "CheckPickup")
		Loop
		
		See:
		CheckPickup:
			MPPU A 1 A_JumpIfCloser(32, "Pickup")
		goto SpawnLoop

		Pickup:
			MPPU A 1 A_JumpIf(1 == ACS_ExecuteWithResult(986, DND_WEAPON_SMG, 1), "PickupSuccess")
		goto PickupFail

		PickupFail:
			MPPU A 1
		goto SpawnLoop

		PickupSuccess:
			TNT1 A 0 A_GiveToTarget("SMG", 1)
			TNT1 A 0 A_GiveToTarget("SMGAmmo", mass)
			TNT1 A 0 A_GiveToTarget("SMGMsg", 1)
		stop
	}
}

ACTOR "Hellforge Cannon" : Weapon
{	
   Inventory.PickupMessage "You got the Hellforge Cannon!"
   Obituary "%k ripped %o apart with a hellforge Cannon."
   Weapon.AmmoType "IronBalls"
   Weapon.AmmoGive 0
   Weapon.SelectionOrder 6666
   Weapon.AmmoUse 0
   Weapon.SlotNumber 9
   +AMMO_OPTIONAL
   +INVENTORY.UNDROPPABLE
    Weapon.BobStyle InverseSmooth
    Weapon.BobSpeed 1.6
    Weapon.BobRangeY 0.5
    Weapon.BobRangeX 0.9
   States
   {
  Remove:
    HFCA A 1 Offset(0, 40)
	HFCA A 1 Offset(0, 48)
	HFCA A 1 Offset(0, 56)
	HFCA A 1 Offset(0, 64)
	HFCA A 1 Offset(0, 72)
	HFCA A 1 Offset(0, 80)
	HFCA A 1 Offset(0, 88)
	TNT1 A 0 A_JumpIfInventory("IronBalls", 1, "RiseBack")
	HFCA A 1 Offset(0, 96)
	TNT1 A 0 A_TakeInventory("ForceWeaponRemove", 1)
	TNT1 A 0 A_TakeInventory("IronBalls", 0)
	TNT1 A 0 A_TakeInventory("H_WeaponSlot9", 1)
    TNT1 A 0 A_TakeInventory("Hellforge Cannon", 1)
	TNT1 A 1
  Stop
  RiseBack:
    HFCA A 1 Offset(0, 88)
	HFCA A 1 Offset(0, 80)
	HFCA A 1 Offset(0, 72)
	HFCA A 1 Offset(0, 64)
	HFCA A 1 Offset(0, 56)
	HFCA A 1 Offset(0, 48)
	HFCA A 1 Offset(0, 40)
  Goto Ready
  Ready:
	TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
    TNT1 A 0 A_JumpIfInventory("IronBalls", 1, "NoRemove")
  Goto Remove
  NoRemove:
	TNT1 A 0 A_GiveInventory("TempWeaponReady", 1)
    HFCA A 1 A_WeaponReady
    Goto Ready
   Spawn:
      WHFC A -1 Bright
      Stop
   Deselect:
	  TNT1 A 0 A_TakeInventory("TempWeaponReady", 1)
      TNT1 A 0 A_TakeInventory("H_WeaponSlot9", 1)
      HFCA A 1 A_Lower
	  TNT1 A 0 A_Lower
      Loop
   Select:
      TNT1 A 0 A_TakeInventory("TempWeaponReady", 1)
	  TNT1 A 0 A_TakeInventory("ForceWeaponRemove", 1)
      TNT1 A 0 A_GiveInventory("H_WeaponSlot9", 1)
	  TNT1 A 0 A_TakeInventory("DnD_WeaponID", 0x7FFFFFFF)
	  TNT1 A 0 A_GiveInventory("DnD_WeaponID", DND_WEAPON_HELLFORGECANNON)
	  TNT1 A 0 ACS_NamedExecuteAlways("DND Weapon Damage Cache", 0, DND_DMGID_0, 10, 1 | (8 << 16))
	  TNT1 A 0 ACS_NamedExecuteAlways("DND Weapon Damage Cache", 0, DND_DMGID_1, 64)
	  TNT1 A 0 ACS_NamedExecuteAlways("DND Weapon Damage Cache", 0, DND_DMGID_2, 1, 3 | (6 << 16))
	SelectLoop:
      HFCA A 1 A_Raise
	  TNT1 A 0 A_Raise
      Loop
   Fire:
      TNT1 A 0 A_TakeInventory("TempWeaponReady", 1)
	  TNT1 A 0 A_JumpIfInventory("IronBalls", 1, "ContinueNormal")
	  HFCA A 1
   Goto Ready
   ContinueNormal:
      HFCA DE 2 Bright
	  HFCA F 1 Bright
      HFCA D 0 A_GunFlash
	  TNT1 A 0 A_TakeInventory("IronBalls", 1)
	  TNT1 A 0 Radius_Quake(4, 3, 0, 1, 0)
      HFCA G 2 Bright A_GiveInventory("HellForgeShooter1", 1)
      HFCA HI 1 BRIGHT
	  HFCA JKL 1
	  HFCA MNO 2
      HFCA A 5 A_ReFire
      Goto Ready
   AltFire:
      TNT1 A 0 A_TakeInventory("TempWeaponReady", 1)
	  TNT1 A 0 A_JumpIfInventory("IronBalls", 3, "ContinueAlt")
	  HFCA A 1
   Goto Ready
   ContinueAlt:
      HFCA DE 2 Bright
	  HFCA F 1 Bright
      HFCA D 0 A_GunFlash
	  TNT1 A 0 A_TakeInventory("IronBalls", 3)
	  TNT1 A 0 Radius_Quake(4, 12, 0, 1, 0)
      HFCA G 1 Bright Offset(1, 33) A_GiveInventory("HellForgeShooter2", 1)
	  HFCA G 1 Bright Offset(2, 32) A_GiveInventory("HellForgeShooter2", 1)
	  HFCA G 1 Bright Offset(0, 33) A_GiveInventory("HellForgeShooter2", 1)
	  HFCA G 1 Bright Offset(-1, 33) A_GiveInventory("HellForgeShooter2", 1)
	  HFCA G 1 Bright Offset(1, 32) A_GiveInventory("HellForgeShooter2", 1)
	  HFCA G 1 Bright Offset(0, 33) A_GiveInventory("HellForgeShooter2", 1)
	  HFCA G 1 Bright Offset(1, 34) A_GiveInventory("HellForgeShooter2", 1)
	  HFCA G 1 Bright Offset(0, 33) A_GiveInventory("HellForgeShooter2", 1)
	  HFCA G 1 Bright Offset(-1, 32) A_GiveInventory("HellForgeShooter2", 1)
	  HFCA G 1 Bright Offset(-2, 33) A_GiveInventory("HellForgeShooter2", 1)
	  HFCA G 1 Bright Offset(0, 32) A_GiveInventory("HellForgeShooter2", 1)
      HFCA HI 1 BRIGHT
	  HFCA JKL 1
	  HFCA MNO 2
      HFCA A 5 A_ReFire   
      Goto Ready
   }
}

Actor HellForgeShooter1 : DnD_Activator {
	States {
		Pickup:
			TNT1 A 0 A_JumpIfInventory("DnD_QuestReward_DreamingGodBonus", 1, "Full")
			TNT1 A 0 A_JumpIfInventory("NetherCheck", 1, "Full")
			TNT1 A 0 A_FireCustomMissile("Ripper1",0,0,0,0)
		Stop
		Full:
			TNT1 A 0 A_FireCustomMissile("Ripper1_FullDMG",0,0,0,0)
		Stop
	}
}

Actor HellForgeShooter2 : DnD_Activator {
	States {
		Pickup:
			TNT1 A 0 A_JumpIfInventory("DnD_QuestReward_DreamingGodBonus", 1, "Full")
			TNT1 A 0 A_JumpIfInventory("NetherCheck", 1, "Full")
			TNT1 A 0 A_FireCustomMissile("Ripper2Proj", random(-9, 9), 0,0,0,0, random(-2,2))
		Stop
		Full:
			TNT1 A 0 A_FireCustomMissile("Ripper2Proj_FullDMG", random(-9, 9), 0,0,0,0, random(-2,2))
		Stop
	}
}

ACTOR Ripper1
{
   Radius 8
   Height 8
   Speed 28
   Damage (ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT, DND_USETARGET))
   PROJECTILE
   +FORCEXYBILLBOARD
   +MTHRUSPECIES
   +FORCERADIUSDMG
   +DONTBLAST
   +FOILINVUL
   Seesound "weapons/macefi"
   DeathSound "weapons/maceex"
   DamageType "Magic"
   States
   {
   Spawn:
      RIP1 AAABBBCCC 1 Bright A_SpawnItemEx("RedPuff",0,0,0,0,0,0,0,8)
      loop
   Death:
      TNT1 A 0 A_SetTranslucent (0.75,1)
      RIP1 D 1 Bright A_Explode(ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_1, TALENT_OCCULT, DND_USETARGET), 84, 0)
      TNT1 A 0 A_CustomMissile("Ripper2", 0, 0, 0, CMF_TRACKOWNER)
      TNT1 A 0 A_CustomMissile("Ripper2", 0, 0, 60, CMF_TRACKOWNER)
      TNT1 A 0 A_CustomMissile("Ripper2", 0, 0, 120, CMF_TRACKOWNER)
      TNT1 A 0 A_CustomMissile("Ripper2", 0, 0, 180, CMF_TRACKOWNER)
      TNT1 A 0 A_CustomMissile("Ripper2", 0, 0, 240, CMF_TRACKOWNER)
      TNT1 A 0 A_CustomMissile("Ripper2", 0, 0, 300, CMF_TRACKOWNER)
      RIP1 DEFGH 3 Bright
      stop
   }
}

Actor Ripper1_FullDMG : Ripper1 {
	DamageType "MagicFull"
	States {
		Death:
			TNT1 A 0 A_SetTranslucent (0.75,1)
			RIP1 D 1 Bright A_Explode(ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_1, TALENT_OCCULT, DND_USETARGET), 84, 0)
			TNT1 A 0 A_CustomMissile("Ripper2_FullDMG", 0, 0, 0, CMF_TRACKOWNER)
			TNT1 A 0 A_CustomMissile("Ripper2_FullDMG", 0, 0, 60, CMF_TRACKOWNER)
			TNT1 A 0 A_CustomMissile("Ripper2_FullDMG", 0, 0, 120, CMF_TRACKOWNER)
			TNT1 A 0 A_CustomMissile("Ripper2_FullDMG", 0, 0, 180, CMF_TRACKOWNER)
			TNT1 A 0 A_CustomMissile("Ripper2_FullDMG", 0, 0, 240, CMF_TRACKOWNER)
			TNT1 A 0 A_CustomMissile("Ripper2_FullDMG", 0, 0, 300, CMF_TRACKOWNER)
			RIP1 DEFGH 3 Bright
		stop
	}
}

ACTOR Ripper2
{
   Radius 5
   Height 5
   Damage (3 * ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_2, TALENT_OCCULT, DND_USETARGET))
   PROJECTILE
   DamageType "Magic"
   Speed 24
   +RIPPER
   +FORCEXYBILLBOARD
   +MTHRUSPECIES
   +DONTBLAST
   +FOILINVUL
   DeathSound "weapons/firex2"
   States
   {
   Spawn:
      RIP2 AAA 1 Bright A_SpawnItemEx("Ripper2Trail")
      RIP2 BBB 1 Bright A_SpawnItemEx("Ripper2Trail")
      loop
   Death:
      RIP2 C 0 Bright A_SetTranslucent (0.67,1)
      RIP2 CDEFG 3 Bright
      stop
   }
}

Actor Ripper2_Damager : DnD_FakeDamager {
	Radius 4
	Height 8
	Damage (3 * ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT, DND_USETARGET))
	DamageType "MagicFull"
	Speed 28
	+FOILINVUL
}

Actor Ripper2_FullDMG : Ripper2 {
	+THRUACTORS
	States {
		Spawn:
			RIP2 A 1 Bright A_SpawnItemEx("Ripper2Trail")
			TNT1 A 0 A_CustomMissile("Ripper2_Damager", 0, 0, 0, CMF_TRACKOWNER)
			RIP2 A 1 Bright A_SpawnItemEx("Ripper2Trail")
			TNT1 A 0 A_CustomMissile("Ripper2_Damager", 0, 0, 0, CMF_TRACKOWNER)
			RIP2 A 1 Bright A_SpawnItemEx("Ripper2Trail")
			TNT1 A 0 A_CustomMissile("Ripper2_Damager", 0, 0, 0, CMF_TRACKOWNER)
			RIP2 B 1 Bright A_SpawnItemEx("Ripper2Trail")
			TNT1 A 0 A_CustomMissile("Ripper2_Damager", 0, 0, 0, CMF_TRACKOWNER)
			RIP2 B 1 Bright A_SpawnItemEx("Ripper2Trail")
			TNT1 A 0 A_CustomMissile("Ripper2_Damager", 0, 0, 0, CMF_TRACKOWNER)
			RIP2 B 1 Bright A_SpawnItemEx("Ripper2Trail")
			TNT1 A 0 A_CustomMissile("Ripper2_Damager", 0, 0, 0, CMF_TRACKOWNER)
		Loop
	}
}

ACTOR Ripper2Trail
{
   Radius 5
   Height 5
   PROJECTILE
   Damagetype normal
   +FORCEXYBILLBOARD
   +EXTREMEDEATH
   +DOOMBOUNCE
   +NOINTERACTION
   +CLIENTSIDEONLY
	RenderStyle Add
	Alpha 0.5
   DeathSound "weapons/firex2"
   States
   {
   Spawn:
      RIP2 AB 2 Bright A_Fadeout(0.07)
      loop
   }
}

Actor Ripper2Proj : Ripper2
{
	Speed 16
	Seesound "weapons/macefi"
	Damage (ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_2, TALENT_OCCULT, DND_USETARGET))
	DamageType "Magic"
	+FOILINVUL
}

Actor Ripper2Proj_FullDMG : Ripper2_FullDMG {
	Speed 16
	Seesound "weapons/macefi"
	Damage (ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_2, TALENT_OCCULT, DND_USETARGET))
	DamageType "MagicFull"
	+FOILINVUL
}

Actor HellforgeCannonPickup : CustomInventory
{
	Radius 16
	Height 24
    Inventory.PickupSound "weapons/pickup"
    Inventory.pickupmessage "\ccWeapon Pickup : \c[Y5]Hellforge Cannon - 9\c-"	
	States
	{
		Spawn:
			WHFC A -1 Bright
		Stop
		Pickup:
			TNT1 A 0 A_JumpIf(1 == ACS_ExecuteWithResult(986, DND_WEAPON_HELLFORGECANNON), "Success")
		Fail
		Success:
			TNT1 A 0 A_GiveInventory("Hellforge Cannon", 1)
			TNT1 A 0 A_GiveInventory("IronBalls", random(10, 16) + ACS_ExecuteWithResult(918, 0, 1, random(10, 16)))
			TNT1 A 0 A_JumpIfInventory("Ability_Temporal", 1, "GiveMore")
		Stop
		GiveMore:
			TNT1 A 0 A_GiveInventory("IronBalls", random(8, 12))
		Stop
	}
}

Actor HellForgeMsg : CustomInventory {
	States {
		Pickup:
			TNT1 A 0 ACS_ExecuteAlways(985, 0, 0, DND_WEAPON_HELLFORGECANNON)
			TNT1 A 0 A_PlaySound("weapons/pickup", 6)
			TNT1 A 0 A_SetBlend("25 99 25", 0.6, 17)
		Stop
	}
}

Actor HellForgePickup_D : DND_DroppedItem {
	Radius 16
	Height 24
	States {
		Spawn:
			WHFC A 17 Bright
		SpawnLoop:
			WHFC A 1 Bright A_LookEx(LOF_NOSOUNDCHECK, 0, 28, 0, 0, "CheckPickup")
		Loop
		
		See:
		CheckPickup:
			WHFC A 1 Bright A_JumpIfCloser(32, "Pickup")
		goto SpawnLoop

		Pickup:
			WHFC A 1 Bright A_JumpIf(1 == ACS_ExecuteWithResult(986, DND_WEAPON_HELLFORGECANNON, 1), "PickupSuccess")
		goto PickupFail

		PickupFail:
			WHFC A 1 Bright
		goto SpawnLoop

		PickupSuccess:
			TNT1 A 0 A_GiveToTarget("Hellforge Cannon", 1)
			TNT1 A 0 A_GiveToTarget("IronBalls", mass)
			TNT1 A 0 A_GiveToTarget("HellForgeMsg", 1)
		stop
	}
}

ACTOR "Bloodfiend Spine" : Weapon
{	
   Obituary "%k splattered %o with his Bloodfiend spine."
   Weapon.AmmoType "BloodAmmo"
   Weapon.Slotnumber 9
   Weapon.AmmoGive 0
   Weapon.SelectionOrder 6666
   Weapon.AmmoUse 0
   +INVENTORY.UNDROPPABLE
  Weapon.BobStyle InverseSmooth
  Weapon.BobSpeed 1.6
  Weapon.BobRangeY 0.6
  Weapon.BobRangeX 0.9
   States
   {
  Remove:
    GORG A 1 Offset(0, 40)
	GORG A 1 Offset(0, 48)
	GORG A 1 Offset(0, 56)
	GORG A 1 Offset(0, 64)
	GORG A 1 Offset(0, 72)
	GORG A 1 Offset(0, 80)
	GORG A 1 Offset(0, 88)
	TNT1 A 0 A_JumpIfInventory("BloodAmmo", 1, "RiseBack")
	GORG A 1 Offset(0, 96)
	TNT1 A 0 A_TakeInventory("P_RedFire", 1)
	TNT1 A 0 A_TakeInventory("ForceWeaponRemove", 1)
	TNT1 A 0 A_TakeInventory("BloodAmmo", 0)
	TNT1 A 0 A_TakeInventory("H_WeaponSlot9", 1)
    TNT1 A 0 A_TakeInventory("Bloodfiend Spine", 1)
	TNT1 A 1
  Stop
  RiseBack:
    GORG A 1 Offset(0, 88)
	GORG A 1 Offset(0, 80)
	GORG A 1 Offset(0, 72)
	GORG A 1 Offset(0, 64)
	GORG A 1 Offset(0, 56)
	GORG A 1 Offset(0, 48)
	GORG A 1 Offset(0, 40)
  Goto Ready
  Ready:
    TNT1 A 0 A_JumpIfInventory("BloodAmmo", 1, "NoRemove")
  Goto Remove
  NoRemove:
      GORG A 0 A_JumpIfInventory("GoreMode", 1, "ReadyAlt")
	  TNT1 A 0 A_GiveInventory("TempWeaponReady", 1)
      GORG A 4 A_weaponReady
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
	  GORG B 4 A_weaponReady
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
	  GORG C 4 A_weaponReady
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
	  GORG D 4 A_weaponReady
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
	  GORG A 4 A_weaponReady
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
	  GORG B 4 A_weaponReady
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
	  GORG C 4 A_weaponReady
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
	  GORG D 4 A_weaponReady
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
	  GORG A 4 A_weaponReady
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
	  GORG B 4 A_weaponReady
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
	  GORG C 4 A_weaponReady
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
	  GORG D 4 A_weaponReady
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
	  GORG A 4 A_weaponReady
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
	  GORG B 4 A_weaponReady
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
	  GORG C 4 A_weaponReady
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
	  GORG D 4 A_weaponReady
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
    Goto Ready
   ReadyAlt:
	  TNT1 A 0 A_GiveInventory("TempWeaponReady", 1)
      GORG K 4 A_WeaponReady
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
	  GORG L 4 A_WeaponReady
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
	  GORG M 4 A_WeaponReady
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
	  GORG N 4 A_WeaponReady
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
      Loop	
   Spawn:
      WGOR A -1
      Stop
   Deselect:
      TNT1 A 0 A_TakeInventory("P_RedFire", 1)
      TNT1 A 0 A_TakeInventory("TempWeaponReady", 1)
      TNT1 A 0 A_TakeInventory("H_WeaponSlot9", 1)
      GORG A 1 A_Lower
	  TNT1 A 0 A_Lower
      Loop
   Select:
      TNT1 A 0 A_GiveInventory("P_RedFire", 1)
      TNT1 A 0 A_TakeInventory("TempWeaponReady", 1)
	  TNT1 A 0 A_TakeInventory("ForceWeaponRemove", 1)
      TNT1 A 0 A_GiveInventory("H_WeaponSlot9", 1)
	  TNT1 A 0 A_TakeInventory("DnD_WeaponID", 0x7FFFFFFF)
	  TNT1 A 0 A_GiveInventory("DnD_WeaponID", DND_WEAPON_BLOODFIENDSPINE)
	  TNT1 A 0 ACS_NamedExecuteAlways("DND Weapon Damage Cache", 0, DND_DMGID_0, 1, 16 | (32 << 16))
	  TNT1 A 0 ACS_NamedExecuteAlways("DND Weapon Damage Cache", 0, DND_DMGID_1, 36)
	  TNT1 A 0 ACS_NamedExecuteAlways("DND Weapon Damage Cache", 0, DND_DMGID_2, 5)
	SelectLoop:
      GORG A 1 A_Raise
	  TNT1 A 0 A_Raise
      Loop
   Fire:
      TNT1 A 0 A_TakeInventory("TempWeaponReady", 1)
	  TNT1 A 0 A_JumpIfInventory("BloodAmmo", 1, "ContinueNorm")
      GORG A 1
   Goto Ready
   ContinueNorm:
      GORG E 0 A_JumpIfInventory("GoreMode",1,"Check")
      GORG E 2 Bright A_PlayWeaponSound("weapons/gorfi1")
	  TNT1 A 0 A_TakeInventory("BloodAmmo", 1)
      GORG F 3 Bright A_GiveInventory("GoreShooter2", 1)
      GORG GH 2 Bright
      GORG A 1
      GORG A 0 A_Refire
      Goto Ready
   Check:
      TNT1 A 0 A_JumpIfInventory("BloodAmmo",2,1)
      Goto AltFire
      TNT1 A 0 A_GunFlash
      GORG O 1 Bright A_PlayWeaponSound("weapons/gorfi2")
      TNT1 A 0 A_TakeInventory("BloodAmmo",2)
	  TNT1 A 0 Radius_Quake(3, 3, 0, 1, 0)
      GORG O 3 Bright A_GiveInventory("GoreShooter1", 1)
   Continue:
      GORG PQR 3 Bright
      GORG I 5 A_PlaySound("weapons/gorsuc")
      GORG JK 5
      GORG KLMNKLMN 3
      GORG I 0 A_Refire
      Goto Ready
   AltFire:
      TNT1 A 0 A_TakeInventory("TempWeaponReady", 1)
      TNT1 A 0 A_JumpIfInventory("GoreMode",1,"ChangeMode")
      TNT1 A 0 A_GiveInventory("GoreMode",1)
      GORG I 5 A_PlaySound("weapons/gorsuc")
      GORG JK 5
      Goto Ready
   ChangeMode:
      TNT1 A 0 A_TakeInventory("GoreMode",1)
      GORG L 5 A_PlaySound("weapons/gorsuc")
      GORG KJI 5
      Goto Ready
   }
}

Actor GoreShooter1 : DnD_Activator {
	States {
		Pickup:
			TNT1 A 0 A_JumpIfInventory("DnD_QuestReward_DreamingGodBonus", 1, "Full")
			TNT1 A 0 A_JumpIfInventory("NetherCheck", 1, "Full")
			TNT1 A 0 A_FireBullets(9, 9, 20, random(1, 3) * ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_2, TALENT_OCCULT), "BloodFX", FBF_NORANDOM | FBF_USEAMMO, 384)
		Stop
		Full:
			TNT1 A 0 A_FireBullets(9, 9, 20, random(1, 3) * ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_2, TALENT_OCCULT), "BloodFX_FullDMG", FBF_NORANDOM | FBF_USEAMMO, 384)
		Stop
	}
}

Actor GoreShooter2 : DnD_Activator {
	States {
		Pickup:
			TNT1 A 0 A_JumpIfInventory("DnD_QuestReward_DreamingGodBonus", 1, "Full")
			TNT1 A 0 A_JumpIfInventory("NetherCheck", 1, "Full")
			TNT1 A 0 A_FireCustomMissile("GoreShot1",0,1,0,0)
		Stop
		Full:
			TNT1 A 0 A_FireCustomMissile("GoreShot1_FullDMG",0,1,0,0)
		Stop
	}
}

Actor BloodFX : BulletPuff
{
   Radius 3
   Height 3
   RENDERSTYLE ADD
   DamageType "Magic"
   ALPHA 0.75
   +NOGRAVITY
   +PUFFONACTORS
   +ALWAYSPUFF
   +FORCEXYBILLBOARD
   +CLIENTSIDEONLY
   Vspeed 0
   States
   {
   Spawn:
      BLFX ABCDEF 3 BRIGHT
      stop
   }
}

Actor BloodFX_FullDMG : BloodFX {
	DamageType "MagicFull"
}

ACTOR GoreShot1
{
   Radius 6
   Height 12
   Speed 36
   Damage (ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT, DND_USETARGET))
   DamageType "Magic"
   PROJECTILE
   RENDERSTYLE Translucent
   Alpha 0.85
   +THRUGHOST
   +DONTBLAST
   +FORCEXYBILLBOARD
   +MTHRUSPECIES
   DeathSound "weapons/globex"
   States
   {
   Spawn:
      FGOR A 2 Bright A_SpawnItem("GoreFX1",0,0)
      FGOR A 0 Bright A_CStaffMissileSlither
      FGOR B 2 Bright A_SpawnItem("GoreFX1",0,0)
      FGOR B 0 Bright A_CStaffMissileSlither
      FGOR C 2 Bright A_SpawnItem("GoreFX1",0,0)
      FGOR C 0 Bright A_CStaffMissileSlither
      FGOR D 2 Bright A_SpawnItem("GoreFX1",0,0)
      FGOR D 0 Bright A_CStaffMissileSlither
      FGOR E 2 Bright A_SpawnItem("GoreFX1",0,0)
      FGOR E 0 Bright A_CStaffMissileSlither
      FGOR F 2 Bright A_SpawnItem("GoreFX1",0,0)
      FGOR F 0 Bright A_CStaffMissileSlither
      loop
   Death:
      FGOR G 4 Bright A_Explode(ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_1, TALENT_OCCULT, DND_USETARGET), 40, 0)
      FGOR HIJ 4 Bright
      stop
   }
}

Actor GoreShot1_FullDMG : GoreShot1 {
	DamageType "MagicFull"
	+FORCERADIUSDMG
	-THRUGHOST
}

ACTOR GoreFX1
{   
   Radius 0
   Height 1
   Scale 0.66
   +NOGRAVITY
   +NOBLOCKMAP
   Damagetype normal
   RENDERSTYLE Translucent
   Alpha 0.85
   +FORCEXYBILLBOARD
   +CLIENTSIDEONLY
   States
   {
   Spawn:
      TNT1 A 3 Bright
      FGOR KLM 3 Bright
      Stop 
   }
}

Actor SpinePickup : CustomInventory
{
	Radius 16
	Height 24
    Inventory.PickupSound "weapons/pickup"
    Inventory.pickupmessage "\ccWeapon Pickup : \c[Y5]Bloodfiend Spine - 9\c-"	
	States
	{
		Spawn:
			WGOR A -1
		Stop
		Pickup:
			TNT1 A 0 A_JumpIf(1 == ACS_ExecuteWithResult(986, DND_WEAPON_BLOODFIENDSPINE), "Success")
		Fail
		Success:
			TNT1 A 0 A_GiveInventory("Bloodfiend Spine", 1)
			TNT1 A 0 A_GiveInventory("BloodAmmo", random(4, 24) + ACS_ExecuteWithResult(918, 0, 1, random(4, 24)))
			TNT1 A 0 A_JumpIfInventory("Ability_Temporal", 1, "GiveMore")
		Stop
		GiveMore:
			TNT1 A 0 A_GiveInventory("BloodAmmo", random(2, 12))
		Stop
	}
}

Actor SpineMsg : CustomInventory {
	States {
		Pickup:
			TNT1 A 0 ACS_ExecuteAlways(985, 0, 0, DND_WEAPON_BLOODFIENDSPINE)
			TNT1 A 0 A_PlaySound("weapons/pickup", 6)
			TNT1 A 0 A_SetBlend("25 99 25", 0.6, 17)
		Stop
	}
}

Actor SpinePickup_D : DND_DroppedItem {
	Radius 16
	Height 24
	XScale 0.7
	YScale 0.8
	States {
		Spawn:
			WGOR A 17
		SpawnLoop:
			WGOR A 1 A_LookEx(LOF_NOSOUNDCHECK, 0, 28, 0, 0, "CheckPickup")
		Loop
		
		See:
		CheckPickup:
			WGOR A 1 A_JumpIfCloser(32, "Pickup")
		goto SpawnLoop

		Pickup:
			WGOR A 1 A_JumpIf(1 == ACS_ExecuteWithResult(986, DND_WEAPON_BLOODFIENDSPINE, 1), "PickupSuccess")
		goto PickupFail

		PickupFail:
			WGOR A 1
		goto SpawnLoop

		PickupSuccess:
			TNT1 A 0 A_GiveToTarget("Bloodfiend Spine", 1)
			TNT1 A 0 A_GiveToTarget("BloodAmmo", mass)
			TNT1 A 0 A_GiveToTarget("SpineMsg", 1)
		stop
	}
}

actor "Enforcer Rifle" : Weapon
{
  Weapon.SelectionOrder 6666
  Weapon.Slotnumber 9
  Weapon.AmmoUse 0
  Weapon.AmmoGive 0
  Scale 0.65
  Weapon.AmmoType "LaserAmmo"
  Obituary  "%o was lasered by %k's Enforcer Rifle"
  Inventory.PickupMessage "Picked up an Enforcer Rifle"
  +AMMO_OPTIONAL
  XScale 0.7
  YScale 0.8  
  +INVENTORY.UNDROPPABLE
  Weapon.BobStyle InverseSmooth
  Weapon.BobSpeed 2.1
  Weapon.BobRangeY 0.4
  Weapon.BobRangeX 0.7
  Tag "Laser Rifle"
  States
  {
  Remove:
    ENRI A 1 Offset(0, 40)
	ENRI A 1 Offset(0, 48)
	ENRI A 1 Offset(0, 56)
	ENRI A 1 Offset(0, 64)
	ENRI A 1 Offset(0, 72)
	ENRI A 1 Offset(0, 80)
	ENRI A 1 Offset(0, 88)
	TNT1 A 0 A_JumpIfInventory("LaserAmmo", 1, "RiseBack")
	ENRI A 1 Offset(0, 96)
	TNT1 A 0 A_TakeInventory("P_RedFire", 1)
	TNT1 A 0 A_TakeInventory("ForceWeaponRemove", 1)
	TNT1 A 0 A_TakeInventory("LaserAmmo", 0)
	TNT1 A 0 A_TakeInventory("H_WeaponSlot9", 1)
    TNT1 A 0 A_TakeInventory("Enforcer Rifle", 1)
	TNT1 A 1
  Stop
  RiseBack:
    ENRI A 1 Offset(0, 88)
	ENRI A 1 Offset(0, 80)
	ENRI A 1 Offset(0, 72)
	ENRI A 1 Offset(0, 64)
	ENRI A 1 Offset(0, 56)
	ENRI A 1 Offset(0, 48)
	ENRI A 1 Offset(0, 40)
  Goto Ready
  Ready:
	TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
    TNT1 A 0 A_JumpIfInventory("LaserAmmo", 1, "NoRemove")
  Goto Remove
  NoRemove:
    TNT1 A 0 A_GiveInventory("TempWeaponReady", 1)
    ENRI A 1 A_WeaponReady
    Goto Ready
  Deselect: 
    TNT1 A 0 A_TakeInventory("P_RedFire", 1)
    TNT1 A 0 A_TakeInventory("TempWeaponReady", 1)
    TNT1 A 0 A_TakeInventory("H_WeaponSlot9", 1)
	TNT1 A 0 A_TakeInventory("DnD_UsingEnergy", 1)
    ENRI A 1 A_Lower
	TNT1 A 0 A_Lower
	Loop
  Select:
    TNT1 A 0 A_GiveInventory("P_RedFire", 1)
	TNT1 A 0 A_TakeInventory("TempWeaponReady", 1)
	TNT1 A 0 A_TakeInventory("ForceWeaponRemove", 1)
    TNT1 A 0 A_GiveInventory("H_WeaponSlot9", 1)
	TNT1 A 0 A_GiveInventory("DnD_UsingEnergy", 1)
	TNT1 A 0 A_TakeInventory("DnD_WeaponID", 0x7FFFFFFF)
	TNT1 A 0 A_GiveInventory("DnD_WeaponID", DND_WEAPON_ENFORCERRIFLE)
	TNT1 A 0 ACS_NamedExecuteAlways("DND Weapon Damage Cache", 0, DND_DMGID_0, 5, 4 | (9 << 16))
SelectLoop:
	ENRI A 1 A_Raise
	TNT1 A 0 A_Raise
    Loop
  Fire:
    TNT1 A 0 A_TakeInventory("TempWeaponReady", 1)
    TNT1 A 0 A_JumpIfInventory("LaserAmmo", 1, "Continue")
	ENRI A 1
  Goto Ready
  Continue:
    ENRI A 1 Bright
    ENRI BC 1 bright
	TNT1 A 0 A_PlayWeaponSound("Enforcer/Fire")
	TNT1 A 0 A_TakeInventory("LaserAmmo", 1)
	TNT1 A 0 A_SpawnItemEx("GunSmokeSmaller", 18 * cos(-pitch), 2, 36 * (1 + sin(-pitch)), 2, 0, 1)
	TNT1 A 0 A_GiveInventory("EnforcerShooter1", 1)
	TNT1 A 0 A_GunFlash
    ENRI DE 1 bright
	ENRI MN 1 Bright
	ENRI A 2 A_ReFire
  Goto Ready
  AltFire:
    TNT1 A 0 A_TakeInventory("TempWeaponReady", 1)
    TNT1 A 0 A_JumpIfInventory("LaserAmmo", 2, "Continue2")
	ENRI A 1
  Goto Ready
  Continue2:
    ENRI BFG 1 Bright
	TNT1 A 0 A_TakeInventory("LaserAmmo", 2)
	TNT1 A 0 A_PlayWeaponSound("Enforcer/Fire")
	TNT1 A 0 A_SpawnItemEx("GunSmoke", 18 * cos(-pitch), 4, 34 * (1 + sin(-pitch)), 2, 0, 1)
	TNT1 A 0 A_GiveInventory("EnforcerShooter2", 1)
	TNT1 A 0 A_GunFlash
    ENRI HIJ 1 Bright
	ENRI KLMN 1
	ENRI A 2 A_ReFire
  Goto Ready
  Flash:
	TNT1 A 2 A_Light1
	TNT1 A 2 A_Light0
	Goto LightDone
  Spawn:
    ENRP A -1
    Stop
  }
}

Actor EnforcerShooter1 : DnD_Activator {
	States {
		Pickup:
			TNT1 A 0 A_JumpIfInventory("NetherCheck", 1, "Full")
			TNT1 A 0 A_FireCustomMissile("EnforcerPlasma", 1, 0, 2, 6)
		Stop
		Full:
			TNT1 A 0 A_FireCustomMissile("EnforcerPlasma_FullDMG", 1, 0, 2, 6)
		Stop
	}
}
	
Actor EnforcerShooter2 : DnD_Activator {
	States {
		Pickup:
			TNT1 A 0 A_JumpIfInventory("NetherCheck", 1, "Full")
			TNT1 A 0 A_FireCustomMissile("EnforcerPlasma", -2, 0, 2, 6)
			TNT1 A 0 A_FireCustomMissile("EnforcerPlasma", 2, 0, 2, 6)
		Stop
		Full:
			TNT1 A 0 A_FireCustomMissile("EnforcerPlasma_FullDMG", -2, 0, 2, 6)
			TNT1 A 0 A_FireCustomMissile("EnforcerPlasma_FullDMG", 2, 0, 2, 6)
		Stop
	}
}

Actor EnforcerPlasma
{
	PROJECTILE
	Height 8
	Radius 4
	Damage (ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_ENERGY, DND_USETARGET))
	DamageType "Energy"
	RenderStyle Add
	Alpha 0.8
	Scale 0.25
	Speed 48
	DeathSound "Enforcer/Hit"
	+FOILINVUL
	+MTHRUSPECIES
	+DONTBLAST
	States
	{
		Spawn:
			TRAC A -1 Bright
		Stop
		Death:
			TNT1 AAAAAA 0 A_SpawnItemEx("EnforcerFX", random(-4,4), random(-4,4), random(-2, 2), 0, 0, 0)
			TNT1 A 2
		Stop
	}
}

Actor EnforcerPlasma_FullDMG : EnforcerPlasma {
	DamageType "EnergyFull"
}

Actor EnforcerFX
{
	Height 1
	Radius 1
	+NOGRAVITY
	+CLIENTSIDEONLY
	States
	{
		Spawn:
			SSF2 ABCD 2 Bright
			SSF2 EFG 2
		Stop
	}
}

Actor LaserPickup : CustomInventory
{
	Radius 24
	Height 24
	XScale 0.7
	YScale 0.8
    Inventory.PickupSound "weapons/pickup"
    Inventory.pickupmessage "\ccWeapon Pickup : \c[Y5]Enforcer Laser Rifle - 9\c-"	
	States
	{
		Spawn:
			ENRP A -1
		Stop
		Pickup:
			TNT1 A 0 A_JumpIf(1 == ACS_ExecuteWithResult(986, DND_WEAPON_ENFORCERRIFLE), "Success")
		Fail
		Success:
			TNT1 A 0 A_GiveInventory("Enforcer Rifle", 1)
			TNT1 A 0 A_GiveInventory("LaserAmmo", random(15, 45) + ACS_ExecuteWithResult(918, 0, 1, random(15, 45)))
			TNT1 A 0 A_JumpIfInventory("Ability_Temporal", 1, "GiveMore")
		Stop
		GiveMore:
			TNT1 A 0 A_GiveInventory("LaserAmmo", random(7, 22))
		Stop
	}
}

Actor LaserMsg : CustomInventory {
	States {
		Pickup:
			TNT1 A 0 ACS_ExecuteAlways(985, 0, 0, DND_WEAPON_ENFORCERRIFLE)
			TNT1 A 0 A_PlaySound("weapons/pickup", 6)
			TNT1 A 0 A_SetBlend("25 99 25", 0.6, 17)
		Stop
	}
}

Actor LaserPickup_D : DND_DroppedItem {
	Radius 16
	Height 24
	XScale 0.7
	YScale 0.8
	States {
		Spawn:
			ENRP A 17
		SpawnLoop:
			ENRP A 1 A_LookEx(LOF_NOSOUNDCHECK, 0, 28, 0, 0, "CheckPickup")
		Loop
		
		See:
		CheckPickup:
			ENRP A 1 A_JumpIfCloser(32, "Pickup")
		goto SpawnLoop

		Pickup:
			ENRP A 1 A_JumpIf(1 == ACS_ExecuteWithResult(986, DND_WEAPON_ENFORCERRIFLE, 1), "PickupSuccess")
		goto PickupFail

		PickupFail:
			ENRP A 1
		goto SpawnLoop

		PickupSuccess:
			TNT1 A 0 A_GiveToTarget("Enforcer Rifle", 1)
			TNT1 A 0 A_GiveToTarget("LaserAmmo", mass)
			TNT1 A 0 A_GiveToTarget("LaserMsg", 1)
		stop
	}
}

ACTOR Venom : Weapon
{
   Obituary "%o was poisoned to the core by %k's Venom."
   Weapon.AmmoType "VenomAmmo"
   Weapon.AmmoGive 0
   Weapon.SelectionOrder 6666
   Weapon.AmmoUse 0
   Weapon.Slotnumber 9
   Scale 0.67
   +INVENTORY.UNDROPPABLE
  Weapon.BobStyle InverseSmooth
  Weapon.BobSpeed 1.6
  Weapon.BobRangeY 0.6
  Weapon.BobRangeX 0.9
   States
   {
  Remove:
    SHRG A 1 Offset(0, 40)
	SHRG A 1 Offset(0, 48)
	SHRG A 1 Offset(0, 56)
	SHRG A 1 Offset(0, 64)
	SHRG A 1 Offset(0, 72)
	SHRG A 1 Offset(0, 80)
	SHRG A 1 Offset(0, 88)
	TNT1 A 0 A_JumpIfInventory("VenomAmmo", 1, "RiseBack")
	SHRG A 1 Offset(0, 96)
	TNT1 A 0 A_TakeInventory("P_GreenFire", 1)
	TNT1 A 0 A_TakeInventory("ForceWeaponRemove", 1)
	TNT1 A 0 A_TakeInventory("VenomAmmo", 0)
	TNT1 A 0 A_TakeInventory("H_WeaponSlot9", 1)
    TNT1 A 0 A_TakeInventory("Venom", 1)
	TNT1 A 1
  Stop
  RiseBack:
    SHRG A 1 Offset(0, 88)
	SHRG A 1 Offset(0, 80)
	SHRG A 1 Offset(0, 72)
	SHRG A 1 Offset(0, 64)
	SHRG A 1 Offset(0, 56)
	SHRG A 1 Offset(0, 48)
	SHRG A 1 Offset(0, 40)
  Goto Ready
  Ready:
    TNT1 A 0 A_JumpIfInventory("VenomAmmo", 1, "NoRemove")
  Goto Remove
   Spawn:
      WSHD A -1
      Stop
   NoRemove:
	  TNT1 A 0 A_GiveInventory("TempWeaponReady", 1)
      SHRG A 4 A_WeaponReady
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
	  SHRG B 4 A_WeaponReady
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
	  SHRG C 4 A_WeaponReady
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
	  SHRG B 4 A_WeaponReady
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
	  SHRG A 4 A_WeaponReady
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
	  SHRG A 4 A_WeaponReady
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
	  SHRG A 4 A_WeaponReady
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
	  SHRG A 4 A_WeaponReady
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
	  SHRG A 4 A_WeaponReady
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
      SHRG A 1 A_PlaySound("weapons/wiggl1")
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
      SHRG A 3 A_WeaponReady
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
      SHRG D 5 A_WeaponReady
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
      SHRG D 1 A_Playsound("weapons/wiggl2")
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
      SHRG E 4 A_WeaponReady
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
      SHRG A 1 A_PlaySound("weapons/wiggl1")
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
      SHRG A 3 A_WeaponReady
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
      SHRG D 5 A_WeaponReady
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
      SHRG D 1 A_Playsound("weapons/wiggl2")
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
      SHRG E 4 A_WeaponReady
	  TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
      goto ready
   Deselect:
      TNT1 A 0 A_TakeInventory("P_GreenFire", 1)
      TNT1 A 0 A_TakeInventory("TempWeaponReady", 1)
      TNT1 A 0 A_TakeInventory("H_WeaponSlot9", 1)
      SHRG A 1 A_Lower
	  TNT1 A 0 A_Lower
      Loop
   Select:
      TNT1 A 0 A_GiveInventory("P_GreenFire", 1)
      TNT1 A 0 A_TakeInventory("TempWeaponReady", 1)
	  TNT1 A 0 A_TakeInventory("ForceWeaponRemove", 1)
      TNT1 A 0 A_GiveInventory("H_WeaponSlot9", 1)
	  TNT1 A 0 A_TakeInventory("DnD_WeaponID", 0x7FFFFFFF)
	  TNT1 A 0 A_GiveInventory("DnD_WeaponID", DND_WEAPON_VENOM)
	  TNT1 A 0 ACS_NamedExecuteAlways("DND Weapon Damage Cache", 0, DND_DMGID_0, 1, 3 | (5 << 16))
	  TNT1 A 0 ACS_NamedExecuteAlways("DND Weapon Damage Cache", 0, DND_DMGID_1, 5, 1 | (3 << 16))
	  TNT1 A 0 ACS_NamedExecuteAlways("DND Weapon Damage Cache", 0, DND_DMGID_2, 6)
	SelectLoop:
      SHRG A 1 A_Raise
	  TNT1 A 0 A_Raise
      Loop
   Fire:
      TNT1 A 0 A_TakeInventory("TempWeaponReady", 1)
      TNT1 A 0 A_JumpIfInventory("VenomAmmo", 1, "Continue")
	  SHRG A 1
   Goto Ready
   Continue:
      SHRG C 2 Bright
      TNT1 A 0 A_GunFlash
      SHRG F 1 Bright A_PlayWeaponSound("weapons/crabfi")
      SHRG F 1 Bright
	  SHRX AB 2 Bright
	  TNT1 A 0 A_TakeInventory("VenomAmmo", 1)
      SHRG G 1 Bright A_GiveInventory("VenomShooter1", 1)
	  SHRX CD 1 Bright
	  SHRG H 1 Bright
	  SHRX EFGH 1 Bright
	  SHRG CBA 4 Bright
      SHRG A 1 A_PlaySound("weapons/wiggl1")
      SHRG AD 3
      SHRG D 1 A_Playsound("weapons/wiggl2")
      SHRG E 3
      SHRG A 2 A_ReFire
      Goto Ready
   AltFire:
      TNT1 A 0 A_TakeInventory("TempWeaponReady", 1)
      TNT1 A 0 A_JumpIfInventory("VenomAmmo", 3, "ContinueAlt")
	  SHRG A 1
   Goto Ready
   ContinueAlt:   
      SHRG C 2 Bright
      TNT1 A 0 A_GunFlash
      SHRG F 1 Bright A_PlayWeaponSound("weapons/crabf2")
      SHRG F 1 Bright
	  SHRX AB 2 Bright
	  TNT1 A 0 A_TakeInventory("VenomAmmo", 3)
	  TNT1 A 0 A_GiveInventory("VenomShooter2", 1)
      SHRG G 1 Bright A_SetPitch(pitch - 8.0)
	  SHRX CD 1 Bright A_SetPitch(pitch + 1.0)
	  SHRG H 1 Bright A_SetPitch(pitch + 1.0)
	  SHRX EFGH 1 Bright A_SetPitch(pitch + 1.0)
	  SHRG C 1 Bright A_SetPitch(pitch + 1.0)
	  SHRG C 3 Bright
	  SHRG BA 4 Bright
      SHRG A 1 A_PlaySound("weapons/wiggl1")
      SHRG AD 4
      SHRG D 1 A_Playsound("weapons/wiggl2")
      SHRG E 4
      SHRG A 7 A_ReFire   
      Goto Ready
   Flash:
      TNT1 A 5 bright A_Light1
      TNT1 A 5 bright A_Light2
      TNT1 A 5 bright A_Light1
      TNT1 A 1 bright A_Light0
      stop
   }
}

Actor VenomShooter1 : DnD_Activator {
	States {
		Pickup:
			TNT1 A 0 A_JumpIfInventory("DnD_QuestReward_DreamingGodBonus", 1, "Full")
			TNT1 A 0 A_JumpIfInventory("NetherCheck", 1, "Full")
			TNT1 A 0 A_FireCustomMissile("Barbshot",frandom(-8.2,8.2),1,0,random(-4,4))
			TNT1 AAAAAAAAAAAAAAA 0 A_FireCustomMissile("Barbshot",frandom(-8.2,8.2),0,0,random(-5,5))
		Stop
		Full:
			TNT1 A 0 A_FireCustomMissile("Barbshot_FullDMG",frandom(-8.2,8.2),1,0,random(-4,4))
			TNT1 AAAAAAAAAAAAAAA 0 A_FireCustomMissile("Barbshot_FullDMG",frandom(-8.2,8.2),0,0,random(-5,5))
		Stop
	}
}

Actor VenomShooter2 : DnD_Activator {
	States {
		Pickup:
			TNT1 A 0 A_JumpIfInventory("DnD_QuestReward_DreamingGodBonus", 1, "Full")
			TNT1 A 0 A_JumpIfInventory("NetherCheck", 1, "Full")
			TNT1 A 0 A_FireCustomMissile("Acidshot",frandom(-8.2,8.2),1,0,random(-4,4))
			TNT1 AAAAAAAAAAAAAAA 0 A_FireCustomMissile("Acidshot",frandom(-8.2,8.2),0,0,random(-5,5))
		Stop
		Full:
			TNT1 A 0 A_FireCustomMissile("Acidshot_FullDMG",frandom(-8.2,8.2),1,0,random(-4,4))
			TNT1 AAAAAAAAAAAAAAA 0 A_FireCustomMissile("Acidshot_FullDMG",frandom(-8.2,8.2),0,0,random(-5,5))
		Stop
	}
}

ACTOR Barbshot
{
   Radius 4
   Height 8
   Speed 60
   ReactionTime 10
   Damage (ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT, DND_USETARGET))
   DamageType "AcidRifle"
   PROJECTILE
   RENDERSTYLE Normal
   ALPHA 1.0
   +RIPPER
   +THRUGHOST
   +FORCEXYBILLBOARD
   +MTHRUSPECIES
   +DONTBLAST
   DeathSound "weapons/crabex"
   States
   {
   Spawn:
      SBRD A 1 Bright A_SpawnItemEx("Barbtrail",0,0,0,0,0,0,0,8)
      TNT1 A 0 A_SpawnItemEx("BarbFX",0,0,0,0,0,0,0,8)
      TNT1 A 0 A_CountDown
      loop
   Death:
      SSFX A 0 Bright A_SetTranslucent(0.75,1)
      SSFX ABCDEFGH 2 Bright
      stop
   }
}

Actor Barbshot_Damager : DnD_FakeDamager {
	Radius 4
	Height 8
	Damage (ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT, DND_USETARGET))
	DamageType "AcidRifleFull"
	Speed 52
}

Actor Barbshot_FullDMG : Barbshot {
	DamageType "AcidRifleFull"
	+THRUACTORS
	States {
		Spawn:
			SBRD A 1 Bright A_SpawnItemEx("Barbtrail",0,0,0,0,0,0,0,8)
			TNT1 A 0 A_CustomMissile("Barbshot_Damager", 0, 0, 0, CMF_TRACKOWNER)
			TNT1 A 0 A_SpawnItemEx("BarbFX",0,0,0,0,0,0,0,8)
			TNT1 A 0 A_CountDown
		Loop
	}
}

ACTOR Barbtrail
{   
   Radius 0
   Height 1
   PROJECTILE
   RENDERSTYLE ADD
   ALPHA 0.75
   +FORCEXYBILLBOARD
   +CLIENTSIDEONLY
   States
   {
   Spawn:
      TNT1 A 1 Bright
      SSFX ABCDEFG 2 Bright
      Stop 
   }
}

ACTOR BarbFX
{   
   Radius 0
   Height 1
   PROJECTILE
   RENDERSTYLE ADD
   ALPHA 0.75
   +FORCEXYBILLBOARD
   +CLIENTSIDEONLY
   States
   {
   Spawn:
      TNT1 A 1 Bright
      SDFX ABCD 2 Bright
      Stop 
   }
}

ACTOR Acidshot : Barbshot
{
   Damage (ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_1, TALENT_OCCULT, DND_USETARGET))
   Speed 35
   ALPHA 0.80
   Gravity 0.25
   ReactionTime 16
   BounceType "Doom"
   -RIPPER
   -NOGRAVITY
   DeathSound "weapons/crabx2"
   SeeSound "weapons/wiggl2"
   States
   {
   Spawn:
      BNAD ABCD 3 Bright A_SpawnItemEx("AcidFX",0,0,0,0,0,0,0,8)
      BNAD A 0 A_CountDown
      loop
   Death:
      BNAD E 3 A_SetTranslucent(0.75,1)
      BNAD F 3 Bright A_Explode(ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_2, TALENT_OCCULT, DND_USETARGET),32,0)
      BNAD GHIJ 3 Bright
      stop
   }
}

Actor Acidshot_FullDMG : AcidShot {
	+FORCERADIUSDMG
}

ACTOR AcidFX
{   
   Radius 0
   Height 1
   PROJECTILE
   RENDERSTYLE ADD
   Gravity 0.25
   ALPHA 0.75
   -NOGRAVITY
   +DONTSPLASH
   +FORCEXYBILLBOARD
   +CLIENTSIDEONLY
   States
   {
   Spawn:
      TNT1 A 2 Bright
      ACFX ABCDE 3 Bright
      Stop 
   }
}

Actor VenomPickup : CustomInventory
{
	Radius 16
	Height 24
    Inventory.PickupSound "weapons/pickup"
    Inventory.pickupmessage "\ccWeapon Pickup : \c[Y5]Venom - 9\c-"	
	Scale 0.67
	States
	{
		Spawn:
			WSHD A -1 Bright
		Stop
		Pickup:
			TNT1 A 0 A_JumpIf(1 == ACS_ExecuteWithResult(986, DND_WEAPON_VENOM), "Success")
		Fail
		Success:
			TNT1 A 0 A_GiveInventory("Venom", 1)
			TNT1 A 0 A_GiveInventory("VenomAmmo", random(15, 25) + ACS_ExecuteWithResult(918, 0, 1, random(15, 25)))
			TNT1 A 0 A_JumpIfInventory("Ability_Temporal", 1, "GiveMore")
		Stop
		GiveMore:
			TNT1 A 0 A_GiveInventory("VenomAmmo", random(7, 12))
		Stop
	}
}

Actor VenomMsg : CustomInventory {
	States {
		Pickup:
			TNT1 A 0 ACS_ExecuteAlways(985, 0, 0, DND_WEAPON_VENOM)
			TNT1 A 0 A_PlaySound("weapons/pickup", 6)
			TNT1 A 0 A_SetBlend("25 99 25", 0.6, 17)
		Stop
	}
}

Actor VenomPickup_D : DND_DroppedItem {
	Radius 16
	Height 24
	Scale 0.67
	States {
		Spawn:
			WSHD A 17 Bright
		SpawnLoop:
			WSHD A 1 Bright A_LookEx(LOF_NOSOUNDCHECK, 0, 28, 0, 0, "CheckPickup")
		Loop
		
		See:
		CheckPickup:
			WSHD A 1 Bright A_JumpIfCloser(32, "Pickup")
		goto SpawnLoop

		Pickup:
			WSHD A 1 Bright A_JumpIf(1 == ACS_ExecuteWithResult(986, DND_WEAPON_VENOM, 1), "PickupSuccess")
		goto PickupFail

		PickupFail:
			WSHD A 1 Bright
		goto SpawnLoop

		PickupSuccess:
			TNT1 A 0 A_GiveToTarget("Venom", 1)
			TNT1 A 0 A_GiveToTarget("VenomAmmo", mass)
			TNT1 A 0 A_GiveToTarget("VenomMsg", 1)
		stop
	}
}

ACTOR "Demon Heart" : Weapon {	
	Obituary "%o drained all of %k's blood."
	Weapon.AmmoType "HeartAmmo"
	Weapon.AmmoGive 0
	Weapon.SelectionOrder 6666
	Weapon.AmmoUse 1
	Weapon.SlotNumber 9
	Weapon.BobStyle InverseSmooth
	Weapon.BobSpeed 2.1
	Weapon.BobRangeY 0.4
	Weapon.BobRangeX 0.5
	+THRUGHOST
	States {
		Spawn:
			TNT1 A -1 Bright
		Loop
	    Remove:
			HRTG A 1 Offset(0, 40)
			HRTG A 1 Offset(0, 48)
			HRTG A 1 Offset(0, 56)
			HRTG A 1 Offset(0, 64)
			HRTG A 1 Offset(0, 72)
			HRTG A 1 Offset(0, 80)
			HRTG A 1 Offset(0, 88)
			TNT1 A 0 A_JumpIfInventory("HeartAmmo", 1, "RiseBack")
			HRTG A 1 Offset(0, 96)
			TNT1 A 0 A_TakeInventory("ForceWeaponRemove", 1)
			TNT1 A 0 A_TakeInventory("HeartAmmo", 0)
			TNT1 A 0 A_TakeInventory("H_WeaponSlot9", 1)
			TNT1 A 0 A_TakeInventory("Demon Heart", 1)
			TNT1 A 1
	    Stop
		RiseBack:
			HRTG A 1 Offset(0, 88)
			HRTG A 1 Offset(0, 80)
			HRTG A 1 Offset(0, 72)
			HRTG A 1 Offset(0, 64)
			HRTG A 1 Offset(0, 56)
			HRTG A 1 Offset(0, 48)
			HRTG A 1 Offset(0, 40)
		Goto Ready
		Ready:
			TNT1 A 0 A_JumpIfInventory("HeartAmmo", 1, "NoRemove")
		Goto Remove
		NoRemove:
			TNT1 A 0 A_GiveInventory("TempWeaponReady", 1)
			TNT1 A 0 A_PlayWeaponSound("Weapons/HeartBeat")
			HRTG A 1 A_WeaponReady
			TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
			HRTG A 1 A_WeaponReady
			TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
			HRTG A 1 A_WeaponReady
			TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
			HRTG A 1 A_WeaponReady
			TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
			HRTG A 1 A_WeaponReady
			TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
			HRTG A 1 A_WeaponReady
			TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
			HRTG A 1 A_WeaponReady
			TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
			HRTG A 1 A_WeaponReady
			TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
			HRTG A 1 A_WeaponReady
			TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
			HRTG A 1 A_WeaponReady
			TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
			HRTG A 1 A_WeaponReady
			TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
			HRTG A 1 A_WeaponReady
			TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
			HRTG A 1 A_WeaponReady
			TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
			HRTG A 1 A_WeaponReady
			TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
			HRTG A 1 A_WeaponReady
			TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
			HRTG A 1 A_WeaponReady
			TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
			HRTG A 1 A_WeaponReady
			TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
			HRTG A 1 A_WeaponReady
			TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
			HRTG B 1 A_WeaponReady
			TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
			HRTG B 1 A_WeaponReady
			TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
			HRTG B 1 A_WeaponReady
			TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
			HRTG B 1 A_WeaponReady
			TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
			HRTG B 1 A_WeaponReady
			TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
			HRTG B 1 A_WeaponReady
			TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
			HRTG B 1 A_WeaponReady
			TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
			HRTG B 1 A_WeaponReady
			TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
			HRTG B 1 A_WeaponReady
			TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
			HRTG B 1 A_WeaponReady
			TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
			HRTG B 1 A_WeaponReady
			TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
			HRTG B 1 A_WeaponReady
			TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
			HRTG B 1 A_WeaponReady
			TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
			HRTG B 1 A_WeaponReady
			TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
			HRTG B 1 A_WeaponReady
			TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
			HRTG B 1 A_WeaponReady
			TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
			HRTG B 1 A_WeaponReady
			TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
			HRTG B 1 A_WeaponReady
		Loop
		Deselect:
		    TNT1 A 0 A_TakeInventory("TempWeaponReady", 1)
		    TNT1 A 0 A_TakeInventory("H_WeaponSlot9", 1)
			HRTG A 1 A_Lower
			TNT1 A 0 A_Lower
		Loop
		Select:
			TNT1 A 0 A_TakeInventory("TempWeaponReady", 1)
			TNT1 A 0 A_TakeInventory("ForceWeaponRemove", 1)
		    TNT1 A 0 A_GiveInventory("H_WeaponSlot9", 1)
			TNT1 A 0 A_TakeInventory("DnD_WeaponID", 0x7FFFFFFF)
			TNT1 A 0 A_GiveInventory("DnD_WeaponID", DND_WEAPON_DEMONHEART)
			TNT1 A 0 ACS_NamedExecuteAlways("DND Weapon Damage Cache", 0, DND_DMGID_0, 8, 1 | (8 << 16))
			TNT1 A 0 ACS_NamedExecuteAlways("DND Weapon Damage Cache", 0, DND_DMGID_1, 8)
	    SelectLoop:
			HRTG A 1 A_Raise
			TNT1 A 0 A_Raise
		Loop
		Fire:
			TNT1 A 0 A_TakeInventory("TempWeaponReady", 1)
			HRTG C 1 Offset(0, 33)
			HRTG C 1 Offset(0, 34)
			HRTG C 1 Offset(1, 35)
			HRTG C 1 Offset(2, 36)
			HRTG C 1 Offset(3, 37)
			HRTG C 1 Offset(4, 38)
			HRTG C 1 Offset(5, 39)
			HRTG C 1 Offset(6, 40)
			HRTG C 1 Offset(7, 41)
			HRTG C 1 Offset(8, 42)
			HRTG C 1 Offset(9, 43)
			HRTG C 1 Offset(10, 44)
			HRTG C 1 Offset(11, 45)
			HRTG C 1 Offset(12, 46)
			TNT1 A 0 A_PlayWeaponSound("Weapons/HeartSqueeze")
			TNT1 A 0 Radius_Quake(4,2,0,1,0)
			TNT1 A 0 A_GiveInventory("HeartAttack", 1)
			TNT1 AAAA 0 A_SpawnItemEx("NashGore_FlyingBlood", 0, 32, 16, random(-8, 8), random(0, 8), random(4, 8), random(0, 180), SXF_CLIENTSIDE)
			HRTG D 1 A_SpawnItemEx("NashGore_FlyingBlood", 0, 32, 16, random(-8, 8), random(0, 8), random(4, 8), random(0, 180), SXF_CLIENTSIDE)
			HRTG D 2 Offset(13, 47)
			HRTG D 1 Offset(14, 48)
			HRTG D 1 Offset(13, 47)
			HRTG D 1 Offset(12, 46)
			HRTG D 1 Offset(11, 45)
			HRTG D 1 Offset(10, 44)
			HRTG D 1 Offset(8, 42)
			HRTG D 1 Offset(6, 40)
			HRTG D 1 Offset(4, 38)
			HRTG D 1 Offset(2, 36)
			HRTG D 1 Offset(0, 34)
			HRTG D 1 Offset(0, 32)
			HRTG C 6
		Goto Ready
	}
}

Actor HeartAttackPuff : BulletPuff {
	Radius 2
	Height 2
	RenderStyle Add
	Vspeed 0
	DamageType "MagicFull"
	var int user_dmg;
	+FOILINVUL
	+DONTSPLASH
	+PUFFONACTORS
	+ALWAYSPUFF
	+PUFFGETSOWNER
    +MTHRUSPECIES
	States {
		Crash:
			TNT1 A 1
		Stop
		Spawn:
		Melee:
			TNT1 A 0
			TNT1 AAAAA 0 A_SpawnDebris("ExplosiveSpark")
			TNT1 A 0 A_PlaySound("Weapons/HeartBurn")
			TNT1 A 0 A_SetUserVar("user_dmg", ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_1, TALENT_OCCULT, DND_USETARGET))
			HRFX A 3 Bright A_Explode(8 * user_dmg, 40, 0)
			HRFX B 3 Bright A_Explode(7 * user_dmg, 48, 0)
			HRFX C 3 Bright A_Explode(6 * user_dmg, 56, 0)
			HRFX D 3 Bright A_Explode(4 * user_dmg, 64, 0)
			HRFX E 3 Bright A_Explode(user_dmg, 64, 0)
		Stop
    }
}

Actor HeartAttack : AkimboShooter_L {
	+INVENTORY.ALWAYSPICKUP
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.IGNORESKILL
	+INVENTORY.UNDROPPABLE
	-INVENTORY.INVBAR
	states {
	Use:
		TNT1 A 0 A_FireBullets(0.0, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_USEAMMO | FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(1.125, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(2.25, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(3.375, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(4.5, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(5.625, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(6.75, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(7.875, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(9.0, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(10.125, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(11.25, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(12.375, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(13.5, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(14.625, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(15.75, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(16.875, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(18.0, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(19.125, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(20.25, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(21.375, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(22.5, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(23.625, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(24.75, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(25.875, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(27.0, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(28.125, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(29.25, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(30.375, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(31.5, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(32.625, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(33.75, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(34.875, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(36.0, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(37.125, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(38.25, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(39.375, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(40.5, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(41.625, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(42.75, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(43.875, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(45.0, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(-1.125, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(-2.25, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(-3.375, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(-4.5, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(-5.625, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(-6.75, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(-7.875, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(-9.0, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(-10.125, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(-11.25, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(-12.375, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(-13.5, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(-14.625, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(-15.75, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(-16.875, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(-18.0, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(-19.125, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(-20.25, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(-21.375, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(-22.5, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(-23.625, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(-24.75, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(-25.875, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(-27.0, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(-28.125, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(-29.25, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(-30.375, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(-31.5, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(-32.625, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(-33.75, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(-34.875, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(-36.0, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(-37.125, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(-38.25, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(-39.375, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(-40.5, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(-41.625, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(-42.75, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(-43.875, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		TNT1 A 0 A_FireBullets(-45.0, 0.0, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT), "HeartAttackPuff", FBF_NORANDOM | FBF_EXPLICITANGLE, 4096)
		Stop
	}
}

Actor DemonHeartPickup : CustomInventory
{
	Radius 16
	Height 24
    Inventory.PickupSound "weapons/pickup"
    Inventory.pickupmessage "\ccWeapon Pickup : \c[Y5]Demon Heart - 9\c-"	
	Scale 0.67
	States
	{
		Spawn:
			HRTW AB 10
		Loop
		Pickup:
			TNT1 A 0 A_JumpIfInventory("Ability_HeartSeeker", 1, "Check2")
		Fail
		Check2:
			TNT1 A 0 A_JumpIf(1 == ACS_ExecuteWithResult(986, DND_WEAPON_DEMONHEART), "Success")
		Fail
		Success:
			TNT1 A 0 A_GiveInventory("Demon Heart", 1)
			TNT1 A 0 A_GiveInventory("HeartAmmo", 1)
			TNT1 A 0 A_JumpIfInventory("Ability_Temporal", 1, "GiveMore")
		Stop
		GiveMore:
			TNT1 A 0 A_GiveInventory("HeartAmmo", 1)
		Stop
	}
}

Actor HeartMsg : CustomInventory {
	States {
		Pickup:
			TNT1 A 0 ACS_ExecuteAlways(985, 0, 0, DND_WEAPON_DEMONHEART)
			TNT1 A 0 A_PlaySound("weapons/pickup", 6)
			TNT1 A 0 A_SetBlend("25 99 25", 0.6, 17)
		Stop
	}
}

Actor DemonHeartPickup_D : DND_DroppedItem {
	Scale 1.0
	States {
		Spawn:
			HRTW A 17
		SpawnLoop:
			HRTW AAAAAAAAAABBBBBBBBBB 1 A_LookEx(LOF_NOSOUNDCHECK, 0, 28, 0, 0, "CheckPickup")
		Loop
		
		See:
		CheckPickup:
			HRTW A 1 A_JumpIfCloser(32, "Pickup")
		goto SpawnLoop

		Pickup:
			HRTW A 1 A_JumpIf(1 == ACS_ExecuteWithResult(986, DND_WEAPON_DEMONHEART, 1), "PickupSuccess")
		goto PickupFail

		PickupFail:
			HRTW A 1
		goto SpawnLoop

		PickupSuccess:
			TNT1 A 0 A_GiveToTarget("Demon Heart", 1)
			TNT1 A 0 A_GiveToTarget("HeartAmmo", mass)
			TNT1 A 0 A_GiveToTarget("HeartMsg", 1)
		stop
	}
}

Actor DarkServantGloves : Weapon {
	radius 20
	height 16
	Weapon.SlotNumber 9
	weapon.selectionorder 6666
	weapon.kickback 100
	obituary "%o was electrocuted by %k's shiny new gloves."
	Inventory.PickupSound "weapons/pickup"
	inventory.pickupmessage "\ccWeapon Pickup : \c[Y5]Dark Servant Gloves - 9"
	weapon.ammotype "DarkServantEnergy"
	weapon.ammouse 0
	weapon.ammouse2 0
	weapon.ammogive 0
	weapon.ammogive2 0
	Tag "Dark Servant Gloves"
	YScale 0.59
	XScale 0.4
	+INVENTORY.UNDROPPABLE
	Weapon.BobStyle InverseSmooth
	Weapon.BobSpeed 2.1
	Weapon.BobRangeY 0.4
	Weapon.BobRangeX 0.7
	states {
		Remove:
			GAU3 A 1 Offset(0, 40)
			GAU3 A 1 Offset(0, 48)
			GAU3 A 1 Offset(0, 56)
			GAU3 A 1 Offset(0, 64)
			GAU3 A 1 Offset(0, 72)
			GAU3 A 1 Offset(0, 80)
			GAU3 A 1 Offset(0, 88)
			TNT1 A 0 A_JumpIfInventory("DarkServantEnergy", 1, "RiseBack")
			GAU3 A 1 Offset(0, 96)
			TNT1 A 0 A_TakeInventory("ForceWeaponRemove", 1)
			TNT1 A 0 A_TakeInventory("DarkServantEnergy", 0)
			TNT1 A 0 A_TakeInventory("H_WeaponSlot9", 1)
			TNT1 A 0 A_TakeInventory("DarkServantGloves", 1)
			TNT1 A 1
		Stop
		RiseBack:
			GAU3 A 1 Offset(0, 88)
			GAU3 A 1 Offset(0, 80)
			GAU3 A 1 Offset(0, 72)
			GAU3 A 1 Offset(0, 64)
			GAU3 A 1 Offset(0, 56)
			GAU3 A 1 Offset(0, 48)
			GAU3 A 1 Offset(0, 40)
		Goto Ready
		Spawn:
			WGT3 A -1
		stop
		Ready:
			TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
			TNT1 A 0 A_JumpIfInventory("DarkServantEnergy", 1, "NoRemove")
		Goto Remove
		NoRemove:
			TNT1 A 0 A_GiveInventory("TempWeaponReady", 1)
			GAU3 A 1 A_WeaponReady
		Goto Ready
		Deselect: 
			TNT1 A 0 A_TakeInventory("TempWeaponReady", 1)
			TNT1 A 0 A_TakeInventory("H_WeaponSlot9", 1)
			GAU3 A 1 A_Lower
			TNT1 A 0 A_Lower
		loop
		Select:
			TNT1 A 0 A_TakeInventory("TempWeaponReady", 1)
			TNT1 A 0 A_TakeInventory("ForceWeaponRemove", 1)
			TNT1 A 0 A_GiveInventory("H_WeaponSlot9", 1)
			TNT1 A 0 A_TakeInventory("DnD_WeaponID", 0x7FFFFFFF)
			TNT1 A 0 A_GiveInventory("DnD_WeaponID", DND_WEAPON_DARKGLOVES)
			TNT1 A 0 ACS_NamedExecuteAlways("DND Weapon Damage Cache", 0, DND_DMGID_0, 10, 6 | (9 << 16))
			TNT1 A 0 ACS_NamedExecuteAlways("DND Weapon Damage Cache", 0, DND_DMGID_1, 32)
	    SelectLoop:
			GAU3 A 1 A_Raise
			TNT1 A 0 A_Raise
		Loop
		Fire:
			TNT1 A 0 A_TakeInventory("TempWeaponReady", 1)
			TNT1 A 0 A_JumpIfInventory("DarkServantEnergy", 1, "ContinueNorm")
		Goto Remove
		ContinueNorm:
			GAU3 A 3 A_PlaySound("weapons/gauntletsactivate")
			GAU3 B 3 
		FireFast:
			GAU3 C 2
			GAU3 D 1 BRIGHT
			GAU3 E 1 BRIGHT A_GiveInventory("DSGloveShooterLeft", 1)
			GAU3 FGH 2
			TNT1 A 0 A_JumpIfInventory("DarkServantEnergy", 1, "ContinueRight")
			TNT1 A 0 A_PlayWeaponSound("weapons/gauntletsrip")
			Goto Ready
		ContinueRight:
			GAU3 I 2
			GAU3 J 1 BRIGHT
			GAU3 K 1 BRIGHT A_GiveInventory("DSGloveShooterRight", 1)
			GAU3 LMN 2
			TNT1 A 0 A_JumpIfInventory("DarkServantEnergy", 1, "CheckFastFire")
		Goto Ready
		CheckFastFire:
			TNT1 A 0 A_Refire("FireFast")
			Goto Ready
		AltFire:
			GAU4 A 3 Bright A_PlayWeaponSound("weapons/gauntletscharge")
			GAU4 BCAB 3 BRIGHT
			GAU4 D 3 
			GAU4 EFGHI 3 BRIGHT
			GAU4 J 3 BRIGHT A_GiveInventory("DSGloveShooterBig", 1)
			GAU4 KLM 3
		Goto Ready
		
		Flash:
			TNT1 A 4 bright A_Light1
			TNT1 A 3 bright A_Light2
			TNT1 A 0 bright A_Light0
		stop
    }
}

Actor DarkServantMissile1Trail {
	+CLIENTSIDEONLY
	+NOINTERACTION
	States {
		Spawn:
			FX16 DEF 2 Bright
		Stop
	}
}

Actor DarkServantMissileSmall {
	PROJECTILE
	Speed 32
	Height 8
	Radius 4
	Damage (ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_OCCULT, DND_USETARGET))
	DamageType "Lightning"
	SeeSound "Weapons/SmallLightning"
	DeathSound "Weapons/SmallLightningH"
	Renderstyle Translucent
	+DONTBLAST
	+PIERCEARMOR
	+FORCEPAIN
	+MTHRUSPECIES
	States {
		Spawn:
			FX16 AABBCC 2 Bright A_SpawnItemEx("DarkServantMissile1Trail", 0, 0, 0, -4, random(-3, 3))
		Loop
		Death:
			FX16 GHIJKL 2 Bright
		Stop
	}
}

Actor DarkServantMissileSmall_Full : DarkServantMissileSmall {
	DamageType "LightningFull"
}

Actor DarkServantMissile2Trail {
	+CLIENTSIDEONLY
	+NOINTERACTION
	Renderstyle Add
	States {
		Spawn:
			FX18 AABB 1 Bright A_FadeOut(0.1)
		Loop
	}
}

Actor DarkServantMissileBig {
	PROJECTILE
	Speed 28
	Height 10
	Radius 6
	Damage (4 * ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_1, TALENT_OCCULT, DND_USETARGET))
	DamageType "Lightning"
	SeeSound "Weapons/BigLightning"
	DeathSound "Weapons/BigLightningH"
	+SEEKERMISSILE
	+PIERCEARMOR
	+FORCEPAIN
	+MTHRUSPECIES
	States {
		Spawn:
			TNT1 A 0 A_SeekerMissile(16, 16, SMF_LOOK)
			FX18 AA 2 Bright A_SpawnItem("DarkServantMissile2Trail")
			TNT1 A 0 A_SeekerMissile(16, 16, SMF_LOOK)
			FX18 BB 2 Bright A_SpawnItem("DarkServantMissile2Trail")
		Loop
		Death:
			TNT1 A 0 A_SpawnItemEx ("PlasmaFlare", 0, 0, 0, 0, 0, 0, 0, SXF_CLIENTSIDE | SXF_NOCHECKPOSITION, 0)
			TNT1 A 0 A_SpawnItemEx("BlueParticleSpawner")
			FX18 CDE 3 Bright A_Explode(ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_1, TALENT_OCCULT, DND_USETARGET), 128, 0)
			FX18 FG 3 Bright 
		Stop
	}
}

Actor DarkServantMissileBig_Full : DarkServantMissileBig {
	DamageType "LightningFull"
	+FORCERADIUSDMG
}

Actor DSGloveShooterLeft : DnD_Activator {
	states {
		Use:
			TNT1 A 0 A_TakeInventory("DarkServantEnergy", 1)
			TNT1 A 0 A_JumpIfInventory("DnD_QuestReward_DreamingGodBonus", 1, "Full")
			TNT1 A 0 A_JumpIfInventory("NetherCheck", 1, "Full")
			TNT1 A 0 A_FireCustomMissile("DarkServantMissileSmall", -2, 0, -12)
		Stop
		Full:
			TNT1 A 0 A_FireCustomMissile("DarkServantMissileSmall_Full", -2, 0, -12)
		Stop
	}
}

Actor DSGloveShooterRight : DnD_Activator {
	states {
		Use:
			TNT1 A 0 A_TakeInventory("DarkServantEnergy", 1)
			TNT1 A 0 A_JumpIfInventory("DnD_QuestReward_DreamingGodBonus", 1, "Full")
			TNT1 A 0 A_JumpIfInventory("NetherCheck", 1, "Full")
			TNT1 A 0 A_FireCustomMissile("DarkServantMissileSmall", 2, 0, 12)
		Stop
		Full:
			TNT1 A 0 A_FireCustomMissile("DarkServantMissileSmall_Full", 2, 0, 12)
		Stop
	}
}

Actor DSGloveShooterBig : DnD_Activator {
	states {
		Use:
			TNT1 A 0 A_TakeInventory("DarkServantEnergy", 3)
			TNT1 A 0 A_JumpIfInventory("DnD_QuestReward_DreamingGodBonus", 1, "Full")
			TNT1 A 0 A_JumpIfInventory("NetherCheck", 1, "Full")
			TNT1 A 0 A_FireCustomMissile("DarkServantMissileBig")
		Stop
		Full:
			TNT1 A 0 A_FireCustomMissile("DarkServantMissileBig_Full")
		Stop
	}
}

Actor DarkServantGlovesPickup : CustomInventory
{
	Radius 16
	Height 24
	Inventory.PickupSound "weapons/pickup"
    Inventory.pickupmessage "\ccWeapon Pickup : \c[Y5]Dark Servant Gloves - 9\c-"
	States
	{
		Spawn:
			WGT3 A -1
		Stop
		Pickup:
			TNT1 A 0 A_JumpIf(1 == ACS_ExecuteWithResult(986, DND_WEAPON_DARKGLOVES), "Success")
		Fail
		Success:
			TNT1 A 0 A_GiveInventory("DarkServantGloves", 1)
			TNT1 A 0 A_GiveInventory("DarkServantEnergy", random(30, 45) + ACS_ExecuteWithResult(918, 0, 1, random(30, 45)))
			TNT1 A 0 A_JumpIfInventory("Ability_Temporal", 1, "GiveMore")
		Stop
		GiveMore:
			TNT1 A 0 A_GiveInventory("DarkServantEnergy", random(15, 25))
		Stop
	}
}

Actor DarkServantGlovesMsg : CustomInventory {
	States {
		Pickup:
			TNT1 A 0 ACS_ExecuteAlways(985, 0, 0, DND_WEAPON_DARKGLOVES)
			TNT1 A 0 A_PlaySound("weapons/pickup", 6)
			TNT1 A 0 A_SetBlend("25 99 25", 0.6, 17)
		Stop
	}
}

Actor DarkServantGlovesPickup_D : DND_DroppedItem {
	Radius 16
	Height 24
	States {
		Spawn:
			WGT3 A 17
		SpawnLoop:
			WGT3 A 1 A_LookEx(LOF_NOSOUNDCHECK, 0, 28, 0, 360, "CheckPickup")
		Loop
		
		See:
		CheckPickup:
			WGT3 A 1 A_JumpIfCloser(32, "Pickup")
		goto SpawnLoop

		Pickup:
			WGT3 A 1 A_JumpIf(1 == ACS_ExecuteWithResult(986, DND_WEAPON_DARKGLOVES, 1), "PickupSuccess")
		goto PickupFail

		PickupFail:
			WGT3 A 1
		goto SpawnLoop

		PickupSuccess:
			TNT1 A 0 A_GiveToTarget("DarkServantGloves", 1)
			TNT1 A 0 A_GiveToTarget("DarkServantEnergy", mass)
			TNT1 A 0 A_GiveToTarget("DarkServantGlovesMsg", 1)
		stop
	}
}

Actor Nailgun2 : Weapon {
	radius 20
	height 16
	Weapon.SlotNumber 9
	weapon.selectionorder 6666
	weapon.kickback 100
	obituary "%o was ripped by %k's nailgun."
	Inventory.PickupSound "weapons/pickup"
	inventory.pickupmessage "\ccWeapon Pickup : \c[Y5]Nailgun - 9"
	weapon.ammotype "BigNail"
	weapon.ammouse 0
	Decal "BulletChip"
	YScale 0.59
	XScale 0.4
	+INVENTORY.UNDROPPABLE
	Weapon.BobStyle InverseSmooth
	Weapon.BobSpeed 2.3
	Weapon.BobRangeY 0.45
	Weapon.BobRangeX 0.75
	Tag "Heavy Nailgun"
	States {
		Spawn:
			NLCG F -1
		Loop
		Remove:
			NLCG A 1 Offset(0, 40)
			NLCG A 1 Offset(0, 48)
			NLCG A 1 Offset(0, 56)
			NLCG A 1 Offset(0, 64)
			NLCG A 1 Offset(0, 72)
			NLCG A 1 Offset(0, 80)
			NLCG A 1 Offset(0, 88)
			TNT1 A 0 A_JumpIfInventory("BigNail", 1, "RiseBack")
			NLCG A 1 Offset(0, 96)
			TNT1 A 0 A_TakeInventory("ForceWeaponRemove", 1)
			TNT1 A 0 A_TakeInventory("BigNail", 0)
			TNT1 A 0 A_TakeInventory("H_WeaponSlot9", 1)
			TNT1 A 0 A_TakeInventory("Nailgun2", 1)
			TNT1 A 1
		Stop
		RiseBack:
			NLCG A 1 Offset(0, 88)
			NLCG A 1 Offset(0, 80)
			NLCG A 1 Offset(0, 72)
			NLCG A 1 Offset(0, 64)
			NLCG A 1 Offset(0, 56)
			NLCG A 1 Offset(0, 48)
			NLCG A 1 Offset(0, 40)
		Goto Ready
		Select:
			TNT1 A 0 A_TakeInventory("TempWeaponReady", 1)
			TNT1 A 0 A_TakeInventory("ForceWeaponRemove", 1)
			TNT1 A 0 A_GiveInventory("H_WeaponSlot9", 1)
			TNT1 A 0 A_TakeInventory("DnD_WeaponID", 0x7FFFFFFF)
			TNT1 A 0 A_GiveInventory("DnD_WeaponID", DND_WEAPON_HEAVYNAILGUN)
			TNT1 A 0 ACS_NamedExecuteAlways("DND Weapon Damage Cache", 0, DND_DMGID_0, 4, 4 | (8 << 16))
	    SelectLoop:
			TNT1 A 0 A_raise
			NLCG A 1 A_Raise
		Loop
		Deselect:
			TNT1 A 0 A_TakeInventory("TempWeaponReady", 1)
			TNT1 A 0 A_TakeInventory("H_WeaponSlot9", 1)
			TNT1 A 0 A_lower
			NLCG A 1 A_Lower
		Loop
		Ready:
			TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
			TNT1 A 0 A_JumpIfInventory("BigNail", 1, "NoRemove")
			NLCG A 1 A_WeaponReady
		Goto Remove
		NoRemove:
			TNT1 A 0 A_GiveInventory("TempWeaponReady", 1)
			NLCG A 1 A_WeaponReady
		Goto Ready
		Fire:
			TNT1 A 0 A_TakeInventory("TempWeaponReady", 1)
			TNT1 A 0 A_JumpIfInventory("BigNail", 1, "ContinueNorm")
		Goto Remove
		ContinueNorm:
			NLCG A 0 A_PlayWeaponSound("Weapons/NG2Fire")
			NLCF A 1 bright Offset(0, 32) A_GiveInventory("Nailgun2Shooter", 1)
			NLCG A 0 A_Recoil(0.4)
			NLCG A 0 Radius_Quake(2,6,0,1,0)
			NLCG B 1 Offset(0, 35)
			NLCG C 1 Offset(0, 34)
			NLCG D 1 Offset(0, 33)
			NLCG A 2 Offset(0, 32) A_Refire
			NLCG B 2 A_Refire
			NLCG C 2 A_Refire
			NLCG D 2 A_Refire
			NLCG A 2 A_Refire
			NLCG B 3 A_Refire
			NLCG C 3 A_Refire
			NLCG D 3 A_Refire
		Goto Ready
	}
}

Actor Nailgun2Shooter : DnD_Activator {
	states {
		Use:
			TNT1 A 0 A_TakeInventory("BigNail", 1)
			TNT1 A 0 A_JumpIfInventory("NetherCheck", 1, "Full")
			TNT1 A 0 A_FireCustomMissile("BigNailProj")
		Stop
		Full:
			TNT1 A 0 A_FireCustomMissile("BigNailProj_Full")
		Stop
	}
}

Actor NailBigBlur       
{
  Height 8
  Radius 1
  Damage 0
  Scale 0.6
  Speed 0.2
  RenderStyle Translucent
  Alpha 0.75
  +NoGravity
  +DropOff
  +NoTeleport
  +CLIENTSIDEONLY
  States
  {
  Spawn:
    NLPJ A 1 A_FadeOut(0.35)
    Loop
  }
}

actor nailGib {
	health 1
	radius 8
	height 8
	mass 1
	+CORPSE
	+NOTELEPORT
	+CLIENTSIDEONLY
	Scale 0.4
	GRAVITY 0.8
	Renderstyle Translucent
	states {
		Spawn:
			NLPJ JKLM 3
		loop
		Crash:
			TNT1 A 0 A_Jump(128, "Flip")
		CrashLoop:
			NLPJ K 2 A_FadeOut(0.025) 
		Loop
		Flip:
			NLPJ M 2 A_FadeOut(0.025)
		Loop
	}
}


Actor BigNailProj {
	Projectile
	Radius 3
	Height 3
	Speed 44
	Damage (ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_BALLISTIC, DND_USETARGET))
	+noextremedeath
	Scale 0.5
	+BloodSplatter
	+RIPPER
	SeeSound ""
	DeathSound ""
	DamageType "Bullet"
	Decal BulletChip
	States {
		Spawn:
			NLPJ A 1 A_SpawnItemEx("NailBigBlur", 0, 0, 0, 1, 0, 0, 180, 128)
			TNT1 A 0 A_PlaySound("Weapons/NailFlight")
		Loop
		Crash:
		Death:
			TNT1 A 0 A_PlaySound("Weapons/NG2HitWall")
			TNT1 A 0 A_SpawnItemEx("WallHitSpark", 0, 0, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION | SXF_CLIENTSIDE)
			TNT1 A 0 A_SpawnDebris("nailgib")
			TNT1 AAAAAA 0 A_CustomMissile ("MeleeSmoke", 0, 0, random (0, 360), 2, random (0, 360))
			TNT1 A 1
		Stop
		XDeath:
			TNT1 A 0 A_PlaySound("Weapons/NG2HitTarget")
			TNT1 AAAAAA 0 A_CustomMissile ("MeleeSmoke", 0, 0, random (0, 360), 2, random (0, 360))
			TNT1 A 1
		Stop
	}
}

Actor BigNailProj_Damager : DnD_FakeDamager {
	Radius 3
	Height 4
	Damage (ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_BALLISTIC, DND_USETARGET))
	DamageType "BulletFull"
	Speed 32
}

Actor BigNailProj_Full : BigNailProj {
	DamageType "BulletFull"
	+THRUACTORS
	States {
		Spawn:
			NLPJ A 1 A_SpawnItemEx("NailBigBlur", 0, 0, 0, 1, 0, 0, 180, 128)
			TNT1 A 0 A_CustomMissile("BigNailProj_Damager", 0, 0, 0, CMF_TRACKOWNER)
			TNT1 A 0 A_PlaySound("Weapons/NailFlight")
		Loop
	}
}

Actor Nailgun2Pickup : CustomInventory
{
	Radius 16
	Height 24
	Inventory.PickupSound "weapons/pickup"
    Inventory.pickupmessage "\ccWeapon Pickup : \c[Y5]Heavy Nailgun - 9\c-"
	States
	{
		Spawn:
			NLCG F -1
		Stop
		Pickup:
			TNT1 A 0 A_JumpIf(1 == ACS_ExecuteWithResult(986, DND_WEAPON_HEAVYNAILGUN), "Success")
		Fail
		Success:
			TNT1 A 0 A_GiveInventory("Nailgun2", 1)
			TNT1 A 0 A_GiveInventory("BigNail", random(40, 56) + ACS_ExecuteWithResult(918, 0, 1, random(40, 56)))
			TNT1 A 0 A_JumpIfInventory("Ability_Temporal", 1, "GiveMore")
		Stop
		GiveMore:
			TNT1 A 0 A_GiveInventory("BigNail", random(20, 28))
		Stop
	}
}

Actor Nailgun2Msg : CustomInventory {
	States {
		Pickup:
			TNT1 A 0 ACS_ExecuteAlways(985, 0, 0, DND_WEAPON_HEAVYNAILGUN)
			TNT1 A 0 A_PlaySound("weapons/pickup", 6)
			TNT1 A 0 A_SetBlend("25 99 25", 0.6, 17)
		Stop
	}
}

Actor Nailgun2Pickup_D : DND_DroppedItem {
	Radius 16
	Height 24
	States {
		Spawn:
			NLCG F 17
		SpawnLoop:
			NLCG F 1 A_LookEx(LOF_NOSOUNDCHECK, 0, 28, 0, 360, "CheckPickup")
		Loop
		
		See:
		CheckPickup:
			NLCG F 1 A_JumpIfCloser(32, "Pickup")
		goto SpawnLoop

		Pickup:
			NLCG F 1 A_JumpIf(1 == ACS_ExecuteWithResult(986, DND_WEAPON_HEAVYNAILGUN, 1), "PickupSuccess")
		goto PickupFail

		PickupFail:
			NLCG F 1
		goto SpawnLoop

		PickupSuccess:
			TNT1 A 0 A_GiveToTarget("Nailgun2", 1)
			TNT1 A 0 A_GiveToTarget("BigNail", mass)
			TNT1 A 0 A_GiveToTarget("Nailgun2Msg", 1)
		stop
	}
}


Actor Berettas : Weapon {
	radius 20
	height 16
	Weapon.SlotNumber 9
	weapon.selectionorder 6666
	weapon.kickback 100
	Inventory.PickupSound "weapons/pickup"
	inventory.pickupmessage "\ccWeapon Pickup : \c[Y5]Akimbo Berettas - 9"
	weapon.ammotype "BerettaAmmo"
	weapon.ammouse 1
	weapon.ammogive 0
	Decal "BulletChip"
	YScale 0.59
	XScale 0.4
	+INVENTORY.UNDROPPABLE
	Weapon.BobStyle InverseSmooth
	Weapon.BobSpeed 2.1
	Weapon.BobRangeY 0.4
	Weapon.BobRangeX 0.7
	Tag "Akimbo Berettas"
	States {
		Spawn:
			PAKM X -1
		Stop
		Remove:
			PAKM A 1 Offset(0, 40)
			PAKM A 1 Offset(0, 48)
			PAKM A 1 Offset(0, 56)
			PAKM A 1 Offset(0, 64)
			PAKM A 1 Offset(0, 72)
			PAKM A 1 Offset(0, 80)
			PAKM A 1 Offset(0, 88)
			TNT1 A 0 A_JumpIfInventory("BerettaAmmo", 1, "RiseBack")
			PAKM A 1 Offset(0, 96)
			TNT1 A 0 A_TakeInventory("ForceWeaponRemove", 1)
			TNT1 A 0 A_TakeInventory("BerettaAmmo", 0)
			TNT1 A 0 A_TakeInventory("H_WeaponSlot9", 1)
			TNT1 A 0 A_TakeInventory("Berettas", 1)
			TNT1 A 1
		Stop
		RiseBack:
			PAKM A 1 Offset(0, 88)
			PAKM A 1 Offset(0, 80)
			PAKM A 1 Offset(0, 72)
			PAKM A 1 Offset(0, 64)
			PAKM A 1 Offset(0, 56)
			PAKM A 1 Offset(0, 48)
			PAKM A 1 Offset(0, 40)
		Goto Ready
		Ready:
			TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
			TNT1 A 0 A_JumpIfInventory("BerettaAmmo", 1, "NoRemove")
		Goto Remove
		NoRemove:
			TNT1 A 0 A_GiveInventory("TempWeaponReady", 1)
			PAKM A 1 A_WeaponReady
		Goto Ready
		Deselect:
			TNT1 A 0 A_TakeInventory("TempWeaponReady", 1)
			TNT1 A 0 A_TakeInventory("H_WeaponSlot9", 1)
		DeselectLoop:
			PAKM A 1 A_Lower
			TNT1 A 0 A_Lower
		Loop
		Select:
			TNT1 A 0 A_TakeInventory("TempWeaponReady", 1)
			TNT1 A 0 A_TakeInventory("ForceWeaponRemove", 1)
			TNT1 A 0 A_GiveInventory("H_WeaponSlot9", 1)
			TNT1 A 0 A_TakeInventory("DnD_WeaponID", 0x7FFFFFFF)
			TNT1 A 0 A_GiveInventory("DnD_WeaponID", DND_WEAPON_BERETTAS)
			TNT1 A 0 ACS_NamedExecuteAlways("DND Weapon Damage Cache", 0, DND_DMGID_0, 10)
		SelectLoop:
			PAKM A 1 A_Raise
			TNT1 A 0 A_Raise
		Loop
		Fire:
			PAKM A 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
		Hold:
			TNT1 A 0 A_GiveInventory("BerettaShooter_R", 1)
			PAKM B 3 Bright A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
			PAKM C 2 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
			PAKM DE 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
			TNT1 A 0 A_GiveInventory("BerettaShooter_L", 1)
			PAKM G 3 Bright A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
			PAKM H 2 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
			PAKM IJ 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
			TNT1 A 0 A_JumpIfInventory("BerettaAmmo", 1, "Keep")
		Goto Remove
		Keep:
			PAKM A 2 A_Refire
		Goto Ready
	}
}

Actor BerettaShooter_R : DnD_Activator {
	States {
		Pickup:
			TNT1 A 0 A_PlaySound("Weapons/BerettaFire", 6)
			TNT1 A 0 A_FireCustomMissile("Tracer", frandom(-2.75, 2.75), 0, 0, frandom(-2.5, 2.5))
			TNT1 A 0 A_SpawnItemEx("GunSmokeSmaller", 20 * cos(-pitch), 9, 35 * (1 + sin(-pitch)), 2, 0, 1)
			TNT1 A 0 A_SpawnItemEx ("pistolcasing",cos(pitch)*22,10,31+(sin(-pitch)*20),0,8,random(4,8),0,0,0)
			TNT1 A 0 A_JumpIfInventory("NetherCheck", 1, "Full")
			TNT1 A 0 A_FireBullets(3.2, 2.4, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_BALLISTIC, DND_ISPISTOL), "NewBulletPuff")
		Stop
		Full:
			TNT1 A 0 A_FireBullets(3.2, 2.4, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_BALLISTIC, DND_ISPISTOL), "NewBulletPuff_FullDMG")
		Stop
	}
}

Actor BerettaShooter_L : DnD_Activator {
	States {
		Pickup:
			TNT1 A 0 A_PlaySound("Weapons/BerettaFire", 7)
			TNT1 A 0 A_FireCustomMissile("Tracer", frandom(-2.75, 2.75), 0, 0, frandom(-2.5, 2.5))
			TNT1 A 0 A_SpawnItemEx("GunSmokeSmaller", 20 * cos(-pitch), -9, 35 * (1 + sin(-pitch)), 2, 0, 1)
			TNT1 A 0 A_SpawnItemEx ("pistolcasing",cos(pitch)*22,-10,31+(sin(-pitch)*20),0,8,random(4,8),0,0,0)
			TNT1 A 0 A_JumpIfInventory("NetherCheck", 1, "Full")
			TNT1 A 0 A_FireBullets(3.2, 2.4, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_BALLISTIC, DND_ISPISTOL), "NewBulletPuff")
		Stop
		Full:
			TNT1 A 0 A_FireBullets(3.2, 2.4, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_BALLISTIC, DND_ISPISTOL), "NewBulletPuff_FullDMG")
		Stop
	}
}

Actor BerettasPickup : CustomInventory
{
	Radius 16
	Height 24
    Inventory.PickupSound "weapons/pickup"
    Inventory.pickupmessage "\ccWeapon Pickup : \c[Y5]Akimbo Berettas - 9\c-"	
	Scale 0.75
	States
	{
		Spawn:
			PAKM X -1
		Stop
		Pickup:
			TNT1 A 0 A_JumpIf(1 == ACS_ExecuteWithResult(986, DND_WEAPON_BERETTAS), "Success")
		Fail
		Success:
			TNT1 A 0 A_GiveInventory("Berettas", 1)
			TNT1 A 0 A_GiveInventory("BerettaAmmo", 2 * random(3, 8) + ACS_ExecuteWithResult(918, 0, 1, 2 * random(3, 8)))
			TNT1 A 0 A_JumpIfInventory("Ability_Temporal", 1, "GiveMore")
		Stop
		GiveMore:
			TNT1 A 0 A_GiveInventory("BerettaAmmo", 2 * random(2, 4))
		Stop
	}
}

Actor BerettasMsg : CustomInventory {
	States {
		Pickup:
			TNT1 A 0 ACS_ExecuteAlways(985, 0, 0, DND_WEAPON_BERETTAS)
			TNT1 A 0 A_PlaySound("weapons/pickup", 6)
			TNT1 A 0 A_SetBlend("25 99 25", 0.6, 17)
		Stop
	}
}

Actor BerettasPickup_D : DND_DroppedItem {
	Radius 16
	Height 24
	Scale 0.75
	States {
		Spawn:
			PAKM X 17
		SpawnLoop:
			PAKM X 1 A_LookEx(LOF_NOSOUNDCHECK, 0, 28, 0, 0, "CheckPickup")
		Loop
		
		See:
		CheckPickup:
			PAKM X 1 A_JumpIfCloser(32, "Pickup")
		goto SpawnLoop

		Pickup:
			PAKM X 1 A_JumpIf(1 == ACS_ExecuteWithResult(986, DND_WEAPON_BERETTAS, 1), "PickupSuccess")
		goto PickupFail

		PickupFail:
			PAKM X 1
		goto SpawnLoop

		PickupSuccess:
			TNT1 A 0 A_GiveToTarget("Berettas", 1)
			TNT1 A 0 A_GiveToTarget("BerettaAmmo", mass)
			TNT1 A 0 A_GiveToTarget("BerettasMsg", 1)
		stop
	}
}

actor "Plasma Bolter" : Weapon {
	Weapon.SelectionOrder 6666
	Weapon.Slotnumber 9
	Weapon.AmmoUse 0
	Weapon.AmmoGive 0
	Weapon.AmmoType "PlasmaBolterAmmo"
	Obituary  "%o was lasered by %k's Plasma Bolter."
	Inventory.PickupMessage "Picked up a Plasma Bolter."
	+AMMO_OPTIONAL
	+INVENTORY.UNDROPPABLE
	Weapon.BobStyle InverseSmooth
	Weapon.BobSpeed 1.8
	Weapon.BobRangeY 0.3
	Weapon.BobRangeX 0.6
	Tag "Plasma Bolter"
	States {
		Remove:
			PBL9 A 1 Offset(0, 40)
			PBL9 A 1 Offset(0, 48)
			PBL9 A 1 Offset(0, 56)
			PBL9 B 1 Offset(0, 64)
			PBL9 B 1 Offset(0, 72)
			PBL9 B 1 Offset(0, 80)
			PBL9 C 1 Offset(0, 88)
			TNT1 A 0 A_JumpIfInventory("PlasmaBolterAmmo", 1, "RiseBack")
			PBL9 C 1 Offset(0, 96)
			TNT1 A 0 A_TakeInventory("P_PlasmaFire", 1)
			TNT1 A 0 A_TakeInventory("ForceWeaponRemove", 1)
			TNT1 A 0 A_TakeInventory("PlasmaBolterAmmo", 0)
			TNT1 A 0 A_TakeInventory("H_WeaponSlot9", 1)
			TNT1 A 0 A_TakeInventory("Plasma Bolter", 1)
			TNT1 A 1
		Stop
		RiseBack:
			PBL9 A 1 Offset(0, 88)
			PBL9 A 1 Offset(0, 80)
			PBL9 A 1 Offset(0, 72)
			PBL9 A 1 Offset(0, 64)
			PBL9 A 1 Offset(0, 56)
			PBL9 A 1 Offset(0, 48)
			PBL9 A 1 Offset(0, 40)
		Goto Ready
		Ready:
			TNT1 A 0 A_JumpIfInventory("ForceWeaponRemove", 1, "Remove")
			TNT1 A 0 A_JumpIfInventory("PlasmaBolterAmmo", 1, "NoRemove")
		Goto Remove
		NoRemove:
			TNT1 A 0 A_GiveInventory("TempWeaponReady", 1)
			PBL9 AAABBBCCC 1 A_WeaponReady
		Goto Ready
		Deselect: 
			TNT1 A 0 A_TakeInventory("P_PlasmaFire", 1)
			TNT1 A 0 A_TakeInventory("TempWeaponReady", 1)
			TNT1 A 0 A_TakeInventory("H_WeaponSlot9", 1)
			TNT1 A 0 A_TakeInventory("DnD_UsingEnergy", 1)
		DeselectLoop:
			PBL9 E 1 A_Lower
			TNT1 A 0 A_Lower
		Loop
		Select:
			TNT1 A 0 A_GiveInventory("P_PlasmaFire", 1)
			TNT1 A 0 A_TakeInventory("TempWeaponReady", 1)
			TNT1 A 0 A_TakeInventory("ForceWeaponRemove", 1)
			TNT1 A 0 A_GiveInventory("H_WeaponSlot9", 1)
			TNT1 A 0 A_GiveInventory("DnD_UsingEnergy", 1)
			TNT1 A 0 A_TakeInventory("DnD_WeaponID", 0x7FFFFFFF)
			TNT1 A 0 A_GiveInventory("DnD_WeaponID", DND_WEAPON_PLASMABOLTER)
			TNT1 A 0 ACS_NamedExecuteAlways("DND Weapon Damage Cache", 0, DND_DMGID_0, 8, 3 | (5 << 16))
			TNT1 A 0 ACS_NamedExecuteAlways("DND Weapon Damage Cache", 0, DND_DMGID_1, 35)
		SelectLoop:
			PBL9 E 1 A_Raise
			TNT1 A 0 A_Raise
		Loop
		Fire:
			TNT1 A 0 A_TakeInventory("TempWeaponReady", 1)
			TNT1 A 0 A_JumpIfInventory("PlasmaBolterAmmo", 1, "Continue")
			PBL9 D 1
		Goto Ready
		Continue:
			PBL9 F 1 Bright Offset(0, 32)
			TNT1 A 0 A_PlayWeaponSound("PlasmaBolter/Fire")
			TNT1 A 0 A_TakeInventory("PlasmaBolterAmmo", 1)
			TNT1 A 0 A_SpawnItemEx("GunSmokeSmaller", 18 * cos(-pitch), 2, 36 * (1 + sin(-pitch)), 2, 0, 1)
			TNT1 A 0 A_GiveInventory("PlasmaBolterShooter1", 1)
			TNT1 A 0 A_GunFlash
			PBL9 F 1 Bright Offset(0, 34)
			PBL9 G 1 Bright Offset(0, 37)
			PBL9 G 1 Bright Offset(0, 40)
			PBL9 G 1 Bright Offset(0, 41)
			PBL9 H 1 Bright Offset(0, 42)
			PBL9 H 1 Bright Offset(0, 38)
			PBL9 D 1 Offset(0, 36)
			PBL9 D 1 Offset(0, 34)
			PBL9 D 2 Offset(0, 32) A_ReFire
		Goto Ready
		AltFire:
			TNT1 A 0 A_TakeInventory("TempWeaponReady", 1)
			TNT1 A 0 A_JumpIfInventory("PlasmaBolterAmmo", 5, "Continue2")
			PBL9 D 1
		Goto Ready
		Continue2:
			PBL9 F 1 Bright Offset(0, 32)
			TNT1 A 0 A_PlayWeaponSound("PlasmaBolter/Fire")
			TNT1 A 0 A_TakeInventory("PlasmaBolterAmmo", 5)
			TNT1 A 0 A_SpawnItemEx("GunSmokeSmaller", 18 * cos(-pitch), 2, 36 * (1 + sin(-pitch)), 2, 0, 1)
			TNT1 A 0 A_GiveInventory("PlasmaBolterShooter2", 1)
			TNT1 A 0 A_GunFlash
			PBL9 F 1 Bright Offset(0, 34)
			PBL9 G 1 Bright Offset(0, 37)
			PBL9 G 1 Bright Offset(0, 40)
			PBL9 G 1 Bright Offset(0, 41)
			PBL9 H 1 Bright Offset(0, 42)
			PBL9 H 1 Bright Offset(0, 38)
			PBL9 D 1 Offset(0, 36)
			PBL9 D 1 Offset(0, 34)
			PBL9 D 9 Offset(0, 32) A_ReFire
		Goto Ready
		Flash:
			TNT1 A 2 A_Light1
			TNT1 A 2 A_Light0
		Goto LightDone
		Spawn:
			PBL9 X -1
		Stop
	}
}

Actor PlasmaBolterShooter1 : DnD_Activator {
	States {
		Pickup:
			TNT1 A 0 A_JumpIfInventory("NetherCheck", 1, "Full")
			TNT1 A 0 A_FireCustomMissile("PlasmaBolterProj")
		Stop
		Full:
			TNT1 A 0 A_FireCustomMissile("PlasmaBolterProj_FullDMG")
		Stop
	}
}

Actor PlasmaBolterShooter2 : DnD_Activator {
	States {
		Pickup:
			TNT1 A 0 A_JumpIfInventory("NetherCheck", 1, "Full")
			TNT1 A 0 A_FireCustomMissile("PlasmaBolterProj2")
		Stop
		Full:
			TNT1 A 0 A_FireCustomMissile("PlasmaBolterProj2_FullDMG")
		Stop
	}
}

Actor PlasmaBolterProj {
	PROJECTILE
	Height 16
	Radius 8
	Damage (ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_ENERGY, DND_USETARGET))
	DamageType "Energy"
	RenderStyle Add
	Alpha 0.8
	Scale 1.33
	Speed 32
	DeathSound "weapons/plasmax"
	var int user_count;
	const int dx = 15;
	+MTHRUSPECIES
	+DONTBLAST
	+DONTREFLECT
	States {
		Spawn:
			TNT1 A 0 NoDelay A_SetUserVar("user_count", 0)
		SpawnLoop:
			PBL9 I 2 Bright
			TNT1 A 0 A_SpawnItemEx("BlueParticleNoGravityFastVanish", 0, dx / 2 + dx * sin(user_count * 30), dx * cos(user_count * 30))
			TNT1 A 0 A_SpawnItemEx("BlueParticleNoGravityFastVanish", 0, -dx / 2 + dx * sin(user_count * 30), dx * cos(user_count * 30))
			TNT1 A 0 A_SpawnItemEx("BlueParticleNoGravityFastVanish", 0, dx * sin(user_count * 30), dx / 2 + dx * cos(user_count * 30))
			TNT1 A 0 A_SpawnItemEx("BlueParticleNoGravityFastVanish", 0, dx * sin(user_count * 30), -dx / 2 + dx * cos(user_count * 30))
			TNT1 A 0 A_SetUserVar("user_count", (user_count + 1) % 12)
			PBL9 I 2 Bright
			TNT1 A 0 A_SpawnItemEx("BlueParticleNoGravityFastVanish", 0, dx / 2 + dx * sin(user_count * 30), dx * cos(user_count * 30))
			TNT1 A 0 A_SpawnItemEx("BlueParticleNoGravityFastVanish", 0, -dx / 2 + dx * sin(user_count * 30), dx * cos(user_count * 30))
			TNT1 A 0 A_SpawnItemEx("BlueParticleNoGravityFastVanish", 0, dx * sin(user_count * 30), dx / 2 + dx * cos(user_count * 30))
			TNT1 A 0 A_SpawnItemEx("BlueParticleNoGravityFastVanish", 0, dx * sin(user_count * 30), -dx / 2 + dx * cos(user_count * 30))
			TNT1 A 0 A_SetUserVar("user_count", (user_count + 1) % 12)
			PBL9 J 2 Bright
			TNT1 A 0 A_SpawnItemEx("BlueParticleNoGravityFastVanish", 0, dx / 2 + dx * sin(user_count * 30), dx * cos(user_count * 30))
			TNT1 A 0 A_SpawnItemEx("BlueParticleNoGravityFastVanish", 0, -dx / 2 + dx * sin(user_count * 30), dx * cos(user_count * 30))
			TNT1 A 0 A_SpawnItemEx("BlueParticleNoGravityFastVanish", 0, dx * sin(user_count * 30), dx / 2 + dx * cos(user_count * 30))
			TNT1 A 0 A_SpawnItemEx("BlueParticleNoGravityFastVanish", 0, dx * sin(user_count * 30), -dx / 2 + dx * cos(user_count * 30))
			TNT1 A 0 A_SetUserVar("user_count", (user_count + 1) % 12)
			PBL9 J 2 Bright
			TNT1 A 0 A_SpawnItemEx("BlueParticleNoGravityFastVanish", 0, dx / 2 + dx * sin(user_count * 30), dx * cos(user_count * 30))
			TNT1 A 0 A_SpawnItemEx("BlueParticleNoGravityFastVanish", 0, -dx / 2 + dx * sin(user_count * 30), dx * cos(user_count * 30))
			TNT1 A 0 A_SpawnItemEx("BlueParticleNoGravityFastVanish", 0, dx * sin(user_count * 30), dx / 2 + dx * cos(user_count * 30))
			TNT1 A 0 A_SpawnItemEx("BlueParticleNoGravityFastVanish", 0, dx * sin(user_count * 30), -dx / 2 + dx * cos(user_count * 30))
			TNT1 A 0 A_SetUserVar("user_count", (user_count + 1) % 12)
		Loop
		Death:
			TNT1 A 0 A_SpawnItemEx ("PlasmaFlare", 0, 0, 0, 0, 0, 0, 0, SXF_CLIENTSIDE | SXF_NOCHECKPOSITION, 0)
			TNT1 A 0 A_SpawnItemEx("PlasmaBolterShockFX")
			TNT1 A 0 A_Explode(ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_1, TALENT_ENERGY, DND_USETARGET), 96)
			PBL9 KLM 4 Bright
		Stop
	}
}

Actor PlasmaBolterProj_FullDMG : PlasmaBolterProj {
	DamageType "EnergyFull"
	+FORCERADIUSDMG
}

Actor PlasmaBolterProj2 : PlasmaBolterProj {
	Speed 20
	+RIPPER
}

Actor PlasmaBolterProj_Damager : DnD_FakeDamager {
	Radius 8
	Height 16
	Damage (ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_ENERGY, DND_USETARGET))
	DamageType "EnergyFull"
	Speed 32
}

Actor PlasmaBolterProj2_FullDMG : PlasmaBolterProj_FullDMG {
	Speed 20
	+THRUACTORS
	States {
		Spawn:
			TNT1 A 0 NoDelay A_SetUserVar("user_count", 0)
		SpawnLoop:
			PBL9 II 1 Bright A_CustomMissile("PlasmaBolterProj_Damager", 0, 0, 0, CMF_TRACKOWNER)
			TNT1 A 0 A_SpawnItemEx("BlueParticleNoGravityFastVanish", 0, dx / 2 + dx * sin(user_count * 30), dx * cos(user_count * 30))
			TNT1 A 0 A_SpawnItemEx("BlueParticleNoGravityFastVanish", 0, -dx / 2 + dx * sin(user_count * 30), dx * cos(user_count * 30))
			TNT1 A 0 A_SpawnItemEx("BlueParticleNoGravityFastVanish", 0, dx * sin(user_count * 30), dx / 2 + dx * cos(user_count * 30))
			TNT1 A 0 A_SpawnItemEx("BlueParticleNoGravityFastVanish", 0, dx * sin(user_count * 30), -dx / 2 + dx * cos(user_count * 30))
			TNT1 A 0 A_SetUserVar("user_count", (user_count + 1) % 12)
			PBL9 II 1 Bright A_CustomMissile("PlasmaBolterProj_Damager", 0, 0, 0, CMF_TRACKOWNER)
			TNT1 A 0 A_SpawnItemEx("BlueParticleNoGravityFastVanish", 0, dx / 2 + dx * sin(user_count * 30), dx * cos(user_count * 30))
			TNT1 A 0 A_SpawnItemEx("BlueParticleNoGravityFastVanish", 0, -dx / 2 + dx * sin(user_count * 30), dx * cos(user_count * 30))
			TNT1 A 0 A_SpawnItemEx("BlueParticleNoGravityFastVanish", 0, dx * sin(user_count * 30), dx / 2 + dx * cos(user_count * 30))
			TNT1 A 0 A_SpawnItemEx("BlueParticleNoGravityFastVanish", 0, dx * sin(user_count * 30), -dx / 2 + dx * cos(user_count * 30))
			TNT1 A 0 A_SetUserVar("user_count", (user_count + 1) % 12)
			PBL9 JJ 1 Bright A_CustomMissile("PlasmaBolterProj_Damager", 0, 0, 0, CMF_TRACKOWNER)
			TNT1 A 0 A_SpawnItemEx("BlueParticleNoGravityFastVanish", 0, dx / 2 + dx * sin(user_count * 30), dx * cos(user_count * 30))
			TNT1 A 0 A_SpawnItemEx("BlueParticleNoGravityFastVanish", 0, -dx / 2 + dx * sin(user_count * 30), dx * cos(user_count * 30))
			TNT1 A 0 A_SpawnItemEx("BlueParticleNoGravityFastVanish", 0, dx * sin(user_count * 30), dx / 2 + dx * cos(user_count * 30))
			TNT1 A 0 A_SpawnItemEx("BlueParticleNoGravityFastVanish", 0, dx * sin(user_count * 30), -dx / 2 + dx * cos(user_count * 30))
			TNT1 A 0 A_SetUserVar("user_count", (user_count + 1) % 12)
			PBL9 JJ 1 Bright A_CustomMissile("PlasmaBolterProj_Damager", 0, 0, 0, CMF_TRACKOWNER)
			TNT1 A 0 A_SpawnItemEx("BlueParticleNoGravityFastVanish", 0, dx / 2 + dx * sin(user_count * 30), dx * cos(user_count * 30))
			TNT1 A 0 A_SpawnItemEx("BlueParticleNoGravityFastVanish", 0, -dx / 2 + dx * sin(user_count * 30), dx * cos(user_count * 30))
			TNT1 A 0 A_SpawnItemEx("BlueParticleNoGravityFastVanish", 0, dx * sin(user_count * 30), dx / 2 + dx * cos(user_count * 30))
			TNT1 A 0 A_SpawnItemEx("BlueParticleNoGravityFastVanish", 0, dx * sin(user_count * 30), -dx / 2 + dx * cos(user_count * 30))
			TNT1 A 0 A_SetUserVar("user_count", (user_count + 1) % 12)
		Loop
	}
}

Actor PlasmaBolterShockFX  {
	RenderStyle add
	Alpha 0.9
	Translation "0:255=%[0.00,0.00,0.00]:[0.29,1.34,1.97]"
	Scale 1.33
	+CLIENTSIDEONLY
	+NOINTERACTION
	States { 
		Spawn: 
			R075 ABCDEFFGGHHIIIJJJKKKLLMMNNOP 1 Bright A_FadeOut(0.045)
		Stop 
	} 
} 

Actor PlasmaBolterPickup : CustomInventory
{
	Radius 24
	Height 24
    Inventory.PickupSound "weapons/pickup"
    Inventory.pickupmessage "\ccWeapon Pickup : \c[Y5]Plasma Bolter - 9\c-"	
	States
	{
		Spawn:
			PBL9 X -1
		Stop
		Pickup:
			TNT1 A 0 A_JumpIf(1 == ACS_ExecuteWithResult(986, DND_WEAPON_PLASMABOLTER), "Success")
		Fail
		Success:
			TNT1 A 0 A_GiveInventory("Plasma Bolter", 1)
			TNT1 A 0 A_GiveInventory("PlasmaBolterAmmo", random(15, 30) + ACS_ExecuteWithResult(918, 0, 1, random(15, 30)))
			TNT1 A 0 A_JumpIfInventory("Ability_Temporal", 1, "GiveMore")
		Stop
		GiveMore:
			TNT1 A 0 A_GiveInventory("PlasmaBolterAmmo", random(7, 15))
		Stop
	}
}

Actor PlasmaBolterMsg : CustomInventory {
	States {
		Pickup:
			TNT1 A 0 ACS_ExecuteAlways(985, 0, 0, DND_WEAPON_PLASMABOLTER)
			TNT1 A 0 A_PlaySound("weapons/pickup", 6)
			TNT1 A 0 A_SetBlend("25 99 25", 0.6, 17)
		Stop
	}
}

Actor PlasmaBolterPickup_D : DND_DroppedItem {
	Radius 16
	Height 24
	States {
		Spawn:
			PBL9 X 17
		SpawnLoop:
			PBL9 X 1 A_LookEx(LOF_NOSOUNDCHECK, 0, 28, 0, 0, "CheckPickup")
		Loop
		
		See:
		CheckPickup:
			PBL9 X 1 A_JumpIfCloser(32, "Pickup")
		goto SpawnLoop

		Pickup:
			PBL9 X 1 A_JumpIf(1 == ACS_ExecuteWithResult(986, DND_WEAPON_PLASMABOLTER, 1), "PickupSuccess")
		goto PickupFail

		PickupFail:
			PBL9 X 1
		goto SpawnLoop

		PickupSuccess:
			TNT1 A 0 A_GiveToTarget("Plasma Bolter", 1)
			TNT1 A 0 A_GiveToTarget("PlasmaBolterAmmo", mass)
			TNT1 A 0 A_GiveToTarget("PlasmaBolterMsg", 1)
		stop
	}
}