ACTOR OrionSniper:MSXWeapon{
	weapon.selectionorder 200
	inventory.pickupsound "weapons/sg_bolt"
	Inventory.PickupMessage "'Orion' EMSR-Mark5 Sniper Gauss Cannon" 
	Weapon.AmmoType1 "sgaussmag"
	Weapon.AmmoType2 "sgauss_ammo"
	Weapon.AmmoUse 1
	Weapon.AmmoGive2 5
	weapon.kickback 100
	weapon.bobstyle inverse
	weapon.bobrangeX 0.4
	weapon.bobrangeY 0.6
	weapon.bobspeed 2.5
	DamageType "ORION_Slug"
	+AMMO_OPTIONAL	
	+NOALERT
	+WEAPON.NOAUTOAIM
	scale 0.29
	states{
	Spawn:
		SGAW A -1
		Stop
	Select:
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_QuickSwap")==1,"SeLoop")
		TNT1 A 15 
	 SeLoop:
		TNT1 AAAAAAAAAA 0 A_Raise
		TNT1 A 1 A_Raise
		Loop
	Deselect:
		TNT1 A 0 A_JumpIfInventory("OrionZoom16x",1,2)
		TNT1 A 0 A_JumpIfInventory("OrionZoom4x",1,1)
		Goto Deselect+10
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_OrionDisableZoomScaling")!=0,2)
		TNT1 A 0 A_ZoomFactor(1.0,ZOOM_INSTANT)
		Goto Deselect+5
		TNT1 A 0 A_ZoomFactor(1.0,ZOOM_NOSCALETURNING|ZOOM_INSTANT)
		SGZU E 1 {A_TakeInventory("OrionZoom4x");
			A_TakeInventory("OrionZoom16x");
			A_GiveInventory("sgauss_acc",60);
			ACS_NamedExecute("Player-ChangeSpeed",0,100,0,0);}
		SGZU DCBA 1
		SGAU A 1 {A_StopSound(6);
			A_PlaySound("weapons/sg_idleoff",6,1.4);
			A_TakeInventory("xhair_switch");
			A_TakeInventory("sgauss_acc",50);
			A_PlaySound("weapons/tp_deselect",CHAN_WEAPON);}
		SGAU BCDEFG 1
		TNT1 AAAAAAAAAA 0 A_Lower
		TNT1 A 1 A_Lower
		Goto Deselect+15
	Ready:
		SGAU G 1 A_PlaySound("weapons/sg_select",CHAN_WEAPON)
		SGAU FEDCBA 1
		TNT1 A 0 {A_SetCrosshair(10);
			A_GiveInventory("xhair_switch");
			A_PlaySound("weapons/sg_idle",6,1.4,1);}
	Idle:
		SGAI A 1 A_WeaponReady(WRF_ALLOWZOOM|WRF_ALLOWRELOAD|WRF_ALLOWUSER1|WRF_ALLOWUSER2|WRF_ALLOWUSER3|WRF_ALLOWUSER4)
		"####" "#" 0 A_JumpIfInventory("SprintingPlayer",1,"Sprint")
		loop
	IdleZoom:
		"####" "#" 0 A_PlaySound("weapons/sg_idle",6,1.0,1)
		"####" "#" 0 A_JumpIfInventory("OrionZoom16x",1,"IdleZoomLoop16x")
	IdleZoomLoop:
		"####" "#" 0 A_JumpIf((GetCVar("MSfiXd_OrionDisableZoomScaling")==1||GetCVar("MSfiXd_OrionDisableZoomScaling")==3),2)
		"####" "#" 0 A_ZoomFactor(4.0,ZOOM_INSTANT)
		Goto IdleZoomLoop+3
		"####" "#" 0 A_ZoomFactor(4.0,ZOOM_NOSCALETURNING|ZOOM_INSTANT)
		"####" "#" 0 A_JumpIfInventory("sgaussmag",1,2)
		SGZI C 1 bright A_WeaponReady(WRF_NOBOB|WRF_ALLOWRELOAD|WRF_ALLOWZOOM|WRF_ALLOWUSER1|WRF_ALLOWUSER2|WRF_ALLOWUSER3|WRF_ALLOWUSER4)
		Goto IdleZoomLoop+5
		SGZI A 1 bright A_WeaponReady(WRF_NOBOB|WRF_ALLOWRELOAD|WRF_ALLOWZOOM|WRF_ALLOWUSER1|WRF_ALLOWUSER2|WRF_ALLOWUSER3|WRF_ALLOWUSER4)
		Goto IdleZoomLoop+5
		"####" "#" 0 A_JumpIfInventory("SprintingPlayer",1,"UnZoom2Sprint")
		Loop
	IdleZoomLoop16x:
		"####" "#" 0 A_JumpIf((GetCVar("MSfiXd_OrionDisableZoomScaling")==2||GetCVar("MSfiXd_OrionDisableZoomScaling")==3),2)
		"####" "#" 0 A_ZoomFactor(16.0,ZOOM_INSTANT)
		Goto IdleZoomLoop16x+3
		"####" "#" 0 A_ZoomFactor(16.0,ZOOM_NOSCALETURNING|ZOOM_INSTANT)
		"####" "#" 0 A_JumpIfInventory("sgaussmag",1,2)
		SGZI D 1 bright A_WeaponReady(WRF_NOBOB|WRF_ALLOWRELOAD|WRF_ALLOWZOOM|WRF_ALLOWUSER1|WRF_ALLOWUSER2|WRF_ALLOWUSER3|WRF_ALLOWUSER4)
		Goto IdleZoomLoop16x+6
		SGZI B 1 bright A_WeaponReady(WRF_NOBOB|WRF_ALLOWRELOAD|WRF_ALLOWZOOM|WRF_ALLOWUSER1|WRF_ALLOWUSER2|WRF_ALLOWUSER3|WRF_ALLOWUSER4)
		Goto IdleZoomLoop16x+6
		"####" "#" 0 A_JumpIfInventory("SprintingPlayer",1,"UnZoom2Sprint")
		Loop
	UnZoom2Sprint:
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_OrionDisableZoomScaling")!=0,2)
		TNT1 A 0 A_ZoomFactor(1.0,ZOOM_INSTANT)
		Goto UnZoom2Sprint+3
		TNT1 A 0 A_ZoomFactor(1.0,ZOOM_NOSCALETURNING|ZOOM_INSTANT)
		SGZU E 1 ACS_NamedExecute("Player-ChangeSpeed",0,100,0,0)
		SGZU DCBA 1
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_OrionZoomReturn")==2,3)
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_OrionZoomReturn_Reload")==1,2)
		TNT1 A 0 {A_TakeInventory("OrionZoom16x");
			A_TakeInventory("OrionZoom4x");}
	Sprint:
		"####" "#" 0 A_JumpIf(GetCVar("MSfiXd_SprintStaminaUse")==0,"SprStart")
		TNT1 A 0 A_JumpIfInventory("PlayerStamina",1,"SprStart")
		TNT1 A 0 A_TakeInventory("SprintingPlayer")
		Goto Idle
	SprStart:
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_SprintHands")==1,"SprStart_HandWeapon")
		TNT1 A 0 {A_TakeInventory("xhair_switch");
			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);}
		SGAS ABCDE 1 Offset(0,32)
		"####" "#" 0 A_JumpIfInventory("SprintingPlayer",1,"SprLoop1")
		Goto SprEnd
	SprStart_HandWeapon:
		SGAU A 1{A_StopSound(6);
			A_PlaySound("weapons/sg_idleoff",6,1.4);
			A_PlaySound("weapons/tp_deselect",CHAN_WEAPON);
			A_GiveInventory("sgauss_acc",60);
			A_TakeInventory("xhair_switch");}
		SGAU CEG 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);//resets the offsets
			ACS_NamedExecute("Player-ChangeSpeed",0,100,0,0);
			A_PlaySound("sfx/sprintend",CHAN_AUTO);}
		SGAS EDCBA 1 
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_OrionZoomReturn")==2,"ReturnZoom")
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_OrionZoomReturn_Sprint")==1,"ReturnZoom")
		TNT1 A 0 {A_GiveInventory("xhair_switch");
			A_TakeInventory("OrionZoom16x");
			A_TakeInventory("OrionZoom4x");}
		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);}
		SGAU G 1 {A_PlaySound("weapons/sg_select",CHAN_WEAPON);
			A_TakeInventory("SprintHands");
			A_SetCrosshair(10);}
		SGAU ECA 1
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_OrionZoomReturn")==2,"ReturnZoom")
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_OrionZoomReturn_Sprint")==1,"ReturnZoom")
		TNT1 A 0 {A_GiveInventory("xhair_switch");
			A_PlaySound("weapons/sg_idle",6,1.4,1);}
		Goto Idle
	Fire:
		TNT1 A 0 A_JumpIfInventory("OrionZoom4x",1,"zoomedfire")
		TNT1 A 0 A_JumpIfInventory("OrionZoom16x",1,"zoomedfire")
		TNT1 A 0 A_JumpIfInventory("sgaussmag",1,2)
		SGAI A 15 A_PlaySound("weapons/noammo",CHAN_AUTO)
		Goto Idle
		TNT1 A 0 {A_Overlay(100,"GaussRecoil");
			A_StopSound(6);
			A_PlaySound("weapons/sg_fire",CHAN_WEAPON);
			A_AlertMonsters(0.0);
			A_RailAttack(0,4,1,"none","none",RGF_FULLBRIGHT|RGF_SILENT|RGF_NOPIERCING,0,"none",0,0,0,35,1.0,1.0,"gausssmoke_spawner",0,0,0);}
		//TNT1 A 0 A_RailAttack(0,4,1,none,none,RGF_FULLBRIGHT|RGF_SILENT|RGF_NOPIERCING,0,0,0,0,300,0,1.0,0,"gausssmoke_spawner")
		TNT1 AAAAAAAAAA 0 A_FireCustomMissile("gausssmoke_spawner2",0,0,3,4,0)			
		TNT1 A 0 A_JumpIfInventory("sgauss_acc",60,"FrAcc4")
		TNT1 A 0 A_JumpIfInventory("sgauss_acc",30,"FrAcc3")
		TNT1 A 0 A_JumpIfInventory("sgauss_acc",1,"FrAcc2")	
	FrAcc1:
		TNT1 AAA 0 A_FireCustomMissile("gauss_shot",0,0,3,4)
		TNT1 AAAAAA 0 A_FireCustomMissile("gauss_shotB",0,0,3,4)			
		SGF1 A 1 bright
		TNT1 A 0 {ACS_NamedExecute("Weapon-Recoil",0,18,random(-20,20),0);
			A_GiveInventory("sgauss_acc",90);}
		Goto FireLast
	FrAcc2:			
		TNT1 A 0 {ACS_NamedExecute("set_SGAcc_rand",0,1,2,0);
			ACS_NamedExecute("set_SGAcc_rand",0,1,1,1);}
		TNT1 AAA 0 A_FireCustomMissile("gauss_shot",ACS_NamedExecuteWithResult("get_SGAcc_rand",0),0,3,4,0,ACS_NamedExecuteWithResult("get_SGAcc_rand",1))
		TNT1 AAAAAA 0 A_FireCustomMissile("gauss_shotB",ACS_NamedExecuteWithResult("get_SGAcc_rand",0),0,3,4,0,ACS_NamedExecuteWithResult("get_SGAcc_rand",1))
		TNT1 A 0 ACS_NamedExecute("Weapon-Recoil",0,24,random(-40,40),0)
		SGF1 A 1 bright
		TNT1 A 0 A_GiveInventory("sgauss_acc",90)
		Goto FireLast
	FrAcc3:
		TNT1 A 0 {ACS_NamedExecute("set_SGAcc_rand",0,2,5,0);
			ACS_NamedExecute("set_SGAcc_rand",0,2,3,1);}
		TNT1 AAA 0 A_FireCustomMissile("gauss_shot",ACS_NamedExecuteWithResult("get_SGAcc_rand",0),0,3,4,0,ACS_NamedExecuteWithResult("get_SGAcc_rand",1))
		TNT1 AAAAAA 0 A_FireCustomMissile("gauss_shotB",ACS_NamedExecuteWithResult("get_SGAcc_rand",0),0,3,4,0,ACS_NamedExecuteWithResult("get_SGAcc_rand",1))
		TNT1 A 0 ACS_NamedExecute("Weapon-Recoil",0,48,random(-60,60),0)
		SGF1 A 1 bright 
		TNT1 A 0 A_GiveInventory("sgauss_acc",90)
		Goto FireLast
	FrAcc4:			
		TNT1 A 0 {ACS_NamedExecute("set_SGAcc_rand",0,2,8,0);
			ACS_NamedExecute("set_SGAcc_rand",0,2,5,1);}
		TNT1 AAA 0 A_FireCustomMissile("gauss_shot",ACS_NamedExecuteWithResult("get_SGAcc_rand",0),0,3,4,0,ACS_NamedExecuteWithResult("get_SGAcc_rand",1))
		TNT1 AAAAAA 0 A_FireCustomMissile("gauss_shotB",ACS_NamedExecuteWithResult("get_SGAcc_rand",0),0,3,4,0,ACS_NamedExecuteWithResult("get_SGAcc_rand",1))
		TNT1 A 0 ACS_NamedExecute("Weapon-Recoil",0,96,random(-80,80),0)
		SGF1 A 1 bright 
		TNT1 A 0 A_GiveInventory("sgauss_acc",90)
		Goto FireLast
	FireLast:
		TNT1 A 0 A_GiveInventory("xhair_hold")
		SGF1 B 1 bright 
		TNT1 A 0 ACS_NamedExecute("Weapon-Recoil",0,18,random(-20,20),0)
		SGF1 C 1 bright 
		SGF1 DEF 1
		TNT1 A 0 A_FireCustomMissile("sgausscasing_spawner",0,0,0,3,0)
		SGF1 GHIJKLMN 2
		TNT1 A 0 A_TakeInventory("xhair_hold")
		SGF1 OP 1
		SGF2 ABCEDFGHIJKLMNO 1
		TNT1 A 0 A_JumpIfInventory("sgaussmag",1,3)
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_AutoReloads")==2,"Reload")
		TNT1 A 0 A_JumpIf((GetCVar("MSfiXd_AutoReloads")==1)&&(GetCVar("MSfiXd_GolamAutoReloads"))==1,"Reload")
		TNT1 A 0 A_PlaySound("weapons/sg_idle",6,1.4,1)
	 FLHold:
		SGAI A 1 A_WeaponReady(WRF_NOPRIMARY|WRF_ALLOWRELOAD|WRF_ALLOWZOOM|WRF_ALLOWUSER1|WRF_ALLOWUSER2|WRF_ALLOWUSER3|WRF_ALLOWUSER3)
		TNT1 A 0 A_JumpIf(GetPlayerInput(INPUT_BUTTONS)&(BT_ATTACK),"FLHold")
		Goto Idle
	GaussRecoil:
		TNT1 A 1 
		TNT1 A 1 A_ZoomFactor(0.995)
		TNT1 A 1 A_ZoomFactor(0.990)
		TNT1 A 1 A_ZoomFactor(0.985)
		TNT1 A 1 A_ZoomFactor(0.980)
		TNT1 A 1 A_ZoomFactor(0.975)
		TNT1 A 1 A_ZoomFactor(0.970)
		TNT1 A 1 A_ZoomFactor(0.965)
		TNT1 A 1 A_ZoomFactor(0.960)
		TNT1 A 1 A_ZoomFactor(0.955)
		TNT1 A 1 A_ZoomFactor(0.950)
		TNT1 A 18
		TNT1 A 1 A_ZoomFactor(0.960)
		TNT1 A 1 A_ZoomFactor(0.970)
		TNT1 A 1 A_ZoomFactor(0.980)
		TNT1 A 1 A_ZoomFactor(0.990)
		TNT1 A 1 A_ZoomFactor(1.000)
		Stop
	zoomedfire:
		TNT1 A 0 A_JumpIfInventory("sgaussmag",1,"zoomedfire")
		TNT1 A 0 A_PlaySound("weapons/noammo",CHAN_AUTO)
		TNT1 A 0 A_JumpIfInventory("OrionZoom16x",1,2)
		SGZI C 15 bright
		Goto IdleZoom
		SGZI D 15 bright					
		Goto IdleZoom
	zoomedfire:
		TNT1 A 0 {A_StopSound(6);
			A_PlaySound("weapons/sg_fire",CHAN_WEAPON);
			A_AlertMonsters(0.0);
			A_RailAttack(0,4,1,"none","none",RGF_FULLBRIGHT|RGF_SILENT|RGF_NOPIERCING,0,"none",0,0,0,35,1.0,1.0,"gausssmoke_spawner",0,0,0);}
		TNT1 AAAAAAAAAA 0 A_FireCustomMissile("gausssmoke_spawner2",0,0,0,4,0)
		TNT1 AAA 0 A_FireCustomMissile("gauss_shot",0,0,0,4)
		TNT1 AAAAAA 0 A_FireCustomMissile("gauss_shotB",0,0,0,4)			
		TNT1 A 0 A_JumpIfInventory("OrionZoom16x",1,"zoomedfireend_16x")
		Goto zoomedfireend_4x
	zoomedfireend_4x:
		SGZF A 1 bright
		TNT1 A 0 ACS_NamedExecute("Weapon-Recoil",0,25,random(-25,25),0)
		SGZF A 6 bright
		TNT1 A 0 A_FireCustomMissile("sgausscasing_spawner2",0,0,0,3,0)
		SGZF A 35 bright
		TNT1 A 0 A_JumpIfInventory("sgaussmag",1,3)
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_AutoReloads")==2,"UnZoomToReload")
		TNT1 A 0 A_JumpIf((GetCVar("MSfiXd_AutoReloads")==1)&&(GetCVar("MSfiXd_GolamAutoReloads"))==1,"UnZoomToReload")
		TNT1 A 0 A_PlaySound("weapons/sg_idle",6,1.4,1)
		Goto IdleZoom
	zoomedfireend_16x:
		SGZF B 1 bright
		TNT1 A 0 ACS_NamedExecute("Weapon-Recoil",0,25,random(-25,25),0)
		SGZF B 6 bright
		TNT1 A 0 A_FireCustomMissile("sgausscasing_spawner2",0,0,0,3,0)
		SGZF B 35 bright
		TNT1 A 0 A_JumpIfInventory("sgaussmag",1,3)
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_AutoReloads")==2,"UnZoomToReload")
		TNT1 A 0 A_JumpIf((GetCVar("MSfiXd_AutoReloads")==1)&&(GetCVar("MSfiXd_GolamAutoReloads"))==1,"UnZoomToReload")
		TNT1 A 0 A_PlaySound("weapons/sg_idle",6,1.4,1)
		Goto IdleZoom
	Zoom:
		TNT1 A 0 A_JumpIfInventory("OrionZoom16x",1,"Zoom16xTo4x")
		TNT1 A 0 A_JumpIfInventory("OrionZoom4x",1,"ZoomTo16x")
	 ZoomTo4x:
		SGZU A 1 {A_GiveInventory("OrionZoom4x");
			A_TakeInventory("OrionZoom16x");
			A_TakeInventory("sgauss_acc",90);
			ACS_NamedExecute("Player-ChangeSpeed",0,50,0,0);
			A_TakeInventory("xhair_switch");
			A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH|WRF_NOBOB);}
		SGZU BCDE 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH|WRF_NOBOB)
		TNT1 A 0 A_JumpIf((GetCVar("MSfiXd_OrionDisableZoomScaling")==1||GetCVar("MSfiXd_OrionDisableZoomScaling")==3),2)
		TNT1 A 0 A_ZoomFactor(4.0,ZOOM_INSTANT)
		Goto ZoomTo4x+8
		TNT1 A 0 A_ZoomFactor(4.0,ZOOM_NOSCALETURNING|ZOOM_INSTANT)
		TNT1 A 0 A_JumpIfInventory("sgaussmag",1,"Z4HoldA")
	  Z4HoldNA:
		SGZI C 1 bright A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH|WRF_NOBOB)
		TNT1 A 0 A_JumpIf(GetPlayerInput(INPUT_BUTTONS)&(BT_ZOOM),"Z4HoldNA")
		Goto IdleZoom
	  Z4HoldA:
		SGZI A 1 bright A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH|WRF_NOBOB)
		TNT1 A 0 A_JumpIf(GetPlayerInput(INPUT_BUTTONS)&(BT_ZOOM),"Z4HoldA")
		Goto IdleZoom
	 ZoomTo16x:
		TNT1 A 0 A_JumpIf((GetCVar("MSfiXd_OrionDisableZoomScaling")==2||GetCVar("MSfiXd_OrionDisableZoomScaling")==3),2)
		TNT1 A 0 A_ZoomFactor(16.0,ZOOM_INSTANT)
		Goto ZoomTo16x+3
		TNT1 A 0 A_ZoomFactor(16.0,ZOOM_NOSCALETURNING|ZOOM_INSTANT)
		TNT1 A 0 {A_GiveInventory("OrionZoom16x");
			A_TakeInventory("OrionZoom4x");
			A_PlaySound("weapons/sg_zoomin",CHAN_WEAPON);}
		TNT1 A 0 A_JumpIfInventory("sgaussmag",1,"Z16HoldA")
	  Z16HoldNA:
		SGZI D 1 bright A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH|WRF_NOBOB)
		TNT1 A 0 A_JumpIf(GetPlayerInput(INPUT_BUTTONS)&(BT_ZOOM),"Z16HoldNA")
		Goto IdleZoom
	  Z16HoldA:
		SGZI B 1 bright A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH|WRF_NOBOB)
		TNT1 A 0 A_JumpIf(GetPlayerInput(INPUT_BUTTONS)&(BT_ZOOM),"Z16HoldA")
		Goto IdleZoom
	 Zoom16xTo4x:
		TNT1 A 0 A_JumpIf((GetCVar("MSfiXd_OrionDisableZoomScaling")==1||GetCVar("MSfiXd_OrionDisableZoomScaling")==3),2)
		TNT1 A 0 A_ZoomFactor(4.0,ZOOM_INSTANT)
		Goto Zoom16xTo4x+3
		TNT1 A 0 A_ZoomFactor(4.0,ZOOM_NOSCALETURNING|ZOOM_INSTANT)
		TNT1 A 0 {A_GiveInventory("OrionZoom4x");
			A_TakeInventory("OrionZoom16x");
			A_PlaySound("weapons/sg_zoomout",CHAN_WEAPON);}
		TNT1 A 0 A_JumpIfInventory("sgaussmag",1,3)
	  Z164HoldNA:
		SGZI C 1 bright A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH|WRF_NOBOB)
		TNT1 A 0 A_JumpIf(GetPlayerInput(INPUT_BUTTONS)&(BT_ZOOM),"Z164HoldNA")
		Goto IdleZoom
	  Z164HoldA:
		SGZI A 1 bright A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH|WRF_NOBOB)
		TNT1 A 0 A_JumpIf(GetPlayerInput(INPUT_BUTTONS)&(BT_ZOOM),"Z164HoldA")
		Goto IdleZoom
	ZoomNormTo16x:
		SGZU A 1 {A_GiveInventory("OrionZoom16x");
			A_TakeInventory("OrionZoom4x");
			A_TakeInventory("sgauss_acc",90);
			ACS_NamedExecute("Player-ChangeSpeed",0,50,0,0);
			A_TakeInventory("xhair_switch");
			A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH|WRF_NOBOB);}
		SGZU BCDE 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH|WRF_NOBOB)
		TNT1 A 0 A_JumpIf((GetCVar("MSfiXd_OrionDisableZoomScaling")==2||GetCVar("MSfiXd_OrionDisableZoomScaling")==3),2)
		TNT1 A 0 A_ZoomFactor(16.0,ZOOM_INSTANT)
		Goto ZoomNormTo16x+8
		TNT1 A 0 A_ZoomFactor(16.0,ZOOM_NOSCALETURNING|ZOOM_INSTANT)
		TNT1 A 0 A_JumpIfInventory("sgaussmag",1,"Z16HoldA")
		Goto Z16HoldNA
	ReturnZoom:
		TNT1 A 0 A_JumpIfInventory("OrionZoom16x",1,"ZoomNormTo16x")
		TNT1 A 0 A_JumpIfInventory("OrionZoom4x",1,"ZoomTo4x")
		TNT1 A 0 {A_GiveInventory("xhair_switch");
			A_TakeInventory("OrionZoom16x");
			A_TakeInventory("OrionZoom4x");
			A_PlaySound("weapons/sg_idle",6,1.4,1);}
		Goto Idle
	UnZoomToReload:
		TNT1 A 0 A_JumpIfInventory("sgaussmag",5,"IdleZoom")
		TNT1 A 0 A_JumpIfInventory("sgauss_ammo",1,1)
		Goto IdleZoom
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_OrionZoomReturn")==2,3)
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_OrionZoomReturn_Reload")==1,2)
		TNT1 A 0 {A_TakeInventory("OrionZoom4x");
			A_TakeInventory("OrionZoom16x");}
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_OrionDisableZoomScaling")!=0,2)
		TNT1 A 0 A_ZoomFactor(1.0,ZOOM_INSTANT)
		Goto UnZoomToReload+8
		TNT1 A 0 A_ZoomFactor(1.0,ZOOM_NOSCALETURNING|ZOOM_INSTANT)	
		SGZU E 1 {A_GiveInventory("sgauss_acc",60);
			ACS_NamedExecute("Player-ChangeSpeed",0,100,0,0);
			A_GiveInventory("xhair_switch");}
		SGZU DCBA 1
		Goto Reload+4
	Reload:
		TNT1 A 0 A_JumpIfInventory("OrionZoom4x",1,"UnZoomToReload")
		TNT1 A 0 A_JumpIfInventory("OrionZoom16x",1,"UnZoomToReload")
		TNT1 A 0 A_JumpIfInventory("sgaussmag",5,"Idle")
		TNT1 A 0 A_JumpIfInventory("sgauss_ammo",1,1)
		Goto Idle			
		TNT1 A 0 {A_GiveInventory("xhair_hold");
			A_GiveInventory("sgauss_acc",90);}
		SGRS ABCDEFGHIJKLMN 1
		SGRS OPQ 2
		TNT1 A 0 {A_StopSound(6);
			A_PlaySound("weapons/sg_idleoff",6,1.4);
			A_PlaySound("weapons/sg_clipout",CHAN_WEAPON);}
		SGRC ABCDEFGHI 1
		SGRC J 10
		SGRC KLMNOPQRR 1
		SGRC S 6
		TNT1 A 0 A_PlaySound("weapons/sg_clipin",CHAN_WEAPON)
		SGRC TUV 1
		SGRC W 8
		TNT1 A 0 A_JumpIfInventory("sgaussmag",1,"Reload_FillClipB")
	Reload_FillClipA:	
		TNT1 A 0 {A_TakeInventory("sgauss_ammo",1);
			A_GiveInventory("sgaussmag",1);}
		TNT1 A 0 A_JumpIfInventory("sgaussmag",5,"ReloadFinish_Long")
		TNT1 A 0 A_JumpIfInventory("sgauss_ammo",1,"Reload_FillClipA")
	ReloadFinish_Long:			
		SGRL ABCDEFGHIJKLMNO 1
		SGRB A 8
		TNT1 A 0 A_PlaySound("weapons/sg_bolt",CHAN_WEAPON)
		SGRB BCDE 1
		SGRB F 10
		TNT1 A 0 A_TakeInventory("xhair_hold")
		SGRB GHIJKLMN 1
		TNT1 A 0 A_PlaySound("weapons/sg_idle",6,1.4,1)
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_OrionZoomReturn")==2,"ReturnZoom")
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_OrionZoomReturn_Reload")==1,"ReturnZoom")
		TNT1 A 0 {A_GiveInventory("xhair_switch");
			A_TakeInventory("OrionZoom16x");
			A_TakeInventory("OrionZoom4x");}
		Goto Idle
	Reload_FillClipB:	
		TNT1 A 0 {A_TakeInventory("sgauss_ammo",1);
			A_GiveInventory("sgaussmag",1);}
		TNT1 A 0 A_JumpIfInventory("sgaussmag",5,"ReloadFinish_Quick")
		TNT1 A 0 A_JumpIfInventory("sgauss_ammo",1,"Reload_FillClipB")
	ReloadFinish_Quick:
		TNT1 A 0 A_TakeInventory("xhair_hold")			
		SGRQ ABCDEFGHIJKLM 1
		TNT1 A 0 A_PlaySound("weapons/sg_idle",6,1.4,1)
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_OrionZoomReturn")==2,"ReturnZoom")
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_OrionZoomReturn_Reload")==1,"ReturnZoom")
		TNT1 A 0 {A_GiveInventory("xhair_switch");
			A_TakeInventory("OrionZoom16x");
			A_TakeInventory("OrionZoom4x");}
		Goto Idle
	UnZoom2Gren:
		TNT1 A 0 A_JumpIfInventory("grenades",1,3)
		TNT1 A 0 A_JumpIfInventory("OrionZoom16x",1,"IdleZoom")
		TNT1 A 0 A_JumpIfInventory("OrionZoom4x",1,"IdleZoom")
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_OrionZoomReturn")==2,3)
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_OrionZoomReturn_Grenades")==1,2)
		TNT1 A 0 {A_TakeInventory("OrionZoom16x");
			A_TakeInventory("OrionZoom4x");}
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_OrionDisableZoomScaling")!=0,2)
		TNT1 A 0 A_ZoomFactor(1.0,ZOOM_INSTANT)
		Goto UnZoom2Gren+9
		TNT1 A 0 A_ZoomFactor(1.0,ZOOM_NOSCALETURNING|ZOOM_INSTANT)		
		SGZU E 1 ACS_NamedExecute("Player-ChangeSpeed",0,100,0,0)
		SGZU DCBA 1
		Goto User1+3
	User1:
		TNT1 A 0 A_JumpIfInventory("OrionZoom16x",1,"UnZoom2Gren")
		TNT1 A 0 A_JumpIfInventory("OrionZoom4x",1,"UnZoom2Gren")
		TNT1 A 0 A_JumpIfInventory("grenades",1,1)
		Goto Idle
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_OrionDisableZoomScaling")!=0,2)
		TNT1 A 0 A_ZoomFactor(1.0,ZOOM_INSTANT)
		Goto User1+6
		TNT1 A 0 A_ZoomFactor(1.0,ZOOM_NOSCALETURNING|ZOOM_INSTANT)	
		SGAG A 1 {A_StopSound(6);
			A_PlaySound("weapons/sg_idleoff",6,1.4);
			A_TakeInventory("sgauss_acc",50);
			ACS_NamedExecute("Player-ChangeSpeed",0,100,0,0);
			A_PlaySound("weapons/tp_deselect",CHAN_WEAPON);}
		SGAG BCDEFG 1
		TNT1 A 0 A_Jump(256,"GrenadeStart")
		Goto GrenadeStart
	GrenadeEnd:
		SGAU G 1 {A_TakeInventory("GrenadeHold");
			A_PlaySound("weapons/sg_select",CHAN_WEAPON);
			A_SetCrosshair(10);}
		SGAU FEDCBA 1
		TNT1 A 0 A_PlaySound("weapons/sg_idle",6,1.4,1)
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_OrionZoomReturn")==2,"ReturnZoom")
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_OrionZoomReturn_Grenades")==1,"ReturnZoom")
		TNT1 A 0 {A_GiveInventory("xhair_switch");
			A_TakeInventory("OrionZoom16x");
			A_TakeInventory("OrionZoom4x");}
		Goto Idle
	AltFire:
		TNT1 A 0 A_JumpIfInventory("OrionZoom16x",1,"ZoomOutSlam")
		TNT1 A 0 A_JumpIfInventory("OrionZoom4x",1,"ZoomOutSlam")
		Goto Slam
	ZoomOutSlam:
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_OrionZoomReturn")==2,3)
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_OrionZoomReturn_WeaponMelee")==1,2)
		TNT1 A 0 {A_TakeInventory("OrionZoom16x");
			A_TakeInventory("OrionZoom4x");}
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_OrionDisableZoomScaling")!=0,2)
		TNT1 A 0 A_ZoomFactor(1.0,ZOOM_INSTANT)
		Goto ZoomOutSlam+6
		TNT1 A 0 A_ZoomFactor(1.0,ZOOM_NOSCALETURNING|ZOOM_INSTANT)		
		SGZU E 1 {ACS_NamedExecute("Player-ChangeSpeed",0,100,0,0);
			A_GiveInventory("sgauss_acc",60);
			A_GiveInventory("xhair_switch");}
		SGZU DCBA 1
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_OrionMeleeOnScopeExit")==0,1)
		Goto Idle
	 Slam:
		SGAM C 1 A_Recoil(-7)
		TNT1 A 0 A_PlayWeaponSound("sfx/meleeswing")
		SGAM EGIK 1
		SGAM N 9 A_CustomPunch((180+random(1,32)),1,CPF_DAGGER|CPF_NOTURN,"Orion_meleepuff",90)
		SGAM MLKJIHGFEDCBA 1	
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_OrionZoomReturn")==2,"ReturnZoom")
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_OrionZoomReturn_WeaponMelee")==1,"ReturnZoom")
		TNT1 A 0 {A_GiveInventory("xhair_switch");
			A_TakeInventory("OrionZoom16x");
			A_TakeInventory("OrionZoom4x");}
		Goto Idle
	// Health Stim Stuff //
	Stim_HolsterCheck:
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_HolsterWeapForItems")==0,"Stimulate")
		TNT1 A 0 A_JumpIfInventory("OrionZoom16x",1,2)
		TNT1 A 0 A_JumpIfInventory("OrionZoom4x",1,1)
		Goto Stim_HolsterCheck+14
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_OrionZoomReturn")==2,3)
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_OrionZoomReturn_HealthStim")==1,2)
		TNT1 A 0 {A_TakeInventory("OrionZoom16x");
			A_TakeInventory("OrionZoom4x");}
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_OrionDisableZoomScaling")!=0,2)
		TNT1 A 0 A_ZoomFactor(1.0,ZOOM_INSTANT)
		Goto Boost_HolsterCheck+9
		TNT1 A 0 A_ZoomFactor(1.0,ZOOM_NOSCALETURNING|ZOOM_INSTANT)	
		SGZU E 1 ACS_NamedExecute("Player-ChangeSpeed",0,100,0,0)
		SGZU DCBA 1
		SGAU A 1 {A_StopSound(6);
			A_PlaySound("weapons/sg_idleoff",6,1.4);
			A_TakeInventory("xhair_switch");
			A_TakeInventory("sgauss_acc",50);
			A_PlaySound("weapons/tp_deselect",CHAN_WEAPON);}
		SGAU BCDEFG 1
		TNT1 A 0 A_Jump(256,"Stimulate")
		Goto Stimulate
	StimulateEnd:
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_HolsterWeapForItems")==0,"StimulateEnd_Quick")
		SGAU G 1 A_PlaySound("weapons/sg_select",CHAN_WEAPON)
		SGAU FEDCBA 1
		TNT1 A 0 {A_SetCrosshair(10);
			A_GiveInventory("xhair_switch");
			A_PlaySound("weapons/sg_idle",6,1.4,1);}
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_OrionZoomReturn")==2,"ReturnZoom")
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_OrionZoomReturn_HealthStim")==1,"ReturnZoom")
		TNT1 A 0 {A_GiveInventory("xhair_switch");
			A_TakeInventory("OrionZoom16x");
			A_TakeInventory("OrionZoom4x");}
		Goto Idle
	StimulateEnd_Quick:
		TNT1 A 0 A_JumpIfInventory("OrionZoom4x",1,"SEQ4X")
		TNT1 A 0 A_JumpIfInventory("OrionZoom16x",1,"SEQ16X")
		SGAI A 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
		TNT1 A 0 A_JumpIf(GetPlayerInput(INPUT_BUTTONS)&(BT_USER2),"StimulateEnd_Quick")
		Goto Idle
	 SEQ4X:
		TNT1 A 0 A_JumpIfInventory("sgaussmag",1,3)
		SGZI C 1 bright A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH|WRF_NOBOB)
		TNT1 A 0 A_JumpIf(GetPlayerInput(INPUT_BUTTONS)&(BT_USER2),"SEQ4X")
		Goto IdleZoom
		SGZI A 1 bright A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH|WRF_NOBOB)
		TNT1 A 0 A_JumpIf(GetPlayerInput(INPUT_BUTTONS)&(BT_USER2),"SEQ4X")
		Goto IdleZoom
	 SEQ16X:
		TNT1 A 0 A_JumpIfInventory("sgaussmag",1,3)
		SGZI D 1 bright A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH|WRF_NOBOB)
		TNT1 A 0 A_JumpIf(GetPlayerInput(INPUT_BUTTONS)&(BT_USER2),"SEQ16X")
		Goto IdleZoom
		SGZI B 1 bright A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH|WRF_NOBOB)
		TNT1 A 0 A_JumpIf(GetPlayerInput(INPUT_BUTTONS)&(BT_USER2),"SEQ16X")
		Goto IdleZoom
	// Shield Booster Stuff //
	Boost_HolsterCheck:
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_HolsterWeapForItems")==0,"Boostify")
		TNT1 A 0 A_JumpIfInventory("OrionZoom16x",1,2)
		TNT1 A 0 A_JumpIfInventory("OrionZoom4x",1,1)
		Goto Boost_HolsterCheck+14
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_OrionZoomReturn")==2,3)
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_OrionZoomReturn_ShieldBooster")==1,2)
		TNT1 A 0 {A_TakeInventory("OrionZoom16x");
			A_TakeInventory("OrionZoom4x");}
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_OrionDisableZoomScaling")!=0,2)
		TNT1 A 0 A_ZoomFactor(1.0,ZOOM_INSTANT)
		Goto Boost_HolsterCheck+9
		TNT1 A 0 A_ZoomFactor(1.0,ZOOM_NOSCALETURNING|ZOOM_INSTANT)	
		SGZU E 1 ACS_NamedExecute("Player-ChangeSpeed",0,100,0,0)
		SGZU DCBA 1
		SGAU A 1 {A_StopSound(6);
			A_PlaySound("weapons/sg_idleoff",6,1.4);
			A_PlaySound("weapons/tp_deselect",CHAN_WEAPON);}
		SGAU BCDEFG 1
		TNT1 A 0 A_Jump(256,"Boostify")
		Goto Boostify
	BoostifyEnd:
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_HolsterWeapForItems")==0,"BoostifyEnd_Quick")
		SGAU G 1 A_PlaySound("weapons/sg_select",CHAN_WEAPON)
		SGAU FEDCBA 1
		TNT1 A 0 {A_SetCrosshair(10);
			A_GiveInventory("xhair_switch");
			A_PlaySound("weapons/sg_idle",6,1.4,1);}
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_OrionZoomReturn")==2,"ReturnZoom")
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_OrionZoomReturn_ShieldBooster")==1,"ReturnZoom")
		TNT1 A 0 {A_GiveInventory("xhair_switch");
			A_TakeInventory("OrionZoom16x");
			A_TakeInventory("OrionZoom4x");}
		Goto Idle
	BoostifyEnd_Quick:
		TNT1 A 0 A_JumpIfInventory("OrionZoom4x",1,"BEQ4X")
		TNT1 A 0 A_JumpIfInventory("OrionZoom16x",1,"BEQ16X")
		SGAI A 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
		TNT1 A 0 A_JumpIf(GetPlayerInput(INPUT_BUTTONS)&(BT_USER3),"BoostifyEnd_Quick")
		Goto Idle
	 BEQ4X:
		TNT1 A 0 A_JumpIfInventory("sgaussmag",1,3)
		SGZI C 1 bright A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH|WRF_NOBOB)
		TNT1 A 0 A_JumpIf(GetPlayerInput(INPUT_BUTTONS)&(BT_USER3),"BEQ4X")
		Goto IdleZoom
		SGZI A 1 bright A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH|WRF_NOBOB)
		TNT1 A 0 A_JumpIf(GetPlayerInput(INPUT_BUTTONS)&(BT_USER3),"BEQ4X")
		Goto IdleZoom
	 BEQ16X:
		TNT1 A 0 A_JumpIfInventory("sgaussmag",1,3)
		SGZI D 1 bright A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH|WRF_NOBOB)
		TNT1 A 0 A_JumpIf(GetPlayerInput(INPUT_BUTTONS)&(BT_USER3),"BEQ16X")
		Goto IdleZoom
		SGZI B 1 bright A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH|WRF_NOBOB)
		TNT1 A 0 A_JumpIf(GetPlayerInput(INPUT_BUTTONS)&(BT_USER3),"BEQ16X")
		Goto IdleZoom
	// Jetpack Stuff //
	User4:
		TNT1 A 0 A_JumpIfInventory("OrionZoom16x",1,2)
		TNT1 A 0 A_JumpIfInventory("OrionZoom4x",1,1)
		Goto User4+15
		TNT1 A 0 A_JumpIfInventory("Jetpack",1,1)
		Goto IdleZoom
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_OrionZoomReturn")==2,3)
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_OrionZoomReturn_Jetpack")==1,2)
		TNT1 A 0 {A_TakeInventory("OrionZoom16x");
			A_TakeInventory("OrionZoom4x");}
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_OrionDisableZoomScaling")!=0,2)
		TNT1 A 0 A_ZoomFactor(1.0,ZOOM_INSTANT)
		Goto User4+9
		TNT1 A 0 A_ZoomFactor(1.0,ZOOM_NOSCALETURNING|ZOOM_INSTANT)
		SGZU E 1 ACS_NamedExecute("Player-ChangeSpeed",0,100,0,0)
		SGZU DCBA 1
		TNT1 A 0 A_JumpIfInventory("Jetpack",1,1)
		Goto Idle
		SGAU A 1 {A_StopSound(6);
			A_PlaySound("weapons/sg_idleoff",6,1.4);
			A_TakeInventory("xhair_switch");
			A_PlaySound("weapons/tp_deselect",CHAN_WEAPON);}
		SGAU BCDEFG 1
		TNT1 A 0 A_Jump(256,"JetpackStart")
		Goto JetpackStart
	WeaponJetEnd:
		SGAU G 1 A_PlaySound("weapons/sg_select",CHAN_WEAPON)
		SGAU FEDCBA 1
		TNT1 A 0 {A_SetCrosshair(10);
			A_PlaySound("weapons/sg_idle",6,1.4,1);}
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_OrionZoomReturn")==2,"ReturnZoom")
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_OrionZoomReturn_HealthStim")==1,"ReturnZoom")
		TNT1 A 0 {A_GiveInventory("xhair_switch");
			A_TakeInventory("OrionZoom16x");
			A_TakeInventory("OrionZoom4x");}
		Goto Idle}}
///////////////////////////////////////////////////////////////////////////////////
ACTOR OrionZoom4x:Inventory{}
ACTOR OrionZoom16x:Inventory{}
actor sgaussmag:ammo{inventory.maxamount 5}
actor sgauss_ammo:ammo{
	radius 16
	height 8
	scale 0.32
	inventory.pickupmessage "Pack of .60 Cal Slugs for Sniper Gauss Cannon"
	inventory.pickupsound "weapons/sg_clipin"
	inventory.amount 5
	inventory.maxamount 30
	ammo.backpackamount 5
	ammo.backpackmaxamount 60
	states{
	spawn:
		GSLU AABCDEFGHIJKLM 2
		loop}}
actor sgauss_acc:inventory{
	Inventory.PickupSound ""
	-INVBAR
	inventory.amount 1
	inventory.maxamount 90}
ACTOR Orion_MeleePuff:MeleePuff{DamageType "ORION_Melee"}
actor gauss_shot:fastprojectile{
	DamageType "ORION_Slug"
	radius 2
	height 2
	scale 0.6
	mass 20
	PROJECTILE
	speed 3000
	damage(250+(10*random(0,3)))
	ProjectileKickBack 250
	renderstyle add
	MissileHeight 8
	deathsound "sfx/sboom1"
	Decal "BigScorch"
	states {
	spawn:
		TNT1 A 1 
		loop
	death:
		TNT1 A 0 A_JumpIf(CountInv("MSfiXd_DegninOre",AAPTR_TARGET)>=1,1)
		Goto Death+2
		TNT1 A 0 A_RemoveForceField
		TNT1 A 0 {A_SpawnItemEx("gshot_flash",0,0,0,0,0,0);
			A_SpawnItemEx("gshot_shockwave",0,0,0,0,0,0);}
		TNT1 AA 0 A_SpawnItemEx("gshot_puff",0,0,0,0,frandom(-0.6,0.6),frandom(-0.6,0.6))
		TNT1 AAAAAAAAA 0 A_SpawnItemEx("gshot_spark",0,0,0,random(1,3),random(4,6),random(0,6),random(180,360),0)
		TNT1 AAAAAA 0 A_SpawnItemEx("gshot_spark2",0,0,0,random(1,3),random(4,6),random(0,6),random(180,360),0)
		TNT1 A 4
		TNT1 AAA 0 A_SpawnItemEx("gpuff_smoke",0,0,0,0,random(1,1),random(-1,1),random(180,360),0)
		TNT1 A 0 A_SpawnItemEx("gshot_firespark",0,0,0,random(6,8),random(6,8),random(1,6),random(180,360),0)
		stop}}
actor gauss_shotB:fastprojectile{
	DamageType "ORION_Slug"
	radius 2
	height 2
	scale 0.6
	mass 20
	PROJECTILE
	speed 3000
	damage(200+(10*random(0,3)))
	ProjectileKickBack 250
	renderstyle add
	MissileHeight 8
	Decal "BigScorch"
	states{
	spawn:
		TNT1 A 1 
		loop
	death:
		TNT1 A 0 A_JumpIf(CountInv("MSfiXd_DegninOre",AAPTR_TARGET)<1,2)
		TNT1 A 0 A_RemoveForceField
		TNT1 AA 0 A_SpawnItemEx("gshot_puff",0,0,0,0,frandom(-0.7,0.7),frandom(-0.7,0.7))
		TNT1 AAAAAAA 0 A_SpawnItemEx("gshot_spark",0,0,0,random(1,3),random(4,6),random(0,6),random(180,360),0)
		TNT1 AAAA 0 A_SpawnItemEx("gshot_spark2",0,0,0,random(1,3),random(4,6),random(0,6),random(180,360),0)
		TNT1 A 4
		TNT1 AA 0 A_SpawnItemEx("gpuff_smoke",0,0,0,0,random(1,1),random(-1,1),random(180,360),0)
		TNT1 A 0 A_SpawnItemEx("gshot_firespark",0,0,0,random(6,8),random(6,8),random(1,6),random(180,360),0)	
		stop}}
actor gshot_puff{
	radius 1
	height 1
	alpha 1
	renderstyle add
	scale 1.6
	+FORCEXYBILLBOARD
	+NOINTERACTION
	states{
	spawn:
		TNT1 A 0 NoDelay A_Jump(256,1,2,3,4,5)
		EXP6 A 0 A_Jump(256,5)
		EXP7 A 0 A_Jump(256,4)
		EXP8 A 0 A_Jump(256,3)
		EXP9 A 0 A_Jump(256,2)
		EXP0 A 0
		"####" AAAABBBCDEFGH 1 Bright
		Stop}}
actor gshot_spark{
	radius 2
	height 2
	scale 0.05
	gravity 0.3
	renderstyle add
	+NOTELEPORT
	+FLOORCLIP
	+FORCEXYBILLBOARD
	bouncetype "doom"
	bouncefactor 0.2
	states{
	spawn:
		SPRK A 40 bright
		"####" "#" 1 bright A_FadeOut(0.1,1)
		Wait}}
actor gshot_spark2:gshot_spark{
	scale 0.07
	gravity 0.32
	states{
	spawn:
		SPRK C 50 bright
		Goto Super::Spawn+1}}
actor gshot_flash{
	renderstyle add
	alpha 0.64
	scale 0.54
	+FORCEXYBILLBOARD
	+NOINTERACTION
	states{
	spawn:
		BFSH A 6 bright
		stop}}
actor gshot_firespark{
	radius 1
	height 1
	speed  4
	damage 0
	RenderStyle add
	Alpha 1
	Scale 0.3
	Mass 0
	+MISSILE
	+FLOORCLIP
	+DONTSPLASH
	+NOTELEPORT
	+FORCEXYBILLBOARD
	BounceType "doom"
	gravity 0.45
	BounceFactor 0.2
	var int user_i;
	States{
	spawn:
		TNT1 A 0 NoDelay A_SetUserVar("user_i",1)
		TNT1 A 0 A_JumpIf(user_i>=70,"Null")
		SPRK A 1 {A_SpawnItemEx("gaussSpark_trail",0,0,2,0,0,0,0);
			A_SpawnItemEx("gSpark_smoke1",0,0,0,frandom(-0.1,0.1),frandom(-0.1,0.1),frandom(0.1,0.3),0);
			A_SetUserVar("user_i",user_i+1);}
		Goto Spawn+1}}
actor gaussSpark_trail{
	radius 1
	height 1
	alpha 1.0
	+FLOORCLIP
	+NOTELEPORT
	+FORCEXYBILLBOARD
	renderstyle add
	scale 0.35
	gravity 0
	states {
	spawn:
		TNT1 A 0 NoDelay A_Jump(256,1,2,3,4,5)
		EXP6 A 0 A_Jump(256,5)
		EXP7 A 0 A_Jump(256,4)
		EXP8 A 0 A_Jump(256,3)
		EXP9 A 0 A_Jump(256,2)
		EXP0 A 0
		"####" AABCDEFGH 2 bright
		Stop}}
actor gSpark_smoke1{
	scale 0.15
	alpha 1.0
	renderstyle add
	+NOINTERACTION
	+NOGRAVITY
	+FORCEXYBILLBOARD
	+NOTELEPORT
	states{
	spawn:
		TNT1 A 4
		TNT1 A 0 A_Jump(256,1,2,3,4)
		SMO1 A 0 A_Jump(256,4)
		SMO1 B 0 A_Jump(256,3)
		SMO1 C 0 A_Jump(256,2)
		SMO1 D 0
		"####" "#" 2 {A_FadeOut(0.04);
			A_ScaleVelocity(0.9);}
		Wait}}
actor gshot_shockwave{
	var int user_scale;
	renderstyle add
	+NOTELEPORT
	+NOCLIP
	+FLOORCLIP
	+NOGRAVITY
	+FORCEXYBILLBOARD
	+NOINTERACTION
	alpha 0.5
	states{
	spawn:
		TNT1 A 0 NoDelay A_SetUserVar("user_scale",1) 
		TNT1 A 0 A_JumpIf(user_scale>=40,2)
		BSW0 A 1 bright {A_FadeOut(0.05,1);
			A_SetScale((user_scale*0.02));
			A_SetUserVar("user_scale",user_scale+4);}
		Goto Spawn+1
		BSW0 A 1 Bright A_FadeOut(0.05)
		Wait}}
///////////////////////////////////////////////////////////////////////////////////
actor sgauss_casing{
	scale 0.12
	radius 2
	height 2
	speed 6
	mass 4
	bouncefactor 0.5
	PROJECTILE
	+DOOMBOUNCE
	+NODROPOFF
	+FORCEXYBILLBOARD
	+NOTELEPORT
	+FLOORCLIP
	-NOGRAVITY
	-NOBLOCKMAP
	seesound "casings/sg_shell"
	states{
	spawn:
		SGSC AABBCCDDEEFFGGHH 1 A_SpawnItemEx("sgauss_casing_smoke",0,0,0,frandom(-0.1,0.1),frandom(-0.1,0.1),frandom(0.6,1.0),0)
		loop
	death:
		TNT1 A 0 A_Jump(256,1,2,3,4)
		SGSC A 0 A_Jump(256,4)
		SGSC E 0 A_Jump(256,3)
		SGSC G 0 A_Jump(256,2)
		SGSC C 0
		"####" "#" 400
		"####" "#" 1 A_FadeOut(0.1,1)
		Wait}}
actor sgausscasing_spawner{
	speed 15
	PROJECTILE
	+NOCLIP
	states{
	spawn:
		TNT1 A 1 NoDelay A_SpawnItemEx("sgauss_casing",-20,20,0,random(0,1),random(5,6),0,0,SXF_TRANSFERPOINTERS) 
		stop}}
actor sgausscasing_spawner2{
	speed 15
	PROJECTILE
	+NOCLIP
	states{
	spawn:
		TNT1 A 1 NoDelay A_SpawnItemEx("sgauss_casing",-25,20,0,random(0,1),random(5,6),0,0,SXF_TRANSFERPOINTERS) 
		stop}}
actor trailtest_spawner{
	+NOINTERACTION
	+NOGRAVITY
	+NOTELEPORT
	+NOCLIP
	states{
	spawn:
		TNT1 A 0 NoDelay A_SpawnItemEx("gaussbeam",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS) 
		stop}}
actor gaussbeam{
	scale 0.04
	alpha 0.4
	renderstyle add
	+NOINTERACTION
	+NOGRAVITY
	+FORCEXYBILLBOARD
	+NOTELEPORT
	states {
	spawn:
		GBDO A 1 bright NoDelay A_FadeOut(0.05)
		loop}}
actor gauss_smoke{
	scale 0.08
	alpha 0.8
	renderstyle add
	+NOINTERACTION
	+NOGRAVITY
	+FORCEXYBILLBOARD
	+NOTELEPORT
	States{
	Spawn:
		TNT1 A 0 NoDelay A_Jump(256,1,2,3,4)
		SMO1 A 0 A_Jump(256,4)
		SMO1 B 0 A_Jump(256,3)
		SMO1 C 0 A_Jump(256,2)
		SMO1 D 0
		"####" "#" 2 {A_FadeOut(0.05);
			A_ScaleVelocity(0.9);}
		Wait}}
actor gauss_smoke2:gauss_smoke{scale 0.22 alpha 1.0}
actor gausssmoke_spawner{
	+NOINTERACTION
	+NOGRAVITY
	+NOTELEPORT
	+NOCLIP
	States{
	Spawn:
		TNT1 A 0 NoDelay A_SpawnItemEx("gauss_smoke",20,0,0,0,frandom(-0.5,0.5),frandom(0.1,0.6),0,SXF_TRANSFERPOINTERS)
		Stop}}
actor gausssmoke_spawner2:gausssmoke_spawner{
	States{
	Spawn:
		TNT1 A 0 NoDelay A_SpawnItemEx("gauss_smoke2",20,0,0,frandom(0.8,1.6),frandom(-0.9,0.9),frandom(0.2,0.7),0,SXF_TRANSFERPOINTERS)
		Stop}}