ACTOR PlasRifle : ModWeapon replaces PlasmaRifle
{
	Weapon.SelectionOrder 100
	Weapon.SlotNumber 6
	Weapon.AmmoType "PlasmaMag"
	Weapon.AmmoUse 1
	Weapon.AmmoGive 0
	Weapon.AmmoType2 "Cell"
	Weapon.AmmoGive2 30
	Weapon.AmmoUse2 0
	Weapon.UpSound "weapons/plsweps/upsnd"
	Inventory.PickupMessage "You got the Plasma Rifle!"
	Inventory.PickupSound "weapons/prifle/pkup"
	Decal PlasmaScorch
	Tag "Plasma Rifle"
	States
	{
	Select:
		TNT1 A 0 A_PlaySound("weapons/prifle/equp", CHAN_AUTO)
		PLZR E 0 A_Raise 
		TNT1 A 0 A_ZoomFactor(1.00)
		PLZR D 1 A_WeaponOffset(54, 100, WOF_INTERPOLATE)
		PLZR C 1 A_WeaponOffset(32, 69, WOF_INTERPOLATE)
		PLZR B 1 A_WeaponOffset(22, 58, WOF_INTERPOLATE)
		PLCH C 1 A_WeaponOffset(10, 47, WOF_INTERPOLATE)
		PLCH B 1 A_WeaponOffset(7, 39, WOF_INTERPOLATE)
		PLCH A 1 A_WeaponOffset(2, 34, WOF_INTERPOLATE)
		Goto Ready
	Deselect:
		TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("led_AnimToggle")==1, "DeadSelect")
		TNT1 A 0 A_JumpIfInventory("PLCooldown", 1, "CoolDeselect")
		TNT1 A 0 A_PlaySound("weapons/plasma/paway", CHAN_AUTO)
		TNT1 A 0 A_PlaySound("weapons/deselect", CHAN_AUTO)
		PLZG A 1 A_WeaponOffset(2, 34, WOF_INTERPOLATE)
		PLZG A 1 A_WeaponOffset(7, 39, WOF_INTERPOLATE)
		PLZR A 1 A_WeaponOffset(10, 47, WOF_INTERPOLATE)
		PLZR B 1 A_WeaponOffset(22, 58, WOF_INTERPOLATE)
		PLZR C 1 A_WeaponOffset(32, 69, WOF_INTERPOLATE)
		PLZR D 1 A_WeaponOffset(54, 100, WOF_INTERPOLATE)
		PLZR E 1 A_Lower
		Wait
	CoolDeselect:
		TNT1 A 0 A_TakeInventory("PLCooldown", 1)
		TNT1 A 0 A_PlaySound("weapons/plasma/paway", CHAN_AUTO)
		TNT1 A 0 A_PlaySound("weapons/deselect", CHAN_AUTO)
		PLZG E 1 A_WeaponOffset(-7, 39, WOF_INTERPOLATE)
		PLZG E 1 A_WeaponOffset(-12, 45, WOF_INTERPOLATE)
		PLZG E 1 A_WeaponOffset(-20, 52, WOF_INTERPOLATE)
		PLZG E 1 A_WeaponOffset(-35, 60, WOF_INTERPOLATE)
		PLZG E 1 A_WeaponOffset(-50, 69, WOF_INTERPOLATE)
		PLZG E 1 A_WeaponOffset(-67, 100, WOF_INTERPOLATE)
		TNT1 A 1 A_Lower
		Wait
	DeadSelect:
		TNT1 A 0 A_JumpIfHealthLower(1, "Dead")
		Goto Deselect+1
	Dead:
		TNT1 A 0 
	Anim:
		TNT1 A 1 A_WeaponOffset(0, 32)
		TNT1 A 0 A_TakeInventory("PLCooldown", 1)
		GRAB ABCD 2
		TNT1 A 0 A_FireProjectile("DitchedPLRifle", 0, 0, 0, 13)
		GRAB EF 2
		GRAB GHI 3
	Stopped:
		TNT1 A 1
		Loop
	Ready:
		TNT1 A 0 A_JumpIfInventory("Punching", 1, "DoPunch")
		PLZG A 1 A_WeaponReady(WRF_ALLOWRELOAD)
		Loop
	Fire:
		TNT1 A 0 A_JumpIfNoAmmo("Reload")
		TNT1 A 0 A_FireLedPLRifle
		TNT1 A 0 A_SetBlend("Blue", GetCvar("led_PLRifFlsh"), 10)
		PLZG A 1 A_WeaponOffset(0, 43, WOF_INTERPOLATE)
		TNT1 A 0 A_SetPitch(pitch-0.4)
		PLZG A 1 A_WeaponOffset(0, 41, WOF_INTERPOLATE)
		TNT1 A 0 A_SetPitch(pitch+0.2)
		PLZG A 1 A_WeaponOffset(0, 39, WOF_INTERPOLATE)
		TNT1 A 0 A_SetPitch(pitch+0.1)
		PLZG A 1 A_WeaponOffset(0, 37, WOF_INTERPOLATE)
		PLZA A 0 A_SetPitch(pitch+0.05)
		PLZA A 0 A_SetPitch(pitch+0.05)
		PLZG A 1 A_ReFire
	Cooldown:
		TNT1 A 0 A_GiveInventory("PLCooldown", 1)
		PLZG B 1
		TNT1 A 0 A_FireProjectile("PistolSmokeSpawner", 0, 0, -2, 2)
		PLZG C 1 
		TNT1 A 0 A_FireProjectile("PistolSmokeSpawner", 0, 0, -3, 3)
		PLZG D 1 
		TNT1 A 0 A_FireProjectile("PistolSmokeSpawner", 0, 0, -4, 4)
		TNT1 A 0 A_JumpIfInventory("Punching", 1, "DoPunch")
		PLZG E 1 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
		TNT1 A 0 A_FireProjectile("GunSmokeSpawner", 0, 0, -8, 7)
		TNT1 A 0 A_JumpIfInventory("Punching", 1, "DoPunch")
		PLZG E 1 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
		TNT1 A 0 A_FireProjectile("GunSmokeSpawner", 0, 0, -8, 7)
		TNT1 A 0 A_JumpIfInventory("Punching", 1, "DoPunch")
		PLZG E 1 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
		TNT1 A 0 A_FireProjectile("GunSmokeSpawner", 0, 0, -8, 7)
		TNT1 A 0 A_JumpIfInventory("Punching", 1, "DoPunch")
		PLZG E 1 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
		TNT1 A 0 A_JumpIfInventory("Punching", 1, "DoPunch")
		PLZG E 1 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
		TNT1 A 0 A_JumpIfInventory("Punching", 1, "DoPunch")
		PLZG E 1 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
		TNT1 A 0 A_JumpIfInventory("Punching", 1, "DoPunch")
		TNT1 A 0 A_TakeInventory("PLCooldown", 1)
		PLZG DCB 2 
		Goto Ready
	Altfire:
		TNT1 A 0 A_JumpIfInventory("PlasmaMag", 20, 1)
		Goto Reload
		TNT1 A 0 A_JumpIf(GetCvar("led_PlasmaAlt") == 1, "RailFire")
		TNT1 A 0 A_PlaySound("weapons/prifle/beep")
		PLZG JAJA 2 
		TNT1 A 0 A_PlaySound("weapons/prifle/chrge")
		PLZG A 1 A_WeaponOffset(1,34, WOF_INTERPOLATE)
		PLZG A 1 A_WeaponOffset(-1,32, WOF_INTERPOLATE)
		PLZG A 1 A_WeaponOffset(-1,34, WOF_INTERPOLATE)
		PLZG A 1 A_WeaponOffset(1,32, WOF_INTERPOLATE)
		PLZG A 1 A_WeaponOffset(1,34, WOF_INTERPOLATE)
		PLZG A 1 A_WeaponOffset(-1,32, WOF_INTERPOLATE)
		PLZG A 1 A_WeaponOffset(-1,34, WOF_INTERPOLATE)
		PLZG A 1 A_WeaponOffset(1,32, WOF_INTERPOLATE)
		PLZG A 1 A_WeaponOffset(0,32, WOF_INTERPOLATE)
	RailFire:
		TNT1 A 0 A_LedPLAltFire
		TNT1 A 0 A_SetBlend("00 00 FF" , GetCvar("led_PLRifFlsh"), 10)
		TNT1 A 0 A_JumpIf(GetCvar("led_ZoomEffects")==0, 2)
		TNT1 A 0 A_ZoomFactor(0.988, ZOOM_INSTANT)
		PLZG A 1 A_WeaponOffset(0, 43, WOF_INTERPOLATE)
		TNT1 A 0 A_JumpIf(GetCvar("led_ZoomEffects")==0, 2)
		TNT1 A 0 A_ZoomFactor(0.99)
		TNT1 A 0 A_SetPitch(pitch-0.75)
		PLZG A 1 A_WeaponOffset(0, 41, WOF_INTERPOLATE)
		TNT1 A 0 A_JumpIf(GetCvar("led_ZoomEffects")==0, 2)
		TNT1 A 0 A_ZoomFactor(0.992)
		TNT1 A 0 A_SetPitch(pitch-0.5)
		PLZG A 1 A_WeaponOffset(0, 39, WOF_INTERPOLATE)
		TNT1 A 0 A_JumpIf(GetCvar("led_ZoomEffects")==0, 2)
		TNT1 A 0 A_ZoomFactor(0.994)
		PLZA A 0 A_SetPitch(pitch+0.25)
		PLZG A 1 A_WeaponOffset(0, 37, WOF_INTERPOLATE)
		TNT1 A 0 A_JumpIf(GetCvar("led_ZoomEffects")==0, 2)
		TNT1 A 0 A_ZoomFactor(0.996)
		PLZA A 0 A_SetPitch(pitch+0.25)
		PLZG B 1 A_WeaponOffset(0, 35, WOF_INTERPOLATE)
		TNT1 A 0 A_JumpIf(GetCvar("led_ZoomEffects")==0, 2)
		TNT1 A 0 A_ZoomFactor(0.998)
		PLZA A 0 A_SetPitch(pitch+0.25)
		TNT1 A 0 A_FireProjectile("PistolSmokeSpawner", 0, 0, -2, 2)
		PLZG C 1 A_WeaponOffset(0, 32, WOF_INTERPOLATE)
		TNT1 A 0 A_JumpIf(GetCvar("led_ZoomEffects")==0, 2)
		TNT1 A 0 A_ZoomFactor(1.00)
		TNT1 A 0 A_FireProjectile("PistolSmokeSpawner", 0, 0, -3, 3)
		PLZA A 0 A_SetPitch(pitch+0.25)
		PLZG D 1
		TNT1 A 0 A_FireProjectile("PistolSmokeSpawner", 0, 0, -4, 4)
		PLZA A 0 A_SetPitch(pitch+0.25)
	RailCool:
		TNT1 A 0 A_GiveInventory("PLCooldown", 1)
		TNT1 A 0 A_JumpIfInventory("Punching", 1, "DoPunch")
		PLZG E 1 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
		TNT1 A 0 A_JumpIfInventory("Punching", 1, "DoPunch")
		TNT1 A 0 A_FireProjectile("GunSmokeSpawner", 0, 0, -8, 7)
		PLZG E 1 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
		TNT1 A 0 A_JumpIfInventory("Punching", 1, "DoPunch")
		TNT1 A 0 A_FireProjectile("GunSmokeSpawner", 0, 0, -8, 7)
		PLZG E 1 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
		TNT1 A 0 A_JumpIfInventory("Punching", 1, "DoPunch")
		TNT1 A 0 A_FireProjectile("GunSmokeSpawner", 0, 0, -8, 7)
		PLZG E 1 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
		TNT1 A 0 A_JumpIfInventory("Punching", 1, "DoPunch")
		TNT1 A 0 A_FireProjectile("GunSmokeSpawner", 0, 0, -8, 7)
		PLZG E 1 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
		TNT1 A 0 A_JumpIfInventory("Punching", 1, "DoPunch")
		PLZG E 1 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
		TNT1 A 0 A_JumpIfInventory("Punching", 1, "DoPunch")
		PLZG E 1 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
		TNT1 A 0 A_JumpIfInventory("Punching", 1, "DoPunch")
		PLZG E 1 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
		TNT1 A 0 A_JumpIfInventory("Punching", 1, "DoPunch")
		PLZG E 1 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
		TNT1 A 0 A_JumpIfInventory("Punching", 1, "DoPunch")
		TNT1 A 0 A_TakeInventory("PLCooldown", 1)
		PLZG DCB 2 
		PLZG J 3 
		PLCH ABC 2 
		TNT1 A 0 A_PlaySound("weapons/prifle/beep")
		PLZG AJAJ 2 A_WeaponReady
		PLZG A 8 A_WeaponReady
		Goto Ready
	Reload:
		TNT1 A 0 A_JumpIfInventory("PlasmaMag", 60, 2)
		TNT1 A 0 A_JumpIfInventory("Cell", 1, "ReloadWork")
		PLZG A 1 A_WeaponReady
		Goto Ready
	ReloadWork:
		TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("led_TogglePlasma")==0, "NoReloadLoop")
		TNT1 A 0 A_PlaySound("weapons/foley", CHAN_AUTO)
		PLZR ABJII 2 
		TNT1 A 0 A_PlaySound("weapons/prifle/cout")
		PLZR HG 1 
		TNT1 A 0 A_FireProjectile("PulseCellDrop", random(-15, 15), 0, -3, -12)
		TNT1 A 0 A_PlaySound("weapons/foley", CHAN_AUTO)
		PLZR EEEEEEEEEEEEEF 2 
	ReloadLoop:
		TNT1 A 0 A_TakeInventory("Cell", 1)
		TNT1 A 0 A_GiveInventory("PlasmaMag", 1)
		TNT1 A 0 A_JumpIfInventory("PlasmaMag", 60, "ReloadFinish")
		TNT1 A 0 A_JumpIfInventory("Cell", 1, "ReloadLoop")
		Goto ReloadFinish
	NoReloadLoop:
		TNT1 A 0 A_TakeInventory("Cell", 1)
		TNT1 A 0 A_GiveInventory("PlasmaMag", 1)
		TNT1 A 0 A_JumpIfInventory("PlasmaMag", 60, "NoReloadFinish")
		TNT1 A 0 A_JumpIfInventory("Cell", 1, "NoReloadLoop")
		Goto NoReloadFinish
	ReloadFinish:
		PLZR GH 1 
		TNT1 A 0 A_PlaySound("weapons/prifle/cin", CHAN_AUTO)
		PLZR I 1
		PLZR J 3
		PLZR M 4
		PLZR NO 2 
		TNT1 A 0 A_PlaySound("weapons/prifle/beep")
		PLZR BA 1 
		PLZG J 6 
		PLZG A 2
		Goto Ready
	NoReloadFinish:
		TNT1 A 0 A_ReFire
		Goto Ready
	DoPunch:
		TNT1 A 0 A_JumpIfInventory("PLCooldown", 1, "CoolDoPunch")
		TNT1 A 0 A_PlaySound("weapons/deselect", CHAN_AUTO)
		TNT1 A 0 A_TakeInventory("Punching",1)
		PLZG A 1 A_WeaponOffset(-5,35, WOF_INTERPOLATE)
		PLZG A 1 A_WeaponOffset(-30,45, WOF_INTERPOLATE)
		PLZG A 1 A_WeaponOffset(-40,52, WOF_INTERPOLATE)
		PLZG A 1 A_WeaponOffset(-49,75, WOF_INTERPOLATE)
		PLZG A 1 A_WeaponOffset(-51,90, WOF_INTERPOLATE)
		TNT1 A 1 A_WeaponOffset(0,32, WOF_INTERPOLATE)
		TNT1 A 0 A_PlaySound("swing")
		Goto ActualPunch
	CoolDoPunch:		
		TNT1 A 0 A_PlaySound("weapons/deselect", CHAN_AUTO)
		TNT1 A 0 A_TakeInventory("PLCooldown", 1)
		TNT1 A 0 A_TakeInventory("Punching",1)
		PLZG E 1 A_WeaponOffset(-5,35, WOF_INTERPOLATE)
		PLZG E 1 A_WeaponOffset(-30,45, WOF_INTERPOLATE)
		PLZG E 1 A_WeaponOffset(-40,52, WOF_INTERPOLATE)
		PLZG E 1 A_WeaponOffset(-49,75, WOF_INTERPOLATE)
		PLZG E 1 A_WeaponOffset(-51,90, WOF_INTERPOLATE)
		TNT1 A 1 A_WeaponOffset(0,32, WOF_INTERPOLATE)
		TNT1 A 0 A_PlaySound("swing")
		Goto ActualPunch
	PunchDone:
		TNT1 A 1 A_WeaponOffset(-90,79, WOF_INTERPOLATE)
		PLZG A 1 A_WeaponOffset(-90,79, WOF_INTERPOLATE)
		PLZG A 1 A_WeaponOffset(-75,69, WOF_INTERPOLATE)
		PLZG A 1 A_WeaponOffset(-60,60, WOF_INTERPOLATE)
		PLZG A 1 A_WeaponOffset(-45,52, WOF_INTERPOLATE)
		PLZG A 1 A_WeaponOffset(-30,45, WOF_INTERPOLATE)
		PLZG A 1 A_WeaponOffset(-15,39, WOF_INTERPOLATE)
		PLZG A 1 A_WeaponOffset(0,32, WOF_INTERPOLATE)
		Goto Ready
	Flash:
		PLZA D 1 Bright A_Light2
		PLZA A 1 Bright A_Light1
		Goto LightDone
	Spawn:
		PLAS A -1
		Stop
	}
}

ACTOR PLCooldown : Inventory
{
	Inventory.MaxAmount 1
}