
actor orionSniper : weapon replaces BFG9000{
	Tag "Orion Sniper Cannon"
  
	weapon.selectionorder 200
	inventory.pickupsound "weapons/sg_bolt"
	Inventory.PickupMessage "Orion EMSR-Mark5 Sniper Gauss Cannon" 
	AttackSound ""
	
	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.75
	//weapon.bobspeed 2.5
	Weapon.preferredSkin "SniperRGSkin"
	+AMMO_OPTIONAL	
	+NOALERT
	+WEAPON.NOAUTOAIM

	scale 0.29
	
	states {
		ready:
			TNT1 A 0 A_PlaySound("weapons/sg_idle",6,1.4,1)
		readyloop:
			SGAI A 1 A_WeaponReady
			TNT1 A 0 A_JumpIfInventory("ReloadingWeapon",1,"Reload")
			NULL A 0 A_JumpIfInventory("TossGrenade", 1, "Grenade")
			NULL A 0 A_JumpIfInventory("AltFuncSwitch", 1, "ZoomWeaponStart")
			TNT1 A 0 A_JumpIfInventory("SprintingPlayer", 1, "Sprint")
			loop
			
		readyzoom:
			TNT1 A 0 A_PlaySound("weapons/sg_idle",6,1.0,1)
		readyzoomloop:
			TNT1 A 0 A_JumpIfInventory("sgausszoom", 2, 4)
			TNT1 A 0 A_JumpIfInventory("sgaussmag", 1, 2)
			SGZI C 1 bright A_WeaponReady(WRF_NOBOB)
			goto readyzoomloop+7
			SGZI A 1 bright A_WeaponReady(WRF_NOBOB)
			goto readyzoomloop+7
				
			TNT1 A 0 A_JumpIfInventory("sgaussmag", 1, 2)
			SGZI D 1 bright A_WeaponReady(WRF_NOBOB)
			goto readyzoomloop+7
			SGZI B 1 bright A_WeaponReady(WRF_NOBOB)
			goto readyzoomloop+7
		
			NULL A 0 A_JumpIfInventory("AltFuncSwitch", 1, "SwitchZoom")
			TNT1 A 0 A_JumpIfInventory("SprintingPlayer", 1, "UnZoom2Sprint")
			NULL A 0 A_JumpIfInventory("TossGrenade", 1, "UnZoom2Gren")
			NULL A 0 A_JumpIfInventory("ReloadingWeapon",1,"UnZoom2Relo")
			loop
		
		/////
		UnZoom2Sprint:
			TNT1 A 0 ACS_ExecuteAlways(Player_ChangeSpeed,0,100,0,0)
			TNT1 A 0 A_ZoomFactor(1.0,ZOOM_INSTANT)
			SGZU EDCBA 1
			TNT1 A 0 A_TakeInventory("sgausszoom", 2)
		Sprint:
			TNT1 A 0 A_JumpIfInventory("PlayerStamina", 1, "SprStart")
			TNT1 A 0 A_TakeInventory("SprintingPlayer",1)
			goto ready
		SprStart:
			TNT1 A 0 A_PlaySound("sfx/sprintstart",CHAN_AUTO)
			TNT1 A 0 ACS_ExecuteAlways(Player_ChangeSpeed,0,200,0,0)
			TNT1 A 0 A_SetBlend("49 99 0",0.4,15)
			TNT1 A 0 A_Recoil(-15)
			SGAS ABCDE 1 Offset(0,32)
			TNT1 A 0 A_JumpIfInventory("SprintingPlayer", 1, "SprLoop1")
			goto SprEnd
		SprLoop1:
			TNT1 A 0 A_JumpIfInventory("PlayerStamina", 1, "SL1")
			TNT1 A 0 A_TakeInventory("SprintingPlayer",1)
			goto SprEnd
		SL1:
			//GASX ABCDEF 1
			SGAS E 1 Offset(-14,33)
			//SGAS E 1 Offset(-27,36)
			SGAS E 1 Offset(-34,39)
			SGAS E 1 Offset(-40,44)
			SGAS E 1 Offset(-43,47)
			SGAS E 1 Offset(-44,50)
			
			TNT1 A 0 A_JumpIfInventory("SprintingPlayer", 1, "SprLoop2")
			goto SprEnd
		SprLoop2:
			TNT1 A 0 A_JumpIfInventory("PlayerStamina", 1, "SL2")
			TNT1 A 0 A_TakeInventory("SprintingPlayer",1)
			goto SprEnd
		SL2:
			//GASX FEDCBA 1
			SGAS E 1 Offset(-44,50)
			//SGAS E 1 Offset(-43,47)
			SGAS E 1 Offset(-40,44)
			SGAS E 1 Offset(-34,39)
			SGAS E 1 Offset(-27,36)
			SGAS E 1 Offset(-14,33)
			TNT1 A 0 A_TakeInventory("PlayerStamina", 4)
			TNT1 A 0 A_JumpIfInventory("SprintingPlayer", 1, "SprLoop3")
			goto SprEnd
		SprLoop3:
			TNT1 A 0 A_JumpIfInventory("PlayerStamina", 1, "SL3")
			TNT1 A 0 A_TakeInventory("SprintingPlayer",1)
			goto SprEnd
		SL3:
			//GASX GHIJKL 1
			SGAS E 1 Offset(14,33)
			//SGAS E 1 Offset(27,36)
			SGAS E 1 Offset(34,39)
			SGAS E 1 Offset(40,44)
			SGAS E 1 Offset(43,47)
			SGAS E 1 Offset(44,50)
			
			TNT1 A 0 A_JumpIfInventory("SprintingPlayer", 1, "SprLoop4")
			goto SprEnd
		SprLoop4:
			TNT1 A 0 A_JumpIfInventory("PlayerStamina", 1, "SL4")
			TNT1 A 0 A_TakeInventory("SprintingPlayer",1)
			goto SprEnd
		SL4:
			//GASX LKJIHG 1
			SGAS E 1 Offset(44,50)
			//SGAS E 1 Offset(43,47)
			SGAS E 1 Offset(40,44)
			SGAS E 1 Offset(34,39)
			SGAS E 1 Offset(27,36)
			SGAS E 1 Offset(14,33)
			TNT1 A 0 A_TakeInventory("PlayerStamina", 4)
			TNT1 A 0 A_JumpIfInventory("SprintingPlayer", 1, "SprLoop1")
		SprEnd:	
			TNT1 A 0 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)//resets the offsets
			TNT1 A 0 ACS_ExecuteAlways(Player_ChangeSpeed,0,100,0,0)
			TNT1 A 0 A_PlaySound("sfx/sprintend",CHAN_AUTO)
			SGAS EDCBA 1 
			goto ready
			
			
		select:
			TNT1 A 0 //A_SetCrosshair(10)
			TNT1 A 0 A_JumpIfInventory("gtoss_weaponmemory",17,"GrenadeEnd")
			NULL A 10
			NULL A 0 A_TakeInventory("AltFuncSwitch", 1)
			NULL A 0 A_TakeInventory("sgausszoom", 2)
			SGAU G 1 A_PlaySound("weapons/sg_select", CHAN_WEAPON)
			SGAU FEDCBA 1
			NULL A 0 A_GiveInventory("xhair_switch",1)
		selectloop:
			SGAI A 1 A_Raise
			goto selectloop
		
		deselect:
			TNT1 A 0 A_StopSound(6)
			TNT1 A 0 A_PlaySound("weapons/sg_idleoff",6,1.4)
			NULL A 0 A_TakeInventory("xhair_switch",1)
			NULL A 0 A_TakeInventory("sgauss_acc", 50)
			NULL A 0 ACS_ExecuteAlways(Player_ChangeSpeed,0,100,0,0)
			NULL A 0 A_ZoomFactor(1.0,ZOOM_INSTANT)
			SGAU A 1 A_PlaySound("weapons/tp_deselect", CHAN_WEAPON)
			SGAU BCDEFG 1
			NULL A 2
		deselectloop:
			NULL A 1 A_Lower
			goto deselectloop
		
		
		////
		Fire:
			TNT1 A 0 A_JumpIfInventory("sgausszoom", 1, "zoomedfire")
			TNT1 A 0 A_JumpIfInventory("sgaussmag", 1, 3)
			SGAI A 1 A_PlaySound("weapons/noammo", CHAN_AUTO)
			SGAI A 14
			goto ready
			
			TNT1 A 0 A_StopSound(6)
			TNT1 A 0 A_PlaySound("weapons/sg_fire")
			TNT1 A 0 A_AlertMonsters //(0.0)
			TNT1 A 0 A_RailAttack(0, 4, 1, none, none, RGF_FULLBRIGHT|RGF_SILENT|RGF_NOPIERCING, 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 A 0 A_RailAttack(0,4,1,none,white,RGF_FULLBRIGHT|RGF_SILENT|RGF_NOPIERCING|RGF_EXPLICITANGLE, 0, 0, 0,0, 0, 10, 1.0, 0, 0)			
			TNT1 AAA 0 A_FireCustomMissile("gauss_shot", 0, 0, 3, 4)
			TNT1 AAAAAA 0 A_FireCustomMissile("gauss_shotB", 0, 0, 3, 4)			
			//TNT1 AAAAAA 0 A_FireBullets (0,0,-1,random(150,190),"gauss_puff",FBF_EXPLICITANGLE,65536)			
			SGF1 A 1 bright
			//TNT1 A 0 ACS_ExecuteAlways(Weapon_Recoil,0,18,random(-20,20),0)
			TNT1 A 0 A_GiveInventory("sgauss_acc",90)
			goto FireLast
		FrAcc2:			
			TNT1 A 0 ACS_ExecuteAlways (set_SGAcc_rand, 0, 1,2, 0)
			TNT1 A 0 ACS_ExecuteAlways (set_SGAcc_rand, 0, 1,1, 1)
			
			TNT1 AAA 0 A_FireCustomMissile("gauss_shot", ACS_ExecuteWithResult(get_SGAcc_rand,0), 0, 3, 4, 0, ACS_ExecuteWithResult(get_SGAcc_rand,1))
			TNT1 AAAAAA 0 A_FireCustomMissile("gauss_shotB", ACS_ExecuteWithResult(get_SGAcc_rand,0), 0, 3, 4, 0, ACS_ExecuteWithResult(get_SGAcc_rand,1))

			//TNT1 A 0 ACS_ExecuteAlways(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_ExecuteAlways (set_SGAcc_rand, 0, 2,5, 0)
			TNT1 A 0 ACS_ExecuteAlways (set_SGAcc_rand, 0, 2,3, 1)

			TNT1 AAA 0 A_FireCustomMissile("gauss_shot", ACS_ExecuteWithResult(get_SGAcc_rand,0), 0, 3, 4, 0, ACS_ExecuteWithResult(get_SGAcc_rand,1))
			TNT1 AAAAAA 0 A_FireCustomMissile("gauss_shotB", ACS_ExecuteWithResult(get_SGAcc_rand,0), 0, 3, 4, 0, ACS_ExecuteWithResult(get_SGAcc_rand,1))
		
			//TNT1 A 0 ACS_ExecuteAlways(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_ExecuteAlways (set_SGAcc_rand, 0, 2,8, 0)
			TNT1 A 0 ACS_ExecuteAlways (set_SGAcc_rand, 0, 2,5, 1)
			
			TNT1 AAA 0 A_FireCustomMissile("gauss_shot", ACS_ExecuteWithResult(get_SGAcc_rand,0), 0, 3, 4, 0, ACS_ExecuteWithResult(get_SGAcc_rand,1))
			TNT1 AAAAAA 0 A_FireCustomMissile("gauss_shotB", ACS_ExecuteWithResult(get_SGAcc_rand,0), 0, 3, 4, 0, ACS_ExecuteWithResult(get_SGAcc_rand,1))
	
			//TNT1 A 0 ACS_ExecuteAlways(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", 1)
			SGF1 B 1 bright 
			//TNT1 A 0 ACS_ExecuteAlways(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", 1)
			SGF1 OP 1
			SGF2 ABCEDFGHIJKLMNO 1		
			SGAI A 1 A_Refire
			Goto Ready
		
		zoomedfire:
			TNT1 A 0 A_JumpIfInventory("sgaussmag", 1, "zoomedfire4x")
			TNT1 A 0 A_PlaySound("weapons/noammo", CHAN_AUTO)
			
			TNT1 A 0 A_JumpIfInventory("sgausszoom", 2, 2)		
			SGZI C 15 bright
			goto readyzoom
			SGZI D 15 bright					
			goto readyzoom
		
		zoomedfire4x:
			TNT1 A 0 A_PlaySound("weapons/sg_fire")
			TNT1 A 0 A_AlertMonsters //(0.0)
			TNT1 A 0 A_RailAttack(0, 0, 1, none, none, RGF_FULLBRIGHT|RGF_SILENT|RGF_NOPIERCING, 0, ""/*, 0, 0, 300, 0, 1.0, 0,"gausssmoke_spawner"*/)			
			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("sgausszoom",2,"zoomedfire12x")
			goto zoomedfire4x+24
			
			SGZF A 1 bright
			//TNT1 A 0 ACS_ExecuteAlways(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 34 bright
			SGZF A 1 bright A_Refire
			goto readyzoom
			
		zoomedfire12x:
			SGZF B 1 bright
			//TNT1 A 0 ACS_ExecuteAlways(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 34 bright
			SGZF B 1 bright A_Refire
			goto readyzoom
		////
		Hold:				
			TNT1 A 0 A_JumpIfInventory("sgausszoom", 2, "H16x")
			TNT1 A 0 A_JumpIfInventory("sgausszoom", 1, "H4x")
		H0x:	
			SGAI A 1 A_WeaponReady
			TNT1 A 0 A_PlaySound("weapons/sg_idle",6,1.0,1)
			TNT1 A 0 A_Refire
			goto ready
						
		H4x:
			TNT1 A 0 A_JumpIfInventory("sgaussmag", 1, 3)
			SGZI C 1 bright A_WeaponReady(WRF_NOBOB)
			TNT1 A 0 A_Refire
			goto readyzoomloop+7
			SGZI A 1 bright A_WeaponReady(WRF_NOBOB)
			TNT1 A 0 A_Refire
			goto readyzoomloop+7
		H16x:		
			TNT1 A 0 A_JumpIfInventory("sgaussmag", 1, 3)
			SGZI D 1 bright A_WeaponReady(WRF_NOBOB)
			TNT1 A 0 A_Refire
			goto readyzoomloop+7
			SGZI B 1 bright A_WeaponReady(WRF_NOBOB)
			TNT1 A 0 A_Refire
			goto readyzoomloop+7
				
		
		
		////
		ZoomWeaponStart:				
			TNT1 A 0 A_GiveInventory("sgausszoom", 1)
			TNT1 A 0 A_TakeInventory("AltFuncSwitch", 1)
			TNT1 A 0 A_TakeInventory("sgauss_acc", 90)
			TNT1 A 0 ACS_ExecuteAlways(Player_ChangeSpeed,0,50,0,0)
			SGZU ABCDE 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH|WRF_NOBOB)
			TNT1 A 0 A_ZoomFactor(4.0,ZOOM_INSTANT)
			goto readyzoom
		SwitchZoom:
			TNT1 A 0 A_JumpIfInventory("sgausszoom",2, "SwitchZoomB")
			TNT1 A 0 A_TakeInventory("AltFuncSwitch", 1)
			TNT1 A 0 A_PlaySound("weapons/sg_zoomin", CHAN_WEAPON)
			TNT1 A 0 A_ZoomFactor(16.0)
			TNT1 A 0 A_JumpIfInventory("sgaussmag",1,2)	//Check ammo in mag
			SGZI D 5 bright A_GiveInventory("sgausszoom", 1)
			goto readyzoom
			SGZI B 5 bright A_GiveInventory("sgausszoom", 1)
			goto readyzoom
			
		SwitchZoomB:
			TNT1 A 0 A_ZoomFactor(4.0)
			TNT1 A 0 A_PlaySound("weapons/sg_zoomout", CHAN_WEAPON)
			TNT1 A 0 A_TakeInventory("AltFuncSwitch", 1)
			TNT1 A 0 A_TakeInventory("sgausszoom", 1)
			goto readyzoom
		////
		
		UnZoom2Relo:
			TNT1 A 0 A_TakeInventory("ReloadingWeapon",9)
			TNT1 A 0 A_GiveInventory("sgauss_acc",60)
			TNT1 A 0 ACS_ExecuteAlways(Player_ChangeSpeed,0,100,0,0)
			TNT1 A 0 A_ZoomFactor(1.0,ZOOM_INSTANT)
			SGZU EDCBA 1
			TNT1 A 0 A_TakeInventory("sgausszoom", 2)
			goto ready
		Reload:
			TNT1 A 0 A_JumpIfInventory("sgaussmag", 5, 2)
			TNT1 A 0 A_JumpIfInventory("sgauss_ammo", 1, 2)
			TNT1 A 0
			goto ready			
			
			TNT1 A 0 A_GiveInventory("xhair_hold", 1)
			TNT1 A 0 A_GiveInventory("sgauss_acc", 90) 
			
			SGRS ABCDEFGHIJKLMN 1
			SGRS OPQ 2
			TNT1 A 0 A_StopSound(6)
			TNT1 A 0 A_PlaySound("weapons/sg_idleoff",6,1.4)
			SGRS R 6 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:	
			NULL A 0 A_TakeInventory("sgauss_ammo",1)
			NULL A 0 A_GiveInventory("sgaussmag",1)
			NULL A 0 A_JumpIfInventory("sgaussmag",5,"ReloadFinish_Long")
			NULL 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", 1)
			SGRB GHIJKLMN 1
			goto ready	
		
		
		Reload_FillClipB:	
			NULL A 0 A_TakeInventory("sgauss_ammo",1)
			NULL A 0 A_GiveInventory("sgaussmag",1)
			NULL A 0 A_JumpIfInventory("sgaussmag",5,"ReloadFinish_Quick")
			NULL A 0 A_JumpIfInventory("sgauss_ammo",1,"Reload_FillClipB")
			
		ReloadFinish_Quick:
			TNT1 A 0 A_TakeInventory("xhair_hold", 1)			
			SGRQ ABCDEFGHIJKLM 1
			goto ready	
			

	  
		UnZoom2Gren:
			TNT1 A 0 A_JumpIfInventory("grenades", 1, 2)
			TNT1 A 0
			goto readyzoom
		
			TNT1 A 0 ACS_ExecuteAlways(Player_ChangeSpeed,0,100,0,0)
			TNT1 A 0 A_ZoomFactor(1.0,ZOOM_INSTANT)
			SGZU EDCBA 1
			TNT1 A 0 A_TakeInventory("sgausszoom", 2)
		Grenade:
			TNT1 A 0 A_JumpIfInventory("grenades", 1, 2)
			TNT1 A 0
			goto ready
			TNT1 A 0 A_StopSound(6)
			TNT1 A 0 A_PlaySound("weapons/sg_idleoff",6,1.4)
			SGAG ABCDEFG 1
			TNT1 A 0 A_GiveInventory("gtoss_weaponmemory", 17)
			TNT1 A 0 A_SelectWeapon("grenade_toss")
			goto deselectLoop
		GrenadeEnd:
			TNT1 A 0 A_TakeInventory("gtoss_weaponmemory",99)
			SGAG GFEDCBA 1
			goto selectLoop
	//////////////////////////////////////////////
		AltFire:
			TNT1 A 0 A_JumpIfInventory("sgausszoom", 1, 2)
			TNT1 A 0
			goto altfire+7
			
			TNT1 A 0 ACS_ExecuteAlways(Player_ChangeSpeed,0,100,0,0)
			TNT1 A 0 A_ZoomFactor(1.0,ZOOM_INSTANT)
			SGZU DCB 1
			NULL A 0 A_TakeInventory("sgausszoom", 2)
			
			SGAM C 1 A_Recoil(-7)
			NULL A 0 A_PlayWeaponSound("sfx/meleeswing")
			SGAM EGIK 1
			SGAM N 9 A_CustomPunch ((180+random(1,32)), 1 , 0 , "meleepuff",90)
			SGAM MLKJIHGFEDCBA 1	
			goto ready
		
		Spawn:
			SGAW A -1
			Stop
	
  }
}

///////////////////////////////////////////////////////////////////////////////////

actor sgaussmag : ammo{
	inventory.maxamount 5
	+INVENTORY.IGNORESKILL
}

actor sgausszoom : inventory{
	inventory.maxamount 2
}

actor sgauss_acc : inventory {
	-INVBAR
	inventory.amount 1
	inventory.maxamount 90
}

actor gauss_shot : fastprojectile{
	radius 2
	height 2
	scale 0.6
	mass 20
	PROJECTILE
	speed 4000
	damage (250+(10*random(0,3)))
	//ProjectileKickBack 250
	renderstyle add
	//damagetype "gauss_shot"
	MissileHeight 8
	deathsound "sfx/sboom1"
	
	states {
		spawn:
			TNT1 A 1 
			loop
		death:
			TNT1 A 0 //A_PlaySound("sfx/powshockblast", CHAN_AUTO)
		
			TNT1 A 0 A_SpawnItemEx("gshot_flash",0,0,0, 0,0,0)
			TNT1 A 0 A_SpawnItemEx("gshot_shockwave",0,0,0, 0,0,0)
			TNT1 AA 0 A_SpawnItemEx("gshot_puff",0,0,0, 0,/*f*/random(-0.6,0.6),/*f*/random(-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)
			
			
			
			//NT1 A 0 A_SpawnItemEx("powbolt_boomflashB",0,0,0, 0,0,0)
			//TNT1 A 0 A_SpawnItemEx("powbolt_boom",0,0,0, 0,0,0)
			//TNT1 A 0 A_SpawnItemEx("powbolt_boom2",0,random(60,70),50, 0,0,0)
			//TNT1 A 0 A_SpawnItemEx("powbolt_boom3",0,random(-70,-60),-50, 0,0,0)
			
			//TNT1 A 0 A_SpawnItemEx("powbolt_smoke",0,0,0, 0,random(-5,5),random(-5,5))
			
			
			
			stop					 
	}
}

actor gauss_shotB : fastprojectile{
	radius 2
	height 2
	scale 0.6
	mass 20
	PROJECTILE
	speed 4000
	damage (200+(10*random(0,3)))
	//ProjectileKickBack 150
	renderstyle add
	//damagetype "gauss_shot"
	MissileHeight 8
	
	states {
		spawn:
			TNT1 A 1 
			loop
		death:
			TNT1 A 0 //A_PlaySound("sfx/powshockblast", CHAN_AUTO)
			
			TNT1 AA 0 A_SpawnItemEx("gshot_puff",0,0,0, 0,/*f*/random(-0.7,0.7),/*f*/random(-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
	+CLIENTSIDEONLY
	states{
		spawn:
			TNT1 A 0
			TNT1 A 0 A_Jump(255, "puff1","puff2","puff3","puff4","puff5")
		puff1:
			EXP6 AAAABBBCDEFGH 1 bright
			stop
		puff2:
			EXP7 AAAABBBCDEFGH 1 bright
			stop
		puff3:
			EXP8 AAAABBBCDEFGH 1 bright
			stop
		puff4:
			EXP9 AAAABBBCDEFGH 1 bright
			stop
		puff5:
			EXP0 AAAABBBCDEFGH 1 bright
			stop
			
	}
}


actor gshot_spark {
	radius 2
	height 2
	scale 0.05
	gravity 0.3
	renderstyle add
	+NOTELEPORT
	+FLOORCLIP
	+FORCEXYBILLBOARD
	+CLIENTSIDEONLY
	bouncetype "doom"
	bouncefactor 0.2
	states{
		spawn:
			SPRK A 40 bright
		spawnloop:
			SPRK A 1 bright A_FadeOut(0.1)
			loop
	}
}

actor gshot_spark2 : gshot_spark {
	scale 0.07
	gravity 0.32
	states{
		spawn:
			SPRK C 50 bright
		spawnloop:
			SPRK C 1 bright A_FadeOut(0.1)
			loop
	}
}

actor gshot_flash {
	renderstyle add
	alpha 0.64
	scale 0.54
	+FORCEXYBILLBOARD
	+NOINTERACTION
	+CLIENTSIDEONLY
	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
	+CLIENTSIDEONLY
	BounceType "doom"
	gravity 0.45
	BounceFactor 0.2
	//var int user_i;
	States
	{
		spawn:
			TNT1 A 0
			TNT1 A 0 //A_SetUserVar("user_i", 1)
		sploop:	
			TNT1 A 0 //A_JumpIf(user_i>=70, "death")
			SPRK A 1 A_SpawnItemEx ("gaussSpark_trail", 0, 0, 2, 0 , 0 , 0 , 0)
			TNT1 A 0 A_SpawnItemEx ("gSpark_smoke1", 0, 0, 0, /*f*/random(-0.1,0.1) , /*f*/random(-0.1,0.1) , /*f*/random(0.1,0.3) , 0)
			TNT1 A 0 //A_SetUserVar("user_i",user_i+1)
			loop
		death:
			TNT1 A 0
			stop
	}
}
 
actor gaussSpark_trail {
	radius 1
	height 1
	alpha 1.0
	+FLOORCLIP
	+NOTELEPORT
	+FORCEXYBILLBOARD
	+CLIENTSIDEONLY
	renderstyle add
	scale 0.35
	gravity 0
	states {
		spawn:
			TNT1 A 0
			TNT1 A 0 A_Jump (255,"trail1","trail2","trail3","trail4","trail5")
		trail1:
			EXP6 AABCDEFGH 2 bright
			stop
		trail2:
			EXP7 AABCDEFGH 2 bright
			stop
		trail3:
			EXP8 AABCDEFGH 2 bright
			stop
		trail4:
			EXP9 AABCDEFGH 2 bright
			stop
		trail5:
			EXP0 AABCDEFGH 2 bright
			stop
	}
}

actor gSpark_smoke1 {
	scale 0.15
	alpha 1.0
	renderstyle add
	+NOINTERACTION
	+NOGRAVITY
	+FORCEXYBILLBOARD
	+NOTELEPORT
	+CLIENTSIDEONLY
	states {
		spawn:
			TNT1 A 4
			TNT1 A 0 A_Jump(255, "Smok1","Smok2","Smok3","Smok4")
		Smok1:
			SMO1 A 2 A_FadeOut(0.04)
			TNT1 A 0 A_ScaleVelocity(0.9)
			loop
		Smok2:
			SMO1 B 2 A_FadeOut(0.04)
			TNT1 A 0 A_ScaleVelocity(0.9)
			loop
		Smok3:
			SMO1 C 2 A_FadeOut(0.04)
			TNT1 A 0 A_ScaleVelocity(0.9)
			loop
		Smok4:
			SMO1 D 2 A_FadeOut(0.04)
			TNT1 A 0 A_ScaleVelocity(0.9)
			loop

	}
}


actor gshot_shockwave {
	//scale 0.27
	//var int user_scale;
	renderstyle add
	+NOTELEPORT
	+NOCLIP
	+FLOORCLIP
	+NOGRAVITY
	+FORCEXYBILLBOARD
	+NOINTERACTION
	+CLIENTSIDEONLY
	alpha 0.5
	states{
		spawn:
			TNT1 A 0
			TNT1 A 0 //A_SetUserVar("user_scale",1) 
		scaledown:			   
			TNT1 A 0 //A_SetScale((user_scale*0.02)) //Start scale
			TNT1 A 0 //A_JumpIf(user_scale>=40,"LoopEnd") //Maximum Scale
			BSW0 A 1 bright A_FadeOut(0.05)
			TNT1 A 0 //A_SetUserVar("user_scale",user_scale+4) //Speed
			loop
		loopend:
			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
	+CLIENTSIDEONLY
	seesound "casings/sg_shell"
	states{
		spawn:
			SGSC AABBCCDDEEFFGGHH 1 A_SpawnItemEx ("sgauss_casing_smoke", 0, 0, 0, /*f*/random(-0.1,0.1), /*f*/random(-0.1,0.1) , /*f*/random(0.6,1.0), 0)
			loop
		death:
			NULL A 0 A_Jump(255, "pos1", "pos2", "pos3", "pos4")
			NULL A 0
		pos1:
			SGSC A 400
			SGSC AAAAAAAAAA 1 A_FadeOut(0.1)
			stop
		pos2:
			SGSC E 400
			SGSC EEEEEEEEEE 1 A_FadeOut(0.1)
			stop
		pos3:
			SGSC G 400
			SGSC GGGGGGGGGG 1 A_FadeOut(0.1)
			stop
		pos4:
			SGSC C 400
			SGSC CCCCCCCCCC 1 A_FadeOut(0.1)
			stop	
	}
}

actor sgausscasing_spawner {
	speed 15
	PROJECTILE
	+NOCLIP
	+CLIENTSIDEONLY
	states{
		spawn:
			NULL A 0
			NULL A 1 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
	+CLIENTSIDEONLY
	states{
		spawn:
			NULL A 0
			NULL A 1 A_SpawnItemEx("sgauss_casing", -25, 20, 0, random(0,1), random(5,6), 0, 0, SXF_TRANSFERPOINTERS) 
			stop
	}

}


actor trailtest_spawner {
	//speed 15
	//PROJECTILE
	+NOINTERACTION
	+NOGRAVITY
	+NOTELEPORT
	+NOCLIP
	+CLIENTSIDEONLY
	states{
		spawn:
			NULL A 0
			NULL A 0 A_SpawnItemEx("gaussbeam", 0, 0, 0, 0, 0, 0, 0, SXF_TRANSFERPOINTERS) 
			//NULL A 0 A_SpawnItemEx("gausstrail", 0, 0, 0, 0, /*f*/random(-0.2,0.2), /*f*/random(-0.2,0.2), 0, SXF_TRANSFERPOINTERS) 
			stop
	}

}


actor gaussbeam {
	scale 0.04
	alpha 0.4
	renderstyle add
	+NOINTERACTION
	+NOGRAVITY
	+FORCEXYBILLBOARD
	+NOTELEPORT
	+CLIENTSIDEONLY
	states {
		spawn:
			TNT1 A 0
			GBDO A 1 bright A_FadeOut(0.05)
			loop
	}
	


}

actor gauss_smoke {
	scale 0.08
	alpha 0.8
	renderstyle add
	+NOINTERACTION
	+NOGRAVITY
	+FORCEXYBILLBOARD
	+NOTELEPORT
	+CLIENTSIDEONLY
	states {
		spawn:
			TNT1 A 0
			TNT1 A 0 A_Jump(255, "Smok1","Smok2","Smok3","Smok4")
		Smok1:
			SMO1 A 2 A_FadeOut(0.05)
			TNT1 A 0 A_ScaleVelocity(0.9)
			loop
		Smok2:
			SMO1 B 2 A_FadeOut(0.05)
			TNT1 A 0 A_ScaleVelocity(0.9)
			loop
		Smok3:
			SMO1 C 2 A_FadeOut(0.05)
			TNT1 A 0 A_ScaleVelocity(0.9)
			loop
		Smok4:
			SMO1 D 2 A_FadeOut(0.05)
			TNT1 A 0 A_ScaleVelocity(0.9)
			loop

	}
}

actor gauss_smoke2 : gauss_smoke {
	scale 0.22
	alpha 1.0
}


actor gausssmoke_spawner {
	+NOINTERACTION
	+NOGRAVITY
	+NOTELEPORT
	+NOCLIP
	+CLIENTSIDEONLY
	states{
		spawn:
			NULL A 0
			NULL A 0 A_SpawnItemEx("gauss_smoke", 20, 0, 0, 0, /*f*/random(-0.5,0.5), /*f*/random(0.1,0.6), 0, SXF_TRANSFERPOINTERS)
			stop
	}

}

actor gausssmoke_spawner2 : gausssmoke_spawner {
	states{
		spawn:
			NULL A 0
			NULL A 0 A_SpawnItemEx("gauss_smoke2", 20, 0, 0, /*f*/random(0.8,1.6), /*f*/random(-0.9,0.9), /*f*/random(0.2,0.7), 0, SXF_TRANSFERPOINTERS)
			stop
	}
}




