//	 CHIMAERA TYPE-7 CONCUSSION RIFLE 
////////////////////

Actor conrifle_flashreset  : Inventory { Inventory.MaxAmount 1 }
Actor conrifle_nfire_flash : Inventory { Inventory.MaxAmount 1 }
Actor conrifle_chrgflash   : Inventory { Inventory.MaxAmount 1 }
Actor conrifle_fchrgflash  : Inventory { Inventory.MaxAmount 1 }

Actor conrifle_fire     : Inventory { Inventory.MaxAmount 1 }
Actor conrifle_normfire : Inventory { Inventory.MaxAmount 1 }
Actor conrifle_charge   : Inventory { Inventory.MaxAmount 1 }
Actor conrifle_fchrg_s1 : Inventory { Inventory.MaxAmount 1 }
Actor conrifle_fchrg_s2 : Inventory { Inventory.MaxAmount 1 }
Actor conrifle_fchrg_s3 : Inventory { Inventory.MaxAmount 1 }
Actor conrifle_fchrg_s4 : Inventory { Inventory.MaxAmount 1 }
Actor conrifle_fchrg_s5 : Inventory { Inventory.MaxAmount 1 }
Actor conrifle_fchrg_s6 : Inventory { Inventory.MaxAmount 1 }
Actor conrifle_fchrg_s7 : Inventory { Inventory.MaxAmount 1 }
Actor conrifle_fchrg_s8 : Inventory { Inventory.MaxAmount 1 }
Actor conrifle_fchrg_s9 : Inventory { Inventory.MaxAmount 1 }

actor chimerarifle : weapon replaces PlasmaRifle {
	Tag "Chimaera Rifle"

	weapon.selectionorder 200
	inventory.pickupmessage "Chimaera DM-REW9 Concussion Pulse Rifle"

	inventory.pickupsound "weapons/cr_clipin"
	weapon.ammotype1 "criflecell"
	weapon.ammotype2 "crifle_ammo"
	weapon.ammouse1 1
	weapon.ammogive2 40
	weapon.kickback 100
	/*
	weapon.bobstyle inverse
	weapon.bobrangeX 0.4
	weapon.bobrangeY 0.75
	weapon.bobspeed 2.5
	*/
	Weapon.preferredSkin "ConrifleSkin"
	+AMMO_OPTIONAL	
	+NOALERT
	+WEAPON.NOAUTOAIM
	scale 0.30
	
	states{
		Spawn:
			CNCW A -1
			stop
			
		
		Flash:
			NULL A 0 A_JumpIfInventory("conrifle_flashreset", 1, "flashreset") 
			NULL A 0 A_JumpIfInventory("conrifle_nfire_flash", 1, "nfire_flash")
			NULL A 0 A_JumpIfInventory("conrifle_chrgflash", 1, "chrgflash")
			NULL A 0 A_JumpIfInventory("conrifle_fchrgflash", 1, "fchrgflash")
			Stop
		AltFlash:
			Goto Flash

		Hold:
			NULL A 0 A_JumpIfInventory("conrifle_fire", 1, "fire") 
			NULL A 0 A_JumpIfInventory("conrifle_normfire", 1, "normfire") 
			NULL A 0 A_JumpIfInventory("conrifle_charge", 1, "charge") 
			NULL A 0 A_JumpIfInventory("conrifle_fchrg_s1", 1, "fchrg_s1") 
			NULL A 0 A_JumpIfInventory("conrifle_fchrg_s2", 1, "fchrg_s2") 
			NULL A 0 A_JumpIfInventory("conrifle_fchrg_s3", 1, "fchrg_s3") 
			NULL A 0 A_JumpIfInventory("conrifle_fchrg_s4", 1, "fchrg_s4") 
			NULL A 0 A_JumpIfInventory("conrifle_fchrg_s5", 1, "fchrg_s5") 
			NULL A 0 A_JumpIfInventory("conrifle_fchrg_s6", 1, "fchrg_s6") 
			NULL A 0 A_JumpIfInventory("conrifle_fchrg_s7", 1, "fchrg_s7") 
			NULL A 0 A_JumpIfInventory("conrifle_fchrg_s8", 1, "fchrg_s8") 
			NULL A 0 A_JumpIfInventory("conrifle_fchrg_s9", 1, "fchrg_s9") 
			Stop
		AltHold:
			Goto Hold

	

			
	    Ready:
			TNT1 A 0 A_JumpIfInventory("crifle_mode", 1, 2)
			TNT1 A 0 A_PlaySound("weapons/cr_pulseidle",6,1.0,1)
		readyloop:
			CNCI A 1 A_WeaponReady
			NULL A 0 A_JumpIfInventory("TossGrenade", 1, "Grenade")
			TNT1 A 0 A_JumpIfInventory("SprintingPlayer", 1, "Sprint")
			NULL A 0 A_JumpIfInventory("AltFuncSwitch", 1, "SwitchMode")
			NULL A 0 A_JumpIfInventory("ReloadingWeapon",1,"Reload")
			loop
			
		
		/////
		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)
			CNCS 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
			CNCS E 1 Offset(-14,33)
			//CNCS E 1 Offset(-27,36)
			CNCS E 1 Offset(-34,39)
			CNCS E 1 Offset(-40,44)
			CNCS E 1 Offset(-43,47)
			CNCS 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
			CNCS E 1 Offset(-44,50)
			//CNCS E 1 Offset(-43,47)
			CNCS E 1 Offset(-40,44)
			CNCS E 1 Offset(-34,39)
			CNCS E 1 Offset(-27,36)
			CNCS 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
			CNCS E 1 Offset(14,33)
			//CNCS E 1 Offset(27,36)
			CNCS E 1 Offset(34,39)
			CNCS E 1 Offset(40,44)
			CNCS E 1 Offset(43,47)
			CNCS 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
			CNCS E 1 Offset(44,50)
			//CNCS E 1 Offset(43,47)
			CNCS E 1 Offset(40,44)
			CNCS E 1 Offset(34,39)
			CNCS E 1 Offset(27,36)
			CNCS 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)
			CNCS EDCBA 1 
			goto ready
		
		Select:
			//TNT1 A 0 A_SetCrosshair(10)
			TNT1 A 0 A_JumpIfInventory("gtoss_weaponmemory",16,"GrenadeEnd")
			NULL A 8
			CNCU G 1  A_PlaySound("weapons/cr_select", CHAN_WEAPON)
			CNCU FEDCBA 1
			NULL A 0 A_GiveInventory("xhair_switch",1)
		SelectLoop:
      		CNCI A 1 A_Raise
      		Goto SelectLoop

		deselect:
			TNT1 A 0 A_JumpIfInventory("crifle_mode", 1, "deselect_jump")
			TNT1 A 0 A_StopSound(6)
			TNT1 A 0 A_PlaySound("weapons/cr_pulseoff", 6)
			
			NULL A 0 A_TakeInventory("conrifle_flashreset", 1) 
			NULL A 0 A_TakeInventory("conrifle_nfire_flash", 1)
			NULL A 0 A_TakeInventory("conrifle_chrgflash", 1)
			NULL A 0 A_TakeInventory("conrifle_fchrgflash", 1)
			
			NULL A 0 A_GiveInventory("conrifle_flashreset", 1)
			TNT1 A 0 A_GunFlash
		
		deselect_jump:
			NULL A 0 A_TakeInventory("xhair_switch",1)
			CNCU A 1 A_PlaySound("weapons/cr_deselect", CHAN_WEAPON)
			CNCU BCDEFG 1
			NULL A 2 
		deselectLoop:
			NULL A 1 A_Lower
			Goto deselectLoop			
			
			
		Fire:
			TNT1 A 0 A_JumpIfInventory("criflecell", 1, 4)
			TNT1 A 0 A_StopSound(6)
			CNCI A 1 A_PlaySound("weapons/cr_noammo", CHAN_WEAPON)
			CNCI A 8
			goto ready
			
			TNT1 A 0 A_JumpIfInventory("crifle_mode",1,"powerfire_start")
		normfire:		
			//TNT1 A 0 A_GunFlash("flashreset")
			TNT1 A 0 A_StopSound(6)
			
			TNT1 A 0 A_TakeInventory("holdcheckcount", 8)
			TNT1 A 0 A_TakeInventory("chargecounter", 20)
			
			TNT1 A 0 A_PlaySound("weapons/cr_fire", CHAN_WEAPON)
			
			NULL A 0 A_TakeInventory("conrifle_flashreset", 1) 
			NULL A 0 A_TakeInventory("conrifle_nfire_flash", 1)
			NULL A 0 A_TakeInventory("conrifle_chrgflash", 1)
			NULL A 0 A_TakeInventory("conrifle_fchrgflash", 1)
			
			NULL A 0 A_GiveInventory("conrifle_nfire_flash", 1)
			TNT1 A 0 A_GunFlash

			CNCI A 1 bright A_FireCustomMissile("shock_normbolt", random(0, 2), 1, 3, 4,0,random(-1,1))  
			//NULL A 0 ACS_ExecuteAlways(Weapon_Recoil,0,28,random(-18,18),0)
			TNT1 A 0 A_GiveInventory("crifleheat", 18)
			NULL A 0 ACS_ExecuteAlways(pmsx_TempCooldown,0,0,0,0)//Temp down...
			TNT1 A 0 A_JumpIfInventory("crifleheat", 200, "ovheat_pulsefire")
			
			CNFR BA 1 
			
			NULL A 0 A_TakeInventory("conrifle_fire", 1) 
			NULL A 0 A_TakeInventory("conrifle_normfire", 1) 
			NULL A 0 A_TakeInventory("conrifle_charge", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s1", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s2", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s3", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s4", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s5", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s6", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s7", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s8", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s9", 1) 
			
			NULL A 0 A_GiveInventory("conrifle_fire", 1)
			TNT1 A 0 A_Refire//("normfire")
			CNFR CDEFGHI 1
			Goto Ready
		nfire_flash:
			TNT1 A 0 A_JumpIfInventory("IsMultiplayer", 1, 1)
			TNT1 A 1
			TNT1 A 0 A_Jump(255,"nfl1","nfl2","nfl3")
		nfl1:
			CNFN A 1 bright
			stop
		nfl2:
			CNFN B 1 bright
			stop
		nfl3:
			CNFN C 1 bright
			stop
	
				
		powerfire_start:
			TNT1 A 0 A_JumpIfInventory("criflecell",40,4)
			TNT1 A 0 A_PlaySound("weapons/cr_notenbatt", CHAN_WEAPON,0.6)
			TNT1 A 0 A_TakeInventory("holdcheckcount", 8)
			CNCI A 8
			goto ready
			
			NULL A 0 A_PlaySound("weapons/cr_chargestart",CHAN_WEAPON,0.5)
			
			NULL A 0 A_TakeInventory("conrifle_flashreset", 1) 
			NULL A 0 A_TakeInventory("conrifle_nfire_flash", 1)
			NULL A 0 A_TakeInventory("conrifle_chrgflash", 1)
			NULL A 0 A_TakeInventory("conrifle_fchrgflash", 1)
			
			NULL A 0 A_GiveInventory("conrifle_chrgflash", 1)
			TNT1 A 0 A_GunFlash
			
			NULL A 0 ACS_Terminate(pmsx_TempCooldown,0)
		charge:
			TNT1 A 0 A_JumpIfInventory("chargecounter", 20, "fullcharge_start")
			TNT1 A 0 A_GiveInventory("chargecounter", 1)
			TNT1 A 1 
			
			NULL A 0 A_TakeInventory("conrifle_fire", 1) 
			NULL A 0 A_TakeInventory("conrifle_normfire", 1) 
			NULL A 0 A_TakeInventory("conrifle_charge", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s1", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s2", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s3", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s4", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s5", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s6", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s7", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s8", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s9", 1) 
			
			NULL A 0 A_GiveInventory("conrifle_charge", 1)
			TNT1 A 0 A_Refire
			TNT1 A 0 A_PlaySound("weapons/cr_notenbatt", CHAN_WEAPON,0.6)
			
			NULL A 0 A_TakeInventory("conrifle_flashreset", 1) 
			NULL A 0 A_TakeInventory("conrifle_nfire_flash", 1)
			NULL A 0 A_TakeInventory("conrifle_chrgflash", 1)
			NULL A 0 A_TakeInventory("conrifle_fchrgflash", 1)
			
			NULL A 0 A_GiveInventory("conrifle_flashreset", 1)
			TNT1 A 0 A_GunFlash
			TNT1 A 0 A_TakeInventory("chargecounter", 99)
			goto ready		
		chrgflash:
			CNPC ABCDEFGHIJKLMNOPQRSTUV 1 bright
			stop
		
		fullcharge_start:
			TNT1 A 0 A_GiveInventory("crifleheat", 11)
			
			NULL A 0 A_TakeInventory("conrifle_flashreset", 1) 
			NULL A 0 A_TakeInventory("conrifle_nfire_flash", 1)
			NULL A 0 A_TakeInventory("conrifle_chrgflash", 1)
			NULL A 0 A_TakeInventory("conrifle_fchrgflash", 1)
			
			NULL A 0 A_GiveInventory("conrifle_fchrgflash", 1)
			TNT1 A 0 A_GunFlash
			TNT1 A 0 A_PlaySound("weapons/cr_chrgloop",CHAN_WEAPON,0.5,1)
		fchrg_s1:
			TNT1 A 0 A_JumpIfInventory("crifleheat",200,"powerfire")
			TNT1 A 1 offset(0,30)
			NULL A 0 A_TakeInventory("conrifle_fire", 1) 
			NULL A 0 A_TakeInventory("conrifle_normfire", 1) 
			NULL A 0 A_TakeInventory("conrifle_charge", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s1", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s2", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s3", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s4", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s5", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s6", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s7", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s8", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s9", 1) 
			
			NULL A 0 A_GiveInventory("conrifle_fchrg_s2", 1)
			TNT1 A 0 A_Refire
			goto powerfire
		fchrg_s2:
			TNT1 A 0 A_JumpIfInventory("crifleheat",200,"powerfire")
			TNT1 A 1 offset(-2,32)
			NULL A 0 A_TakeInventory("conrifle_fire", 1) 
			NULL A 0 A_TakeInventory("conrifle_normfire", 1) 
			NULL A 0 A_TakeInventory("conrifle_charge", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s1", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s2", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s3", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s4", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s5", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s6", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s7", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s8", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s9", 1) 
			
			NULL A 0 A_GiveInventory("conrifle_fchrg_s3", 1)
			TNT1 A 0 A_Refire
			goto powerfire
		fchrg_s3:
			TNT1 A 0 A_JumpIfInventory("crifleheat",200,"powerfire")
			TNT1 A 1 offset(2,34)
			NULL A 0 A_TakeInventory("conrifle_fire", 1) 
			NULL A 0 A_TakeInventory("conrifle_normfire", 1) 
			NULL A 0 A_TakeInventory("conrifle_charge", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s1", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s2", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s3", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s4", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s5", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s6", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s7", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s8", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s9", 1) 
			
			NULL A 0 A_GiveInventory("conrifle_fchrg_s4", 1)
			TNT1 A 0 A_Refire
			goto powerfire
		fchrg_s4:
			TNT1 A 0 A_JumpIfInventory("crifleheat",200,"powerfire")
			TNT1 A 1 offset(-2,30)
			NULL A 0 A_TakeInventory("conrifle_fire", 1) 
			NULL A 0 A_TakeInventory("conrifle_normfire", 1) 
			NULL A 0 A_TakeInventory("conrifle_charge", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s1", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s2", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s3", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s4", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s5", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s6", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s7", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s8", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s9", 1) 
			
			NULL A 0 A_GiveInventory("conrifle_fchrg_s5", 1)
			TNT1 A 0 A_Refire
			goto powerfire
		fchrg_s5:
			TNT1 A 0 A_JumpIfInventory("crifleheat",200,"powerfire")
			TNT1 A 1 offset(0,34)
			NULL A 0 A_TakeInventory("conrifle_fire", 1) 
			NULL A 0 A_TakeInventory("conrifle_normfire", 1) 
			NULL A 0 A_TakeInventory("conrifle_charge", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s1", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s2", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s3", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s4", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s5", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s6", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s7", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s8", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s9", 1) 
			
			NULL A 0 A_GiveInventory("conrifle_fchrg_s6", 1)
			TNT1 A 0 A_Refire
			goto powerfire
		fchrg_s6:
			TNT1 A 0 A_JumpIfInventory("crifleheat",200,"powerfire")
			TNT1 A 1 offset(2,32)
			TNT1 A 0 A_GiveInventory("crifleheat", 11)
			NULL A 0 ACS_ExecuteAlways(pmsx_TempCooldown,0,0,0,0)//Temp down...
			NULL A 0 A_TakeInventory("conrifle_fire", 1) 
			NULL A 0 A_TakeInventory("conrifle_normfire", 1) 
			NULL A 0 A_TakeInventory("conrifle_charge", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s1", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s2", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s3", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s4", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s5", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s6", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s7", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s8", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s9", 1) 
			
			NULL A 0 A_GiveInventory("conrifle_fchrg_s1", 1)
			TNT1 A 0 A_Refire
			goto powerfire
		//////////////////
		fchrg_s7:
			TNT1 A 1 offset(-2,34)
			NULL A 0 A_TakeInventory("conrifle_fire", 1) 
			NULL A 0 A_TakeInventory("conrifle_normfire", 1) 
			NULL A 0 A_TakeInventory("conrifle_charge", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s1", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s2", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s3", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s4", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s5", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s6", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s7", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s8", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s9", 1) 
			
			NULL A 0 A_GiveInventory("conrifle_fchrg_s8", 1)
			TNT1 A 0 A_Refire
			goto powerfire
		fchrg_s8:
			TNT1 A 1 offset(2,30)
			NULL A 0 A_TakeInventory("conrifle_fire", 1) 
			NULL A 0 A_TakeInventory("conrifle_normfire", 1) 
			NULL A 0 A_TakeInventory("conrifle_charge", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s1", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s2", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s3", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s4", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s5", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s6", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s7", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s8", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s9", 1) 
			
			NULL A 0 A_GiveInventory("conrifle_fchrg_s9", 1)
			TNT1 A 0 A_Refire
			goto powerfire
		fchrg_s9:
			TNT1 A 1 offset(0,32)
			NULL A 0 A_TakeInventory("conrifle_fire", 1) 
			NULL A 0 A_TakeInventory("conrifle_normfire", 1) 
			NULL A 0 A_TakeInventory("conrifle_charge", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s1", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s2", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s3", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s4", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s5", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s6", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s7", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s8", 1) 
			NULL A 0 A_TakeInventory("conrifle_fchrg_s9", 1) 
			
			NULL A 0 A_GiveInventory("conrifle_fchrg_s1", 1)
			TNT1 A 0 A_Refire
			goto powerfire
		/////////////////
		fchrgflash:
			CNPH AABBCCDDEEFFGGHHIIJJKKLLMMNNOOPPQQRRSSTTUU 1 bright
			loop
		
			
		powerfire:
			TNT1 A 0 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)//resets the offsets
			TNT1 A 0 A_StopSound(5)
			
			NULL A 0 A_TakeInventory("conrifle_flashreset", 1) 
			NULL A 0 A_TakeInventory("conrifle_nfire_flash", 1)
			NULL A 0 A_TakeInventory("conrifle_chrgflash", 1)
			NULL A 0 A_TakeInventory("conrifle_fchrgflash", 1)
			
			NULL A 0 A_GiveInventory("conrifle_flashreset", 1)
			TNT1 A 0 A_GunFlash
			TNT1 A 0 A_TakeInventory("holdcheckcount", 9)
			TNT1 A 0 A_TakeInventory("chargecounter", 99)
			TNT1 A 0 A_PlaySound("weapons/cr_powfire", CHAN_WEAPON)
			CNPF A 1 bright A_FireCustomMissile("shock_powbolt", 0, 0, 3, 4)
			//NULL A 0 ACS_ExecuteAlways(Weapon_Recoil,0,70,random(-45,45),0)
			TNT1 A 0 A_TakeInventory("criflecell", 40)/*, TIF_NOTAKEINFINITE*/
			CNPF B 1 bright
			TNT1 A 0 A_GiveInventory("crifleheat", 106)
			NULL A 0 ACS_ExecuteAlways(pmsx_TempCooldown,0,0,0,0)//Temp down...
			TNT1 A 0 A_JumpIfInventory("crifleheat", 200, "ovheat_powerfire")
			
			CNPR ABCDEFGHIJKLM 1
			Goto Ready
		
		ovheat_pulsefire:
			NULL A 0 ACS_Terminate(pmsx_TempCooldown,0)
			CPFO ABCDEFG 1
			NULL A 0 A_PlaySound("weapons/cr_stuck",CHAN_AUTO,2.0)
			goto ovheat_fireloop
		ovheat_powerfire:
			NULL A 0 ACS_Terminate(pmsx_TempCooldown,0)
			CSFO ABCDEFGHIJK 1
			NULL A 0 A_PlaySound("weapons/cr_stuck",CHAN_AUTO,2.0)
			goto ovheat_fireloop
		ovheat_fireloop:
			TNT1 A 0 A_JumpIfInventory("overheat_holdtimer", 50, "ovheat_fireend")
			TNT1 A 0 A_FireCustomMissile ("crifle_heatsteam_spawner", 0, 0, 5, 5)
			CFOE A 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
			TNT1 A 0 A_GiveInventory("overheat_holdtimer",1)
			loop
		ovheat_fireend:
			NULL A 0 A_PlaySound("weapons/cr_coolend",CHAN_WEAPON,0.5)
			TNT1 A 0 A_TakeInventory("overheat_holdtimer", 999)
			TNT1 A 0 ACS_ExecuteAlways(pmsx_TempCooldown,0,0,0,0) //temp down!
			CFOE BCDEFGHI 1
			goto ready
				
		flashreset:
			TNT1 AA 1
			stop
		
		SwitchMode:
			TNT1 A 0 A_JumpIfInventory("crifle_mode",1,"Mode2Pulse")
		Mode2Shock:	
			CNSW AB 1
			TNT1 A 0 A_Print ("- SHOCK MODE -")
			TNT1 A 0 A_StopSound(6)
			TNT1 A 0 A_PlaySound("weapons/cr_modeswitch",CHAN_AUTO,1.5) 
			CNSW C 6 A_GiveInventory("crifle_mode",1)
			CNSW BA 1
			goto ready
		Mode2Pulse:	
			CNSW AB 1
			TNT1 A 0 A_Print ("- PULSE MODE -")
			TNT1 A 0 A_PlaySound("weapons/cr_modeswitch",CHAN_AUTO,1.5) 
			CNSW C 6 A_TakeInventory("crifle_mode",9)
			TNT1 A 0 A_PlaySound("weapons/cr_pulseidle",6,1.0,1)
			CNSW BA 1
			goto ready
			
		Reload:
			TNT1 A 0 A_JumpIfInventory("criflecell", 80, 2)
			TNT1 A 0 A_JumpIfInventory("crifle_ammo", 1, 2)
			TNT1 A 0
			goto ready
			
			TNT1 A 0 A_JumpIfInventory("crifle_mode", 1, 3)
			TNT1 A 0 A_StopSound(6)
			TNT1 A 0 A_PlaySound("weapons/cr_pulseoff", 6)
			
			CNR1 ABCD 1
			TNT1 A 0 A_PlaySound("weapons/cr_clipout", CHAN_WEAPON)
			CNR1 EFGHIJK 1
			CNR1 L 2
			CNR2 ABCDEFGHIKLM 1
			//CNR2 N 1
			CNR3 ABCDEFG 1
			CNR3 HIJJJ 2
			CNR3 L 1
			TNT1 A 0 A_PlaySound("weapons/cr_clipin", CHAN_WEAPON)
			CNR3 M 2
		
		Reload_FillClip:	
			NULL A 0 A_TakeInventory("crifle_ammo",1)
			NULL A 0 A_GiveInventory("criflecell",1)
			NULL A 0 A_JumpIfInventory("criflecell",80,"ReloadFinish")
			NULL A 0 A_JumpIfInventory("crifle_ammo",1,"Reload_FillClip")
			
		ReloadFinish:
			CNR3 NNNNO 2
			CNR4 AABCDEFGHIJKLMNO 1
			goto ready
		
		Grenade:
			TNT1 A 0 A_JumpIfInventory("grenades", 1, 2)
			TNT1 A 0
			goto ready
			TNT1 A 0 A_JumpIfInventory("crifle_mode", 1, 3)
			TNT1 A 0 A_StopSound(6)
			TNT1 A 0 A_PlaySound("weapons/cr_pulseoff", 6)
			
			CNCG ABCDEFG 1
			TNT1 A 0 A_GiveInventory("gtoss_weaponmemory", 16)
			TNT1 A 0 A_SelectWeapon("grenade_toss")
			goto deselectLoop
		GrenadeEnd:
			TNT1 A 0 A_TakeInventory("gtoss_weaponmemory",99)
			CNCG GFEDCBA 1
			goto selectLoop
			
		/////////////////////////////////////////////////////////
		AltFire:
			CNCM C 1 A_Recoil(-6)
			NULL A 0 A_PlayWeaponSound("sfx/meleeswing")
			CNCM EHJ 1
			CNCM L 9 A_CustomPunch ((164+random(1,32)), 1 , 0 , "meleepuff",88)
			CNCM KJIHGFEDCBA 1
			goto ready
			
	}

}


actor criflecell : ammo {
	inventory.maxamount 80
	+INVENTORY.IGNORESKILL
}

actor crifleheat : Inventory{
	Inventory.Amount 1
	Inventory.MaxAmount 200
	+INVENTORY.IGNORESKILL
	-INVBAR
}

actor overheat_holdtimer : inventory {
	Inventory.Amount 1
	Inventory.MaxAmount 100
}

actor crifle_mode : inventory {
	Inventory.Amount 1
	Inventory.MaxAmount 1
}

actor holdcheckcount : inventory {
	inventory.amount 1
	inventory.maxamount 15
}

actor chargecounter : inventory {
	inventory.amount 1
	inventory.maxamount 21
}


Actor user_boomc : Inventory {}

actor shock_powbolt : fastprojectile{
	radius 5
	height 5
	scale 0.6
	mass 20
	PROJECTILE
	+NODAMAGETHRUST
	+FORCERADIUSDMG
	//-FORCEPAIN
	//-NOGRAVITY
	//gravity 0.1
	speed 95
	damage 100
	//ProjectileKickBack 250
	renderstyle add
	damagetype "concussion_blast"
	MissileType "powbolt_trail1"
	MissileHeight 8
	//var int user_boomc;
	
	+THRUSPECIES
	Species "Player"
	
	states {
		spawn:
			CPBL ABCDEFGHIJKL 1 bright A_SpawnItemEx("powbolt_trail2",0,0,0, 0,0,0)
			loop
		death:
			TNT1 A 0 A_PlaySound("sfx/powshockblast", CHAN_AUTO)
			TNT1 A 0 //A_SetUserVar("user_boomc", 0)
			
			TNT1 A 0 A_SpawnItemEx("powbolt_boomflash",0,0,0, 0,0,0)
			TNT1 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))
			TNT1 A 0 A_SpawnItemEx("powbolt_smoke",0,0,0, 0,random(-5,5),random(-5,5))
			TNT1 A 0 A_SpawnItemEx("powbolt_smoke",0,0,0, 0,random(-5,5),random(-5,5))
			TNT1 A 0 A_SpawnItemEx("powbolt_smoke",0,0,0, 0,random(-5,5),random(-5,5))
			TNT1 A 0 A_SpawnItemEx("powbolt_smoke",0,0,0, 0,random(-5,5),random(-5,5))
			TNT1 A 0 A_SpawnItemEx("powbolt_smoke",0,0,0, 0,random(-5,5),random(-5,5))
			TNT1 A 0 A_SpawnItemEx("powbolt_smoke",0,0,0, 0,random(-5,5),random(-5,5))
			
			//TNT1 A 0 A_SpawnItemEx("powbolt_boom2",0,0,0, 0,0,0)
			TNT1 A 0 A_SpawnItemEx("pbolt_boomwave",0,0,0, 0,0,0)
			TNT1 A 0 //A_Quake(5, 20, 0, 864, " ")
			TNT1 A 0 A_Explode (320 * 3, 200, 1, 1/*, 64*/)
			TNT1 A 0 A_Explode (145 * 3, 340, 0, 1/*, 0*/)
		boom:
			TNT1 A 0 //A_JumpIf(user_boomc>=5,"boom2")
			TNT1 A 0 A_JumpIfInventory("user_boomc", 5, "boom2")
			//TNT1 A 0 A_RadiusThrust (900, 160, 0, 0)
			TNT1 A 0 A_Explode (random(110,130) * 3, 350, 0, 1/*, 0*/)
			TNT1 A 1 A_GiveInventory("user_boomc", 1)
			//TNT1 A 1 //A_SetUserVar("user_boomc", user_boomc+1)
			loop
		boom2:
			TNT1 A 0 A_ChangeFlag("FORCERADIUSDMG",0)
			//TNT1 A 0 A_ChangeFlag("FORCEPAIN",0)
			TNT1 A 0 //A_SetUserVar("user_boomc", 0)
			TNT1 A 0 A_TakeInventory("user_boomc", 99)
			TNT1 A 0 A_SpawnItemEx("pbolt_boomwave",0,0,0, 0,0,0)
						
			TNT1 A 0 A_SpawnItemEx("powbolt_smoke",0,0,0, 0,random(-5,5),random(-5,5))
			TNT1 A 0 A_SpawnItemEx("powbolt_smoke",0,0,0, 0,random(-5,5),random(-5,5))
			TNT1 A 0 A_SpawnItemEx("powbolt_smoke",0,0,0, 0,random(-5,5),random(-5,5))
			TNT1 A 0 A_SpawnItemEx("powbolt_smoke",0,0,0, 0,random(-5,5),random(-5,5))
			TNT1 A 0 A_SpawnItemEx("powbolt_smoke",0,0,0, 0,random(-5,5),random(-5,5))
			TNT1 A 0 A_SpawnItemEx("powbolt_smoke",0,0,0, 0,random(-5,5),random(-5,5))
			TNT1 A 0 A_SpawnItemEx("powbolt_smoke",0,0,0, 0,random(-5,5),random(-5,5))
			
			
			//TNT1 A 0 A_SpawnItemEx("powbolt_boom",0,0,0, 0,0,0)
		boom2s:
			TNT1 A 0 //A_JumpIf(user_boomc>=20,"boomend")
			TNT1 A 0 A_JumpIfInventory("user_boomc", 20, "boomend")
			//TNT1 A 0 A_RadiusThrust (900, 160, 0, 0)
			TNT1 A 0 A_Explode (random(72,82) * 3, 300, 0, 1/*, 0*/)
			//TNT1 A 2 //A_SetUserVar("user_boomc", user_boomc+1)
			TNT1 A 2 A_GiveInventory("user_boomc", 1)
			loop
		boomend:
			TNT1 A 0
			stop
			stop					 
	}
}

actor powbolt_boom {
	height 5
	radius 5
	scale 1.5
	alpha 1.0
	renderstyle add
	+NOINTERACTION
	+FORCEXYBILLBOARD
	+CLIENTSIDEONLY
	states {
		spawn:
		CBE1 ABCDEFGHIJKLMNOPQRSTUVWX 1 bright
		stop
	
	}

}

actor powbolt_boom2 : powbolt_boom {
	scale 1.3
	states {
		spawn:
		CBE2 ABCDEFGHIJKLMNOP 1 bright
		stop
	
	}
}

actor powbolt_boom3 : powbolt_boom {
	scale 1.45
	states {
		spawn:
		CBE3 ABCDEFGHIJKLMNOP 1 bright
		stop
	
	}
}

actor powbolt_boomflash {
	scale 0.95
	alpha 1.0
	renderstyle add
	+NOINTERACTION
	+FORCEXYBILLBOARD
	+CLIENTSIDEONLY
	states {
		spawn:
			CBFL A 3 bright
		spend:
			CBFL A 1 bright A_FadeOut(0.05) 
			stop
	}
}

actor powbolt_boomflashB {
	scale 0.6
	alpha 1.0
	renderstyle add
	+NOINTERACTION
	+FORCEXYBILLBOARD
	+CLIENTSIDEONLY
	states {
		spawn:
			TNT1 A 0
			TNTE A 0 A_Jump(256, "f1", "f2", "f3", "f4")
		f1:	
			CBF2 A 1 bright A_FadeOut(0.02) 
			wait 
		f2:	
			CBF2 B 1 bright A_FadeOut(0.02) 
			wait 
		f3:	
			CBF2 C 1 bright A_FadeOut(0.02) 
			wait 
		f4:	
			CBF2 C 1 bright A_FadeOut(0.02) 
			wait
	}
}

actor powbolt_smoke {
	scale 1.3
	alpha 0.8
	Translation "0:255=%[0.0,0.0,0.0]:[0.2,1.0,0.0]"
	renderstyle add
	+NOTELEPORT
	+FLOORCLIP
	+NOGRAVITY
	+FORCEXYBILLBOARD
	+NOINTERACTION
	+CLIENTSIDEONLY
	states{
		spawn:
			TNT1 A 0
			TNT1 A 0 A_Jump(255, "s1","s2","s3","s4","s5","s6","s7","s8","s9","s10","s11","s12","s13","s14","s15","s16","s17","s18","s19","s20","s21","s22","s23","s24")
		s1:
			SMK5 A 3 A_ScaleVelocity(0.9)
			TNT1 A 0 A_FadeOut(0.05)
			loop
		s2:
			SMK5 B 3 A_ScaleVelocity(0.9)
			TNT1 A 0 A_FadeOut(0.05)
			loop
		s3:
			SMK5 C 3 A_ScaleVelocity(0.9)
			TNT1 A 0 A_FadeOut(0.05)
			loop
		s4:
			SMK5 D 3 A_ScaleVelocity(0.9)
			TNT1 A 0 A_FadeOut(0.05)
			loop
		s5:
			SMK5 E 3 A_ScaleVelocity(0.9)
			TNT1 A 0 A_FadeOut(0.05)
			loop
		s6:
			SMK5 F 3 A_ScaleVelocity(0.9)
			TNT1 A 0 A_FadeOut(0.05)
			loop
		s7:
			SMK5 G 3 A_ScaleVelocity(0.9)
			TNT1 A 0 A_FadeOut(0.05)
			loop
		s8:
			SMK5 H 3 A_ScaleVelocity(0.9)
			TNT1 A 0 A_FadeOut(0.05)
			loop
		s9:
			SMK5 I 3 A_ScaleVelocity(0.9)
			TNT1 A 0 A_FadeOut(0.05)
			loop
		s10:
			SMK5 J 3 A_ScaleVelocity(0.9)
			TNT1 A 0 A_FadeOut(0.05)
			loop
		s11:
			SMK5 K 3 A_ScaleVelocity(0.9)
			TNT1 A 0 A_FadeOut(0.05)
			loop
		s12:
			SMK5 L 3 A_ScaleVelocity(0.9)
			TNT1 A 0 A_FadeOut(0.05)
			loop
		s13:
			SMK5 M 3 A_ScaleVelocity(0.9)
			TNT1 A 0 A_FadeOut(0.05)
			loop
		s14:
			SMK5 N 3 A_ScaleVelocity(0.9)
			TNT1 A 0 A_FadeOut(0.05)
			loop
		s15:
			SMK5 O 3 A_ScaleVelocity(0.9)
			TNT1 A 0 A_FadeOut(0.05)
			loop
		s16:
			SMK5 P 3 A_ScaleVelocity(0.9)
			TNT1 A 0 A_FadeOut(0.05)
			loop
		s17:
			SMK5 Q 3 A_ScaleVelocity(0.9)
			TNT1 A 0 A_FadeOut(0.05)
			loop
		s18:
			SMK5 R 3 A_ScaleVelocity(0.9)
			TNT1 A 0 A_FadeOut(0.05)
			loop
		s19:
			SMK5 S 3 A_ScaleVelocity(0.9)
			TNT1 A 0 A_FadeOut(0.05)
			loop
		s20:
			SMK5 T 3 A_ScaleVelocity(0.9)
			TNT1 A 0 A_FadeOut(0.05)
			loop
		s21:
			SMK5 U 3 A_ScaleVelocity(0.9)
			TNT1 A 0 A_FadeOut(0.05)
			loop
		s22:
			SMK5 V 4 A_ScaleVelocity(0.9)
			TNT1 A 0 A_FadeOut(0.05)
			loop
		s23:
			SMK5 W 3 A_ScaleVelocity(0.9)
			TNT1 A 0 A_FadeOut(0.05)
			loop
		s24:
			SMK5 X 3 A_ScaleVelocity(0.9)
			TNT1 A 0 A_FadeOut(0.05)
			loop
			
	}
}

actor pbolt_boomwave {
	//var int user_scale;
	//scale 0.7
	alpha 1.0
	renderstyle add
	+NOINTERACTION
	+FORCEXYBILLBOARD
	+CLIENTSIDEONLY
	states{
		spawn:
			TNT1 A 0
			TNT1 A 0 //A_SetUserVar("user_scale",4)
		scaledown:
			TNT1 A 0 //A_SetScale((user_scale*0.01)) 
			TNT1 A 0 //A_JumpIf(user_scale>=110,"LoopEnd") 
			CPEW B 1 bright A_FadeOut(0.06)
			TNT1 A 0 //A_SetUserVar("user_scale",user_scale+10)
			loop
		loopend:
			CPEW B 1 Bright A_FadeOut(0.1)
			wait
			
	}
}



actor powbolt_trail1 {
	scale 0.1
	alpha 1.0
	renderstyle add
	+NOINTERACTION
	+NOGRAVITY
	+FORCEXYBILLBOARD
	+NOTELEPORT
	+CLIENTSIDEONLY
	states {
		spawn:
			CPST ABCDE 2 bright
		tofade:
			CPST FGHIJKLLMMNNOOOO 2 bright A_Fadeout(0.1)
			stop
	}
}


//Thanks to DBThanatos for the original code
actor powbolt_trail2 {
	//var int user_scale;
	//scale 0.7
	alpha 1.0
	renderstyle add
	+NOINTERACTION
	+FORCEXYBILLBOARD
	+CLIENTSIDEONLY
	states{
		spawn:
			TNT1 A 0
			TNT1 A 0 //A_SetUserVar("user_scale",4)
		scaledown:
			TNT1 A 0 //A_SetScale((user_scale*0.01)) 
			TNT1 A 0 //A_JumpIf(user_scale>=30,"LoopEnd") 
			CPEW A 1 bright A_FadeOut(0.04)
			TNT1 A 0 //A_SetUserVar("user_scale",user_scale+1)
			loop
		loopend:
			CPEW A 1 Bright A_FadeOut(0.1)
			wait
			
	}
}


actor shock_normbolt : fastprojectile {
	radius 6
	height 6
	scale 0.15
	mass 20
	PROJECTILE
	+NODAMAGETHRUST
	//-NOGRAVITY
	//gravity 0.1
	speed 50
	damage 3
	//ProjectileKickBack 180
	renderstyle add
	damagetype "concussion_blast"
	MissileType "normbolt_trail"
	MissileHeight 8
	//var int user_boomc;
	
	+THRUSPECIES
	Species "Player"
	
	states {
		spawn:
			CPBL ABCDEFGHIJKL 1 bright
			loop
		death:
			//TNT1 A 0 A_SetUserVar("user_boomc", 0)
			
			TNT1 A 0 A_PlaySound("sfx/normshockblast", CHAN_AUTO)
			TNT1 A 0 A_SpawnItemEx("normbolt_boomflash",0,0,0, 0,0,0)
			TNT1 A 0 A_SpawnItemEx("nbolt_boomflashB",0,0,0, 0,0,0)
			TNT1 A 0 A_SpawnItemEx("normbolt_boom",0,0,0, 0,0,0)
			TNT1 A 0 A_SpawnItemEx("nbolt_boomwave",0,0,0, 0,0,0)
			
			TNT1 A 0 A_SpawnItemEx("normbolt_smoke",0,0,0, 0,random(-1,1),random(-1,1))
			TNT1 A 0 A_SpawnItemEx("normbolt_smoke",0,0,0, 0,random(-1,1),random(-1,1))
			TNT1 A 0 A_SpawnItemEx("normbolt_smoke",0,0,0, 0,random(-1,1),random(-1,1))
			TNT1 A 0 A_SpawnItemEx("normbolt_smoke",0,0,0, 0,random(-1,1),random(-1,1))
			TNT1 A 0 A_Explode (13 * 1.5, 48, 1, 1/*, 0*/)
			TNT1 AAAAAAAAAA 2 A_Explode (7 * 1.5, 102, 0, 1/*, 48*/)
			stop			 
	}
}

actor normbolt_trail {
	scale 0.10
	alpha 0.36
	renderstyle add
	+NOINTERACTION
	+NOGRAVITY
	+FORCEXYBILLBOARD
	+NOTELEPORT
	+CLIENTSIDEONLY
	states {
		spawn:
			CPTR ABCDEFJHIJKLMNO 1 bright A_FadeOut(0.1)
			stop
	}
}

actor normbolt_boom {
	scale 0.4
	alpha 1.0
	renderstyle add
	+NOINTERACTION
	+FORCEXYBILLBOARD
	+CLIENTSIDEONLY
	states {
		spawn:
		CBE2 ABCDEFGHIJKLMNOP 1 bright
		stop
	
	}

}

actor normbolt_boomflash : powbolt_boomflash {
	scale 0.25
	states {
		spawn:
			CBFL A 3 bright
		spend:
			CBFL A 1 bright A_FadeOut(0.1) 
			stop
	}
}

actor nbolt_boomflashB {
	scale 0.1
	alpha 1.0
	renderstyle add
	+NOINTERACTION
	+FORCEXYBILLBOARD
	+CLIENTSIDEONLY
	states {
		spawn:
			TNT1 A 0
			TNTE A 0 A_Jump(256, "f1", "f2", "f3", "f4")
		f1:	
			CBF2 A 1 bright A_FadeOut(0.05) 
			wait 
		f2:	
			CBF2 B 1 bright A_FadeOut(0.05) 
			wait 
		f3:	
			CBF2 C 1 bright A_FadeOut(0.05) 
			wait 
		f4:	
			CBF2 C 1 bright A_FadeOut(0.05) 
			wait
	}
}

actor normbolt_smoke : powbolt_smoke {
	scale 0.4
}

/*
actor nbolt_boomwave {
	//var int user_scale;
	alpha 1.0
	renderstyle add
	+NOINTERACTION
	+FORCEXYBILLBOARD
	+CLIENTSIDEONLY
	states{
		spawn:
			TNT1 A 0
			TNT1 A 0 //A_SetUserVar("user_scale",2)
		scaledown:
			TNT1 A 0 //A_SetScale((user_scale*0.005)) //Start scale
			TNT1 A 0 //A_JumpIf(user_scale>=55,"LoopEnd") //Maximum Scale
			CPEW B 1 bright A_FadeOut(0.1)
			TNT1 A 0 //A_SetUserVar("user_scale",user_scale+8) //Increment
			loop
		loopend:
			CPEW B 1 Bright A_FadeOut(0.1)
			wait
			
	}
}
*/

Actor nbolt_boomwave
{
	+CLIENTSIDEONLY
	
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 A_SpawnItemEx("nbolt_boomwave_2",  0, 0, 0, 0, 0, 0)
		TNT1 A 1 A_SpawnItemEx("nbolt_boomwave_10", 0, 0, 0, 0, 0, 0)
		TNT1 A 1 A_SpawnItemEx("nbolt_boomwave_18", 0, 0, 0, 0, 0, 0)
		TNT1 A 1 A_SpawnItemEx("nbolt_boomwave_24", 0, 0, 0, 0, 0, 0)
		TNT1 A 1 A_SpawnItemEx("nbolt_boomwave_32", 0, 0, 0, 0, 0, 0)
		TNT1 A 1 A_SpawnItemEx("nbolt_boomwave_40", 0, 0, 0, 0, 0, 0)
		TNT1 A 1 A_SpawnItemEx("nbolt_boomwave_48", 0, 0, 0, 0, 0, 0)
		Stop
	}
}

Actor nbolt_boomwave_base 
{
	RenderStyle Add
	Alpha 1.0
	Scale 0.2
	
	+NOINTERACTION
	+NOGRAVITY
	+FORCEXYBILLBOARD
	+CLIENTSIDEONLY
	
	States
	{
	Spawn:
		CPEW B 2 Bright
		Stop
	}
}

Actor nbolt_boomwave_2 : nbolt_boomwave_base 
{
	Alpha 1.0
	Scale 0.01
}

Actor nbolt_boomwave_10 : nbolt_boomwave_base 
{
	Alpha 0.9
	Scale 0.05
}

Actor nbolt_boomwave_18 : nbolt_boomwave_base 
{
	Alpha 0.8
	Scale 0.09
}

Actor nbolt_boomwave_24 : nbolt_boomwave_base 
{
	Alpha 0.7
	Scale 0.12
}

Actor nbolt_boomwave_32 : nbolt_boomwave_base 
{
	Alpha 0.6
	Scale 0.16
}

Actor nbolt_boomwave_40 : nbolt_boomwave_base 
{
	Alpha 0.5
	Scale 0.2
}

Actor nbolt_boomwave_48 : nbolt_boomwave_base 
{
	Alpha 0.4
	Scale 0.24
}









