ACTOR 64DoomPlayer2 : DoomPlayer REPLACES DoomPlayer
{
	Height 64 // DEFAULT IS 56
	Radius 18 // DOOM 64 IS 19, DEFAULT IS 16
	Gravity 0.7 // DEFAULT IS 1.0
	
	Player.StartItem "IsPlaying", 1
	Player.StartItem "64Pistol"
	Player.StartItem "64Clip", 50
	Player.StartItem "64Fist"
	
	Player.ForwardMove 0.7, 0.9 // DEFAULT IS 1 FOR BOTH
	Player.SideMove 0.7, 0.9 // DEFAULT IS 1 FOR BOTH
	Player.ViewHeight 56 // DOOM 64 HEIGHT IS 56, DEFAULT IS 41
	Player.AttackZOffset 16 // LEVEL SHOTS 22 AT 56 HEIGHT, DOOM 64 IS 16-20, DEFAULT IS 0
	
	Player.WeaponSlot 1, "64Chainsaw", "64Fist"
	Player.WeaponSlot 2, "64Pistol"
	Player.WeaponSlot 3, "64Shotgun", "64SuperShotgun"
	Player.WeaponSlot 4, "64AssaultRifle", "64Chaingun", "64Minigun"
	Player.WeaponSlot 5, "64RocketLauncher", "64GrenadeLauncher"
	Player.WeaponSlot 6, "64Nailgun", "64PlasmaRifle", "64Railgun"
	Player.WeaponSlot 7, "64BFG9000", "64BFG10k"
	Player.WeaponSlot 8, "64Unmaker", "64Raiden"
	
	+PLAYERPAWN.NOTHRUSTWHENINVUL
	
	States
	{
		Pain.Vertigo:
			PLAY G 0 ThrustThingZ(0, 55, 0, 0)
			PLAY G 4 A_Pain
			Goto Spawn
		Death:
			PLAY H 10
			PLAY I 10 A_PlayerScream
			PLAY J 10 A_NoBlocking
			PLAY KL 8
			PLAY M -1
			Stop
		XDeath:
			PLAY O 5
			PLAY P 5 A_XScream
			PLAY Q 5 A_NoBlocking
			PLAY RSTU 5
			PLAY V -1
			Stop
		Crush:
			A027 A 0
			A027 A 0 A_PlaySound("misc/gibbed")
			A027 A -1
			Stop
	}
}

ACTOR 64Nailgun : Weapon 16033
{
	//$Color 14
	//$NotAngled
	//$Sprite NLGPA0
	//$Category Doom64ThingsVoid
	Scale 1.3
	Radius 20
	Height 25
	Weapon.SlotNumber 6
	Weapon.SelectionOrder 600
	Weapon.AmmoUse 1
	Weapon.AmmoGive 20
	Weapon.AmmoType "64NailAmmo"
	Inventory.PickupMessage "$GOTNAILGUN"
	Inventory.PickupSound "misc/w_pkup"
	Obituary "$OB_NAILGUN"
	Tag "$TAG_NAILGUN"
	AttackSound "NULL"
	+DONTGIB
	
	States
	{
		Spawn:
			NLGP A -1
			Stop
		Ready:
			NLGN A 1 A_WeaponReady
			Loop
		Deselect:
			NLGN A 0 A_Lower
			NLGN A 1 A_Lower
			Loop
		Select:
			NLGN A 0 A_Raise
			NLGN A 1 A_Raise
			Loop
		Fire:
		NLGN E 0 A_GunFlash
		NLGN E 0 A_PlayWeaponSound("nailgun/fire")
		NLGN A 0 A_FireCustomMissile("DummyProjectile1", 0, 0, 0, 0, 0, 0)
		TNT1 A 0 A_FireCustomMissile ("64NailShot", 0, 1, random(3,5), 0, 0, 0)
		NLGN A 0 A_SetPitch (pitch-2)
		NLGN B 1 BRIGHT
		NLGN H 1 BRIGHT A_SetPitch (pitch+0.45)
		NLGN CD 1 A_SetPitch (pitch+0.45)
		NLGN A 1 A_SetPitch (pitch+0.45)
		NLGN A 0 a_checkreload
		
		NLGN E 0 A_GunFlash
		NLGN E 0 A_PlayWeaponSound("nailgun/fire")
		NLGN A 0 A_FireCustomMissile("DummyProjectile1", 0, 0, 0, 0, 0, 0)
		TNT1 A 0 A_FireCustomMissile ("64NailShot", 0, 1, random(-5,-3), 0, 0, 0)
		NLGN A 0 A_SetPitch (pitch-2)
		NLGN E 1 BRIGHT
		NLGN I 1 BRIGHT A_SetPitch (pitch+0.45)
		NLGN FG 1 A_SetPitch (pitch+0.45)
		NLGN A 1 A_SetPitch (pitch+0.45)
		NLGN A 0 A_ReFire
		NLGN AA 1 A_SetPitch (pitch+0.2)
		Goto Ready
		Flash:
			TNT1 A 1
			Goto LightDone
	}
}

ACTOR 64NailShot : FastProjectile
{
	Damage 6
	Speed 70
	Radius 4
	Height 4
	XScale 0.30
	YScale 0.40
	Alpha 1
	Renderstyle Normal
	SeeSound "NULL"
	DeathSound "NULL"
	Decal "BulletChip"
	Obituary "$OB_NAILGUN"
	HitObituary "$OB_NAILGUN"
	PROJECTILE
	+FORCEXYBILLBOARD
	-BLOODLESSIMPACT
	+BLOODSPLATTER
	+NODAMAGETHRUST
	+NOEXTREMEDEATH
	
	States
	{
		Spawn:
			DART AA 1
			Loop
		Death:
			TNT1 A 0 A_SpawnItemEx("64BulletPuff", 0, 0, 0, 0, 0, 0, 0, 0, 0)
			TNT1 A 0 A_PlaySound("nail/hitworld", CHAN_BODY, 1, 0, ATTN_NORM)
			TNT1 A 1
			Stop
		XDeath:
			TNT1 A 0 A_PlaySound("nail/hitbody", CHAN_BODY, 0.8, 0, ATTN_NORM)
			TNT1 A 1
			Stop
		Crash:
			TNT1 A 0 A_SpawnItemEx("64BulletPuff", 0, 0, 0, 0, 0, 0, 0, 0, 0)
			TNT1 A 0 A_PlaySound("nail/hitworld", CHAN_BODY, 1, 0, ATTN_NORM)
			TNT1 A 1
			Stop
	}
}

ACTOR 64NailAmmo : Ammo 16034
{
	//$Color 6
	//$NotAngled
	//$Category Doom64ThingsVoid
	Radius 20
	Height 25
	Scale 1.4
	Inventory.PickupMessage "$GOTNAILS"
	Inventory.PickupSound "misc/i_pkup"
	Inventory.Icon "NLBXA0"
	Inventory.Amount 30
	Inventory.MaxAmount 100
	Ammo.BackpackAmount 20
	Ammo.BackpackMaxAmount 200
	+DONTGIB
	
	States
	{
		Spawn:
			NLBX A -1
			Stop
	}
}

//Sprite From Skulltag
ACTOR Minigun : Weapon 16035
{
	Weapon.AmmoType "Clip" 
	Weapon.AmmoGive 20
	Weapon.AmmoUse 1
	Weapon.SlotNumber 4
	Weapon.Selectionorder 700
	Weapon.Kickback 100
	Inventory.PickupMessage "$PICKUP_MINIGUN"
	Obituary "$OB_MINIGUN"
	AttackSound "weapons/minigun"
	Radius 20
	Height 16
	States
	{
	Spawn:
		MNGN A -1
		Loop
	Ready:
		MNGG A 1 A_WeaponReady
		Loop
	Deselect:
		MNGG A 1 A_Lower
		Loop
	Select: 
		MNGG A 1 A_Raise 
		Loop 
	Fire: 
		MNGG A 0 A_GunFlash
		MNGG A 2 A_FireBullets(5.6, 0, 1, 5, "64BulletPuff")
		MNGG B 2 A_FireBullets(5.6, 0, 1, 5, "64BulletPuff")
		MNGG A 2 A_ReFire
		MNGG B 2
		MNGG A 4
		MNGG B 4
		MNGG A 8
		MNGG B 8
		goto Ready 
	Flash: 
		MNGF A 3 BRIGHT A_Light1 
		MNGF B 3 BRIGHT A_Light0
		Stop 
	}
}

//Sprite From Doom 64 Skulltag Stuff
actor 64Minigun : Minigun Replaces Minigun
{
  //$Color 14
  //$NotAngled
  //$Sprite MNGNA0
  //$Category Doom64ThingsVoid
  Decal "BulletChip"
  +DONTGIB
  states
  {
	Ready:
		TNT1 A 0 A_JumpIf(CallACS("ClassicAnims") == 1, "ClassicReady")
		MNGG A 1 A_WeaponReady
		Loop
	ClassicReady:
		TNT1 A 0 A_JumpIf(CallACS("ClassicAnims") == 0, "Ready")
		CMNG A 1 A_WeaponReady
		Loop
	Deselect:
		TNT1 A 0 A_JumpIf(CallACS("ClassicAnims") == 1, "ClassicDeselect")
		MNGG A 1 A_Lower
		Loop
	ClassicDeselect:
		TNT1 A 0 A_JumpIf(CallACS("ClassicAnims") == 0, "Deselect")
		CMNG A 1 A_Lower
		Loop
	Select: 
		TNT1 A 0 A_JumpIf(CallACS("ClassicAnims") == 1, "ClassicSelect")
		MNGG A 1 A_Raise 
		Loop 
	ClassicSelect: 
		TNT1 A 0 A_JumpIf(CallACS("ClassicAnims") == 0, "Select")
		CMNG A 1 A_Raise 
		Loop 
	Fire: 
		TNT1 A 0 A_JumpIf(CallACS("ClassicAnims") == 1, "ClassicFire")
		TNT1 A 0 A_JumpIf(CallACS("DropCasings") == 1, "CasingsFire")
		MNGG A 0 A_GunFlash
		MNGG A 0 A_FireCustomMissile("DummyProjectile2", 0, 0, 0, 0, 0, 0)
		MNGG A 1 A_FireBullets(5.6, 0, 1, 5, "64BulletPuff")
		MNGG A 0 A_FireCustomMissile("DummyProjectile2", 0, 0, 0, 0, 0, 0)
		MNGG B 1 A_FireBullets(5.6, 0, 1, 5, "64BulletPuff")
		MNGG A 1 A_SetPitch(pitch-1.0)
		MNGG B 1 A_SetPitch(pitch+0.6)
		MNGG B 1 A_SetPitch(pitch+0.4)
		MNGG A 0 A_ReFire
		MNGG ABAB 1 A_WeaponReady
		MNGG ABAB 2 A_WeaponReady
		MNGG ABAB 3 A_WeaponReady
		goto Ready 
	ClassicFire: 
		TNT1 A 0 A_JumpIf(CallACS("DropCasings") == 1, "ClassicCasingsFire")
		CMNG A 0 A_GunFlash
		CMNG A 0 A_FireCustomMissile("DummyProjectile2", 0, 0, 0, 0, 0, 0)
		CMNG A 1 A_FireBullets(5.6, 0, 1, 5, "64BulletPuff")
		CMNG A 0 A_FireCustomMissile("DummyProjectile2", 0, 0, 0, 0, 0, 0)
		CMNG B 1 A_FireBullets(5.6, 0, 1, 5, "64BulletPuff")
		CMNG A 1 A_SetPitch(pitch-1.0)
		CMNG B 1 A_SetPitch(pitch+0.6)
		CMNG B 1 A_SetPitch(pitch+0.4)
		CMNG A 0 A_ReFire
		goto ClassicReady 
	CasingsFire: 
		MNGG A 0 A_GunFlash
		MNGG A 0 A_FireCustomMissile("DummyProjectile2", 0, 0, 0, 0, 0, 0)
		MNGG A 1 A_FireBullets(5.6, 0, 1, 5, "64BulletPuff")
		TNT1 A 0 A_SpawnItemEx("BulletCasing", 12, 0, 35, Random(3, 4), Random(7, 8), Random(7, 9), 0)
		MNGG A 0 A_FireCustomMissile("DummyProjectile2", 0, 0, 0, 0, 0, 0)
		MNGG B 1 A_FireBullets(5.6, 0, 1, 5, "64BulletPuff")
		TNT1 A 0 A_SpawnItemEx("BulletCasing", 12, 0, 35, Random(3, 4), Random(7, 8), Random(7, 9), 0)
		MNGG A 1 A_SetPitch(pitch-1.0)
		MNGG B 1 A_SetPitch(pitch+0.6)
		MNGG B 1 A_SetPitch(pitch+0.4)
		MNGG A 0 A_ReFire
		MNGG ABAB 1 A_WeaponReady
		MNGG ABAB 2 A_WeaponReady
		MNGG ABAB 3 A_WeaponReady
		goto Ready 
	ClassicCasingsFire: 
		CMNG A 0 A_GunFlash
		CMNG A 0 A_FireCustomMissile("DummyProjectile2", 0, 0, 0, 0, 0, 0)
		CMNG A 1 A_FireBullets(5.6, 0, 1, 5, "64BulletPuff")
		TNT1 A 0 A_SpawnItemEx("BulletCasing", 12, 0, 35, Random(3, 4), Random(7, 8), Random(7, 9), 0)
		CMNG A 0 A_FireCustomMissile("DummyProjectile2", 0, 0, 0, 0, 0, 0)
		CMNG B 1 A_FireBullets(5.6, 0, 1, 5, "64BulletPuff")
		TNT1 A 0 A_SpawnItemEx("BulletCasing", 12, 0, 35, Random(3, 4), Random(7, 8), Random(7, 9), 0)
		CMNG A 1 A_SetPitch(pitch-1.0)
		CMNG B 1 A_SetPitch(pitch+0.6)
		CMNG B 1 A_SetPitch(pitch+0.4)
		CMNG A 0 A_ReFire
		goto ClassicReady 
    Flash: 
    MNGF AB 3 BRIGHT
    Stop 
  }
}

//Sprite From Skulltag
ACTOR GrenadeLauncher : DoomWeapon 16036
{
	Radius 20
	Height 16
	Weapon.Selectionorder 2500
	Weapon.SlotNumber 5
	+WEAPON.NOAUTOFIRE
	+WEAPON.NOAUTOAIM
	Weapon.AmmoUse 1
	Weapon.AmmoGive 2
	Weapon.AmmoType "RocketAmmo"
	Weapon.Kickback 100
	Inventory.PickupMessage "$PICKUP_GRENADELAUNCHER"

	// action native A_FireSTGrenade (); // de-nativized in ZDoom

	States
	{
	Spawn:
		GLAU A -1
		stop
	Ready:
		GRLG A 1 A_WeaponReady
		loop
	Deselect:
		GRLG A 1 A_Lower
		loop
	Select: 
		GRLG A 1 A_Raise
		loop
	Fire: 
		GRLG B 8 A_GunFlash
		GRLG B 12 A_FireSTGrenade
		GRLG B 0 A_ReFire
		goto Ready 
	Flash: 
		GRLF A	3 bright A_Light1
		GRLF B	4 bright
		GRLF C 4 bright A_Light2
		GRLF D 4 bright A_Light2
		Goto LightDone
	}

}

//Sprite From Doom 64 Skulltag Stuff
actor 64GrenadeLauncher : GrenadeLauncher Replaces GrenadeLauncher
{
  //$Color 14
  //$NotAngled
  //$Sprite GLAUA0
  //$Category Doom64ThingsVoid
  +DONTGIB
  states
  {
    Fire: 
	TNT1 A 0 A_JumpIf(CallACS("ClassicAnims") == 1, "ClassicFire")
	GRLG B 0 A_FireCustomMissile("DummyProjectile4", 0, 0, 0, 0, 0, 0)
    GRLG B 8 A_GunFlash
    GRLG B 0 A_FireCustomMissile("64Grenade", 0, true, 0, 0, 0, 6.328125)
	GRLG B 0 A_SetPitch(pitch-1.0)
	GRLG A 2 A_SetPitch(pitch+0.5)
	GRLG A 10 A_SetPitch(pitch+0.5)
	GRLG A 3
    GRLG B 0 A_ReFire
    Goto Ready 
    ClassicFire: 
	GRLG B 0 A_FireCustomMissile("DummyProjectile4", 0, 0, 0, 0, 0, 0)
    GRLG B 8 A_GunFlash
    GRLG B 0 A_FireCustomMissile("64Grenade", 0, true, 0, 0, 0, 6.328125)
	GRLG B 0 A_SetPitch(pitch-1.0)
	GRLG B 2 A_SetPitch(pitch+0.5)
	GRLG B 10 A_SetPitch(pitch+0.5)
	GRLG B 3
    GRLG B 0 A_ReFire
    Goto Ready 
  Flash: 
    GRLF A 3 bright
    GRLF BCD 4 bright
    Goto LightDone
  }
}

//Sprite From Skulltag
ACTOR BFG10K : DoomWeapon 16037
{
	Radius 20
	Height 20
	Weapon.Selectionorder 2800
	Weapon.SlotNumber 7
	Weapon.AmmoUse 5
	Weapon.AmmoGive 40
	Weapon.AmmoType "Cell"
	Weapon.Kickback 100
	Inventory.Pickupmessage "$PICKUP_BFG10K"
	+WEAPON.NOAUTOFIRE
	+WEAPON.NOLMS
	States
	{
	Spawn:
		BFG2 A -1
		stop
	Ready:
		BG2G A 0 A_PlaySound ("weapons/bfg10kidle")
		BG2G A 1 A_WeaponReady
		BG2G A 1 A_WeaponReady
		BG2G A 1 A_WeaponReady
		BG2G B 1 A_WeaponReady
		BG2G B 1 A_WeaponReady
		BG2G B 1 A_WeaponReady
		BG2G C 1 A_WeaponReady
		BG2G C 1 A_WeaponReady
		BG2G C 1 A_WeaponReady
		BG2G D 1 A_WeaponReady
		BG2G D 1 A_WeaponReady
		BG2G D 1 A_WeaponReady
		loop
	Deselect:
		BG2G E 1 A_Lower
		loop
	Select:
		BG2G E 1 A_Raise
		loop
	Fire:
		BG2G E 20 A_PlaySound ("weapons/bfg10kf")
		BG2G F 4
		BG2G G 1
		BG2G H 1
		BG2G I 1
		BG2G J 1
		goto Hold
	Hold:
		BG2G K 2 A_GunFlash
		BG2G L 2 A_FireBullets(0,0,1,0,"BFG10kShot")
		BG2G M 2
		BG2G N 0 A_ReFire
		BG2G O 35 A_PlaySound ("weapons/bfg10kcool")
		goto Ready
	Flash:
		TNT1 A 2 bright A_Light1
		TNT1 A 3 bright
		Goto LightDone
		stop
	}
}

//Sprite From Doom 64 Skulltag Stuff
actor 64BFG10k : BFG10K replaces BFG10K
{
  //$Color 14
  //$NotAngled
  //$Sprite BFG2A0
  //$Category Doom64ThingsVoid
  states
  {
  Select:
	BG2G A 1 A_Raise
    loop
  Deselect:
	BG2G A 1 A_Lower
    loop
  Fire:
    BG2G A 20 bright A_PlaySound ("weapons/bfg10kf")
    BG2G A 7 bright
    BG2G E 1 bright A_SetBlend ("Green",0.75,14)
    Goto Hold
  Hold:
    BG2G F 2 bright A_GunFlash
    BG2G F 0 bright A_Recoil (1)
    BG2G G 2 bright A_FireBullets(0,0,1,0,"BFG10kShot")
    BG2G H 2 bright
    BG2G G 0 bright A_ReFire
    BG2G A 35 bright A_PlaySound ("weapons/bfg10kcool")
    Goto Ready
  Flash:
    TNT1 A 2 Bright
    TNT1 A 3 Bright
    Goto LightDone
    Stop
  }
}

//Sprite From Skulltag
ACTOR RailGun : DoomWeapon 16038
{
	Radius 20
	Height 16
	Weapon.Selectionorder 100
	Weapon.SlotNumber 6
	Weapon.AmmoUse 10
	Weapon.AmmoGive 40
	Weapon.AmmoType "Cell"
	Inventory.Pickupmessage "$PICKUP_RAILGUN"
	Obituary "$OB_RAILGUN"
	States
	{
	Ready:
		RLGG A 1 A_WeaponReady
		loop
	Deselect:
		RLGG A 1 A_Lower
		loop
	Select:
		RLGG A 1 A_Raise
		loop
	Fire: // states modified from the original
		RLGG E 12 A_FireRailgun
		RLGG F 6 A_CheckForReload(4, "Reloaded")
		RLGG GHIJK 6
		RLGG L 6 A_ResetReloadCounter
	Reloaded:
		RLGG A 6
		RLGG M 0 A_ReFire
		Goto Ready
	Flash:
		TNT1 A 5 bright A_Light1
		TNT1 A 5 bright A_Light2
		TNT1 A 0 bright A_Light0
		Goto LightDone
	Spawn:
		RAIL A -1
		stop
	}
}

//Sprite From Doom 64 Skulltag Stuff
actor 64Railgun : Railgun replaces Railgun
{
  //$Color 14
  //$NotAngled
  //$Sprite RAILA0
  //$Category Doom64ThingsVoid
  +DONTGIB
  states
  {
  Fire:
	TNT1 A 0 A_JumpIf(CallACS("ClassicAnims") == 1, "ClassicFire")
	RLGG B 0 BRIGHT A_FireCustomMissile("DummyProjectile3", 0, 0, 0, 0, 0, 0)
    RLGG B 12 bright A_FireRailgun
    RLGG J 4 A_CheckForReload(4, "Reloaded")
    RLGG I 4
    RLGG CHDEFGH 6
    RLGG I 4
    RLGG J 4 A_ResetReloadCounter
	Goto Ready
  ClassicFire:
	RLGG B 0 BRIGHT A_FireCustomMissile("DummyProjectile3", 0, 0, 0, 0, 0, 0)
    RLGG B 12 bright A_FireRailgun
    RLGG J 4 A_CheckForReload(4, "Reloaded")
    RLGG I 4
    RLGG CCCCCCC 6
    RLGG I 4
    RLGG J 4 A_ResetReloadCounter
	Goto Ready
  Reloaded:
    RLGG A 6
    RLGG K 0 A_ReFire
    Goto Ready
  Flash:
    TNT1 A 5 bright
    TNT1 A 5 bright
    TNT1 A 0 bright
    Goto LightDone
  }
}

//Sprite From Brutal Doom 64
ACTOR 64AssaultRifle : DoomWeapon 16039
{
   //$Color 14
   //$NotAngled
   //$Sprite RIFDA0
   //$Category Doom64ThingsVoid
   Attacksound "weapons/chngun"
   Weapon.SelectionOrder 700
   Weapon.SlotNumber 4
   Weapon.AmmoUse 1
   Weapon.AmmoGive 20
   Weapon.AmmoType "Clip"
   Inventory.PickupMessage "You got an assault rifle!"
   Obituary "%o was mowed down by %k's assault rifle."
   Tag "Assault Rifle"
   Decal "BulletChip"
   +DONTGIB
   States
   {
  Ready:
	TNT1 A 0 A_JumpIf(CallACS("ClassicAnims") == 1, "ClassicReady")
    RIFG A 1 A_WeaponReady
    loop
  ClassicReady:
	TNT1 A 0 A_JumpIf(CallACS("ClassicAnims") == 0, "Ready")
    RICG A 1 A_WeaponReady
    loop
  Deselect:
	TNT1 A 0 A_JumpIf(CallACS("ClassicAnims") == 1, "ClassicDeselect")
    RIFG A 1 A_Lower
    loop
  ClassicDeselect:
	TNT1 A 0 A_JumpIf(CallACS("ClassicAnims") == 0, "Deselect")
    RICG A 1 A_Lower
    loop
  Select:
	TNT1 A 0 A_JumpIf(CallACS("ClassicAnims") == 1, "ClassicSelect")
    RIFG A 1 A_Raise
    loop
  ClassicSelect:
	TNT1 A 0 A_JumpIf(CallACS("ClassicAnims") == 0, "Select")
    RICG A 1 A_Raise
    loop
  Fire:
	TNT1 A 0 A_JumpIf(CallACS("ClassicAnims") == 1, "ClassicFire")
	TNT1 A 0 A_JumpIf(CallACS("DropCasings") == 1, "CasingsFire")
    RIFF A 1
    RIFF A 2
    RIFF A 1 A_GunFlash
	RIFF A 0 A_FireCustomMissile("DummyProjectile1", 0, 0, 0, 0, 0, 0)
    RIFF B 2 A_FireBullets (2.0, 0, 1, 7, "64BulletPuff")
	RIFF B 1 A_SetPitch(pitch-0.8)
	RIFF B 1 A_SetPitch(pitch+0.2)
    RIFF B 0 A_ReFire
    Goto Ready
  CasingsFire:
    RIFF A 1
    RIFF A 2
    RIFF A 1 A_GunFlash
	RIFF A 0 A_FireCustomMissile("DummyProjectile1", 0, 0, 0, 0, 0, 0)
    RIFF B 2 A_FireBullets (2.0, 0, 1, 7, "64BulletPuff")
	TNT1 A 0 A_SpawnItemEx("BulletCasing", 12, 0, 35, Random(3, 4), Random(7, 8), Random(7, 9), 0)
	RIFF B 1 A_SetPitch(pitch-0.8)
	RIFF B 1 A_SetPitch(pitch+0.2)
    RIFF B 0 A_ReFire
    Goto Ready
  ClassicFire:
	TNT1 A 0 A_JumpIf(CallACS("DropCasings") == 1, "ClassicCasingsFire")
    RICF A 1
    RICF A 2
    RICF A 1 A_GunFlash("ClassicFlash")
	RICF A 0 A_FireCustomMissile("DummyProjectile1", 0, 0, 0, 0, 0, 0)
    RICF B 2 A_FireBullets (2.0, 0, 1, 7, "64BulletPuff")
	RICF B 1 A_SetPitch(pitch-0.8)
	RICF B 1 A_SetPitch(pitch+0.2)
    RICF B 0 A_ReFire
    Goto ClassicReady
  ClassicCasingsFire:
    RICF A 1
    RICF A 2
    RICF A 1 A_GunFlash("ClassicFlash")
	RICF A 0 A_FireCustomMissile("DummyProjectile1", 0, 0, 0, 0, 0, 0)
    RICF B 2 A_FireBullets (2.0, 0, 1, 7, "64BulletPuff")
	TNT1 A 0 A_SpawnItemEx("BulletCasing", 12, 0, 35, Random(3, 4), Random(7, 8), Random(7, 9), 0)
	RICF B 1 A_SetPitch(pitch-0.8)
	RICF B 1 A_SetPitch(pitch+0.2)
    RICF B 0 A_ReFire
    Goto ClassicReady
  Flash:
    RIFF A 3 bright A_Light1
    RIFF B 4 bright A_Light2
    RIFF B 0 bright A_Light0
    stop
  ClassicFlash:
    RICF A 3 bright A_Light1
    RICF B 4 bright A_Light2
    RICF B 0 bright A_Light0
    stop
  Spawn:
    RIFD A -1
    loop
   }
}

//Sprite From MetaDoom
ACTOR 64Raiden : DoomWeapon 16040
{
	//$Color 14
	//$NotAngled
	//$Sprite RAIAZ0
	//$Category Doom64ThingsVoid
	Radius 20
	Height 20
	Weapon.SelectionOrder 2900
	Weapon.SlotNumber 8
	Weapon.AmmoUse 1
	Weapon.AmmoGive 20
	Weapon.AmmoType "64ElectricCell"
	Inventory.PickupMessage "$GOTLASER"
	Inventory.PickupSound "misc/w_pkup"
	AttackSound "Null"
	Inventory.Icon "RAIAZ0"
	Tag "Raiden"
	-WEAPON.NOAUTOFIRE
	+DONTGIB
	
	States
	{
		Spawn:
			RAIA Z -1
			Loop
		Ready:
			RAIA A 1 A_WeaponReady
			Loop
		Deselect:
			RAIA A 0 A_Lower
			RAIA A 1 A_Lower
			Loop
		Select:
			RAIA A 0 A_Raise
			RAIA A 1 A_Raise
			Loop
		Fire:
			// No upgrade level = standard single shot (10 tics)
			// First upgrade level = faster single shot (5 tics)
			// Second upgrade level = two beams that fire close together
			// Third upgrade level = beams fire outward from middle, 4 each side
			
			RAIA A 0 A_JumpIfInventory("RaidenUpgrades", 1, "FireUpgradeOne")
			RAIA A 0 A_GunFlash
			RAIA A 0 A_PlaySound("weapons/unmaker", CHAN_AUTO, 0.8, 0, ATTN_NORM)
			RAIA A 3 A_FireCustomMissile("RaidenLaser")
			RAIA A 7
			RAIA A 0 A_ReFire
			Goto Ready
		FireUpgradeOne: // This will be used if the player has one upgrade
			RAIA A 0 A_JumpIfInventory("RaidenUpgrades", 2, "FireUpgradeTwo")
			RAIA A 0 A_GunFlash
			RAIA A 0 A_PlaySound("weapons/unmaker", CHAN_AUTO, 0.8, 0, ATTN_NORM)
			RAIA A 3 A_FireCustomMissile("RaidenLaser")
			RAIA A 2
			RAIA A 0 A_ReFire
			Goto Ready
		FireUpgradeTwo: // This will be used if the player has two upgrades
			RAIA A 0 A_JumpIfInventory("RaidenUpgrades", 3, "FireUpgradeThree")
			RAIA A 0 A_GunFlash
			RAIA A 0 A_PlaySound("weapons/unmaker", CHAN_AUTO, 0.8, 0, ATTN_NORM)
			RAIA A 0 A_FireCustomMissile("RaidenLaser", 1.0)
			RAIA A 0 A_JumpIfNoAmmo(3) //3
			RAIA A 0 A_FireCustomMissile("RaidenLaser", -1.0)
			RAIA A 3
			RAIA A 2
			RAIA A 0 A_ReFire
			Goto Ready
		FireUpgradeThree: // This will be used if the player has three upgrades
			RAIA A 0 A_GunFlash
			RAIA A 0 A_PlaySound("weapons/unmaker", CHAN_AUTO, 0.8, 0, ATTN_NORM)
			RAIA A 0 A_FireCustomMissile("RaidenLaser")
			RAIA A 0 A_JumpIfNoAmmo(5) //5
			RAIA A 0 A_FireCustomMissile("RaidenLaser", 2.0)
			RAIA A 0 A_JumpIfNoAmmo(3) //3
			RAIA A 0 A_FireCustomMissile("RaidenLaser", -2.0)
			RAIA A 3
			RAIA A 2
			RAIA A 0 A_ReFire("Hold1")
			Goto Ready
		Hold1: // Move laser outward if held for more shots
			RAIA A 0 A_GunFlash
			RAIA A 0 A_PlaySound("weapons/unmaker", CHAN_AUTO, 0.8, 0, ATTN_NORM)
			RAIA A 0 A_FireCustomMissile("RaidenLaser")
			RAIA A 0 A_JumpIfNoAmmo(5) //5
			RAIA A 0 A_FireCustomMissile("RaidenLaser", 3.5)
			RAIA A 0 A_JumpIfNoAmmo(3) //3
			RAIA A 0 A_FireCustomMissile("RaidenLaser", -3.5)
			RAIA A 3
			RAIA A 2
			RAIA A 0 A_ReFire("Hold2")
			Goto Ready
		Hold2:
			RAIA A 0 A_GunFlash
			RAIA A 0 A_PlaySound("weapons/unmaker", CHAN_AUTO, 0.8, 0, ATTN_NORM)
			RAIA A 0 A_FireCustomMissile("RaidenLaser")
			RAIA A 0 A_JumpIfNoAmmo(5) //5
			RAIA A 0 A_FireCustomMissile("RaidenLaser", 5.0)
			RAIA A 0 A_JumpIfNoAmmo(3) //3
			RAIA A 0 A_FireCustomMissile("RaidenLaser", -5.0)
			RAIA A 3
			RAIA A 2
			RAIA A 0 A_ReFire("Hold3")
			Goto Ready
		Hold3:
			RAIA A 0 A_GunFlash
			RAIA A 0 A_PlaySound("weapons/unmaker", CHAN_AUTO, 0.8, 0, ATTN_NORM)
			RAIA A 0 A_FireCustomMissile("RaidenLaser")
			RAIA A 0 A_JumpIfNoAmmo(5) //5
			RAIA A 0 A_FireCustomMissile("RaidenLaser", 6.5)
			RAIA A 0 A_JumpIfNoAmmo(3) //3
			RAIA A 0 A_FireCustomMissile("RaidenLaser", -6.5)
			RAIA A 3
			RAIA A 2
			RAIA A 0 A_CheckReload //A_ReFire("Hold4")
			Goto Ready
		Hold4: // Original Unmaker only fires 4 on each side, this adds a 5th
			RAIA A 0 A_GunFlash
			RAIA A 0 A_PlaySound("weapons/unmaker", CHAN_AUTO, 0.8, 0, ATTN_NORM)
			RAIA A 0 A_FireCustomMissile("RaidenLaser")
			RAIA A 0 A_JumpIfNoAmmo(5) //5
			RAIA A 0 A_FireCustomMissile("RaidenLaser", 8.0)
			RAIA A 0 A_JumpIfNoAmmo(3) //3
			RAIA A 0 A_FireCustomMissile("RaidenLaser", -8.0)
			RAIA A 3
			RAIA A 2
			RAIA A 0 A_CheckReload
			Goto Ready
		Flash:
			RAIA B 3 BRIGHT A_Light1
			Goto LightDone
	}
}

ACTOR 64ElectricCell : Ammo 16041
{
  //$Color 6
  //$NotAngled
  //$Category Doom64ThingsVoid
  Inventory.PickupMessage "Picked up an electric cell."
  Inventory.Amount 20
  Inventory.MaxAmount 150
  Ammo.BackpackAmount 20
  Ammo.BackpackMaxAmount 300
  Inventory.Icon "CEL2A0"
  States
  {
  Spawn:
    CEL2 A -1
    Stop
  }
}

ACTOR RaidenUpgrades : Inventory
{
	Game Doom
	+UNDROPPABLE
	Inventory.MaxAmount 3
}

ACTOR RaidenUpgrade1Icon : Inventory
{
	Game Doom
	+UNDROPPABLE
	Inventory.MaxAmount 1
}

ACTOR RaidenUpgrade2Icon : Inventory
{
	Game Doom
	+UNDROPPABLE
	Inventory.MaxAmount 1
}

ACTOR RaidenUpgrade3Icon : Inventory
{
	Game Doom
	+UNDROPPABLE
	Inventory.MaxAmount 1
}

ACTOR 64RaidenUpgrade1 : CustomInventory 16042
{
	//$Color 19
	//$NotAngled
	//$Category Doom64ThingsVoid
	Inventory.Amount 1
	Inventory.MaxAmount 1
	Inventory.InterHubAmount 1
	Inventory.Icon "ART4A0"
	Inventory.PickupMessage "$GOTARTIFACT1"
	Inventory.PickupSound "misc/i_pkup"
	+DONTGIB
	+COUNTITEM
	-INTERHUBSTRIP
	
	States
	{
		Spawn:
			ART4 ABCDEDCB 5 BRIGHT
			Loop
		Pickup:
			TNT1 A 0 A_JumpIfInventory("RaidenUpgrade1Icon", 1, "AlreadyTaken")
			TNT1 A 0 A_GiveInventory("RaidenUpgrades", 1)
			TNT1 A 0 A_GiveInventory("RaidenUpgrade1Icon", 1)
			Stop
		AlreadyTaken:
			TNT1 A 0
			Fail
	}
}

ACTOR 64RaidenUpgrade2 : CustomInventory 16043
{
	//$Color 5
	//$NotAngled
	//$Category Doom64ThingsVoid
	Inventory.Amount 1
	Inventory.MaxAmount 1
	Inventory.InterHubAmount 1
	Inventory.Icon "ART5A0"
	Inventory.PickupMessage "$GOTARTIFACT2"
	Inventory.PickupSound "misc/i_pkup"
	+DONTGIB
	+COUNTITEM
	-INTERHUBSTRIP
	
	States
	{
		Spawn:
			ART5 ABCDEDCB 5 BRIGHT
			Loop
		Pickup:
			TNT1 A 0 A_JumpIfInventory("RaidenUpgrade2Icon", 1, "AlreadyTaken")
			TNT1 A 0 A_GiveInventory("RaidenUpgrades", 1)
			TNT1 A 0 A_GiveInventory("RaidenUpgrade2Icon", 1)
			Stop
		AlreadyTaken:
			TNT1 A 0
			Fail
	}
}

ACTOR 64RaidenUpgrade3 : CustomInventory 16044
{
	//$Color 3
	//$NotAngled
	//$Category Doom64ThingsVoid
	Inventory.Amount 1
	Inventory.MaxAmount 1
	Inventory.InterHubAmount 1
	Inventory.Icon "ART6A0"
	Inventory.PickupMessage "$GOTARTIFACT3"
	Inventory.PickupSound "misc/i_pkup"
	+DONTGIB
	+COUNTITEM
	-INTERHUBSTRIP
	
	States
	{
		Spawn:
			ART6 ABCDEDCB 5 BRIGHT
			Loop
		Pickup:
			TNT1 A 0 A_JumpIfInventory("RaidenUpgrade3Icon", 1, "AlreadyTaken")
			TNT1 A 0 A_GiveInventory("RaidenUpgrades", 1)
			TNT1 A 0 A_GiveInventory("RaidenUpgrade3Icon", 1)
			Stop
		AlreadyTaken:
			TNT1 A 0
			Fail
	}
}

actor RSCell : RandomSpawner replaces Cell
{
    DropItem "64Cell" 255 70
    DropItem "64NailAmmo" 255 40
    DropItem "64ElectricCell" 255 30
}

actor RSPlasmaRifle : RandomSpawner replaces PlasmaRifle
{
    DropItem "64PlasmaRifle" 255 70
    DropItem "64Railgun" 255 30
}

actor RSChaingun : RandomSpawner replaces Chaingun
{
    DropItem "64Chaingun" 255 70
    DropItem "64Minigun" 255 40
}

actor RSRocketLauncher : RandomSpawner replaces RocketLauncher
{
    DropItem "64RocketLauncher" 255 70
    DropItem "64GrenadeLauncher" 255 40
}

actor RSBFG9000 : RandomSpawner replaces BFG9000
{
    DropItem "64BFG9000" 255 70
    DropItem "64BFG10k" 255 40
    DropItem "64Raiden" 255 30
}