// Chainsaw (Doom)

ACTOR StartingChainsaw : IDMWeapon
{
	//Weapon.PreferredSkin "ChainsawMarine"
	Weapon.SisterWeapon "DualChainsaw"
	Weapon.Kickback 0
	Weapon.SelectionOrder 1500
	Weapon.ReadySound "weapons/sawidle"
	Inventory.PickupMessage "Chainsaw! (Slot 1)"
	Obituary "%o was minced by %k's Chainsaw."
	Tag "Chainsaw"
	Damagetype "Saw"
	Decal BulletChip
	+WEAPON.MELEEWEAPON
	+WEAPON.ALLOW_WITH_RESPAWN_INVUL
	+WEAPON.NOLMS
	States
	{
	Ready:
      SAWG C 3 A_WeaponReady
	  SAWG D 3 A_WeaponReady
      Loop
	Deselect:
      TNT1 A 0 A_Lower
      TNT1 A 0 A_Lower
      SAWG C 1 A_Lower
      Loop
	Select:
	  TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
	Sloop:
      TNT1 A 0 A_Raise
      TNT1 A 0 A_Raise
      SAWG C 1 A_Raise
	  Loop
	Fire:
	  TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"Quad")
	  SAWG AB 2 A_Saw("weapons/sawfull","weapons/sawhit",random(1,4) * random(1,4),"ChainsawPuff",0,104)
	  TNT1 A 0 A_Refire
      Goto Ready
	Quad:
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	  SAWG AB 2 A_Saw("weapons/sawfull","weapons/sawhit",random(1,4) * random(1,4),"ExtremePuff",0,104)
	  TNT1 A 0 A_Refire
      Goto Ready
	Spawn:
      CSAW A -1 Bright
      Stop
	}
}

ACTOR DualChainsaw : StartingChainsaw
{
	+POWERED_UP
	+WEAPON.CHEATNOTWEAPON
	Weapon.SisterWeapon "StartingChainsaw"
	Decal BulletChip
	States
	{
	Ready:
      SAW2 C 3 A_WeaponReady
	  SAW2 D 3 A_WeaponReady
      Loop
	Deselect:
      SAW2 C 0 A_Lower
      SAW2 C 0 A_Lower
      SAW2 C 1 A_Lower
      Loop
	Select:
	  TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
	Sloop:
      SAW2 C 0 A_Raise
      SAW2 C 0 A_Raise
      SAW2 C 1 A_Raise
      Loop
	Fire:
	  TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"Quad")
	Normal:
	  TNT1 A 0 A_Saw("weapons/sawfull","weapons/sawhit",random(2,8) * random(1,4),"ChainsawPuff",0,104)
	  SAW2 A 2 A_Saw("weapons/sawfull","weapons/sawhit",random(2,8) * random(1,4),"ChainsawPuff",0,104)
	  TNT1 B 0 A_Saw("weapons/sawfull","weapons/sawhit",random(2,8) * random(1,4),"ChainsawPuff",0,104)
	  SAW2 B 2 A_Saw("weapons/sawfull","weapons/sawhit",random(2,8) * random(1,4),"ChainsawPuff",0,104)
      SAWG B 0 A_ReFire
	  Goto Ready
	Quad:
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	  SAW2 A 0 A_Saw("weapons/sawfull","weapons/sawhit",random(2,8) * random(1,4),"ExtremePuff",0,104)
	  SAW2 A 2 A_Saw("weapons/sawfull","weapons/sawhit",random(2,8) * random(1,4),"ExtremePuff",0,104)
	  SAW2 B 0 A_Saw("weapons/sawfull","weapons/sawhit",random(2,8) * random(1,4),"ExtremePuff",0,104)
	  SAW2 B 2 A_Saw("weapons/sawfull","weapons/sawhit",random(2,8) * random(1,4),"ExtremePuff",0,104)
      SAWG B 0 A_ReFire
      Goto Ready
	Spawn:
      CSAW A -1 Bright
      Stop
	}
}