ACTOR TaurusCannon:MSXWeapon{
	weapon.selectionorder 150
	inventory.pickupsound "weapons/tp_fullcycle"
	inventory.pickupmessage "'Taurus' SA22M5 Personal Auto-Cannon"
	scale 0.32
	weapon.ammotype1 "cannonmag"
	weapon.ammotype2 "cannon_ammo"
	weapon.ammouse1 1
	weapon.ammogive2 15
	weapon.kickback 100
	weapon.bobstyle inverse
	weapon.bobrangeX 0.4
	weapon.bobrangeY 0.6
	weapon.bobspeed 2.5
	+AMMO_OPTIONAL	
	+NOALERT
	+WEAPON.NOAUTOAIM
   	states{
	spawn:
		TPCW A -1
		loop
	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:
		TPCU A 1 {A_TakeInventory("xhair_switch",1);
			A_PlaySound("weapons/tp_deselect",CHAN_WEAPON);}
		TPCU BCDEFG 1
		TNT1 AAAAAAAAAA 0 A_Lower
		TNT1 A 1 A_Lower
		Goto Deselect+7
	Ready:
		TPCU G 1 {A_PlaySound("weapons/tp_select",CHAN_WEAPON);
			A_SetCrosshair(10);}
		TPCU FEDCBA 1
		TNT1 A 0 A_GiveInventory("xhair_switch",1)
	Idle:	
		TPCI A 1 A_WeaponReady(WRF_ALLOWRELOAD|WRF_ALLOWUSER1|WRF_ALLOWUSER2|WRF_ALLOWUSER3|WRF_ALLOWUSER4)
		"####" "#" 0 A_JumpIfInventory("SprintingPlayer",1,"Sprint")
		loop
	Sprint:
		"####" "#" 0 A_JumpIf(GetCVar("MSfiXd_SprintStaminaUse")==0,"SprStart")
		TNT1 A 0 A_JumpIfInventory("PlayerStamina",1,"SprStart")
		TNT1 A 0 A_TakeInventory("SprintingPlayer",1)
		Goto Idle
	SprStart:
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_SprintHands")==1,"SprStart_HandWeapon")
		TNT1 A 0 {A_TakeInventory("xhair_switch",1);
			A_PlaySound("sfx/sprintstart",CHAN_AUTO);
			ACS_NamedExecute("Player-ChangeSpeed",0,GetCVar("MSfiXd_SprintSpeed"),0,0);
			A_SetBlend("49 99 0",0.4,15);
			A_Recoil(-15);}
		TPCS ABCDE 1
		"####" "#" 0 A_JumpIfInventory("SprintingPlayer",1,"SprLoop1")
		Goto SprEnd
	SprStart_HandWeapon:
		TPCU A 1{A_PlaySound("weapons/tp_deselect",CHAN_WEAPON);
			A_TakeInventory("xhair_switch",1);}
		TPCU CEG 1
		TNT1 A 1 A_GiveInventory("SprintHands")
		TNT1 A 0 A_Jump(256,"SprStart_Hands")
		Goto SprStart_Hands
	SprEnd:
		TNT1 A 0 {ACS_NamedExecute("Player-ChangeSpeed",0,100,0,0);
			A_PlaySound("sfx/sprintend",CHAN_AUTO);}
		TPCS EDCBA 1
		TNT1 A 0 A_GiveInventory("xhair_switch",1)
		Goto Idle
	SprEnd_HandWeapon:
		TNT1 A 0 {A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH);
			ACS_NamedExecute("Player-ChangeSpeed",0,100,0,0);
			A_PlaySound("sfx/sprintend",CHAN_AUTO);}
		TPCU G 1 {A_TakeInventory("SprintHands");
			A_SetCrosshair(10);
			A_PlaySound("weapons/tp_select",CHAN_WEAPON);}
		TPCU ECA 1
		TNT1 A 0 A_GiveInventory("xhair_switch",1)
		Goto Idle
	AutoReloadCheck:
		TNT1 A 0 A_JumpIfInventory("cannonmag",1,"Idle")
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_AutoReloads")==2,"Reload")
		TNT1 A 0 A_JumpIf((GetCVar("MSfiXd_AutoReloads")==1)&&(GetCVar("MSfiXd_TaurusAutoReloads"))==1,"Reload")
		Goto Idle
	fire:
		TNT1 A 0 A_JumpIfInventory("cannonmag", 1, 3)
		TPCI A 1 A_PlayWeaponSound("weapons/noammo")
		TPCI A 6
		goto Idle
		
		NULL A 0 A_Light1
		NULL A 0 A_AlertMonsters
		NULL A 0 A_PlaySound("weapons/tp_fire", CHAN_WEAPON)
		TPCF A 1 bright A_FireCustomMissile ("cslugshot", 0, 1, 5, 5 , 0, 0)
		NULL A 0 ACS_NamedExecute("Weapon-Recoil",0,40,random(-20,20),0)
		
		TPCF B 1 bright
		TNT1 A 0 A_Light0
		TPBN A 1
		TNT1 A 0 A_JumpIfInventory("cannonmag", 1, 1)
		goto fire+13
		
		TPBN A 1 A_ReFire("doublefire")
		goto fire+13
		
		TNT1 A 0
		TNT1 A 0 A_PlaySound("weapons/tp_halfcycle", CHAN_AUTO)			
		TNT1 A 0 A_JumpIfInventory("cannonmag", 1, 8)
		TPBH D 1
		TNT1 A 0 A_FireCustomMissile("cancasing_spawner",0,0,0,5,0)
		TPBH EF 1 //no shell
		TPBH GH 1
		TPCI A 1 
		//Goto Idle
		Goto AutoReloadCheck
		TPBH A 1
		TNT1 A 0 A_FireCustomMissile("cancasing_spawner",0,0,0,5,0)
		TPBH BC 1 //shell
		TPBH GH 1
		TPCI A 1 
		//Goto Idle
		Goto AutoReloadCheck
	doublefire:	
		TNT1 A 0 A_JumpIfInventory("cannonmag", 1, 14)
		TNT1 A 0 A_PlaySound("weapons/tp_fullcycle", CHAN_AUTO)
		TPBF D 1
		TNT1 A 0 A_FireCustomMissile("cancasing_spawner",0,0,0,5,0)
		TPBF EFG 1
		TNT1 A 0 A_FireCustomMissile("cancasing_spawner",0,0,0,4,0)
		TPBF KLMNO 1
		//Goto Idle
		Goto AutoReloadCheck
			
		TPBN CDE 1
		TPCI A 1 
		TNT1 A 0 A_Light1
		NULL A 0 A_AlertMonsters
		TNT1 A 0 A_PlaySound("weapons/tp_fire", CHAN_WEAPON)
		TPCF C 1 bright A_FireCustomMissile ("cslugshot", 0, 1, 5, 2 , 0, 0)
		NULL A 0 ACS_NamedExecute("Weapon-Recoil",0,60,random(-30,30),0)
		goto doublefire+23
		
		TPCF D 1 bright
		TNT1 A 0 A_Light0
		TPBN A 1 
		//TPBN B 1 
		NULL A 0 A_PlaySound("weapons/tp_fullcycle",CHAN_AUTO)
		TPBF D 1
		TNT1 A 0 A_FireCustomMissile("cancasing_spawner",0,0,0,5,0)
		TPBF EFG 1
		NULL A 0 A_JumpIfInventory("cannonmag", 1, 7)
		TNT1 A 0 A_FireCustomMissile("cancasing_spawner",0,0,0,4,0)
		TPBF KLMNO 1
		//Goto Idle
		Goto AutoReloadCheck
		TNT1 A 0 A_FireCustomMissile("cancasing_spawner",0,0,0,4,0)
		TPBF HIJNO 1
		//Goto Idle
		Goto AutoReloadCheck
	Reload:
		TNT1 A 0 A_JumpIfInventory("cannonmag",0,"Idle")
		TNT1 A 0 A_JumpIfInventory("cannon_ammo",1,1)
		Goto Idle
		TPRS ABCDEFG 1
		TRCO A 4
		TRCO BC 1
		TRCO D 2 A_PlaySound("weapons/tp_clipout",CHAN_WEAPON)
		TRCO EEFFGHIJKL 1
		TRCO M 10
		TRCI ABCD 1
		TRCI EF 2
		TRCI GH 1
		TRCI I 1 A_PlaySound("weapons/tp_clipin",CHAN_WEAPON)		
		TRCI J 1
		TRCI K 4
		TRCI LMNOOPPQQRST 1
		TRCI U 1 A_PlaySound("weapons/tp_clipin2",CHAN_WEAPON)		
		TNT1 A 0 A_JumpIfInventory("cannonmag",1,"Reload_FillClipB")
		
	Reload_FillClipA:	
		TNT1 A 0 {A_TakeInventory("cannon_ammo",1);
			A_GiveInventory("cannonmag",1);}
		TNT1 A 0 A_JumpIfInventory("cannonmag",0,"ReloadFinish_Long")
		TNT1 A 0 A_JumpIfInventory("cannon_ammo",1,"Reload_FillClipA")			
	ReloadFinish_Long:
		TRCI U 5
		TRCE ABCDEFG 1
		TRLS ABCDEFGHIJKLMN 1 
		TRLS O 3 A_PlaySound("weapons/tp_bolt1",CHAN_WEAPON) 
		TRLS PQRS 1 
		TRLS TU 2
		TRLS V 4
		TNT1 A 0 A_PlaySound("weapons/tp_bolt2",CHAN_WEAPON) 
		TRLS UT 2
		TRLS WX 1
		TNT1 A 0 A_PlaySound("weapons/tp_fullcycle",CHAN_AUTO) 
		TRLE ABCD 1 
		TNT1 A 0 A_JumpIfInventory("cannonmag",2,4) 
		TRLE EGI 1
		Goto RF_LongEnd
		TRLE FHJ 1
	RF_LongEnd:
		TRLE KLMNO 1
		Goto Idle
	Reload_FillClipB:	
		TNT1 A 0 A_TakeInventory("cannon_ammo",1)
		TNT1 A 0 A_GiveInventory("cannonmag",1)
		TNT1 A 0 A_JumpIfInventory("cannonmag",0,"ReloadFinish_Quick")
		TNT1 A 0 A_JumpIfInventory("cannon_ammo",1,"Reload_FillClipB")
	ReloadFinish_Quick:
		TRCI U 5
		TRCE ABCDEFG 1
		TRQE ABCDEFG 1			
		Goto Idle
	User1:
		TNT1 A 0 A_JumpIfInventory("grenades",1,1)
		Goto Idle
		TPCU A 1 {A_TakeInventory("xhair_switch",1);
			A_PlaySound("weapons/tp_deselect",CHAN_WEAPON);}
		TPCU BCDEFG 1
		TNT1 A 0 A_Jump(256,"GrenadeStart")
		Goto GrenadeStart
	GrenadeEnd:
		TPCU G 1 {A_TakeInventory("GrenadeHold");
			A_PlaySound("weapons/tp_select",CHAN_WEAPON);
			A_SetCrosshair(10);}
		TPCU FEDCBA 1
		TNT1 A 0 A_GiveInventory("xhair_switch",1)
		Goto Idle
	// Health Stim Stuff //
	Stim_HolsterCheck:
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_HolsterWeapForItems")==0,"Stimulate")
		TPCU A 1 {A_TakeInventory("xhair_switch",1);
			A_PlaySound("weapons/tp_deselect",CHAN_WEAPON);}
		TPCU BCDEFG 1
		TNT1 A 0 A_Jump(256,"Stimulate")
		Goto Stimulate
	StimulateEnd:
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_HolsterWeapForItems")==0,"StimulateEnd_Quick")
		TPCU G 1 {A_PlaySound("weapons/tp_select",CHAN_WEAPON);
			A_SetCrosshair(10);}
		TPCU FEDCBA 1
		TNT1 A 0 A_GiveInventory("xhair_switch",1)
		Goto Idle
	StimulateEnd_Quick:
		TPCI A 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
		TNT1 A 0 A_JumpIf(GetPlayerInput(INPUT_BUTTONS)&(BT_USER2),"StimulateEnd_Quick")
		Goto Idle
	// Shield Booster Stuff //
	Boost_HolsterCheck:
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_HolsterWeapForItems")==0,"Boostify")
		TPCU A 1 {A_TakeInventory("xhair_switch",1);
			A_PlaySound("weapons/tp_deselect",CHAN_WEAPON);}
		TPCU BCDEFG 1
		TNT1 A 0 A_Jump(256,"Boostify")
		Goto Stimulate
	BoostifyEnd:
		TNT1 A 0 A_JumpIf(GetCVar("MSfiXd_HolsterWeapForItems")==0,"BoostifyEnd_Quick")
		TPCU G 1 {A_PlaySound("weapons/tp_select",CHAN_WEAPON);
			A_SetCrosshair(10);}
		TPCU FEDCBA 1
		TNT1 A 0 A_GiveInventory("xhair_switch",1)
		Goto Idle
	BoostifyEnd_Quick:
		TPCI A 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
		TNT1 A 0 A_JumpIf(GetPlayerInput(INPUT_BUTTONS)&(BT_USER3),"BoostifyEnd_Quick")
		Goto Idle
	// Jetpack Stuff //
	User4:
		TNT1 A 0 A_JumpIfInventory("Jetpack",1,1)
		Goto Idle
		TPCU A 1 {A_TakeInventory("xhair_switch",1);
			A_PlaySound("weapons/tp_deselect",CHAN_WEAPON);}
		TPCU BCDEFG 1
		TNT1 A 0 A_Jump(256,"JetpackStart")
		Goto JetpackStart
	WeaponJetEnd:
		TPCU G 1 A_PlaySound("weapons/tp_select",CHAN_WEAPON)
		TPCU FEDCBA 1
		TNT1 A 0 {A_SetCrosshair(10);
			A_GiveInventory("xhair_switch",1);}
		Goto Idle
	AltFire:
		TPCM C 1 A_Recoil(-7)
		TNT1 A 0 A_PlayWeaponSound("sfx/meleeswing")
		TPCM EGIK 1
		TPCM N 9 A_CustomPunch((188+random(1,32)),1,CPF_DAGGER|CPF_NOTURN,"Taurus_meleepuff",92)
		TPCM MLKJIHGFEDCBA 1
		Goto Idle}}
actor cannonmag:Ammo{Inventory.MaxAmount 30 Inventory.Icon ""}
actor cannon_ammo:ammo{
	radius 16
	height 8
	scale 0.35
	inventory.pickupmessage "Box of 30mm Slugs for Auto-Cannon"
	inventory.pickupsound "weapons/tp_clipin"
	inventory.amount 10
	inventory.maxamount 120
	ammo.backpackamount 10
	ammo.backpackmaxamount 240
	states{
	Spawn:
		CSLU A -1
		stop}}
actor cannoniscooling:Inventory {
	Inventory.PickupSound ""
	Inventory.Amount 1
	Inventory.MaxAmount 2}
actor cann_autocool_sw:Inventory{
	Inventory.PickupSound ""
	Inventory.Amount 1
	Inventory.MaxAmount 2}
actor cannon_casing {
	scale 0.3
	radius 2
	height 2
	speed 6
	mass 4
	bouncefactor 0.6
	PROJECTILE
	+DOOMBOUNCE
	+NODROPOFF
	+FORCEXYBILLBOARD
	+NOTELEPORT
	+FLOORCLIP
	-NOGRAVITY
	-NOBLOCKMAP
	seesound "casings/ar_casing"
	states{
	spawn:
		ACSC ABCDEF 2
		loop
	death:
		TNT1 A 0 A_Jump(256,1,2,3)
		ACSC B 0 A_Jump(256,3)
		ACSC C 0 A_Jump(256,2)
		ACSC F 0
		"####" "#" 400
		"####" "#" 1 A_FadeOut(0.1,1)
		Wait}}
ACTOR cannon_casing2:cannon_casing{
	States{
	Spawn:
		ACSC FDCBA 2
		Loop}}
actor cancasing_spawner{
	speed 15
	PROJECTILE
	+NOCLIP
	states{
	spawn:
		TNT1 A 0 NoDelay A_Jump(256,1,2)
		TNT1 A 1 A_SpawnItemEx("cannon_casing",0,14,3,1,random(4,5),random(0,1),0,SXF_TRANSFERPOINTERS) 
		stop
		TNT1 A 1 A_SpawnItemEx("cannon_casing2",0,14,3,1,random(4,5),random(0,1),0,SXF_TRANSFERPOINTERS) 
		stop}}
ACTOR Taurus_MeleePuff:MeleePuff{DamageType "TAURUS_Melee"}
actor cslugshot:FastProjectile{ 
    Radius 5
	Height 5  
	Mass 1
	Damage(300+(10*random(0,3)))
	alpha 1
	Speed 100
	RenderStyle ADD
	Scale 0.30
	DamageType "TAURUS_Slug"
	MissileType "cslugtrail_spawner"
	MissileHeight 8
	ProjectileKickBack 110
	PROJECTILE
	+NOTELEPORT
	+FORCEXYBILLBOARD
	Decal "BigScorch"
	States{
	Spawn:
		LEYS O 1 bright 
     	loop
	Death:
		TNT1 A 0 A_JumpIf(CountInv("MSfiXd_DegninOre",AAPTR_TARGET)>=1,1)
		Goto Death+2
		TNT1 A 0 A_RemoveForceField
		TNT1 AA 0 A_PlaySound("sfx/cannonblast")
		TNT1 A 0 bright A_Explode(95,128)
		TNT1 A 0 A_SpawnItemEx("cslugboom_flash",0,0,0,0,0,0,0)
		TNT1 A 0 A_SpawnItemEx("cslugshotboom",0,0,0,0,0,0,0,0)
		TNT1 A 0 A_SpawnItemEx("cslugshotboom2",0,0,0,0,0,0,0,0)
		TNT1 A 0 A_SpawnItemEx("cslugshotboom3",0,0,0,0,0,0,0,0)
		TNT1 A 0 A_SpawnItemEx("cslugboom_wave",0,0,0,0,0,0,0)
		TNT1 AAAAA 0 A_SpawnItemEx("cslugboom_spark",0,0,0,random(1,2),random(2,4),random(0,6),random(180,360))
		TNT1 AAA 0 A_SpawnItemEx("cslugboom_spark2",0,0,0,random(1,2),random(2,4),random(0,6),random(180,360))
		TNT1 A 3
		TNT1 AAAAAA 0 A_SpawnItemEx("cslugboom_smoke",0,0,0,random(0,1),frandom(-1.8,1.8),frandom(-1.8,1.8),random(0,90),0)
		stop}}
actor cslugtrail_spawner{
	+NOGRAVITY
	+NOCLIP
	States{
	spawn:
		TNT1 A 0
		TNT1 A 0 A_SpawnItemEx("cslugcoretrail",0,0,0,0,0,0,0)
		TNT1 A 0 A_SpawnItemEx("cslugtrail",0,0,0,0,0,0,0)
		stop}}
actor cslugcoretrail{
	scale 0.12
	alpha 1.0
	renderstyle add
	+NOINTERACTION
	+NOGRAVITY
	+FORCEXYBILLBOARD
	+NOTELEPORT
	states{
	spawn:
		SPRK C 2 bright
	sploop:
		SPRK C 1 bright {A_FadeOut(0.25);
			A_SetScale(ScaleX*0.8,ScaleY*0.8);}
		Wait}}
actor cslugtrail{
	scale 0.08
	alpha 1.0
	renderstyle add
	+NOINTERACTION
	+NOGRAVITY
	+FORCEXYBILLBOARD
	+NOTELEPORT
	states {
	spawn:
		SMK1 ABCDEFGHIJKLMNOPQ 1 bright NoDelay A_FadeOut(0.08)
		stop}}
actor cslugshotboom{
	alpha 1
	RenderStyle ADD
	Scale 0.75
	+NOGRAVITY
	+NOBLOCKMAP
	+FLOORCLIP
	+NOTELEPORT
	+FORCEXYBILLBOARD
	+NOINTERACTION
	states{
	spawn:
		SX06 ABCDEFGHIJKLMNOPQRSTUVWX 1 bright		
		stop}}
actor cslugshotboom2{
	alpha 1
	RenderStyle ADD
	Scale 1
	+NOGRAVITY
	+NOBLOCKMAP
	+FLOORCLIP
	+NOTELEPORT
	+FORCEXYBILLBOARD
	+NOINTERACTION
	states{
	spawn:
		TNT1 A 5
		SX05 BCDFG 1 bright	
	sploop:
		SX05 G 1 bright A_FadeOut(0.08)
		loop}}
actor cslugshotboom3{
	alpha 1
	RenderStyle ADD
	Scale 1
	+NOGRAVITY
	+NOBLOCKMAP
	+FLOORCLIP
	+NOTELEPORT
	+FORCEXYBILLBOARD
	+NOINTERACTION
	states{
	spawn:
		TNT1 A 2
		SX07 ABCDEFGHIJKLMNOP 1 bright
		stop}}
actor cslugboom_flash{
	scale 0.74
	alpha 1.0
	renderstyle add
	+NOTELEPORT
	+NOCLIP
	+FLOORCLIP
	+NOGRAVITY
	+FORCEXYBILLBOARD
	+NOINTERACTION
	states{
	spawn:
		BFSH A 3 bright
		stop}}
actor cslugboom_spark{
	radius 2
	height 2
	alpha 1
	scale 0.04
	gravity 0.4
	renderstyle add
	+NOTELEPORT
	+FLOORCLIP
	+FORCEXYBILLBOARD
	bouncetype "doom"
	bouncefactor 0.2
	states{
	spawn:
		SPRK A 15 bright
		SPRK A 1 bright A_FadeOut(0.1)
		Wait}}
actor cslugboom_spark2:cslugboom_spark{
	scale 0.06
	gravity 0.3
	states{
	spawn:
		SPRK C 20 bright
		SPRK C 1 bright A_FadeOut(0.1)
		Wait}}
actor cslugboom_wave{
	var int user_scale;
	alpha 0.8
	renderstyle add
	+NOINTERACTION
	+FORCEXYBILLBOARD
	states{
	Spawn:
		TNT1 A 0 NoDelay A_SetUserVar("user_scale",3)
		TNT1 A 0 A_SetScale((user_scale*0.018)) 
		TNT1 A 0 A_JumpIf(user_scale>=30,3)
		BSW0 A 1 bright A_FadeOut(0.09)
		TNT1 A 0 A_SetUserVar("user_scale",user_scale+3)
		Goto Spawn+1
		BSW0 B 1 Bright A_FadeOut(0.1)
		Wait}}
actor csteam_spawner{
	radius 1
	height 1
	speed 15
	PROJECTILE
	+NOCLIP
	states{
	spawn:
		TNT1 A 1
		TNT1 A 0 A_SpawnItemEx("cannon_steam",0,0,0,random(3,4),random(-1,1),2,0,SXF_TRANSFERPITCH)
		stop}}
actor cannon_steam{
	radius 3
	height 3
	scale 0.12
	renderstyle add
	alpha 0.5
	damage 0
	speed 0
	+RIPPER
	+NOTELEPORT
	+NOCLIP
	+NOGRAVITY
	+FORCEXYBILLBOARD
	states{
	spawn:
		SMK4 ABCDEFGHIJ 1 A_Explode(2,4,0,0)
		SMK4 J 1 {A_FadeOut(0.1);
			A_Explode(1,4,0,0);}
		loop}}