ACTOR NovaRifle : weapon replaces PlasmaRifle
{
	Weapon.SelectionOrder 100
	Weapon.SlotNumber 6
	Weapon.AmmoType "Cell"
	Weapon.AmmoGive 60
	Weapon.AmmoUse 1
	Weapon.AmmoType2 "Cellpak"
	Weapon.AmmoUse2 1
	Inventory.PickupMessage "You got the Nova Rifle!"
	Inventory.PickupSound "weapons/fist/swing"
	Obituary "%o was Cronenberged by %k's Nova Rifle"
	+WEAPON.NOALERT
	+WEAPON.AMMO_CHECKBOTH
	Tag "Nova Rifle"
	Weapon.BobStyle "Smooth"
	Weapon.BobSpeed 2.0
	Weapon.BobRangeX 0.30
	Weapon.BobRangeY 0.40
	States
	{
	Ready:
		PLZG E 1 Offset(-200,50) A_PlaySound("weapons/plasmagun/upsound")
		PLZG E 1 Offset(-175,49)
		PLZG E 1 Offset(-140,47)
		PLZG E 1 Offset(-110,45)
		PLZG D 1 Offset(-65,43)
		PLZG D 1 Offset(-50,41)
		PLZG C 1 Offset(-40,39)
		PLZG C 1 Offset(-32,38)
		PLZG C 1 Offset(-28,37)
		PLZG B 1 Offset(-20,36)
		PLZG B 1 Offset(-10,35)
		PLZG A 1 Offset(-5,34)
		PLZG A 1 Offset(0,32)
	ReadyII:
		TNT1 A 0 A_JumpIfInventory("Cellpak",0,2)
		TNT1 A 0 A_JumpIfInventory("Cell",1,2)
		PLZG A 1 A_WeaponReady
		Loop
		PLZG A 1 A_WeaponReady(WRF_ALLOWRELOAD)
		Loop
	Deselect:
		PLZG A 1 Offset(15,40)
		PLZG A 1 Offset(30,55)
		PLZG A 1 Offset(45,75)
		PLZG A 1 Offset(60,100)
		PLZG A 1 Offset(75,130)
		TNT1 A 5
		TNT1 A 0 A_Lower
	Wait
	Select:
			TNT1 A 0 A_Raise 
		Loop
	Fire:
		TNT1 A 0 A_JumpIfInventory("Cellpak",1,1)
		Goto ReloadCheck
		TNT1 A 0 A_TakeInventory("Cellpak",1,TIF_NOTAKEINFINITE)
		TNT1 A 0 A_GunFlash
		TNT1 A 0 A_AlertMonsters
		TNT1 A 0 A_PlaySound ("weapons/plasmagun/fire", CHAN_WEAPON)
		TNT1 A 0 A_SetPitch (pitch+0.1)
		PLZG A 1 A_FireCustomMissile("Plasma", 0, 0, -1, 1)
		TNT1 A 0 A_SetPitch (pitch-0.1)
		TNT1 A 0 A_ZoomFactor(0.996)
		PLZF B 1 Bright A_ZoomFactor(0.995)
		PLZF B 1 Offset(0,33) A_ZoomFactor(0.999)
		PLZF B 1 Offset(0,32) A_ZoomFactor(1.0)
		PLZF CB 1 A_ReFire
		TNT1 A 0 A_FireCustomMissile("GunSmokeSpawner",0,0,-4,5)
		PLZG EEEE 3
		PLZG DCB 2
		Goto ReadyII
	AltFire:
		TNT1 A 0 A_JumpIfInventory("Cellpak",1,1)
		Goto ReloadCheck
		PLZG J 1
		PLZG K 1 A_PlaySound ("weapons/plasmagun/charge", CHAN_AUTO)
		PLZG JKK 1
		PLCH ABCDEF 1
		PLZG A 2
		TNT1 A 0 A_TakeInventory("Cellpak",5,TIF_NOTAKEINFINITE)
		TNT1 A 0 A_GunFlash
		TNT1 A 0 A_PlaySound ("weapons/plasmagun/fire")
		TNT1 A 0 A_FireCustomMissile("NovaBall",0,0,0,0,(0))
		PLZF B 1 A_ZoomFactor(0.99)
		PLZF B 1 Bright A_ZoomFactor(0.985)
		PLZF B 1 A_ZoomFactor(0.995)
		TNT1 A 0 A_AlertMonsters
		TNT1 A 0 A_ZoomFactor(1.0)
		PLZF CB 1
		RALE AB 1
		TNT1 A 0 A_FireCustomMissile("GunSmokeSpawner",0,0,-4,5)
		RALE D 12
		RALE CBA 2
		PLZG J 2//10
		TNT1 A 0 A_Playsound("weapons/plasmagun/beep",6)
		PLZG AJ 3
		Goto ReadyII
	Flash:
		NOVF A 1 Bright A_Light2
		NOVF C 1 Bright A_Light2
		TNT1 A 1 A_Light1
		Goto LightDone
	AltFlash:
		NOVF A 1 Bright A_Light2
		NOVF D 1 Bright A_Light1
		TNT1 A 1 A_Light1
		Goto LightDone
	ReloadCheck:
		TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("NovaReload")==0, "NoReloadLoop")
		Goto Reload
	Reload:
		TNT1 A 0 A_PlaySound ("weapons/plasmagun/dryfire", CHAN_AUTO)
		TNT1 A 0 A_PlaySound ("weapons/plasmagun/reload")
		PLZR ABJII 3
		PLZR HGEEEEEEEEEEF 2
	ReloadLoop:
		TNT1 A 0 A_GiveInventory("Cellpak")
		TNT1 A 0 A_TakeInventory("Cell",1,TIF_NOTAKEINFINITE)
		TNT1 A 0 A_JumpIfInventory("Cellpak",0,"ReloadEnd")
		TNT1 A 0 A_JumpIfInventory("Cell",1,"ReloadLoop")
		Goto ReloadEnd
	NoReloadLoop:
		TNT1 A 0 A_GiveInventory("Cellpak")
		TNT1 A 0 A_TakeInventory("Cell",1,TIF_NOTAKEINFINITE)
		TNT1 A 0 A_JumpIfInventory("Cellpak",0,"ReadyII")
		TNT1 A 0 A_JumpIfInventory("Cell",1,"NoReloadLoop")
		Goto ReadyII
	ReloadEnd:
		PLZR GHIJBAA 3
		Goto ReadyII
	Spawn:
		PLAS A -1
		Stop
	}
}

ACTOR Cellpak : Ammo
{
	+IGNORESKILL
	Inventory.MaxAmount 60
}

ACTOR Plasma : PlasmaBall
{
	Scale 0.8
	Speed 40
	Damage 8
	SeeSound "none"
	DeathSound "weapons/plasmad/explode"
	Obituary "%o was liquified by %k's Pulse Rifle"
	Decal PlasmaScorchFast
	States
	{
	Spawn:
		PLZS AB 6 Bright
		Loop
	Death:
		TNT1 A 0 A_CustomMissile ("PlasmaSmoke", 1, 0, random (0, 360), 2, random (0, 160))
		PLZE ABCDE 4 Bright
		Stop
	}
}

ACTOR PlasmaShot : Plasma
{
	Scale 0.4
	Radius 7
	Height 8
	Speed 35
	Damage 4
}

ACTOR NovaBall : Plasma
{
	Scale 0.8
	Speed 40
	Damage 10
	Decal PlasmaResidue
	DontHurtShooter
	States
	{
	Death:
		TNT1 A 0 A_Explode(80,96,(0))//,0,0,20,20,"NovaExtra",none)
		TNT1 A 0 A_BFGSpray ("NovaExtra", 20, 5)
		TNT1 A 0 A_PlaySound ("weapons/bfgx")
		RR00 ABCDEF 3 Bright
		TNT1 A 0 A_CustomMissile ("PlasmaSmoke", 1, 0, random (0, 360), 2, random (0, 160))
		Stop
	}
}

ACTOR NovaExtra
{
	+NOBLOCKMAP
	+NOGRAVITY
	RenderStyle Add
	Alpha 0.75
	DamageType "BFGSplash"
	States
	{
	Spawn:
		PLZE ABCDE 4 Bright
		Stop
	}
}