actor hydrashotgun:MSXWeapon{
	weapon.selectionorder 200
	inventory.pickupsound "weapons/hs_bolt"
	inventory.pickupmessage "'Hydra' HM9 Automatic Shotgun"
	weapon.ammotype "hydraclip"
	weapon.ammotype2 "autoshot_ammo"
	weapon.ammouse 1
	weapon.ammogive2 8
	weapon.ammogive1 0
	weapon.kickback 100
	weapon.bobstyle inverse
	weapon.bobrangeX 0.4
	weapon.bobrangeY 0.6
	weapon.bobspeed 2.5
	+AMMO_OPTIONAL
	+NOALERT
	+WEAPON.NOAUTOAIM
	scale 0.32
	states{	
	spawn:
		HASW A -1
    	stop
	Select:
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_QuickSwap")==1,"SeLoop")
		TNT1 A 10
	 SeLoop:
		TNT1 AAAAAAAAAA 0 A_Raise
		TNT1 A 1 A_Raise
		Loop
	Deselect:
		HASU A 1 {A_TakeInventory("xhair_switch",1);
			A_PlaySound("weapons/hs_deselect",CHAN_WEAPON);}
		HASU BCDEF 1
		TNT1 AAAAAAAAAA 0 A_Lower
		TNT1 A 1 A_Lower
		Goto Deselect+7
	Ready:
		HASU F 1 {A_PlaySound("weapons/hs_select",CHAN_WEAPON);
			A_SetCrosshair(10);}
		HASU EDCBA 1
		TNT1 A 0 A_GiveInventory("xhair_switch",1)
	Idle:
		HASI A 1 A_WeaponReady(WRF_ALLOWRELOAD|WRF_ALLOWUSER1|WRF_ALLOWUSER2|WRF_ALLOWUSER3|WRF_ALLOWUSER4)
		"####" "#" 0 A_JumpIfInventory("SprintingPlayer",1,"Sprint")
		loop
	Sprint:
		"####" "#" 0 A_JumpIf(GetCVar("MSfiXd_SprintStaminaUse")==0,"SprStart")
		TNT1 A 0 A_JumpIfInventory("PlayerStamina",1,"SprStart")
		TNT1 A 0 A_TakeInventory("SprintingPlayer",1)
		Goto Idle
	SprStart:
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_SprintHands")==1,"SprStart_HandWeapon")
		TNT1 A 0 {A_TakeInventory("xhair_switch",1);
			A_PlaySound("sfx/sprintstart",CHAN_AUTO);
			ACS_NamedExecute("Player-ChangeSpeed",0,GetCVar("MSfiXd_SprintSpeed"),0,0);
			A_SetBlend("49 99 0",0.4,15);
			A_Recoil(-15);}
		HASS ABCDE 1
		"####" "#" 0 A_JumpIfInventory("SprintingPlayer",1,"SprLoop1")
		Goto SprEnd
	SprStart_HandWeapon:
		HASU A 1{A_PlaySound("weapons/hs_deselect",CHAN_WEAPON);
			A_TakeInventory("xhair_switch",1);}
		HASU CE 1
		TNT1 A 1 A_GiveInventory("SprintHands")
		TNT1 A 0 A_Jump(256,"SprStart_Hands")
		Goto SprStart_Hands
	SprEnd:
		TNT1 A 0 {A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH);
			ACS_NamedExecute("Player-ChangeSpeed",0,100,0,0);
			A_PlaySound("sfx/sprintend",CHAN_AUTO);}
		HASS EDCBA 1
		TNT1 A 0 A_GiveInventory("xhair_switch",1)
		Goto Idle
	SprEnd_HandWeapon:
		TNT1 A 0 {A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH);
			ACS_NamedExecute("Player-ChangeSpeed",0,100,0,0);
			A_PlaySound("sfx/sprintend",CHAN_AUTO);}
		HASU E 1 {A_TakeInventory("SprintHands");
			A_SetCrosshair(10);
			A_PlaySound("weapons/hs_select",CHAN_WEAPON);}
		HASU CA 1
		TNT1 A 0 A_GiveInventory("xhair_switch",1)
		Goto Idle
	Fire:
		TNT1 A 0 A_JumpIfInventory("hydraclip",1,"FireCont")
		HASI A 7 A_PlaySound("weapons/noammo",CHAN_WEAPON)
		Goto Idle
	FireCont:
		TNT1 A 0 A_PlayWeaponSound("weapons/hs_fire")
		TNT1 A 0 A_AlertMonsters
		TNT1 A 0 A_GunFlash
		TNT1 A 1 A_FireBullets(6,5,9,11,"buckshot_impact",FBF_NORANDOM|FBF_USEAMMO)
		TNT1 A 0 ACS_NamedExecute("Weapon-Recoil",0,35,random(-25,25),0)
		TNT1 A 0 A_Light0
		TNT1 A 0 A_FireCustomMissile("regshell_spawner",0,0,0,3,0)
		HASI D 2
		HASI CB 1 
		HASI A 3
		TNT1 A 0 A_JumpIfInventory("hydraclip",1,"Idle")
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_AutoReloads")==2,"Reload")
		TNT1 A 0 A_JumpIf((GetCVar("MSfiXd_AutoReloads")==1)&&(GetCVar("MSfiXd_HydraAutoReloads"))==1,"Reload")
		Goto Idle
	Flash:
		TNT1 A 0 A_Jump(256,1,2)
		HASF A 0 A_Jump(256,2)
		HASF B 0
		"####" "#" 1 bright A_Light2
		TNT1 A 1 A_Light1
		TNT1 A 1 A_Light0
		stop
	Reload:
		TNT1 A 0 A_JumpIfInventory("hydraclip",16,2)
		TNT1 A 0 A_JumpIfInventory("autoshot_ammo",1,2)
		TNT1 A 0
		Goto Idle			
		HARS ABCDEFG 1
		HARS H 4 A_PlaySound("weapons/hs_clipout",CHAN_WEAPON)
		HARS IJJ 1
		HARS K 8
		HARS LMNOP 1
		HARS Q 15
		HARS RST 1
		HARS U 1 A_PlaySound("weapons/hs_clipin",CHAN_WEAPON)
		HARS V 1 
		HARS W 8
		TNT1 A 0 A_JumpIfInventory("hydraclip",1,"Reload_FillClipB")
	Reload_FillClipA:	
		TNT1 A 0 A_TakeInventory("autoshot_ammo",1)
		TNT1 A 0 A_GiveInventory("hydraclip",1)
		TNT1 A 0 A_JumpIfInventory("hydraclip",16,"ReloadFinish_Long")
		TNT1 A 0 A_JumpIfInventory("autoshot_ammo",1,"Reload_FillClipA")
	ReloadFinish_Long:	
		HARL ABCDD 1
		HARL E 3 A_PlaySound("weapons/hs_bolt",CHAN_WEAPON)
		HARL FGHH 1
		HARL I 8
		HARL KMNOP 1		
		Goto Idle
	Reload_FillClipB:	
		TNT1 A 0 A_TakeInventory("autoshot_ammo",1)
		TNT1 A 0 A_GiveInventory("hydraclip",1)
		TNT1 A 0 A_JumpIfInventory("hydraclip",16,"ReloadFinish_Quick")
		TNT1 A 0 A_JumpIfInventory("autoshot_ammo",1,"Reload_FillClipB")	
	ReloadFinish_Quick:
		HARQ ABCDEFG 1
		Goto Idle
	User1:
		TNT1 A 0 A_JumpIfInventory("grenades",1,1)
		Goto Idle
		HASU A 1 {A_TakeInventory("xhair_switch",1);
			A_PlaySound("weapons/hs_deselect",CHAN_WEAPON);}
		HASU BCDEF 1
		TNT1 A 0 A_Jump(256,"GrenadeStart")
		Goto GrenadeStart
	GrenadeEnd:
		HASU F 1 {A_TakeInventory("GrenadeHold");
			A_PlaySound("weapons/hs_select",CHAN_WEAPON);
			A_SetCrosshair(10);}
		HASU EDCBA 1
		TNT1 A 0 A_GiveInventory("xhair_switch",1)
		Goto Idle
	// Health Stim Stuff //
	Stim_HolsterCheck:
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_HolsterWeapForItems")==0,"Stimulate")
		HASU A 1 {A_TakeInventory("xhair_switch",1);
			A_PlaySound("weapons/hs_deselect",CHAN_WEAPON);}
		HASU BCDEF 1
		TNT1 A 0 A_Jump(256,"Stimulate")
		Goto Stimulate
	StimulateEnd:
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_HolsterWeapForItems")==0,"StimulateEnd_Quick")
		HASU F 1 {A_PlaySound("weapons/hs_select",CHAN_WEAPON);
			A_SetCrosshair(10);}
		HASU EDCBA 1
		TNT1 A 0 A_GiveInventory("xhair_switch",1)
		Goto Idle
	StimulateEnd_Quick:
		HASI A 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
		TNT1 A 0 A_JumpIf(GetPlayerInput(INPUT_BUTTONS)&(BT_USER2),"StimulateEnd_Quick")
		Goto Idle
	// Shield Booster Stuff //
	Boost_HolsterCheck:
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_HolsterWeapForItems")==0,"Boostify")
		HASU A 1 {A_TakeInventory("xhair_switch",1);
			A_PlaySound("weapons/hs_deselect",CHAN_WEAPON);}
		HASU BCDEF 1
		TNT1 A 0 A_Jump(256,"Boostify")
		Goto Boostify
	BoostifyEnd:
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_HolsterWeapForItems")==0,"BoostifyEnd_Quick")
		HASU F 1 {A_PlaySound("weapons/hs_select",CHAN_WEAPON);
			A_SetCrosshair(10);}
		HASU EDCBA 1
		TNT1 A 0 A_GiveInventory("xhair_switch",1)
		Goto Idle
	BoostifyEnd_Quick:
		HASI A 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
		TNT1 A 0 A_JumpIf(GetPlayerInput(INPUT_BUTTONS)&(BT_USER3),"BoostifyEnd_Quick")
		Goto Idle
	// Jetpack Stuff //
	User4:
		TNT1 A 0 A_JumpIfInventory("Jetpack",1,1)
		Goto Idle
		HASU A 1 {A_PlaySound("weapons/hs_deselect",CHAN_WEAPON);
			A_TakeInventory("xhair_switch",1);}
		HASU BCDEF 1
		TNT1 A 0 A_Jump(256,"JetpackStart")
		Goto JetpackStart
	WeaponJetEnd:
		HASU F 1 A_PlaySound("weapons/hs_select",CHAN_WEAPON)
		HASU EDCBA 1
		TNT1 A 0 {A_SetCrosshair(10);
			A_GiveInventory("xhair_switch",1);}
		Goto Idle
	AltFire:
		HASM C 1 A_Recoil(-6)
		TNT1 A 0 A_PlayWeaponSound("sfx/meleeswing")
		HASM EHJ 1
		HASM L 9 A_CustomPunch((164+random(1,32)),1,CPF_DAGGER|CPF_NOTURN,"Hydra_MeleePuff",88)
		HASM KJIHGFEDCBA 1
		Goto Idle}}
actor hydraclip:ammo{Inventory.MaxAmount 16 Inventory.Icon ""}
actor autoshot_ammo:ammo{
	radius 16
	height 8
	scale 0.30
	inventory.pickupmessage "Pack of 12 Gauge shells for Auto-Shotgun"
	inventory.pickupsound "weapons/hs_clipin"
	inventory.amount 6
	inventory.maxamount 128
	ammo.backpackamount 6
	ammo.backpackmaxamount 256
	states{
	Spawn:
		BUKD A -1
		stop}}
actor autoshot_ammobox:autoshot_ammo{
	radius 16
	height 8
	scale 0.35
	inventory.pickupmessage "Box of 12 Gauge shells for Auto-Shotgun"
	inventory.pickupsound "weapons/hs_clipin"
	inventory.amount 16
	states{
	Spawn:
		BUKB A -1
		stop}}
ACTOR Hydra_MeleePuff:MeleePuff{DamageType "HYDRA_Melee"}
actor buckshot_impact{		
	Radius 1
	Height 1
	Alpha 1
	DamageType "HYDRA_Pellet"
	RenderStyle ADD
	Scale 0.16
	+NOGRAVITY
	+NOBLOCKMAP
	+FLOORCLIP
	+NOTELEPORT
	+FORCEXYBILLBOARD
	+NOEXTREMEDEATH
	+NOINTERACTION
	+PUFFONACTORS
	Decal "BulletChip"
	States{
	Spawn:
		TNT1 A 0 NoDelay A_PlaySound("sfx/bulletric")
		TNT1 A 0 A_SpawnItemEx("buckshot_flare",0,0,0, 0,0,0,0)
		TNT1 AAAA 0 A_SpawnItemEx("buckshot_spark",0,0,0,frandom(0.5,1.0),random(2,4),random(0,5),random(0,180))
		TNT1 AA 0 A_SpawnItemEx("buckshot_spark2",0,0,0,frandom(0.5,1.0),random(2,4),random(0,5),random(0,180))
		TNT1 AA 0 A_SpawnItemEx("buckshot_smoke",0,0,0, 0,frandom(-0.3,0.3),frandom(0,0.35),random(0,180))
		TNT1 A 0 A_Jump(256,1,2,3,4)
		IPF2 A 0 A_Jump(256,4)
		IPF2 B 0 A_Jump(256,3)
		IPF2 C 0 A_Jump(256,2)
		IPF2 D 0
		"####" "###" 1 BRIGHT A_SetScale(scaleX*0.9,scaleY*0.9)
		Stop}}
actor buckshot_flare{
	scale 0.16
	alpha 1.0
	renderstyle add
	+NOINTERACTION
	+FORCEXYBILLBOARD
	+NOTELEPORT
	states{
	spawn:
		LEYS O 3 BRIGHT
		LEYS O 1 bright A_FadeOut(0.25)
		Wait}}
actor buckshot_spark{
	radius 2
	height 2
	alpha 1
	scale 0.024
	gravity 0.4
	renderstyle add
	+NOTELEPORT
	+FLOORCLIP
	+FORCEXYBILLBOARD
	bouncetype "doom"
	bouncefactor 0.2
	states{
	spawn:
		SPRK AAA 2 bright NoDelay A_ScaleVelocity(0.9)
		"####" "#" 1 bright {A_FadeOut(0.1);
			A_ScaleVelocity(0.9);}
		Wait}}
actor buckshot_spark2:buckshot_spark{
	scale 0.028
	gravity 0.3
	states{
	spawn:
		SPRK CCCCC 2 bright NoDelay A_ScaleVelocity(0.9) 
		SPRK C 1 bright {A_FadeOut(0.1);
			A_ScaleVelocity(0.9);}
		Wait}}
actor buckshot_smoke{
	scale 0.1
	alpha 0.45
	renderstyle add
	+NOTELEPORT
	+FORCEXYBILLBOARD
	+NOINTERACTION
	states{
	spawn:
		TNT1 A 3
		TNT1 A 0 A_Jump(256,1,2,3,4,5,6)
		SMK1 A 0 A_Jump(256,6)
		SMK1 B 0 A_Jump(256,5)
		SMK1 C 0 A_Jump(256,4)
		SMK1 D 0 A_Jump(256,3)
		SMK1 E 0 A_Jump(256,2)
		SMK1 F 0
		"####" "#" 2 {A_Fadeout(0.015);
			A_SetScale(ScaleX*1.02,ScaleY*1.02);}
		Wait}}
actor regshell_casing{
	scale 0.09
	radius 2
	height 2
	speed 6
	mass 4
	bouncefactor 0.5
	PROJECTILE
	+DOOMBOUNCE
	+NODROPOFF
	+FORCEXYBILLBOARD
	+NOTELEPORT
	+FLOORCLIP
	-NOGRAVITY
	-NOBLOCKMAP
	seesound "casings/hp_shell"
	deathsound "casings/hp_shell"
	states{
	spawn:
		SHCS ABCDEFG 2
		loop
	death:
		TNT1 A 0 A_Jump(256,1,2,3)
		SHCS C 0
		SHCS D 0
		SCCS G 0
		"####" "#" 400
		"####" "#" 1 A_FadeOut(0.1)
		Wait}}
ACTOR regshell_casing2:regshell_casing{
	States{
	Spawn:
		SHCS GFEDCBA 2
		Loop}}
actor regshell_spawner{
	speed 15
	PROJECTILE
	+NOCLIP
	states{
	spawn:
		TNT1 A 0 NoDelay A_Jump(256,1,2)
		TNT1 A 1 A_SpawnItemEx("regshell_casing",-7,9,0,0,random(3,4),random(1,2),0,SXF_TRANSFERPOINTERS) 
		stop
		TNT1 A 1 A_SpawnItemEx("regshell_casing2",-7,9,0,0,random(3,4),random(1,2),0,SXF_TRANSFERPOINTERS) 
		stop}}