ACTOR SaturnV : RocketLauncher Replaces RocketLauncher
{
	Weapon.SelectionOrder 2500
	Weapon.SlotNumber 5
	Weapon.AmmoType "RocketAmmo"
	Weapon.AmmoGive 6
	Weapon.AmmoUse 1
	Weapon.AmmoType2 "RocketRounds"
	Weapon.AmmoUse2 1
    +WEAPON.NOALERT
    +WEAPON.AMMO_CHECKBOTH
	Inventory.PickupMessage "You got the Saturn V!"
	Inventory.PickupSound "weapons/fist/swing"
	Obituary "%o was sent to the moon by %k's Saturn Rocket"
	Tag "Saturn V"
	Weapon.BobStyle "Smooth"
	Weapon.BobSpeed 2.0
	Weapon.BobRangeX 0.30
	Weapon.BobRangeY 0.40
	Scale 1.1
	States
	{
	Ready:
		SATV A 1 Offset(55,100) A_PlaySound("weapons/launcher/ready")
		SATV A 1 Offset(50,95)
		SATV A 1 Offset(45,90)
		SATV A 1 Offset(40,85)
		SATV A 1 Offset(35,80)
		SATV A 1 Offset(30,75)
		SATV A 1 Offset(25,70)
		SATV A 1 Offset(20,65)
		SATV A 1 Offset(15,60)
		SATV A 1 Offset(10,55)
		SATV A 1 Offset(5,50)
		SATV A 1 Offset(4,45)
		SATV A 1 Offset(3,40)
		SATV A 1 Offset(2,35)
		SATV A 1 Offset(1,32)
	ReadyII:
		TNT1 A 0 A_JumpIfInventory("RocketRounds",0,2)
		TNT1 A 0 A_JumpIfInventory("RocketAmmo",1,2)
		SATV A 1 A_WeaponReady
		Loop
		SATV A 1 A_WeaponReady (WRF_ALLOWRELOAD)
		Loop
	Select:
		SATV A 0 A_Raise
		Loop
	Deselect:
		SATV A 1 Offset(10,40)
		SATV A 1 Offset(15,55)
		SATV A 1 Offset(20,75)
		SATV A 1 Offset(25,100)
		SATV A 1 Offset(30,130)
		SATV A 0 A_Lower
		Wait
		SATV A 0 A_Lower
		Loop
	Fire:
		TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("SaturnReload")==0, "SlowFire")
		TNT1 A 0 A_JumpIfInventory("Switch",1,"Fire2")
		TNT1 A 0 A_JumpIfInventory("RocketRounds",1,1)
        Goto ReloadCheck
		TNT1 A 0 A_PlaySound ("weapons/launcher/fire",4)
		TNT1 A 0 A_TakeInventory("RocketRounds",1,TIF_NOTAKEINFINITE)
		TNT1 A 0 A_GiveInventory("FirstSix",1)
		SATV A 1 A_GunFlash
		SATV A 1 BRIGHT A_AlertMonsters
		TNT1 A 0 A_SetPitch (pitch+0.3)
		TNT1 A 0 A_Light2
		TNT1 AAAAAA 0 A_FireCustomMissile("SaturnTracer",FRandom(-8.0,8.0),0,0,0,0,FRandom(-4.0,4.0))
		SATV B 1 BRIGHT A_FireCustomMissile("SaturnRocket", 0, 0, 0, 5)
		TNT1 AAAAAA 0 A_FireCustomMissile("GunSmokeSpawner",0,0,0,-5)
		TNT1 A 0 A_SetPitch (pitch-0.3)
		TNT1 A 0 A_ZoomFactor(0.99)
		SATV C 1 A_Light1
		TNT1 A 0 A_ZoomFactor(0.965)
		SATV D 1 A_Light0
		TNT1 A 0 A_ZoomFactor(0.985)
		SATV E 2 offset(0,34)
		TNT1 A 0 offset(0,32)
		TNT1 A 0 A_ZoomFactor(0.995)
		SATV FG 2
		TNT1 A 0 A_ZoomFactor(1.0)
		SATV G 1
		TNT1 A 0 A_JumpIfInventory("FirstSix",6,"Swing")
		SATV A 1 A_Refire
		Goto ReadyII
	Fire2:
		TNT1 A 0 A_JumpIfInventory("LastSix",6,"ReloadCheck")
		TNT1 A 0 A_JumpIfInventory("RocketRounds",1,1)
        Goto ReloadCheck
		TNT1 A 0 A_PlaySound ("weapons/launcher/fire",4)
		TNT1 A 0 A_TakeInventory("RocketRounds",1,TIF_NOTAKEINFINITE)
		TNT1 A 0 A_GiveInventory("LastSix",1)
		SATV A 1 A_GunFlash
		SATV A 1 BRIGHT A_AlertMonsters
		TNT1 A 0 A_SetPitch (pitch+0.3)
		TNT1 A 0 A_Light2
		TNT1 AAAAAA 0 A_FireCustomMissile("SaturnTracer",FRandom(-8.0,8.0),0,0,0,0,FRandom(-4.0,4.0))
		SATV B 1 BRIGHT A_FireCustomMissile("SaturnRocket", 0, 0, 0, 5)
		TNT1 AAAAAA 0 A_FireCustomMissile("GunSmokeSpawner",0,0,0,-5)
		TNT1 A 0 A_SetPitch (pitch-0.3)
		TNT1 A 0 A_ZoomFactor(0.99)
		SATV C 1 A_Light1
		TNT1 A 0 A_ZoomFactor(0.965)
		SATV D 1 A_Light0
		TNT1 A 0 A_ZoomFactor(0.985)
		SATV E 2 offset(0,34)
		TNT1 A 0 offset(0,32)
		TNT1 A 0 A_ZoomFactor(0.995)
		SATV FG 2
		TNT1 A 0 A_ZoomFactor(1.0)
		SATV G 1
		TNT1 A 0 A_ZoomFactor(1.0)
		SATV A 1 A_Refire
		Goto ReadyII
	SlowFire:
		TNT1 A 0 A_JumpIfInventory("Switch",1,"SlowFire2")
		TNT1 A 0 A_JumpIfInventory("RocketRounds",1,1)
        Goto ReloadCheck
		TNT1 A 0 A_PlaySound ("weapons/launcher/fire",4)
		TNT1 A 0 A_TakeInventory("RocketRounds",1,TIF_NOTAKEINFINITE)
		TNT1 A 0 A_GiveInventory("FirstSix",1)
		SATV A 1 A_GunFlash
		SATV A 1 BRIGHT A_AlertMonsters
		TNT1 A 0 A_SetPitch (pitch+0.3)
		TNT1 A 0 A_Light2
		TNT1 AAAAAA 0 A_FireCustomMissile("SaturnTracer",FRandom(-8.0,8.0),0,0,0,0,FRandom(-4.0,4.0))
		SATV B 1 BRIGHT A_FireCustomMissile("SaturnRocket", 0, 0, 0, 5)
		TNT1 AAAAAA 0 A_FireCustomMissile("GunSmokeSpawner",0,0,0,-5)
		TNT1 A 0 A_SetPitch (pitch-0.3)
		TNT1 A 0 A_ZoomFactor(0.99)
		SATV C 1 A_Light1
		TNT1 A 0 A_ZoomFactor(0.965)
		SATV D 1 A_Light0
		TNT1 A 0 A_ZoomFactor(0.985)
		SATV E 2 offset(0,34)
		TNT1 A 0 offset(0,32)
		TNT1 A 0 A_ZoomFactor(0.995)
		SATV FG 2
		TNT1 A 0 A_ZoomFactor(1.0)
		SATV G 1
		SATV A 2
		TNT1 A 0 A_JumpIfInventory("FirstSix",6,"Swing")
		SATV A 1 A_Refire
		Goto ReadyII
	Flash:
		SATF A 1 A_Light0 
		SATF B 1 Bright A_Light2
		SATF C 1 Bright A_Light1
		SATF D 1 A_Light1
		SATF E 1 A_Light0
		Goto LightDone
	AltFire:
		TNT1 A 0 A_JumpIfInventory("Switch",1,"AltFire2")
		TNT1 A 0 A_JumpIfInventory("RocketRounds",1,1)
		Goto ReloadCheck
		TNT1 A 0 A_PlaySound ("weapons/grenade/fire",4)
		TNT1 A 0 A_TakeInventory("RocketRounds",1,TIF_NOTAKEINFINITE)
		TNT1 A 0 A_GiveInventory("FirstSix",1)
		SATV A 2 A_AlertMonsters
		TNT1 A 0 A_SetPitch (pitch+0.1)
		SATV B 1 BRIGHT A_FireCustomMissile("SaturnG", 0, 0, 0, 6)
		TNT1 A 0 A_FireCustomMissile("GunSmokeSpawner",0,0,0,-5)
		TNT1 A 0 A_SetPitch (pitch-0.1)
		TNT1 A 0 A_ZoomFactor(0.99)
		SATV CD 2 offset (0,34)
		TNT1 A 0 A_ZoomFactor(0.992)
		SATV E 2 offset (0,36)
		TNT1 A 0 A_ZoomFactor(1.0)
		SATV F 2 offset (0,35)
		SATV G 2 offset (0,34)	
		SATV A 2 offset (0,33)
		SATV A 4 offset (0,32)
		SATV A 2
		TNT1 A 0 A_JumpIfInventory("FirstSix",6,"Swing")
		SATV A 1 A_Refire
		Goto ReadyII
	AltFire2:
		TNT1 A 0 A_JumpIfInventory("LastSix",6,"ReloadCheck")
		TNT1 A 0 A_JumpIfInventory("RocketRounds",1,1)
		Goto ReloadCheck
		TNT1 A 0 A_PlaySound ("weapons/grenade/fire",4)
		TNT1 A 0 A_TakeInventory("RocketRounds",1,TIF_NOTAKEINFINITE)
		TNT1 A 0 A_GiveInventory("LastSix",1)
		SATV A 2 A_AlertMonsters
		TNT1 A 0 A_SetPitch (pitch+0.1)
		SATV B 1 BRIGHT A_FireCustomMissile("SaturnG", 0, 0, 0, 6)
		TNT1 A 0 A_FireCustomMissile("GunSmokeSpawner",0,0,0,-5)
		TNT1 A 0 A_SetPitch (pitch-0.1)
		TNT1 A 0 A_ZoomFactor(0.99)
		SATV CD 2 offset (0,34)
		TNT1 A 0 A_ZoomFactor(0.992)
		SATV E 2 offset (0,36)
		TNT1 A 0 A_ZoomFactor(1.0)
		SATV F 2 offset (0,35)
		SATV G 2 offset (0,34)	
		SATV A 2 offset (0,33)
		SATV A 4 offset (0,32)
		SATV A 2
		TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("SaturnReload")==0, "AltFire2NoReload")
		Goto AltFire2End
	AltFire2NoReload:
		TNT1 A 0 A_JumpIfInventory("LastSix",6,"Swing")
	AltFire2End:
		SATV A 1 A_Refire
		Goto ReadyII
	Swing:
		TNT1 A 0 A_PlaySound ("weapons/launcher/up",7) 
		TNT1 A 0 A_TakeInventory("FirstSix",6)
		TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("SaturnReload")==0, 1)
		TNT1 A 0 A_GiveInventory("Switch",1)
		SATR ABCDEFK 2
		TNT1 A 0 A_Refire
		Goto ReadyII
	ReloadCheck:
		TNT1 A 0 A_TakeInventory("Switch",1)
		TNT1 A 0 A_TakeInventory("LastSix",6)
		TNT1 A 0 A_TakeInventory("FirstSix",6)
		TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("SaturnReload")==0, "NoReload")
		Goto Reload
	Reload:
		SATR AB 2
		TNT1 A 0 A_PlaySound ("weapons/launcher/up",7)
		SATR CDEFK 2
		SATR ABCDDDDE 1
		TNT1 A 0 A_PlaySound ("weapons/launcher/load",7)
		SATR EFGHIJJJ 2
		Goto ReloadLoop
	ReloadLoop:
		TNT1 A 0 A_GiveInventory("RocketRounds")
		TNT1 A 0 A_TakeInventory("RocketAmmo",1,TIF_NOTAKEINFINITE)
		TNT1 A 0 A_JumpIfInventory("RocketRounds",0,"ReloadEnd")
		TNT1 A 0 A_JumpIfInventory("RocketAmmo",1,"ReloadLoop")
		Goto ReloadEnd
	ReloadEnd:
		TNT1 A 0 A_TakeInventory("Switch",1)
		TNT1 A 0 A_TakeInventory("LastSix",6)
		TNT1 A 0 A_TakeInventory("FirstSix",6)
		SATR JIHGFEDDD 2
		TNT1 A 0 A_PlaySound ("weapons/launcher/ready") 
		SATR KLM 2
		TNT1 A 0 A_Refire
		Goto ReadyII
	NoReload:
		TNT1 A 0 A_GiveInventory("RocketRounds")
		TNT1 A 0 A_TakeInventory("RocketAmmo",1,TIF_NOTAKEINFINITE)
		TNT1 A 0 A_JumpIfInventory("RocketRounds",0,"NoReloadEnd")
		TNT1 A 0 A_JumpIfInventory("RocketAmmo",1,"NoReload")
		Goto NoReloadEnd
	NoReloadEnd:
		TNT1 A 0 A_TakeInventory("Switch",1)
		TNT1 A 0 A_TakeInventory("LastSix",6)
		TNT1 A 0 A_TakeInventory("FirstSix",6)
		TNT1 A 0 A_Refire
		Goto ReadyII
	Spawn:
		LAWN A -1
		Stop
	}
}

ACTOR RocketRounds : Ammo
{
	+IGNORESKILL
	Inventory.MaxAmount 12
}

ACTOR SaturnRocket : Rocket
{
	Radius 10
	Height 8
	Speed 50
	Damage 20
	Decal "BigScorch"
	Projectile
	Gravity 1.0
	SeeSound "none"
	DeathSound "weapons/launcher/hit"
	Obituary "$OB_MPROCKET"
	States
	{
	Spawn:
		MSLE A 1 Bright
		Loop
	Death:
		TNT1 A 0 A_Explode
		TNT1 A 0 A_CustomMissile ("RocketSmoke", 1, 0, random (0, 360), 2, random (0, 160))
		MACX ABCD 2 Bright
		MACX EFG 3 Bright
		MACX HIJ 3
		Stop
	}
}

Actor SaturnG : Grenade
{
	Gravity 0.3
	BounceFactor 0.5
	WallBounceFactor 0.6
	Decal "BigScorch"
	BounceSound "weapons/grenadebounce"
	DeathSound "none"
	+FLOORCLIP
	-ACTIVATEPCROSS
	States
	{
	Spawn:
		SATG A 1 Bright
		Loop
	Crash:
		TNT1 A 0
		Goto Spawn
	Death:
		TNT1 A 0 A_Explode
		TNT1 A 0 A_CustomMissile ("RocketSmoke", 1, 0, random (0, 360), 2, random (0, 160))
		TNT1 A 0 A_PlaySound("weapons/launcher/hit")
		HELX ABCD 2 Bright
		HELX EFG 2 Bright
		HELX HIJ 3
		Stop
	}
}

Actor GrenadeTimer : Inventory
{
	Inventory.Maxamount 60
}

ACTOR SingleRocket : RocketAmmo replaces RocketAmmo
{
	Inventory.Icon "ROKKA0"
	Inventory.PickupSound "rocketup"
	States
	{
	Spawn:
		ROKK A -1
		Stop
	}
}

ACTOR Rockets : RocketBox replaces RocketBox
{
	Inventory.PickupSound "rocketup"
	States
	{
	Spawn:
		BRKK A -1
		Stop
	}
}

ACTOR SaturnTracer : Tracer
{
	Damage (random(0,1))
	Speed 120
}

ACTOR FirstSix : Inventory
{
	Inventory.Maxamount 6
}

ACTOR LastSix : Inventory
{
	Inventory.Maxamount 6
}

ACTOR Switch : Inventory
{
	Inventory.Maxamount 1
}