
ACTOR RLDeathsGaze : RLWeapon
{
  Inventory.Pickupsound "weapons/unique"
  Obituary "%o lost a staring contest to %k's gaze."
  Decal BulletChip
  Tag "Death's Gaze"
  Scale 0.35
  Weapon.SelectionOrder 11
  Weapon.SlotNumber 2
  Weapon.AmmoUse1 1
  Weapon.AmmoGive1 0
  Weapon.AmmoType1 "RLDeathsGazeClip"
  Weapon.AmmoType2 "Clip"
  Inventory.Icon "DGAZICON"
  States
  {
  Ready:
	TNT1 A 0 A_JumpIfInventory("RLMisfireSpamPreventionCooldown",1,"MisfirePrevention")
	TNT1 A 0 A_JumpIfInventory("DRPGDRLAActive",1,"DoorpegOutpostCheck")
  ReadyDoorpegCheck:
	TNT1 A 0 A_JumpIfInventory("RLDeathsGazeDemonArtifacts",2,"ReadyX")
  ReadyDoorpegCheck2:
    DGAZ ABCDDDCB 4 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
	TNT1 A 0 A_Jump(180,"ReadyBlink")
    Loop
  ReadyBlink:
    DGAZ E 2 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
    DGAZ A 4 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
	TNT1 A 0 A_Jump(128,"Ready")
    DGAZ E 2 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
    Goto Ready
  ReadyBlinkX:
    DGAZ E 2 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
    DGAZ A 1 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
	TNT1 A 0 A_FireBullets (0, 0, -1, (0), "RLDeathsGazeWitheringGazePuff", FBF_NOFLASH | FBF_NORANDOM)
    DGAZ A 1 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
	TNT1 A 0 A_FireBullets (0, 0, -1, (0), "RLDeathsGazeWitheringGazePuff", FBF_NOFLASH | FBF_NORANDOM)
    DGAZ A 1 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
	TNT1 A 0 A_Jump(128,"Ready")
    DGAZ A 1 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
    DGAZ E 2 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
    Goto Ready
  ReadyX:
	TNT1 A 0 A_FireBullets (0, 0, -1, (0), "RLDeathsGazeWitheringGazePuff", FBF_NOFLASH | FBF_NORANDOM)
    DGAZ A 1 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
	TNT1 A 0 A_FireBullets (0, 0, -1, (0), "RLDeathsGazeWitheringGazePuff", FBF_NOFLASH | FBF_NORANDOM)
    DGAZ A 1 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
	TNT1 A 0 A_FireBullets (0, 0, -1, (0), "RLDeathsGazeWitheringGazePuff", FBF_NOFLASH | FBF_NORANDOM)
    DGAZ A 1 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
	TNT1 A 0 A_FireBullets (0, 0, -1, (0), "RLDeathsGazeWitheringGazePuff", FBF_NOFLASH | FBF_NORANDOM)
    DGAZ A 1 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
	TNT1 A 0 A_FireBullets (0, 0, -1, (0), "RLDeathsGazeWitheringGazePuff", FBF_NOFLASH | FBF_NORANDOM)
    DGAZ B 1 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
	TNT1 A 0 A_FireBullets (0, 0, -1, (0), "RLDeathsGazeWitheringGazePuff", FBF_NOFLASH | FBF_NORANDOM)
    DGAZ B 1 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
	TNT1 A 0 A_FireBullets (0, 0, -1, (0), "RLDeathsGazeWitheringGazePuff", FBF_NOFLASH | FBF_NORANDOM)
    DGAZ B 1 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
	TNT1 A 0 A_FireBullets (0, 0, -1, (0), "RLDeathsGazeWitheringGazePuff", FBF_NOFLASH | FBF_NORANDOM)
    DGAZ B 1 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
	TNT1 A 0 A_FireBullets (0, 0, -1, (0), "RLDeathsGazeWitheringGazePuff", FBF_NOFLASH | FBF_NORANDOM)
    DGAZ C 1 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
	TNT1 A 0 A_FireBullets (0, 0, -1, (0), "RLDeathsGazeWitheringGazePuff", FBF_NOFLASH | FBF_NORANDOM)
    DGAZ C 1 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
	TNT1 A 0 A_FireBullets (0, 0, -1, (0), "RLDeathsGazeWitheringGazePuff", FBF_NOFLASH | FBF_NORANDOM)
    DGAZ C 1 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
	TNT1 A 0 A_FireBullets (0, 0, -1, (0), "RLDeathsGazeWitheringGazePuff", FBF_NOFLASH | FBF_NORANDOM)
    DGAZ C 1 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
	TNT1 A 0 A_FireBullets (0, 0, -1, (0), "RLDeathsGazeWitheringGazePuff", FBF_NOFLASH | FBF_NORANDOM)
    DGAZ D 1 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
	TNT1 A 0 A_FireBullets (0, 0, -1, (0), "RLDeathsGazeWitheringGazePuff", FBF_NOFLASH | FBF_NORANDOM)
    DGAZ D 1 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
	TNT1 A 0 A_FireBullets (0, 0, -1, (0), "RLDeathsGazeWitheringGazePuff", FBF_NOFLASH | FBF_NORANDOM)
    DGAZ D 1 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
	TNT1 A 0 A_FireBullets (0, 0, -1, (0), "RLDeathsGazeWitheringGazePuff", FBF_NOFLASH | FBF_NORANDOM)
    DGAZ D 1 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
	TNT1 A 0 A_FireBullets (0, 0, -1, (0), "RLDeathsGazeWitheringGazePuff", FBF_NOFLASH | FBF_NORANDOM)
    DGAZ D 1 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
	TNT1 A 0 A_FireBullets (0, 0, -1, (0), "RLDeathsGazeWitheringGazePuff", FBF_NOFLASH | FBF_NORANDOM)
    DGAZ D 1 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
	TNT1 A 0 A_FireBullets (0, 0, -1, (0), "RLDeathsGazeWitheringGazePuff", FBF_NOFLASH | FBF_NORANDOM)
    DGAZ D 1 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
	TNT1 A 0 A_FireBullets (0, 0, -1, (0), "RLDeathsGazeWitheringGazePuff", FBF_NOFLASH | FBF_NORANDOM)
    DGAZ D 1 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
	TNT1 A 0 A_FireBullets (0, 0, -1, (0), "RLDeathsGazeWitheringGazePuff", FBF_NOFLASH | FBF_NORANDOM)
    DGAZ D 1 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
	TNT1 A 0 A_FireBullets (0, 0, -1, (0), "RLDeathsGazeWitheringGazePuff", FBF_NOFLASH | FBF_NORANDOM)
    DGAZ D 1 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
	TNT1 A 0 A_FireBullets (0, 0, -1, (0), "RLDeathsGazeWitheringGazePuff", FBF_NOFLASH | FBF_NORANDOM)
    DGAZ D 1 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
	TNT1 A 0 A_FireBullets (0, 0, -1, (0), "RLDeathsGazeWitheringGazePuff", FBF_NOFLASH | FBF_NORANDOM)
    DGAZ D 1 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
	TNT1 A 0 A_FireBullets (0, 0, -1, (0), "RLDeathsGazeWitheringGazePuff", FBF_NOFLASH | FBF_NORANDOM)
    DGAZ C 1 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
	TNT1 A 0 A_FireBullets (0, 0, -1, (0), "RLDeathsGazeWitheringGazePuff", FBF_NOFLASH | FBF_NORANDOM)
    DGAZ C 1 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
	TNT1 A 0 A_FireBullets (0, 0, -1, (0), "RLDeathsGazeWitheringGazePuff", FBF_NOFLASH | FBF_NORANDOM)
    DGAZ C 1 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
	TNT1 A 0 A_FireBullets (0, 0, -1, (0), "RLDeathsGazeWitheringGazePuff", FBF_NOFLASH | FBF_NORANDOM)
    DGAZ C 1 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
	TNT1 A 0 A_FireBullets (0, 0, -1, (0), "RLDeathsGazeWitheringGazePuff", FBF_NOFLASH | FBF_NORANDOM)
    DGAZ B 1 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
	TNT1 A 0 A_FireBullets (0, 0, -1, (0), "RLDeathsGazeWitheringGazePuff", FBF_NOFLASH | FBF_NORANDOM)
    DGAZ B 1 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
	TNT1 A 0 A_FireBullets (0, 0, -1, (0), "RLDeathsGazeWitheringGazePuff", FBF_NOFLASH | FBF_NORANDOM)
    DGAZ B 1 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
	TNT1 A 0 A_FireBullets (0, 0, -1, (0), "RLDeathsGazeWitheringGazePuff", FBF_NOFLASH | FBF_NORANDOM)
    DGAZ B 1 A_WeaponReady (WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
	TNT1 A 0 A_Jump(180,"ReadyBlinkX")
    Goto Ready
  ReadyNoReload:
    DGAZ E 2 A_WeaponReady (WRF_ALLOWZOOM)
    Goto Ready
	
  ScavengerDrop:
	TNT1 A 0 A_JumpIfInventory("RLScavengerDrop",1,"WeaponDropConfirm")
	TNT1 A 0 A_GiveInventory("RLScavengerDrop",1)
	TNT1 A 0 A_Print("Press again to drop current weapon,\nor press \crAlt Fire\c- to scrap it to retrieve a \cgDemon Artifact.")
	Goto AfterModDrop
  WeaponDropConfirm:
	TNT1 A 0 A_GiveInventory("RLMisfireSpamPreventionCooldown",1)
	TNT1 A 0 A_TakeInventory("RLScavengerDrop",1)
	TNT1 A 0 A_TakeInventory("RLWeaponDrop",1)
	TNT1 A 0 A_JumpIfInventory("RLDeathsGazeDemonArtifacts", 1, "WeaponDropModded")
	TNT1 A 0 A_JumpIfInventory("RLDeathsGazeModLimit", 1, "WeaponDropModded")
	TNT1 A 0 A_SpawnItemEx("RLDeathsGazePickup", 0, 0, 40, 12, 0, 0, 0, SXF_SETMASTER)
	Goto WeaponDropRemoval
  WeaponDropModded:
	TNT1 A 2 A_SpawnItemEx("RLDeathsGazePickupModded", 0, 0, 40, 12, 0, 0, 0, SXF_SETMASTER)
  WeaponDropRemoval:
    TNT1 A 0 A_TakeInventory("RLDeathsGazeModLimit", 1)
    TNT1 A 0 A_TakeInventory("RLDeathsGazePowerMod", 1)
    TNT1 A 0 A_TakeInventory("RLDeathsGazeBulkMod", 1)
    TNT1 A 0 A_TakeInventory("RLDeathsGazeAgilityMod", 1)
    TNT1 A 0 A_TakeInventory("RLDeathsGazeTechnicalMod", 1)
    TNT1 A 0 A_TakeInventory("RLDeathsGazeSniperMod", 1)
    TNT1 A 0 A_TakeInventory("RLDeathsGazeFirestormMod", 1)
    TNT1 A 0 A_TakeInventory("RLDeathsGazeNanoMod", 1)
    TNT1 A 0 A_TakeInventory("RLDeathsGazeDemonArtifacts", 3)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
	TNT1 A 0 A_TakeInventory("RLDeathsGazeSelected", 1)
	TNT1 A 0 A_TakeInventory("RLWeaponLimit",1)
	TNT1 A 1 A_TakeInventory("RLDeathsGaze",1)
	Stop
  AfterModDrop:
    DGAZ ABCDDDCB 2 A_WeaponReady (WRF_ALLOWRELOAD)
    Goto Ready
  MisfirePrevention:
    DGAZ A 1 A_WeaponReady (WRF_NOFIRE | WRF_NOBOB)
    TNT1 A 0 A_JumpIfInventory("RLMisfireSpamPreventionCooldown", 1, "MisfirePrevention")
    Goto Ready
	
  Deselect:
	TNT1 A 0
	TNT1 A 0 A_GiveInventory("RLDeselectionFunction",1)
	TNT1 A 0 A_TakeInventory("RLDeathsGazeSelected", 1)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
  DeselectLoop:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "DeselectRenegade")
    TNT1 AA 0 A_Lower
    DGAZ E 1 A_Lower
    Goto DeselectLoop
  DeselectRenegade:
    TNT1 A 0 A_Lower
    loop
  SelectRenegade: 
    TNT1 A 0 A_Raise
    loop
  SelectSetWeapon:
	TNT1 A 0 A_GiveInventory("RLPistolTypeWeapon", 1)
	TNT1 A 0 A_GiveInventory("RLDemonicWeaponToken", 1)
	TNT1 A 0 A_GiveInventory("RLDeathsGazeSelected", 1)
    Goto SelectLoop
  SelectLoop:
    TNT1 A 0 A_JumpIfInventory("RLShellshockPerk", 1, "SelectRenegade")
    TNT1 AA 0 A_Raise
    DGAZ E 1 A_Raise
    Goto SelectLoop
	
// 8x damage with Scout, half spread
  Fire:
	
	DGAZ A 0 A_JumpIfInventory("RLRestrictionMeleeOnly",1,"MeleeRestricted") // Cannot fire in levels that restrict it
	DGAZ A 0 A_JumpIfInventory("RLRestrictionSilencedOnly",1,"SilencedRestricted") // Cannot fire in levels that restrict it
	DGAZ A 0 A_JumpIfInventory("RLRestrictionBoomOnly",1,"BoomRestricted") // Cannot fire in levels that restrict it
	DGAZ A 0 A_JumpIfInventory("RLRestrictionHighTechOnly",1,"HighTechRestricted") // Cannot fire in levels that restrict it
	DGAZ A 0 A_JumpIfInventory("RLRestrictionCunningOnly",1,"CunningRestricted") // Cannot fire in levels that restrict it
	
	TNT1 A 0 A_JumpIfNoAmmo("Reload")
	TNT1 A 0 A_TakeInventory("RLDeathsGazeAnimationState", 3)
	TNT1 A 0 A_AlertMonsters
	TNT1 A 0 A_JumpIfInventory("RLDeathsGazePowerMod",1,"FireP")
	TNT1 A 0 A_JumpIfInventory("RLDeathsGazeAgilityMod",1,"FireA")
	TNT1 A 0 A_JumpIfInventory("RLDeathsGazeDemonArtifacts",3,"FireX")
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireBullets (2, 2, -1, (10*random(5,6)), "RLDeathsGazePuff", FBF_NORANDOM)
    Goto FireFinish
	TNT1 A 0 A_FireBullets (1, 1, -1, (80), "RLDeathsGazePuff", FBF_NORANDOM)
    Goto FireFinish
  FireP:
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireBullets (2, 2, -1, (12*random(5,6)), "RLDeathsGazePuff", FBF_NORANDOM)
    Goto FireFinish
	TNT1 A 0 A_FireBullets (1, 1, -1, (96), "RLDeathsGazePuff", FBF_NORANDOM)
    Goto FireFinish
  FireA:
	TNT1 A 0 A_JumpIfInventory("RLSharpshooterPerk",1,2)
	TNT1 A 0 A_FireBullets (0, 0, -1, (10*random(5,6)), "RLDeathsGazePuff", FBF_NORANDOM)
    Goto FireFinish
	TNT1 A 0 A_FireBullets (0, 0, -1, (80), "RLDeathsGazePuff", FBF_NORANDOM)
    Goto FireFinish
  FireX:
	TNT1 A 0 A_JumpIfInventory("RLDeathsGazeAgilityMod",1,2)
	TNT1 A 0 A_FireBullets (2, 2, -1, 6*6*6, "RLDeathsGazePuffX", FBF_NORANDOM)
    Goto FireFinishHolyShit
	TNT1 A 0 A_FireBullets (0, 0, -1, (216), "RLDeathsGazePuffX", FBF_NORANDOM)
    Goto FireFinishHolyShit
  FireFinish:
    TNT1 A 0 A_SpawnItemEx ("RLPistolRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    TNT1 A 0 A_TakeInventory("RLDeathsGazeClip", 1, TIF_NOTAKEINFINITE)
    TNT1 A 0 A_PlaySound("weapons/deathsgaze", CHAN_WEAPON, 1, 0, 0.7)
    TNT1 A 0 A_PlaySound("weapons/deathsgaze", 7, 0.05, 0, 0.20)
    DGAZ F 2 Bright A_GunFlash
    DGAZ G 2 Bright
    DGAZ HIJ 2
	Goto Ready
  FireFinishHolyShit:
    TNT1 A 0 A_SpawnItemEx ("RLPistolRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    TNT1 A 0 A_TakeInventory("RLDeathsGazeClip", 1, TIF_NOTAKEINFINITE)
    TNT1 A 0 A_PlaySound("weapons/deathsgaze", CHAN_WEAPON, 1, 0, 0.6)
    TNT1 A 0 A_PlaySound("weapons/deathsgaze", 7, 0.05, 0, 0.20)
    TNT1 A 0 A_PlaySound("weapons/unmakerimpact", CHAN_BODY, 1, 0, 0.5)
    DGAZ F 2 Bright A_GunFlash
    DGAZ G 2 Bright
    DGAZ HIJ 2
	Goto Ready
	
  Reload:
    DGAZ E 2 A_WeaponReady (WRF_NOPRIMARY | WRF_ALLOWZOOM)
    Goto ReloadFrameChosen
  ReloadFrameChosen:
	TNT1 A 0 A_JumpIfInventory("RLDeathsGazeBulkMod",1,2)
	TNT1 A 0 A_JumpIfInventory("RLDeathsGazeClip", 10, "Ready")
	Goto ReloadStartCheck
	TNT1 A 0 A_JumpIfInventory("RLDeathsGazeClip", 19, "Ready")
	Goto ReloadStartCheck
  ReloadStartCheck:
	TNT1 A 0 A_JumpIfInventory("Clip", 1, 1)
	Goto Ready
	TNT1 A 0 // Play the reload animation.
	TNT1 A 0 A_JumpIfInventory("RLDeathsGazeTechnicalMod",1,"Reload1")
    DGAZ K 2
    DGAZ L 2
    DGAZ M 2
    DGAZ N 2
    DGAZ O 2
    DGAZ P 2
	TNT1 A 0 A_PlaySound("weapons/deathsgazeunload", 7)
    TNT1 A 0 A_SpawnItemEx ("RLStandardReloadOutRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    TNT1 A 28
	Goto ReloadWorking
  Reload1:
    DGAZ K 2
    DGAZ L 2
    DGAZ M 2
    DGAZ N 2
    DGAZ O 2
    DGAZ P 2
	TNT1 A 0 A_PlaySound("weapons/deathsgazeunload", 7)
    TNT1 A 0 A_SpawnItemEx ("RLStandardReloadOutRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
    TNT1 A 25
  ReloadWorking:
	TNT1 A 0 A_TakeInventory("Clip", 1)
	TNT1 A 0 A_GiveInventory("RLDeathsGazeClip", 1)
	TNT1 A 0 A_JumpIfInventory("RLDeathsGazeBulkMod",1,2)
	TNT1 A 0 A_JumpIfInventory("RLDeathsGazeClip",10,"ReloadFinish")
	Goto ReloadWorkingAmmoCheck
	TNT1 A 0 A_JumpIfInventory("RLDeathsGazeClip",19,"ReloadFinish")
	Goto ReloadWorkingAmmoCheck
  ReloadWorkingAmmoCheck:
	TNT1 A 0 A_JumpIfInventory("Clip",1,"ReloadWorking")
	Goto ReloadFinish
  ReloadFinish:
	TNT1 A 0 A_PlaySound("weapons/deathsgazeload", CHAN_ITEM)
    TNT1 A 0 A_SpawnItemEx ("RLStandardReloadInRecoil", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) // Pitch-based recoil
	TNT1 A 0 A_JumpIfInventory("RLDeathsGazeTechnicalMod",1,"ReloadFinish1")
    TNT1 A 5
    DGAZ P 2
    DGAZ O 2
    DGAZ N 2
    DGAZ M 2
    DGAZ L 2
    DGAZ K 2
    DGAZ A 7 A_ReFire
	Goto Ready
  ReloadFinish1:
    TNT1 A 2
    DGAZ P 2
    DGAZ O 2
    DGAZ N 2
    DGAZ M 2
    DGAZ L 2
    DGAZ K 2
    DGAZ A 7 A_ReFire
	Goto Ready
  Flash:
    TNT1 A 2 A_Light1
    TNT1 A 2 A_Light2
    TNT1 A 0 A_Light0
    Goto LightDone
  Spawn:
	TNT1 A 0 NoDelay A_SpawnItemEx("RLDeathsGazePickup",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION, 0, tid)
    Stop
  Altfire:
	TNT1 A 0 A_JumpIfInventory("RLArmorModItemActivate",1, "ArmorModConversion")
	TNT1 A 0 A_JumpIfInventory("RLScavengerDrop",1,"ScavengerTime")
	Goto ReadyNoReload
  ModDiscombobulation:
	TNT1 A 0 A_Print("Applied Mod pack extracted from discarded weapon.")
	TNT1 A 0 ACS_NamedExecuteAlways("ScavengeMods", 0)
	TNT1 A 3
	TNT1 A 0 A_TakeInventory("RLScavengerDrop",1)
    TNT1 A 0 A_TakeInventory("RLDeathsGazeModLimit", 1)
    TNT1 A 0 A_TakeInventory("RLDeathsGazePowerMod", 1)
    TNT1 A 0 A_TakeInventory("RLDeathsGazeBulkMod", 1)
    TNT1 A 0 A_TakeInventory("RLDeathsGazeAgilityMod", 1)
    TNT1 A 0 A_TakeInventory("RLDeathsGazeTechnicalMod", 1)
    TNT1 A 0 A_TakeInventory("RLDeathsGazeSniperMod", 1)
    TNT1 A 0 A_TakeInventory("RLDeathsGazeFirestormMod", 1)
    TNT1 A 0 A_TakeInventory("RLDeathsGazeNanoMod", 1)
    TNT1 A 0 A_TakeInventory("RLDeathsGazeDemonArtifacts", 3)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
	TNT1 A 0 A_TakeInventory("RLDeathsGazeSelected", 1)
	TNT1 A 0 A_TakeInventory("RLWeaponLimit",1)
	Goto ScavengerTimeEnd
  ArtifactDiscombobulation:
	TNT1 A 0 A_Print("The weapon tries to fight your attempts to remove an artifact.\nYou manage to remove one, but the weapon is ruined.")
	TNT1 A 3
	TNT1 A 0 A_TakeInventory("RLScavengerDrop",1)
    TNT1 A 0 A_TakeInventory("RLDeathsGazeModLimit", 1)
    TNT1 A 0 A_TakeInventory("RLDeathsGazePowerMod", 1)
    TNT1 A 0 A_TakeInventory("RLDeathsGazeBulkMod", 1)
    TNT1 A 0 A_TakeInventory("RLDeathsGazeAgilityMod", 1)
    TNT1 A 0 A_TakeInventory("RLDeathsGazeTechnicalMod", 1)
    TNT1 A 0 A_TakeInventory("RLDeathsGazeSniperMod", 1)
    TNT1 A 0 A_TakeInventory("RLDeathsGazeFirestormMod", 1)
    TNT1 A 0 A_TakeInventory("RLDeathsGazeNanoMod", 1)
    TNT1 A 0 A_TakeInventory("RLDeathsGazeDemonArtifacts", 3)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
	TNT1 A 0 A_TakeInventory("RLDeathsGazeSelected", 1)
	TNT1 A 0 A_TakeInventory("RLWeaponLimit",1)
	TNT1 A 0 A_FireCustomMissile("DroppedRLDemonArtifact",0,0,0)
	Goto ScavengerTimeEnd
  ScavengerTime:
	TNT1 A 0 A_GiveInventory("RLScavengingExtraEffects", 1)
	TNT1 A 0 A_JumpIfInventory("RLDeathsGazeDemonArtifacts",1,"ArtifactDiscombobulation")
	TNT1 A 0 A_JumpIfInventory("RLDeathsGazeModLimit",1,"ModDiscombobulation")
	TNT1 A 0 A_Print("OH GOD WHAT DID YOU DO")
	TNT1 A 0 A_TakeInventory("RLScavengerDrop",1)
    TNT1 A 0 A_TakeInventory("RLDeathsGazeModLimit", 1)
    TNT1 A 0 A_TakeInventory("RLDeathsGazePowerMod", 1)
    TNT1 A 0 A_TakeInventory("RLDeathsGazeBulkMod", 1)
    TNT1 A 0 A_TakeInventory("RLDeathsGazeAgilityMod", 1)
    TNT1 A 0 A_TakeInventory("RLDeathsGazeTechnicalMod", 1)
    TNT1 A 0 A_TakeInventory("RLDeathsGazeSniperMod", 1)
    TNT1 A 0 A_TakeInventory("RLDeathsGazeFirestormMod", 1)
    TNT1 A 0 A_TakeInventory("RLDeathsGazeNanoMod", 1)
    TNT1 A 0 A_TakeInventory("RLDeathsGazeDemonArtifacts", 3)
	TNT1 A 0 A_GiveInventory("RLRarityTokenRemover", 1)
	TNT1 A 0 A_TakeInventory("RLDeathsGazeSelected", 1)
	TNT1 A 0 A_TakeInventory("RLWeaponLimit",1)
	TNT1 A 0 A_FireCustomMissile("DroppedRLDemonArtifact",0,0,0)
	Goto ScavengerTimeEnd
  ScavengerTimeEnd:
	TNT1 A 1 A_TakeInventory("RLDeathsGaze",1)
	Stop
//==============================================================================
//					--	DRPG Compatibility Stuff  --
//==============================================================================
  DoorpegOutpostCheck:
	TNT1 A 0 ACS_NamedExecuteAlways("InOutpost", 0, "ReadyDoorpegCheck2")
	Goto ReadyDoorpegCheck
  }
}

//-------------------------------------------------------------------
//		PROJECTILES

actor RLDeathsGazePuff : BulletPuff
{
	RenderStyle ADD
	Alpha 0.9
	Scale 0.7
	VSpeed 0
	DamageType "Bullet"
	Species "Player"
	+PUFFONACTORS
	+MTHRUSPECIES
	+FORCEXYBILLBOARD
	+ALWAYSPUFF
	+PUFFGETSOWNER
	+HITTRACER
	+FORCEXYBILLBOARD
	-ALLOWPARTICLES
	-SOLID
	
	var int user_firestormtimer;
	States
	{
		Spawn:
			TNT1 A 0
			TNT1 A 0 A_JumpIfInventory ("RLDeathsGazeNanoMod", 1, "NanoMode", AAPTR_TARGET)
			TNT1 A 0 A_JumpIfInventory ("RLDeathsGazeDemonArtifacts", 1, "HealthBonusGiving", AAPTR_TARGET)
			TNT1 A 0 A_JumpIfInventory ("RLDeathsGazeFirestormMod", 1, "FirestormMode", AAPTR_TARGET)
			TNT1 A 0 A_JumpIfInventory ("RLDeathsGazeSniperMod", 1, "SniperMode", AAPTR_TARGET)
			TNT1 A 0 A_Jump (256, "Animation")
			Goto Animation
		XDeath:
			TNT1 A 0
			TNT1 A 0 A_JumpIfInventory ("RLDeathsGazeNanoMod", 1, "NanoMode", AAPTR_TARGET)
			TNT1 A 0 A_JumpIfInventory ("RLDeathsGazeDemonArtifacts", 1, "HealthBonusGiving", AAPTR_TARGET)
			TNT1 A 0 A_JumpIfInventory ("RLDeathsGazeFirestormMod", 1, "FirestormMode", AAPTR_TARGET)
			TNT1 A 0 A_JumpIfInventory ("RLDeathsGazeSniperMod", 1, "SniperMode", AAPTR_TARGET)
			TNT1 A 0 A_Jump (256, "Animation")
			Goto Animation
		Crash:
			TNT1 A 0
			TNT1 A 0 A_Jump (256, "Animation")
			Goto Animation
		NanoMode:
			TNT1 AAA 0 A_GiveInventory ("HealthBonus", 1, AAPTR_TARGET)
			TNT1 A 0 A_JumpIfInventory ("RLDeathsGazeDemonArtifacts", 1, "HealthBonusGiving", AAPTR_TARGET)
			TNT1 A 0 A_Jump (256, "Animation")
			Goto Animation
		HealthBonusGiving:
			TNT1 AA 0 A_GiveInventory ("HealthBonus", 1, AAPTR_TARGET)
			TNT1 A 0 A_JumpIfInventory ("RLDeathsGazeFirestormMod", 1, "FirestormMode", AAPTR_TARGET)
			TNT1 A 0 A_JumpIfInventory ("RLDeathsGazeSniperMod", 1, "SniperMode", AAPTR_TARGET)
			TNT1 A 0 A_Jump (256, "Animation")
			Goto Animation
		SniperMode:
			TNT1 A 0 A_GiveInventory ("RLPowerDeathsGazeResistance", 1, AAPTR_TARGET)
			TNT1 A 0 A_Jump (256, "Animation")
			Goto Animation
		FirestormMode:
			TNT1 A 0 A_ChangeFlag ("DONTSPLASH", 1)
			TNT1 A 0 A_ChangeFlag ("NOPAIN", 1)
			TNT1 A 0 A_SetDamageType ("Unholy")
			TNT1 A 0 A_SetUserVar("user_firestormtimer", random(30,40))
			TNT1 A 0 A_PlaySound ("weapons/deathsgazefirestorm", 7, 1, 0, 0.9)
			TNT1 A 0 A_SpawnItemEx ("RLDeathsGazeBurnEffectStart", 5,0,32, 0,0,0, 0, SXF_NOCHECKPOSITION)
			Goto FirestormModeLoop
		FirestormModeLoop:
			TNT1 A 0 A_JumpIf (user_firestormtimer <= 0, "End")
			TNT1 A 0 A_Warp (AAPTR_TRACER, 0,0,16, 0, WARPF_NOCHECKPOSITION)
			TNT1 A 0 A_Explode (random(1,3), 96, 0, 0, 96)
			TNT1 AA 0 A_SpawnItemEx ("RLDeathsGazeBurnEffect", frandom(-20,20),frandom(-20,20),frandom(4,60), 0,0,0, 0, SXF_NOCHECKPOSITION)
			TNT1 A 0 A_SetUserVar("user_firestormtimer", user_firestormtimer - 1)
			TNT1 A 1
			Goto FirestormModeLoop
		Animation:
			TNT1 A 0 A_Stop
			TNT1 A 0 A_JumpIf(CallACS("DRLA_Fancyprojectiles") == 1, "Animation.Fancy")
		Animation.Normal:
			TNT1 A 0 A_Jump (128, 4)
			UNPF ABE 2 Bright
			stop
			UNPF CDE 2 Bright
			stop
		Animation.Fancy:
			TNT1 A 0 A_SpawnItemEx("RLDemonicWeponEvilTrace",0,0,frandom(-0.4,0.4),0,0,0,0,0,0)
			TNT1 A 0 A_SpawnItemEx("RLPuffSmoke",0,0,0,0,0,0,0,0,188)
			TNT1 A 0 A_SpawnItemEx("RLRicochetEffect", 0, 0, 0, frandom(-10.0,10.0), frandom(-10.0,10.0), frandom(-10.0,10.0), frandom(0.0,360.0),0,128)
			TNT1 AAAA 0 A_SpawnItemEx("RLBulletPuffShrapnel", 0, 0, 0, frandom(-5.0,5.0), frandom(-5.0,5.0), frandom(-5.0,5.0), frandom(0.0,360.0),0,128)
			TNT1 A 0 A_Jump (128, 4)
			UNPF ABE 2 Bright
			stop
			UNPF CDE 2 Bright
			stop
		End:
			TNT1 A 8
			Stop
	}
}

ACTOR RLDemonicWeponEvilTrace
{
	Renderstyle Add
	Scale 0.6
	+NOINTERACTION
	States
	{
		Spawn:
			DEFC ABABABABABABABABAB 2 Bright A_SpawnItemEx("RLShrapnelSmoke",0,0,frandom(-1.0,1.0),0,0,frandom(0.0,4.0),0,0,0)
			DEFC CDCDCDCDCDCD 3 Bright A_SetScale(scalex - 0.03)
			DEFC EFEFEF 4 Bright A_SetScale(scalex - 0.02)
			Stop
	}
}

ACTOR RLDeathsGazePuffX : RLDeathsGazePuff
{
	DamageType "Unholy"
	States
	{
		Animation:
			TNT1 A 0 A_Stop
			TNT1 A 0 A_JumpIf(CallACS("DRLA_Fancyprojectiles") == 1, "Animation.Fancy")
		Animation.Normal:
			SOLX AAAAABBCCDDEE 1 Bright
			stop
		Animation.Fancy:
			TNT1 A 0 A_SpawnItemEx("RLDemonicWeponEvilTrace",0,0,frandom(-0.4,0.4),0,0,0,0,0,0)
			TNT1 A 0 A_SpawnItemEx("RLPuffSmoke",0,0,0,0,0,0,0,0,188)
			TNT1 A 0 A_SpawnItemEx("RLRicochetEffect", 0, 0, 0, frandom(-10.0,10.0), frandom(-10.0,10.0), frandom(-10.0,10.0), frandom(0.0,360.0),0,128)
			TNT1 AAAA 0 A_SpawnItemEx("RLBulletPuffShrapnel", 0, 0, 0, frandom(-5.0,5.0), frandom(-5.0,5.0), frandom(-5.0,5.0), frandom(0.0,360.0),0,128)
			SOLX AAAAABBCCDDEE 1 Bright
			stop
	}
}

actor RLDeathsGazeWitheringGazePuff : BulletPuff
{
	DamageType "NullDamage"
	Species "Player"
	+NODECAL
	+BLOODLESSIMPACT
	+PUFFONACTORS
	+FORCEPAIN
    +MTHRUSPECIES
	+ALWAYSPUFF
	+PUFFGETSOWNER
	-ALLOWPARTICLES
    -SOLID
    States
    {
      Spawn:
        TNT1 A 0
        TNT1 A 0 A_Jump (256, "End")
        Goto End
      XDeath:
        TNT1 A 0
        TNT1 A 0 A_Jump (256, "End")
        Goto End
      Crash:
        TNT1 A 0
        TNT1 A 0 A_Jump (256, "End")
        Goto End
      End:
        TNT1 A 8
        Stop
    }
}

actor RLPowerDeathsGazeResistance : PowerProtection
{
   powerup.Duration -1
   inventory.icon "DMNAJ0"
   damagefactor "Melee", 0.5
   damagefactor "Bullet", 0.5
   damagefactor "Fire", 0.5
   damagefactor "Plasma", 0.5
   damagefactor "Unholy", 0.5
   damagefactor "Holy", 5.0
   +INVENTORY.UNTOSSABLE
   +INVENTORY.ADDITIVETIME
}

actor RLDeathsGazeBurnEffect
{
    Radius 1
    Height 1
    Speed 0
    +NOGRAVITY
    -SOLID
    +NOCLIP
    +RANDOMIZE
    +NOINTERACTION
	+FORCEXYBILLBOARD
    Scale 0.45
    RenderStyle Add
    Alpha 0.95
    States
    {
      Spawn:
        TNT1 A 0
        DEPL CCDDEEFFGGHHII 1 Bright A_FadeTo (0, 0.07, 1)
        Stop
    }
}

actor RLDeathsGazeBurnEffectStart : RLDeathsGazeBurnEffect
{
    Scale 1.45
    States
    {
      Spawn:
        TNT1 A 0
        DEPL CCCDDDEEEFFFGGGHHHIII 1 Bright A_FadeTo (0, 0.07, 1)
        Stop
    }
}

//-------------------------------------------------------------------
//		MECHANICS

Actor RLDeathsGazeSelected : RLPermanentInventory {}
Actor RLDeathsGazeDemonArtifacts : RLDemonArtifactAmount {}
Actor RLDeathsGazeAnimationState : RLPermanentInventory
{
inventory.maxamount 3
}
Actor RLDeathsGazeModLimit : RLUniqueModAmount {}
Actor RLDeathsGazePowerMod : RLUniqueModAmount {}
Actor RLDeathsGazeBulkMod : RLUniqueModAmount {}
Actor RLDeathsGazeAgilityMod : RLUniqueModAmount {}
Actor RLDeathsGazeTechnicalMod : RLUniqueModAmount {}
Actor RLDeathsGazeNanoMod : RLUniqueModAmount {}
Actor RLDeathsGazeFirestormMod : RLUniqueModAmount {}
Actor RLDeathsGazeSniperMod : RLUniqueModAmount {}

ACTOR RLDeathsGazeClip : Ammo
{
   +INVENTORY.IGNORESKILL
   Inventory.MaxAmount 19
   Inventory.Icon ""
}

//-------------------------------------------------------------------
//		PICKUPS

ACTOR RLDeathsGazePickup : RLDemonicWeaponPickup
{
	//$Sprite DGAZX0
	Tag "Death's Gaze [Pickup]"
	States
	{
	SpawnFrame:
		DGAZ X 4
		"####" "#" 0 A_Jump(256, "SpawnLoop")
		Goto SpawnLoop
	SpawnLoop:
		DGAZ XXXXXXXXYYYYYYYY 1 A_JumpIf(Abs(VelZ) <= 0.01 && user_floorhit == 0, "FloorHit")
		Loop
	FloorHit:
		"####" "#" 0 A_PlaySound("weapons/gundropmedium")
		"####" "#" 0 A_ScaleVelocity (0.5)
		"####" "#" 0 A_ChangeFlag("SPECIAL", true)
		"####" "#" 0 A_ChangeFlag("THRUACTORS", false)
		"####" "#" 0 A_SetUserVar("user_floorhit", 1)
		"####" "#" 0 A_Jump(256, "SpawnLoop")
		Stop
	Pickup:
		"####" "#" 0
		"####" "#" 0 A_JumpIfInventory("RLDeathsGaze",1,"NotPickup") // If the player already has this weapon, they are not given the weapon
		"####" "#" 0 A_JumpIfInventory("RLWeaponLimit",0,"NotPickupLimit") // The absolute max limit check for weapons
		"####" "#" 0 A_Jump(256, "GiveWeapon")
		Goto GiveWeapon
	GiveWeapon:
		"####" "#" 0 A_GiveInventory("RLDeathsGaze",1)
		"####" "#" 0 A_GiveInventory("RLWeaponLimit",1)
		"####" "#" 0 A_GiveInventory("RLDemonicItemFound",1, AAPTR_PLAYER1)
		"####" "#" 0 A_Print("\ccPicked up \cgDeath's Gaze.")
		Goto PickupSound
	NotPickupLimit:
		"####" "#" 0 A_Jump(256, "NotPickup")
		Goto NotPickup
	NotPickup:
		"####" "#" 0 A_JumpIfInventory("DRLA_WeaponAntiLogFloodCheck",1,"NotPickup_NoPrint")
		"####" "#" 0 A_GiveInventory("DRLA_WeaponAntiLogFloodCheck")
		"####" "#" 0 A_Print("\cg= Death's Gaze =", 2, "CONFONT")
		Goto NotPickup_NoPrint
	NotPickup_NoPrint:
		"####" "#" 0
		Fail
	PickupSound:
		"####" "#" 0 A_PlaySound("weapons/DeathsGazepickup")
		Stop
//==============================================================================
	MarathonStuff:
		"####" "#" 0 A_SpawnItemEx("RLMarathonClip",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION)
		Stop
	SuperweaponStuff:
		"####" "#" 0 A_Jump(256, "NoSpecialStartsStuff")
		Goto NoSpecialStartsStuff
	}
}

ACTOR RLDeathsGazeWorldSpawnPickup : RLDeathsGazePickup 17200
{
	States
	{
	NoSpecialStartsStuff:
		TNT1 A 0 A_SpawnItemEx("RLRarityBeamDemonicWorld", 0,0,0, 0,0,0, 0, SXF_SETMASTER)
		TNT1 A 0 A_JumpIf(CallACS("DRPGCheckTiem"), "DRPGInit")
		"####" "#" 0 A_Jump(256, "SpawnFrame")
		Goto SpawnFrame
		
	SpawnFrame:
		DGAZ X 4
		"####" "#" 0 A_GiveInventory("RLDemonicItemSpawnMessageSender",1)
		"####" "#" 0 A_PlaySound("weapons/demonicspawned", 7, 0.25, 0, 0)
		"####" "#" 0 A_Jump(256, "SpawnLoop")
		Goto SpawnLoop
		
	GiveWeapon:
		"####" "#" 0 A_GiveInventory("RLDeathsGaze",1)
		"####" "#" 0 A_GiveInventory("RLWeaponLimit",1)
		"####" "#" 0 A_GiveInventory("RLDemonicItemFound",1, AAPTR_PLAYER1)
		"####" "#" 0 A_Print("\ccPicked up \cgDeath's Gaze.")
		"####" "#" 0 A_GiveInventory("RLDangerLevelDemonicGiver",1, AAPTR_PLAYER1)
		Goto PickupSound
	}
}

ACTOR RLDeathsGazePickupModded : RLDeathsGazePickup
{
	+INVENTORY.TRANSFER
	States
	{
	Spawn:
		TNT1 A 0 NoDelay ACS_NamedExecuteAlways("GetWeaponMods", 0)
		TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 0, "NoSpecialStartsStuff")
		"####" "#" 0 A_Jump(256, "SpecialStartsStuff")
		Goto SpecialStartsStuff
		
	SpawnFrame:
		DGAZ X 4
		"####" "#" 0 A_Jump(256, "SpawnLoop")
		Goto SpawnLoop
	SpawnLoop:
		"####" "#" 0 A_JumpIf(VelZ <= 0.01 && user_floorhit == 0, "FloorHit")
		"####" "#" 0 ACS_NamedExecuteAlways("RLWeaponModDisplay", 0)
		DGAZ X 1 A_JumpIf(Abs(VelZ) <= 0.01 && user_floorhit == 0, "FloorHit")
		"####" "#" 0 ACS_NamedExecuteAlways("RLWeaponModDisplay", 0)
		DGAZ X 1 A_JumpIf(Abs(VelZ) <= 0.01 && user_floorhit == 0, "FloorHit")
		"####" "#" 0 ACS_NamedExecuteAlways("RLWeaponModDisplay", 0)
		DGAZ X 1 A_JumpIf(Abs(VelZ) <= 0.01 && user_floorhit == 0, "FloorHit")
		"####" "#" 0 ACS_NamedExecuteAlways("RLWeaponModDisplay", 0)
		DGAZ X 1 A_JumpIf(Abs(VelZ) <= 0.01 && user_floorhit == 0, "FloorHit")
		"####" "#" 0 ACS_NamedExecuteAlways("RLWeaponModDisplay", 0)
		DGAZ X 1 A_JumpIf(Abs(VelZ) <= 0.01 && user_floorhit == 0, "FloorHit")
		"####" "#" 0 ACS_NamedExecuteAlways("RLWeaponModDisplay", 0)
		DGAZ X 1 A_JumpIf(Abs(VelZ) <= 0.01 && user_floorhit == 0, "FloorHit")
		"####" "#" 0 ACS_NamedExecuteAlways("RLWeaponModDisplay", 0)
		DGAZ X 1 A_JumpIf(Abs(VelZ) <= 0.01 && user_floorhit == 0, "FloorHit")
		"####" "#" 0 ACS_NamedExecuteAlways("RLWeaponModDisplay", 0)
		DGAZ X 1 A_JumpIf(Abs(VelZ) <= 0.01 && user_floorhit == 0, "FloorHit")
		"####" "#" 0 ACS_NamedExecuteAlways("RLWeaponModDisplay", 0)
		DGAZ Y 1 A_JumpIf(Abs(VelZ) <= 0.01 && user_floorhit == 0, "FloorHit")
		"####" "#" 0 ACS_NamedExecuteAlways("RLWeaponModDisplay", 0)
		DGAZ Y 1 A_JumpIf(Abs(VelZ) <= 0.01 && user_floorhit == 0, "FloorHit")
		"####" "#" 0 ACS_NamedExecuteAlways("RLWeaponModDisplay", 0)
		DGAZ Y 1 A_JumpIf(Abs(VelZ) <= 0.01 && user_floorhit == 0, "FloorHit")
		"####" "#" 0 ACS_NamedExecuteAlways("RLWeaponModDisplay", 0)
		DGAZ Y 1 A_JumpIf(Abs(VelZ) <= 0.01 && user_floorhit == 0, "FloorHit")
		"####" "#" 0 ACS_NamedExecuteAlways("RLWeaponModDisplay", 0)
		DGAZ Y 1 A_JumpIf(Abs(VelZ) <= 0.01 && user_floorhit == 0, "FloorHit")
		"####" "#" 0 ACS_NamedExecuteAlways("RLWeaponModDisplay", 0)
		DGAZ Y 1 A_JumpIf(Abs(VelZ) <= 0.01 && user_floorhit == 0, "FloorHit")
		"####" "#" 0 ACS_NamedExecuteAlways("RLWeaponModDisplay", 0)
		DGAZ Y 1 A_JumpIf(Abs(VelZ) <= 0.01 && user_floorhit == 0, "FloorHit")
		"####" "#" 0 ACS_NamedExecuteAlways("RLWeaponModDisplay", 0)
		DGAZ Y 1 A_JumpIf(Abs(VelZ) <= 0.01 && user_floorhit == 0, "FloorHit")
		Loop
	GiveWeapon:
		"####" "#" 0 A_GiveInventory("RLDeathsGaze",1)
		"####" "#" 0 A_GiveInventory("RLWeaponLimit",1)
		"####" "#" 0 A_GiveInventory("RLDemonicItemFound",1, AAPTR_PLAYER1)
		"####" "#" 0 A_Print("\ccPicked up \cbmodded \cgDeath's Gaze.")
		Goto PickupSound
	NotPickupLimit:
		"####" "#" 0 A_JumpIfInventory("DRLA_WeaponAntiLogFloodCheck",1,"NotPickup_NoPrint")
		"####" "#" 0 A_GiveInventory("DRLA_WeaponAntiLogFloodCheck")
		"####" "#" 0 A_Print("\cg= Death's Gaze =", 2, "CONFONT")
		Goto NotPickup_NoPrint
	NotPickup:
		"####" "#" 0 A_JumpIfInventory("RLDeathsGazeModLimit", 1, "NotPickup_Modded")
		"####" "#" 0 A_JumpIfInventory("DRLA_WeaponAntiLogFloodCheck",1,"NotPickup_NoPrint")
		"####" "#" 0 A_GiveInventory("DRLA_WeaponAntiLogFloodCheck")
		"####" "#" 0 A_Print("\cg= Death's Gaze =\n\n\ccYou replace your unmodded\n\ccweapon with the one you picked up.", 5, "CONFONT")
		"####" "#" 0 A_GiveInventory("Clip",52)
		Goto PickupSound
	NotPickup_Modded:
		"####" "#" 0 A_Print("\cg= Death's Gaze =\n\n\caYou are already carrying a modded\n\caweapon of this type", 5, "CONFONT")
		Fail
	}
}
