
//Fast fire totem variant.
ACTOR Dusk_Sword_Fastfire : Dusk_Sword
{
	+POWERED_UP 
	Weapon.SisterWeapon Dusk_Sword
	States
	{

//Powered up fire
	Fire:
		TNT1 A 0 A_JumpIfHealthLower(100,"Fire_99")
//		W11C A 3 A_WeaponReady(WRF_NOFIRE)
//		TNT1 A 0 A_Refire(1)
//	Goto Fire99
		TNT1 A 0 A_PlayWeaponSound("sword/altload")
TNT1 A 0 A_JumpIfInventory("Fastfire_TotemAmount",31,"Fire_Stacked2")
		W11G A 1 BRIGHT A_WeaponReady (WRF_NOFIRE|WRF_NOSWITCH)
		TNT1 A 0 A_Refire(1)//If you don't hold altfire, it goes back into fire.
		Goto Fire_99
		W11G C 1 BRIGHT A_WeaponReady (WRF_NOFIRE|WRF_NOSWITCH)
		TNT1 A 0 A_Refire(1)
		Goto Fire_99
		W11G E 1 BRIGHT A_WeaponReady (WRF_NOFIRE|WRF_NOSWITCH)
		TNT1 A 0 A_Refire(1)
		Goto Fire_99
		W11G G 1 BRIGHT A_WeaponReady (WRF_NOFIRE|WRF_NOSWITCH)
		TNT1 A 0 A_Refire(1)
		Goto Fire_99

		W11G IK 1 BRIGHT A_WeaponReady (WRF_NOFIRE|WRF_NOSWITCH)
		TNT1 A 0 A_Refire(1)
		Goto Fire_99

		W11G MO 1 BRIGHT A_WeaponReady (WRF_NOFIRE|WRF_NOSWITCH)
		TNT1 A 0 A_Refire("Fire100Hold")
		Goto Fire100End




	Fire_Stacked2:
		W11G A 1 BRIGHT A_WeaponReady (WRF_NOFIRE|WRF_NOSWITCH)
		TNT1 A 0 A_Refire(1)//If you don't hold altfire, it goes back into fire.
		Goto Fire_99
		W11G E 1 BRIGHT A_WeaponReady (WRF_NOFIRE|WRF_NOSWITCH)
		TNT1 A 0 A_Refire(1)
		Goto Fire_99
		W11G I 1 BRIGHT A_WeaponReady (WRF_NOFIRE|WRF_NOSWITCH)
		TNT1 A 0 A_Refire(1)
		Goto Fire_99

		W11G M 1 BRIGHT A_WeaponReady (WRF_NOFIRE|WRF_NOSWITCH)
		TNT1 A 0 A_Refire("Fire100Hold")
		Goto Fire100End





	Fire100Hold:
		TNT1 A 0 A_JumpIfHealthLower(100,"Fire100End")
		W11H ABC 1 BRIGHT A_WeaponReady (WRF_NOFIRE|WRF_NOSWITCH)
		TNT1 A 0 A_Refire(1)
		Goto Fire100End
		W11H DEF 1 BRIGHT A_WeaponReady (WRF_NOFIRE|WRF_NOSWITCH)
		TNT1 A 0 A_Refire(1)
		Goto Fire100End
		TNT1 A 0 A_JumpIfHealthLower(100,"Fire100End")
		W11H GHI 1 BRIGHT A_WeaponReady (WRF_NOFIRE|WRF_NOSWITCH)
		TNT1 A 0 A_Refire(1)
		Goto Fire100End
		W11H JKL 1 BRIGHT A_WeaponReady (WRF_NOFIRE|WRF_NOSWITCH)
		TNT1 A 0 A_Refire("Fire100Hold")
		Goto Fire100End



	Fire100End:
		TNT1 A 0 A_Gunflash("Flash100")
	//TNT1 A 0 A_PlaySound("sword/altfire")
		TNT1 A 0 A_PlayWeaponSound("sword/fire")
		W11I ABCDEFGH 1 BRIGHT A_WeaponReady (WRF_NOFIRE|WRF_NOSWITCH)
		W11I IJKL 1 BRIGHT A_WeaponReady (WRF_ALLOWRELOAD)
		W11I MNOPQRSTUVWXYZ 1 A_WeaponReady (WRF_ALLOWRELOAD)
		W11J ABCD 1 A_WeaponReady (WRF_ALLOWRELOAD)
		Goto Ready
		
		
	
	
		

//Normal fire if below 100 hp		
	Fire_99:
		TNT1 A 0 A_Gunflash
		TNT1 A 0 A_JumpIfInventory("Weapon_Fireleft", 1, "Fire_99_Left")	 

		TNT1 A 0 A_GiveInventory("Weapon_Fireleft", 1)
		Goto Fire_99_Continue

	Fire_99_Left:
        TNT1 A 0 A_TakeInventory("Weapon_Fireleft", 2)
		Goto Fire_99_Continue



	Fire_99_Continue:
TNT1 A 0 A_JumpIfInventory("Fastfire_TotemAmount",31,"Fire_99_Continue_Stacked2")
			W11F A 0 A_JumpIfInventory("Weapon_Fireleft", 1, 2)
			W11E A 0
		"####" ABCDEFGHIJK 1 A_WeaponReady (WRF_NOFIRE|WRF_NOSWITCH)
		"####" LMNOPQRSTUVWXYZ 1 A_WeaponReady (WRF_ALLOWRELOAD)
		Goto Ready



	Fire_99_Continue_Stacked2:
			W11F A 0 A_JumpIfInventory("Weapon_Fireleft", 1, 2)
			W11E A 0
		"####" ABCDEF 1 A_WeaponReady (WRF_NOFIRE|WRF_NOSWITCH)
		"####" GHIJKLMNOPQRSTUVWXYZ 1 A_WeaponReady (WRF_ALLOWRELOAD)
		Goto Ready




		

	AltFireCoverEnd:
		W11M ABCD 1 BRIGHT A_WeaponReady (WRF_NOFIRE|WRF_NOSWITCH)
		W11M EFGH 1 BRIGHT A_WeaponReady (WRF_ALLOWRELOAD)
		W11M IJKLMNOPQR 1 A_WeaponReady (WRF_ALLOWRELOAD)
		Goto Ready	

	}
}



