
actor DUMP3FistDummy : BulletPuff replaces Fist {}

actor DUMP3Boolean: Inventory
{
    Inventory.MaxAmount 1
    +UNDROPPABLE
    -INVBAR
}

actor DUMP3Counter: Inventory
{
    Inventory.MaxAmount 0x7FFFFFFF
    +UNDROPPABLE
    -INVBAR
}

ACTOR DUMP3CustomFunction : CustomInventory
{
  -COUNTITEM
  +INVENTORY.ALWAYSPICKUP
  Inventory.PickupMessage ""
  Inventory.PickupSound ""
  States
  {
  Spawn:
    TNT1 A 1
    Stop
  Pickup:
    TNT1 A 0
	TNT1 A 0
    Stop
  }
}

ACTOR DUMP3Cooldown : Powerup
{
	Powerup.Duration -5
    +UNDROPPABLE
}

ACTOR DUMP3VisualEffect
{
	Radius 16
	Height 8
    Scale 0.8
    Alpha 0.85
    RenderStyle Add
	+NOGRAVITY
	+THRUACTORS
	+NOTONAUTOMAP
    +NOTIMEFREEZE
    States
    {
    Spawn:
	    TNT1 AA 1 Bright
        Stop
    }
}

ACTOR DUMP3MaxHax
{
	+NOGRAVITY
	+THRUACTORS
	+NOTONAUTOMAP
    +NOTIMEFREEZE
	+NOCLIP
    States
    {
    Spawn:
	    TNT1 A 1
        Stop
    }
}

ACTOR DUMP3SynthFire : DUMP3Boolean {}
ACTOR DUMP3SynthAltFire : DUMP3Boolean {}
ACTOR DUMP3Crouching : DUMP3Boolean {}
ACTOR DUMP3StrafeLeft : DUMP3Boolean {}
ACTOR DUMP3StrafeRight : DUMP3Boolean {}
ACTOR DUMP3Forwards : DUMP3Boolean {}
ACTOR DUMP3Backwards : DUMP3Boolean {}

//==============================================================================

//Used to cycle through different frames on guns.
Actor DUMP3GunState : DUMP3Counter
{
	inventory.maxamount 99999
}

Actor DUMP3GunState2 : DUMP3Counter
{
	inventory.maxamount 99999
}

//-------------------------------------------------

actor DUMP3ChainsawSlotFilled : DUMP3Boolean { -INVENTORY.UNDROPPABLE +INVENTORY.UNTOSSABLE }
actor DUMP3ShotgunSlotFilled : DUMP3Boolean { -INVENTORY.UNDROPPABLE +INVENTORY.UNTOSSABLE }
actor DUMP3SuperShotgunSlotFilled : DUMP3Boolean { -INVENTORY.UNDROPPABLE +INVENTORY.UNTOSSABLE }
actor DUMP3ChaingunSlotFilled : DUMP3Boolean { -INVENTORY.UNDROPPABLE +INVENTORY.UNTOSSABLE }
actor DUMP3RocketLauncherSlotFilled : DUMP3Boolean { -INVENTORY.UNDROPPABLE +INVENTORY.UNTOSSABLE }
actor DUMP3PlasmaRifleSlotFilled : DUMP3Boolean { -INVENTORY.UNDROPPABLE +INVENTORY.UNTOSSABLE }
actor DUMP3BFG9000SlotFilled : DUMP3Boolean { -INVENTORY.UNDROPPABLE +INVENTORY.UNTOSSABLE }

//-------------------------------------------------
// This stuff isn't used anymore, but I'll leave it here because reasons

actor DUMP3ShiningHeartHammerToken : DUMP3Boolean {}
actor DUMP3NeuralStunnerToken : DUMP3Boolean {}
actor DUMP3ChronitonRifleToken : DUMP3Boolean {}

actor DUMP3TeslaRifleToken : DUMP3Boolean {}
actor DUMP3Fusion_GunToken : DUMP3Boolean {}
actor DUMP3MagicNagantToken : DUMP3Boolean {}
actor DUMP3HolyWaterPistolToken : DUMP3Boolean {}
actor DUMP3WingmanToken : DUMP3Boolean {}
actor DUMP3KurddToken : DUMP3Boolean {}
actor DUMP3ShotgunAndUziToken : DUMP3Boolean {}

actor DUMP3FlechetteCannonToken : DUMP3Boolean {}
actor DUMP3DoubleShotgunToken : DUMP3Boolean {}
actor DUMP3GOH12Token : DUMP3Boolean {}
actor DUMP3SlugThrowerToken : DUMP3Boolean {}
actor DUMP3DualWSTEM5sToken : DUMP3Boolean {}

actor DUMP3RybakToken : DUMP3Boolean {}
actor DUMP3srs_chaingunToken : DUMP3Boolean {}
actor DUMP3IronAnnihilatorToken : DUMP3Boolean {}
actor DUMP3D3ChaingunToken : DUMP3Boolean {}
actor DUMP3GibmakerToken : DUMP3Boolean {}
actor DUMP3DualModeRifleToken : DUMP3Boolean {}
actor DUMP3RepeaterToken : DUMP3Boolean {}
actor DUMP3FlakchetteToken : DUMP3Boolean {}
actor DUMP3AntiMaterielRifleToken : DUMP3Boolean {}

actor DUMP3MiniRocketLauncherToken : DUMP3Boolean {}
actor DUMP3ElementLauncherToken : DUMP3Boolean {}
actor DUMP3CactusPipeToken : DUMP3Boolean {}
actor DUMP3DualCannonToken : DUMP3Boolean {}
actor DUMP3RemoteMinesToken : DUMP3Boolean {}

actor DUMP3TankfistToken : DUMP3Boolean {}
actor DUMP3RayBeamCannonToken : DUMP3Boolean {}
actor DUMP3SquinkolizatorToken : DUMP3Boolean {}
actor DUMP3AbyssalRodToken : DUMP3Boolean {}
actor DUMP3PlasmaBustersToken : DUMP3Boolean {}
actor DUMP3NovaBlasterToken : DUMP3Boolean {}
actor DUMP3NanotoolToken : DUMP3Boolean {}
actor DUMP3SirusBusterCannonToken : DUMP3Boolean {}
actor DUMP3SuperPlasmaGunToken : DUMP3Boolean {}
actor DUMP3BioEradicatorToken : DUMP3Boolean {}
actor DUMP3DualPlasmaPistolsToken : DUMP3Boolean {}

actor DUMP3RevenantBoxToken : DUMP3Boolean {}
actor DUMP3ExterminatusDuoToken : DUMP3Boolean {}
actor DUMP3srs_bombToken : DUMP3Boolean {}
actor DUMP3DarkPulseCannonToken : DUMP3Boolean {}
actor DUMP3PlasmaTrackerToken : DUMP3Boolean {}
actor DUMP3PoweredMachinegunsToken : DUMP3Boolean {}
actor DUMP3LaundryFuToken : DUMP3Boolean {}

//-------------------------------------------------

actor DUMP3Player : DoomPlayer
{
    Player.StartItem "DUMP3IA-7", 1
    Player.StartItem "Clip", 50
    +THRUSPECIES
    Species "Player"
}

//-------------------------------------------------

actor DUMP3Weapon : Weapon
{
	Weapon.BobStyle Alpha
	Weapon.BobSpeed 2.5
	Weapon.BobRangeX 0.2
	Weapon.BobRangeY 0.5
//    +INVENTORY.UNDROPPABLE
    +INVENTORY.UNTOSSABLE
	+WEAPON.AMMO_OPTIONAL
	+WEAPON.ALT_AMMO_OPTIONAL
	+WEAPON.NOALERT
//	+CHEATNOTWEAPON
    States
    {
    Ready:
        TNT1 A 1 A_WeaponReady
        loop
    Select:
        TNT1 A 0 A_Raise
        TNT1 A 1 A_Raise
        loop
    Deselect:
        TNT1 A 0 A_Lower
        TNT1 A 1 A_Lower
        loop
    Fire:
        TNT1 A 1
        goto Ready
    Zoom:
        "####" "#" 1 A_WeaponReady (WRF_NOFIRE)
	    "####" "#" 0 A_JumpIfInventory("DUMP3WeaponDropCooldown",1,"Ready")
	    "####" "#" 0 A_GiveInventory("DUMP3WeaponDropCounter",1)
	    "####" "#" 0 A_JumpIfInventory("DUMP3WeaponDropCounter",0,"DropGun")
        "####" "#" 1 A_WeaponReady (WRF_NOFIRE | WRF_ALLOWZOOM)
	    "####" "#" 0 A_TakeInventory("DUMP3WeaponDropCounter",999)
	    "####" "#" 0 A_Jump(256, "Ready")
	    Goto Ready
    DropGun:
	    "####" "#" 0 A_TakeInventory("DUMP3WeaponDropCounter",999)
	    "####" "#" 0 A_GiveInventory("DUMP3WeaponDropCooldown",1)
	    "####" "#" 0 A_Jump(256, "DropGunPickup")
	    Goto DropGunPickup
    DropGunPickup:
	    "####" "#" 0 A_TakeInventory("DUMP3ChainsawSlotFilled",1)
	    "####" "#" 0 A_TakeInventory("DUMP3Weapon",1)
		"####" "#" 0 A_JumpIf(CallACS("dump3_rerollgun") == 1, "RerollGun")
	    "####" "#" 0 A_Jump(256, "Deselect")
	    Goto Deselect
    RerollGun:
		"####" "#" 0
	    "####" "#" 0 A_Jump(256, "Deselect")
	    Goto Deselect
    }
}

// Weapon dropping code mercilessly stolen from LegenDoom because I am the lazy
// also because it's pretty much what I would've done anyway and I ALREADY DID IT ONCE

// Countdown timer for dropping weapons, hold altfire down to drop your current weapon.
Actor DUMP3WeaponDropCounter : DUMP3Counter
{
inventory.maxamount 15 // Length in tics, alter this value to change how long you have to hold down altfire.
}

ACTOR DUMP3WeaponDropCooldown : DUMP3Cooldown
{
	Powerup.Duration -2
}

//-------------------------------------------------

actor DUMP3BulletPuff : BulletPuff { +MTHRUSPECIES Species "Player" Decal "BulletChip"} // If this replaces, zombies of the same type won't infight anymore

//ACTOR DUMP3Rocket : Rocket /*replaces Rocket //Cyberdemons use these too, sooo*/ { +MTHRUSPECIES Species "Player" }

//ACTOR DUMP3PlasmaBall : PlasmaBall replaces PlasmaBall { +MTHRUSPECIES Species "Player" }

//ACTOR DUMP3BFGBall : BFGBall replaces BFGBall { +MTHRUSPECIES Species "Player" }

//ACTOR DUMP3BFGExtra : BFGExtra replaces BFGExtra { +MTHRUSPECIES Species "Player" }

//-------------------------------------------------

#include "actors/pistol.dec"

#include "actors/chainsaw/petlostsoul.dec"
#include "actors/chainsaw/volcanus.dec"
#include "actors/chainsaw/hammer.dec"
#include "actors/chainsaw/neuralstunner.dec"
#include "actors/chainsaw/chronitonrifle.dec"

#include "actors/shotgun/teslarifle.dec"
#include "actors/shotgun/magicnagant.dec"
#include "actors/shotgun/frostfiretome.dec"
#include "actors/shotgun/holywaterpistol.dec"
#include "actors/shotgun/wingman.dec"
#include "actors/shotgun/shotgunanduzi.dec"

#include "actors/supershotgun/hellhammer.dec"
#include "actors/supershotgun/flechettecannon.dec"
#include "actors/supershotgun/tyrant.dec"
#include "actors/supershotgun/doubleshotgun.dec"
#include "actors/supershotgun/maestro.dec"
#include "actors/supershotgun/goh12.dec"
#include "actors/supershotgun/slugthrower.dec"
#include "actors/supershotgun/kurdd.dec"
#include "actors/supershotgun/dualwstem5s.dec"

#include "actors/chaingun/rybak.dec"
#include "actors/chaingun/srschaingun.dec"
#include "actors/chaingun/ironannihilator.dec"
#include "actors/chaingun/d3chaingun.dec"
#include "actors/chaingun/dualmoderifle.dec"
#include "actors/chaingun/repeater.dec"
#include "actors/chaingun/flakchettegun.dec"
#include "actors/chaingun/amr.dec"
#include "actors/chaingun/klobbs.dec"

#include "actors/rocketlauncher/minirocketlauncher.dec"
#include "actors/rocketlauncher/cactuspipe.dec"
#include "actors/rocketlauncher/elementlauncher.dec"
#include "actors/rocketlauncher/ovum.dec"
#include "actors/rocketlauncher/dualcannon.dec"
#include "actors/rocketlauncher/remotemines.dec"

#include "actors/plasmarifle/tankfist.dec"
#include "actors/plasmarifle/raybeamcannon.dec"
#include "actors/plasmarifle/fusiongun.dec"
#include "actors/plasmarifle/squinkolizator.dec"
#include "actors/plasmarifle/abyssalrod.dec"
#include "actors/plasmarifle/plasmabusters.dec"
#include "actors/plasmarifle/novablaster.dec"
#include "actors/plasmarifle/nanotool.dec"
#include "actors/plasmarifle/sirusbustercannon.dec"
#include "actors/plasmarifle/superplasmagun.dec"
#include "actors/plasmarifle/bioeradicator.dec"
#include "actors/plasmarifle/dualplasmapistols.dec"

#include "actors/bfg/revenantbox.dec"
#include "actors/bfg/exterminatusduo.dec"
#include "actors/bfg/srsbomb.dec"
#include "actors/bfg/hs011.dec"
#include "actors/bfg/darkpulsecannon.dec"
#include "actors/bfg/plasmatracker.dec"
#include "actors/bfg/multihexdevice.dec"
#include "actors/bfg/gibmaker.dec"
#include "actors/bfg/poweredmachineguns.dec"
#include "actors/bfg/laundryfu.dec"

#include "actors/pickups.dec"


//==============================================================================
//			YHOLE CRAP
//==============================================================================


// Base is Wildweasel's casings from WW-Terror pls don't shoot lasers at me I just wanted nice casing physics
ACTOR DUMP39mmCasing
{
	PROJECTILE
	-NOGRAVITY
	-NOBLOCKMAP
	+THRUACTORS
	+FORCEXYBILLBOARD
	+CLIENTSIDEONLY
	+NOTRIGGER
	BounceType Doom
	BounceSound "casings/bullet"
	WallBounceSound "casings/bullet"
	BounceFactor 0.25
	WallBounceFactor 0.1
	Mass 5
	Radius 3
	Height 3
	Scale 0.2
	States
	{
	Spawn:
		9MMC ABCDEFGH 2
		"####" A 0 A_JumpIf(waterlevel >= 1, 1)
		Loop
		"####" I 1 A_FadeTo(0, 0.1, 1)
		Loop
	Death:
		"####" A 0 A_Jump(256,"FadeOut1","FadeOut2")
	FadeOut1:
		"####" A 0 A_Jump (128, 2)
		"####" A 0 A_SetScale (scalex - (scalex * 2), scaley)
		"####" I 1000 A_SetTics (CallACS("dump3_casingstime"))
		"####" I 1 A_FadeTo(0, 0.01, 1)
		Wait
	FadeOut2:
		"####" A 0 A_Jump (128, 2)
		"####" A 0 A_SetScale (scalex - (scalex * 2), scaley)
		"####" J 1000 A_SetTics (CallACS("dump3_casingstime"))
		"####" J 1 A_FadeTo(0, 0.01, 1)
		Wait
	}
}

ACTOR DUMP39mmCasingSpawner
{
  Radius 4
  Height 4
  Speed 20
  Damage 0
  Projectile
  +THRUACTORS
  +NOCLIP
  +CLIENTSIDEONLY
  States
  {
  Spawn:
    TNT1 A 1
  Death:
    TNT1 A 0 A_SpawnItemEx("DUMP39mmCasing",0,0,0, frandom(7,8),frandom(2.5,1.5),frandom(3,5), frandom(-55,-80), SXF_NOCHECKPOSITION)
    Stop
  }
}

ACTOR DUMP39mmCasingSpawner2 : DUMP39mmCasingSpawner
{
  States
  {
  Spawn:
    TNT1 A 1
  Death:
    TNT1 A 0 A_SpawnItemEx("DUMP39mmCasing",0,0,0, frandom(7,8),frandom(-2.5,-1.5),frandom(3,5), frandom(55,80), SXF_NOCHECKPOSITION)
    Stop
  }
}

ACTOR DUMP3ShellCasing : DUMP39mmCasing
{
	BounceSound "casings/shell"
	WallBounceSound "casings/shell"
	Scale 0.13
	States
	{
	Spawn:
		12GS ABCDEFGH 2
		"####" A 0 A_JumpIf(waterlevel >= 1, 1)
		Loop
		"####" I 1 A_FadeTo(0, 0.1, 1)
		Loop
	}
}

ACTOR DUMP3ShellCasingSpawner : DUMP39mmCasingSpawner
{
  States
  {
  Spawn:
    TNT1 A 1
  Death:
    TNT1 A 0 A_SpawnItemEx("DUMP3ShellCasing",0,0,0, frandom(7,8),frandom(-2.5,-1.5),frandom(3,5), frandom(75,110), SXF_NOCHECKPOSITION)
    Stop
  }
}

ACTOR DUMP3ShellCasingSpawner2 : DUMP39mmCasingSpawner
{
  States
  {
  Spawn:
    TNT1 A 1
  Death:
    TNT1 A 0 A_SpawnItemEx("DUMP3ShellCasing",0,0,0, frandom(7,8),frandom(1.5,2.5),frandom(-3,-5), frandom(-140,-180), SXF_NOCHECKPOSITION)
    Stop
  }
}

ACTOR DUMP3ShellCasingSpawner3 : DUMP39mmCasingSpawner
{
  States
  {
  Spawn:
    TNT1 A 1
  Death:
    TNT1 A 0 A_SpawnItemEx("DUMP3ShellCasing",0,0,0, frandom(7,8),frandom(-2.5,-1.5),frandom(3,5), frandom(-75,-110), SXF_NOCHECKPOSITION)
    Stop
  }
}

ACTOR DUMP3ShellCasingSpawner4 : DUMP39mmCasingSpawner
{
  States
  {
  Spawn:
    TNT1 A 1
  Death:
    TNT1 A 0 A_SpawnItemEx("DUMP3ShellCasing",0,0,0, frandom(7,8),frandom(-2.5,-1.5),frandom(-3,-5), frandom(-220,-180), SXF_NOCHECKPOSITION)
    Stop
  }
}

ACTOR DUMP3556mmCasing : DUMP39mmCasing
{
	BounceSound "casings/chaingun"
	WallBounceSound "casings/chaingun"
	Scale 0.2
	States
	{
	Spawn:
		556C ABCDEFGH 2
		"####" A 0 A_JumpIf(waterlevel >= 1, 1)
		Loop
		"####" I 1 A_FadeTo(0, 0.1, 1)
		Loop
	}
}

ACTOR DUMP3556mmCasingSpawner : DUMP39mmCasingSpawner
{
  States
  {
  Spawn:
    TNT1 A 1
  Death:
    TNT1 A 0 A_SpawnItemEx("DUMP3556mmCasing",0,0,0, frandom(7,8),frandom(2.5,1.5),frandom(3,5), frandom(-55,-80), SXF_NOCHECKPOSITION)
    Stop
  }
}

ACTOR DUMP3556mmCasingSpawner2 : DUMP39mmCasingSpawner
{
  States
  {
  Spawn:
    TNT1 A 1
  Death:
    TNT1 A 0 A_SpawnItemEx("DUMP3556mmCasing",0,0,0, frandom(7,8),frandom(-2.5,-1.5),frandom(3,5), frandom(55,80), SXF_NOCHECKPOSITION)
    Stop
  }
}

ACTOR DUMP3CokeBottleCasing : DUMP39mmCasing
{
	BounceSound "casings/chaingun"
	WallBounceSound "casings/chaingun"
	Scale 0.35
	States
	{
	Spawn:
		556C ABCDEFGH 2
		"####" A 0 A_JumpIf(waterlevel >= 1, 1)
		Loop
		"####" I 1 A_FadeTo(0, 0.1, 1)
		Loop
	}
}

ACTOR DUMP3CokeBottleCasingSpawner : DUMP39mmCasingSpawner
{
  States
  {
  Spawn:
    TNT1 A 1
  Death:
    TNT1 A 0 A_SpawnItemEx("DUMP3CokeBottleCasing",0,0,0, frandom(7,8),frandom(2.5,1.5),frandom(3,5), frandom(-55,-80), SXF_NOCHECKPOSITION)
    Stop
  }
}

ACTOR DUMP3FlakShellCasing : DUMP39mmCasing // Sprite loosely based on the Flak Cannon shell from Unreal Tournament
{
	BounceSound "casings/flak"
	WallBounceSound "casings/flak"
	BounceFactor 0.5 // 0.25
	WallBounceFactor 0.75 // 0.075
	BounceCount 2
	Mass 5
	Radius 5
	Height 9
	Scale 0.45 //0.2225
	States
	{
	Spawn:
		FLAK ABCDEFGH 2
		"####" A 0 A_JumpIf(waterlevel >= 1, 1)
		Loop
		"####" I 1 A_FadeTo(0, 0.1, 1)
		Loop
	}
}

ACTOR DUMP3FlakShellCasingSpawner : DUMP39mmCasingSpawner
{
  States
  {
  Spawn:
    TNT1 A 1
  Death:
    TNT1 A 0 A_SpawnItemEx("DUMP3FlakShellCasing",0,0,0, frandom(1.5,2.5),frandom(-2.5,2.5),frandom(-3,-5), frandom(-140,-180), SXF_NOCHECKPOSITION)
    Stop
  }
}

ACTOR DUMP3GunSmoke
{
	PROJECTILE
	-MISSILE // This caused smoke to become invisible unless the player's gun was level
	+DONTSPLASH
	+THRUACTORS
	+FORCEXYBILLBOARD
	+CLIENTSIDEONLY
	Speed 20
	Radius 3
	Height 3
	RenderStyle Translucent
	Alpha 0.25
	Scale 0.3
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 A_ScaleVelocity (0.01)
		TNT1 A 0 A_SetScale (scalex * frandom(0.08,0.14))
		TNT1 A 0 A_Jump (128, 2)
		TNT1 A 0 A_SetScale (scalex - (scalex * 2), scaley)
		SMOK ABCDEFGHIJKLMNOPQ 1 A_FadeTo(0, 0.01, 1)
		Stop
	}
}

ACTOR DUMP3GunSmokeSpawner : DUMP39mmCasingSpawner
{
  Speed 7
  States
  {
  Spawn:
    TNT1 A 1
//	TNT1 A 0 A_SetPitch (velz, 0)
  Death:
    TNT1 A 0 A_SpawnItemEx("DUMP3GunSmoke",0,0,0, velx,vely+frandom(-0.2,0.2),velz, 0, SXF_NOCHECKPOSITION | SXF_ABSOLUTEVELOCITY)
    TNT1 AA 0 A_SpawnItemEx("DUMP3GunSmoke",0,0,0, velx+frandom(0.2,0.2),vely+frandom(-0.2,0.2),velz, 0, SXF_NOCHECKPOSITION | SXF_ABSOLUTEVELOCITY)
    Stop
  }
}
