ACTOR Longhorn : GuncasterWeapon replaces GoldWand
{
   Game Doom
   Game Heretic
   Inventory.PickupSound "misc/w_pkup"
   Inventory.PickupMessage "$GOTLONGHORN"
   Obituary "$KILLLONGHORN"
   Weapon.UpSound "Longhorn/Up" 
   Weapon.SelectionOrder 3
   Weapon.AmmoGive 0
   Weapon.AmmoType "LonghornAmmo"
   Weapon.AmmoUse 1
   Weapon.Kickback 200
   Weapon.SlotNumber 2
   Weapon.BobStyle InverseSmooth
   Weapon.BobSpeed 1.9
   Weapon.BobRangeY 0.5
   Weapon.BobRangeX 1.0
   Scale 1.1
   +NOAUTOFIRE
   +NOALERT
   +INVENTORY.UNDROPPABLE
   States
   {
   Spawn:
      LGHG X -1
      Stop
   Ready:
      LGHK Z 0 A_JumpIf(CallACS("GunslingerMode"), "ZweiReady")
      LGHK Z 0 A_JumpIfInventory("PowerGunzerking",1,"ZweiReady")
      LGHK Z 1 A_WeaponReady(WRF_ALLOWZOOM|WRF_ALLOWRELOAD)
      Loop
   DeselectMain:
      TNT1 A 0 A_JumpIf(CallACS("GunslingerMode"), "ZweiDeselect")
      TNT1 A 0 A_JumpIfInventory("PowerGunzerking",1,"ZweiDeselect")
	  TNT1 A 0 A_Gunflash("Nullify",GFF_NOEXTCHANGE)
      LGHK Z 1 A_Lower
      LGHK Z 0 A_Lower
      Loop
   Select:
      LGHK Z 0 A_JumpIf(CallACS("CrosshairMode"), 2)
      TNT1 A 0 A_SetCrosshair(55)
      TNT1 A 0 A_JumpIf(CallACS("GunslingerMode"), "ZweiSelect")
      TNT1 A 0 A_JumpIfInventory("PowerGunzerking",1,"ZweiSelect")
      LGHK Z 1 A_Raise
      LGHK Z 0 A_Raise
      Loop 
   Fire:
      LGHF A 0 A_PlaySound("Longhorn/Fire",1,0.4)
      LGHF A 0 A_PlaySound("Longhorn/Alt",5,0.4)
      LGHF A 0 A_PlaySound("Longhorn/Add",6,0.4)
      LGHF A 0 A_SetBlend("Yellow",0.1,7)
      LGHF A 0 A_Recoil(7)
      LGHF A 0 A_AlertMonsters
      LGHF A 0 A_Quake (5, 8, 0, 3, none)
	  LGHF AAAA 0 A_FireBullets(0.25,0.5,-1,9*random(1,3),"InvisPuff",FBF_NORANDOM)
      LGHF A 0 A_FireBullets(0.25,0.5,-1,9*random(1,3),"HuegPuff",FBF_USEAMMO|FBF_NORANDOM)
      LGHF A 0 A_SetPitch(pitch-2.0)
      LGHF A 0 A_SetAngle(angle-2.0)
	  LGHF AA 0 A_FireCustomMissile("GunsmokeSpawner_Small",0,0,14,2)
      LGHF A 1 Bright A_ZoomFactor(0.99)
      LGHR A 0 A_SetPitch(pitch-3.75)
      LGHR A 0 A_SetAngle(angle-3.5)
	  LGHF AA 0 A_FireCustomMissile("GunsmokeSpawner_Small",0,0,18,5)
      LGHR A 1 A_ZoomFactor(0.97)
      LGHR A 0 A_SetPitch(pitch-2.25)
      LGHR A 0 A_SetAngle(angle-2.25)
	  LGHF AA 0 A_FireCustomMissile("GunsmokeSpawner_Small",0,0,22,8)
      LGHR B 1 A_ZoomFactor(0.95)
      LGHR A 0 A_SetPitch(pitch-1.85)
      LGHR A 0 A_SetAngle(angle-1.85)
	  LGHF AA 0 A_FireCustomMissile("GunsmokeSpawner_Small",0,0,26,12)
	  LGHR C 1 A_ZoomFactor(0.94)
      LGHR A 0 A_SetPitch(pitch-1.65)
      LGHR A 0 A_SetAngle(angle-1.65)
	  LGHR D 1 A_ZoomFactor(0.93)
      LGHR A 0 A_SetPitch(pitch-1.25)
      LGHR A 0 A_SetAngle(angle-1.25)
	  LGHR E 1 A_ZoomFactor(0.935)
      LGHR A 0 A_SetPitch(pitch-0.75)
      LGHR A 0 A_SetAngle(angle-0.75)
	  LGHR F 1 A_ZoomFactor(0.94)
      LGHR A 0 A_SetPitch(pitch-0.35)
      LGHR A 0 A_SetAngle(angle-0.35)
      //LGHR A 0 A_PlaySound("Longhorn/Load",6,0.2)
	  LGHR G 1 A_ZoomFactor(0.945)
	  LGHR H 1 A_ZoomFactor(0.95)
      TNT1 A 0 A_SetPitch(pitch+0.15)
      TNT1 A 0 A_SetAngle(angle-0.15)
	  LGHR I 1 A_ZoomFactor(0.96)
      TNT1 A 0 A_SetPitch(pitch+0.25)
      TNT1 A 0 A_SetAngle(angle-0.25)
	  LGHR J 1 A_ZoomFactor(0.97)
      TNT1 A 0 A_SetPitch(pitch+0.35)
      TNT1 A 0 A_SetAngle(angle+0.35)
	  LGHR K 1 A_ZoomFactor(0.98)
      TNT1 A 0 A_SetPitch(pitch+0.85)
      TNT1 A 0 A_SetAngle(angle+0.85)
	  LGHR L 1 A_ZoomFactor(0.99)
      TNT1 A 0 A_SetPitch(pitch+1.05)
      TNT1 A 0 A_SetAngle(angle+1.05)
	  LGHR M 1 A_ZoomFactor(0.995)
      LGHR A 0 A_SetPitch(pitch+1.25)
      LGHR A 0 A_SetAngle(angle+1.25)
	  LGHR N 1 A_ZoomFactor(1)
      LGHR A 0 A_SetPitch(pitch+0.95)
      LGHR A 0 A_SetAngle(angle+0.95)
	  LGHR O 1
      TNT1 A 0 A_SetPitch(pitch+0.75)
      TNT1 A 0 A_SetAngle(angle+0.75)
	  LGHR P 1
      TNT1 A 0 A_SetPitch(pitch+0.55)
      TNT1 A 0 A_SetAngle(angle+0.55)
	  LGHR Q 1
      TNT1 A 0 A_SetPitch(pitch+0.45)
      TNT1 A 0 A_SetAngle(angle+0.45)
	  LGHR R 1
      TNT1 A 0 A_SetPitch(pitch+0.35)
      TNT1 A 0 A_SetAngle(angle+0.35)
	  LGHR S 1
      TNT1 A 0 A_SetPitch(pitch+0.25)
      TNT1 A 0 A_SetAngle(angle+0.25)
	  LGHR T 1
      TNT1 A 0 A_SetPitch(pitch+0.15)
      TNT1 A 0 A_SetAngle(angle+0.15)
	  LGHR U 1
	  LGHR V 1
	  LGHK Z 1
      LGHG A 0 A_ReFire
      Goto Ready
	AltFire:
	  LGHM A 0
	  Goto Super::CheckForMagic
	Zoom:
      TNT1 A 0 A_JumpIf(CallACS("GunslingerMode"),2)
	  LGHK A 0 A_JumpIfInventory("PowerGunzerking",1,1)
	  Goto Super::Zoom
	  1GHK A 0
	  Goto Super::Zoom
	  
	//Zweihander

   ZweiSelect:
      3GHG A 0 A_Raise
      3GHG A 1 A_Raise
      Loop
   ZweiDeselect:
	  TNT1 A 0 A_TakeInventory("SynthFireActive",1)
	  TNT1 A 0 A_TakeInventory("SynthFireLeft",1)
	  TNT1 A 0 A_TakeInventory("SynthFireRight",1)
	  TNT1 A 0 A_GunFlash("Nullify")
   Zweihander:
	  3GHG A 0 A_Lower
	  3GHG A 1 A_Lower
	  Loop
   ZweiReady:
	  3GHG A 0 A_GiveInventory("SynthFireActive",1)
	  3GHG A 0 ACS_NamedExecuteAlways("SynthLeft")
	  3GHG A 0 ACS_NamedExecuteAlways("SynthRight")
	  3GHG A 0 A_Gunflash("Flash",GFF_NOEXTCHANGE)
	  Goto RIdle
	  
   //Right
   RIdle:
	  1GHG A 0 A_JumpIfInventory("SynthFireRight",1,"RFire")
	  1GHG A 1 A_WeaponReady(WRF_NOFIRE|WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
      TNT1 A 0 A_JumpIf(CallACS("GunslingerMode"), "RIdle")
	  1GHG A 0 A_JumpIfInventory("PowerGunzerking",1,"RIdle")
	  Goto BackToReady
   BackToReady:
	  1GHG A 0 A_GunFlash("Nullify")
	  Goto Ready
   RFire:
      TNT1 A 0 A_JumpIf(CallACS("GunslingerMode"),2)
	  1GHG A 0 A_JumpIfInventory("PowerGunzerking",1,1) 
	  Goto BackToReady
	  1GHG A 1 A_JumpIfInventory("LonghornAmmo",1,1)
	  Goto RIdle
      1GHF A 0 A_PlaySound("Longhorn/Fire",1,0.4)
      1GHF A 0 A_PlaySound("Longhorn/Alt",5,0.4)
      1GHF A 0 A_PlaySound("Longhorn/Add",6,0.4)
      1GHF A 0 A_SetBlend("Yellow",0.1,7)
      1GHF A 0 A_Recoil(5)
      1GHF A 0 A_AlertMonsters
      1GHF A 0 A_Quake (5, 8, 0, 3, none)
	  2GHF A 0 A_TakeInventory("LonghornAmmo",1,TIF_NOTAKEINFINITE)
	  1GHF AAAA 0 A_FireBullets(0.25,0.5,-1,9*random(1,3),"InvisPuff",FBF_NORANDOM)
      1GHF A 0 A_FireBullets(0.25,0.5,-1,9*random(1,3),"HuegPuff",FBF_NORANDOM) //FBF_USEAMMO|
      1GHF A 0 A_SetPitch(pitch-0.75)
      1GHF A 0 A_SetAngle(angle-0.75)
	  LGHF AA 0 A_FireCustomMissile("GunsmokeSpawner_Small",0,0,18,0)
      1GHF A 1 Bright A_ZoomFactor(0.99)
      1GHR A 0 A_SetPitch(pitch-1.0)
      1GHR A 0 A_SetAngle(angle-0.85)
	  LGHF AA 0 A_FireCustomMissile("GunsmokeSpawner_Small",0,0,22,4)
      1GHR A 1 A_ZoomFactor(0.97)
      1GHR A 0 A_SetPitch(pitch-0.8)
      1GHR A 0 A_SetAngle(angle-0.8)
	  LGHF AA 0 A_FireCustomMissile("GunsmokeSpawner_Small",0,0,26,8)
      1GHR B 1 A_ZoomFactor(0.95)
      1GHR A 0 A_SetPitch(pitch-0.75)
      1GHR A 0 A_SetAngle(angle-0.75)
	  LGHF AA 0 A_FireCustomMissile("GunsmokeSpawner_Small",0,0,30,12)
	  1GHR C 1 A_ZoomFactor(0.94)
      1GHR A 0 A_SetPitch(pitch-0.7)
      1GHR A 0 A_SetAngle(angle-0.7)
	  1GHR D 1 A_ZoomFactor(0.93)
      1GHR A 0 A_SetPitch(pitch-0.65)
      1GHR A 0 A_SetAngle(angle-1.65)
	  1GHR E 1 A_ZoomFactor(0.935)
      1GHR A 0 A_SetPitch(pitch-0.5)
      1GHR A 0 A_SetAngle(angle-0.5)
	  1GHR F 1 A_ZoomFactor(0.94)
      1GHR A 0 A_SetPitch(pitch-0.35)
      1GHR A 0 A_SetAngle(angle-0.35)
      //1GHR A 0 A_PlaySound("Longhorn/Load",6,0.2)
	  1GHR G 1 A_ZoomFactor(0.945)
	  1GHR H 1 A_ZoomFactor(0.95)
      TNT1 A 0 A_SetPitch(pitch+0.15)
      TNT1 A 0 A_SetAngle(angle-0.15)
	  1GHR I 1 A_ZoomFactor(0.96)
      TNT1 A 0 A_SetPitch(pitch+0.25)
      TNT1 A 0 A_SetAngle(angle-0.25)
	  1GHR J 1 A_ZoomFactor(0.97)
      TNT1 A 0 A_SetPitch(pitch+0.35)
      TNT1 A 0 A_SetAngle(angle+0.35)
	  1GHR K 1 A_ZoomFactor(0.98)
      TNT1 A 0 A_SetPitch(pitch+0.45)
      TNT1 A 0 A_SetAngle(angle+0.45)
	  1GHR L 1 A_ZoomFactor(0.99)
      TNT1 A 0 A_SetPitch(pitch+0.65)
      TNT1 A 0 A_SetAngle(angle+0.65)
	  1GHR M 1 A_ZoomFactor(0.995)
      1GHR A 0 A_SetPitch(pitch+0.55)
      1GHR A 0 A_SetAngle(angle+0.55)
	  1GHR N 1 A_ZoomFactor(1)
      1GHR A 0 A_SetPitch(pitch+0.45)
      1GHR A 0 A_SetAngle(angle+0.45)
	  1GHR O 1
      TNT1 A 0 A_SetPitch(pitch+0.35)
      TNT1 A 0 A_SetAngle(angle+0.35)
	  1GHR P 1
      TNT1 A 0 A_SetPitch(pitch+0.25)
      TNT1 A 0 A_SetAngle(angle+0.25)
	  1GHR Q 1
      TNT1 A 0 A_SetPitch(pitch+0.15)
      TNT1 A 0 A_SetAngle(angle+0.15)
	  1GHR R 1
      TNT1 A 0 A_SetPitch(pitch+0.1)
      TNT1 A 0 A_SetAngle(angle+0.1)
	  1GHR S 1
      TNT1 A 0 A_SetPitch(pitch+0.05)
      TNT1 A 0 A_SetAngle(angle+0.05)
	  1GHR T 1
      TNT1 A 0 A_SetPitch(pitch+0.025)
      TNT1 A 0 A_SetAngle(angle+0.025)
	  1GHR U 1
	  1GHR V 1
	  1GHG A 1
	  Goto RIdle
	  
   //Left
   
   Nullify:
	  TNT1 A 0
	  Stop
   Flash:
	  TNT1 A 0 A_Light0
   LIdle:
	  2GHG A 1 A_JumpIfInventory("SynthFireLeft",1,"LFire")
	  Loop
   LFire:
      TNT1 A 0 A_JumpIf(CallACS("GunslingerMode"),2)
	  2GHG A 0 A_JumpIfInventory("PowerGunzerking",1,1) 
	  Goto Nullify
	  2GHG A 1 A_JumpIfInventory("LonghornAmmo",1,1)
	  Goto LIdle
      2GHF A 0 A_PlaySound("Longhorn/Fire",1,0.4)
      2GHF A 0 A_PlaySound("Longhorn/Alt",5,0.4)
      2GHF A 0 A_PlaySound("Longhorn/Add",6,0.4)
      2GHF A 0 A_SetBlend("Yellow",0.1,7)
      2GHF A 0 A_Recoil(5)
      2GHF A 0 A_AlertMonsters
      2GHF A 0 A_Quake (5, 8, 0, 3, none)
	  2GHF A 0 A_TakeInventory("LonghornAmmo",1,TIF_NOTAKEINFINITE)
	  2GHF AAAA 0 A_FireBullets(0.25,0.5,-1,9*random(1,3),"InvisPuff",FBF_NORANDOM)
      2GHF A 0 A_FireBullets(0.25,0.5,-1,9*random(1,3),"HuegPuff",FBF_NORANDOM) //FBF_USEAMMO|
      2GHF A 0 A_SetPitch(pitch-0.75)
      2GHF A 0 A_SetAngle(angle+0.75)
	  LGHF AA 0 A_FireCustomMissile("GunsmokeSpawner_Small",0,0,-18,0)
      2GHF A 1 Bright A_ZoomFactor(0.99)
      2GHR A 0 A_SetPitch(pitch-1.0)
      2GHR A 0 A_SetAngle(angle+0.85)
	  LGHF AA 0 A_FireCustomMissile("GunsmokeSpawner_Small",0,0,-22,4)
      2GHR A 1 A_ZoomFactor(0.97)
      2GHR A 0 A_SetPitch(pitch-0.8)
      2GHR A 0 A_SetAngle(angle+0.8)
	  LGHF AA 0 A_FireCustomMissile("GunsmokeSpawner_Small",0,0,-26,8)
      2GHR B 1 A_ZoomFactor(0.95)
      2GHR A 0 A_SetPitch(pitch-0.75)
      2GHR A 0 A_SetAngle(angle+0.75)
	  LGHF AA 0 A_FireCustomMissile("GunsmokeSpawner_Small",0,0,-30,12)
	  2GHR C 1 A_ZoomFactor(0.94)
      2GHR A 0 A_SetPitch(pitch-0.7)
      2GHR A 0 A_SetAngle(angle+0.7)
	  2GHR D 1 A_ZoomFactor(0.93)
      2GHR A 0 A_SetPitch(pitch-0.65)
      2GHR A 0 A_SetAngle(angle+1.65)
	  2GHR E 1 A_ZoomFactor(0.935)
      2GHR A 0 A_SetPitch(pitch-0.5)
      2GHR A 0 A_SetAngle(angle+0.5)
	  2GHR F 1 A_ZoomFactor(0.94)
      2GHR A 0 A_SetPitch(pitch-0.35)
      2GHR A 0 A_SetAngle(angle+0.35)
      //2GHR A 0 A_PlaySound("Longhorn/Load",6,0.2)
	  2GHR G 1 A_ZoomFactor(0.945)
	  2GHR H 1 A_ZoomFactor(0.95)
      TNT1 A 0 A_SetPitch(pitch+0.15)
      TNT1 A 0 A_SetAngle(angle+0.15)
	  2GHR I 1 A_ZoomFactor(0.96)
      TNT1 A 0 A_SetPitch(pitch+0.25)
      TNT1 A 0 A_SetAngle(angle+0.25)
	  2GHR J 1 A_ZoomFactor(0.97)
      TNT1 A 0 A_SetPitch(pitch+0.35)
      TNT1 A 0 A_SetAngle(angle-0.35)
	  2GHR K 1 A_ZoomFactor(0.98)
      TNT1 A 0 A_SetPitch(pitch+0.45)
      TNT1 A 0 A_SetAngle(angle-0.45)
	  2GHR L 1 A_ZoomFactor(0.99)
      TNT1 A 0 A_SetPitch(pitch+0.65)
      TNT1 A 0 A_SetAngle(angle-0.65)
	  2GHR M 1 A_ZoomFactor(0.995)
      2GHR A 0 A_SetPitch(pitch+0.55)
      2GHR A 0 A_SetAngle(angle-0.55)
	  2GHR N 1 A_ZoomFactor(1)
      2GHR A 0 A_SetPitch(pitch+0.45)
      2GHR A 0 A_SetAngle(angle-0.45)
	  2GHR O 1
      TNT1 A 0 A_SetPitch(pitch+0.35)
      TNT1 A 0 A_SetAngle(angle-0.35)
	  2GHR P 1
      TNT1 A 0 A_SetPitch(pitch+0.25)
      TNT1 A 0 A_SetAngle(angle-0.25)
	  2GHR Q 1
      TNT1 A 0 A_SetPitch(pitch+0.15)
      TNT1 A 0 A_SetAngle(angle-0.15)
	  2GHR R 1
      TNT1 A 0 A_SetPitch(pitch+0.1)
      TNT1 A 0 A_SetAngle(angle-0.1)
	  2GHR S 1
      TNT1 A 0 A_SetPitch(pitch+0.05)
      TNT1 A 0 A_SetAngle(angle-0.05)
	  2GHR T 1
      TNT1 A 0 A_SetPitch(pitch+0.025)
      TNT1 A 0 A_SetAngle(angle-0.025)
	  2GHR U 1
	  2GHR V 1
	  2GHG A 1
	  Goto LIdle
	}
}
