/*
CREDITS:

Sprites - DoomNukem, with edits like clip animation or hammer by me
Flash - Bane

Sounds:
Fire - Miztaegg\Generic Sounds from the 70s
Altfire Launch - Valve (Team Fortress)
Altfire Clunky noises - ID Soft. (Doom 3)
*/

ACTOR Hornet : Weapon
{
  Tag "Silver Hornet"
  Inventory.PickupSound "misc/w_pkup"
  Inventory.PickupMessage "Nabbed ''Silver Hornet'' shiny revol-over-kill! It's over... FOR YOU, YOU DAMN TREE!! HARHARAR! (2)"
  Obituary "%k mistook %o with a tree."
  Weapon.UpSound "Weapons/HornetUp"
  Weapon.SelectionOrder 5
  Weapon.AmmoType "Boolet"
  Weapon.AmmoGive 0
  Weapon.AmmoUse 3
  Weapon.AmmoType2 "RawketAmmo"
  Weapon.AmmoGive2 0
  Weapon.AmmoUse2 1
  Weapon.Kickback 20
  Weapon.SlotNumber 2
  Weapon.BobStyle InverseSmooth
  Weapon.BobSpeed 1.7
  Weapon.BobRangeY 0.6
  Weapon.BobRangeX 1.2
  +WEAPON.CHEATNOTWEAPON
  +NOALERT
  +ALT_AMMO_OPTIONAL
  States
  {
  //SINGLE LEVORVEL
  
   Ready:
      TNT1 A 0 A_JumpIfInventory("BasicUpgrade",1,"ZweiReady")
      HRNG A 1 A_WeaponReady
      Loop
   Deselect:
      TNT1 A 0 A_ZoomFactor(1)
      TNT1 A 0 A_JumpIfInventory("BasicUpgrade",1,"ZweiDeselect")
      HRNG A 1 A_Lower
      HRNG A 0 A_Lower
      Loop
   Select:
      TNT1 A 0 A_JumpIfInventory("BasicUpgrade",1,"ZweiSelect")
      HRNG A 1 A_Raise
      HRNG A 0 A_Raise
      Loop
   Fire:
	  HRNG BC 2
      HRNF A 0 A_AlertMonsters
      HRNF A 0 A_PlaySound("Weapons/FistMagnum",5,0.5)
      HRNF A 0 A_Recoil(2)
      
      TNT1 A 0 A_GiveInventory("BooletCasing",3)
      TNT1 A 0 A_JumpIfInventory("CaliberUpgrade",1,"CFire")
      TNT1 A 0 A_FireBullets(2.0,0.75,2,60,"InvisPuff",0)
      HRNF A 0 A_FireBullets(2.0,0.75,-1,60,"BulletPuff",1)
   Endo:
      HRNF A 0 A_Light2
	  HRNF A 0 A_SetPitch(pitch-1.5)
      HRNF A 0 A_SetAngle(angle-1.5)
      HRNF A 1 Bright A_ZoomFactor(0.99)
	  HRNF B 0 A_SetPitch(pitch-1.4)
      HRNF B 0 A_SetAngle(angle-1.4)
      HRNF B 1 Bright A_ZoomFactor(0.98)
      HRNR A 0 A_Light1
      HRNR A 0 A_SetPitch(pitch-1.2)
      HRNR A 0 A_SetAngle(angle-1.2)
      HRNR A 1 A_ZoomFactor(0.95)
      HRNR A 0 A_SetPitch(pitch-1.0)
      HRNR A 0 A_SetAngle(angle-1.0)
      HRNR B 1 A_ZoomFactor(0.935)
      HRNR A 0 A_SetPitch(pitch-0.8)
      HRNR A 0 A_SetAngle(angle-0.8)
      HRNR C 1 A_ZoomFactor(0.95)
      HRNR A 0 A_SetPitch(pitch-0.6)
      HRNR A 0 A_SetAngle(angle-0.6)
      HRNR D 1 A_ZoomFactor(0.94)
      HRNR A 0 A_SetPitch(pitch-0.4)
      HRNR A 0 A_SetAngle(angle-0.4)
	  HRNR C 0 A_Light0  
      HRNR E 1 A_ZoomFactor(0.95)
      HRNR A 0 A_SetPitch(pitch-0.25)
      HRNR A 0 A_SetAngle(angle-0.25)
      HRNR F 1 A_ZoomFactor(0.96)
      HRNR A 0 A_SetPitch(pitch-0.125)
      HRNR A 0 A_SetAngle(angle-0.125)
      HRNR G 1 A_ZoomFactor(0.97)
      HRNR A 0 A_SetPitch(pitch-0.1)
      HRNR A 0 A_SetAngle(angle-0.1)
      HRNR H 1 A_ZoomFactor(0.98)
      HRNR I 1 A_ZoomFactor(0.99)
      HRNR J 1 A_ZoomFactor(0.995)
      HRNR K 1 A_ZoomFactor(1)
      HRNR LMNOPQR 1
      HRNG A 1
	  HRNG A 0 A_ReFire
      Goto Ready
   CFire:
      HRNF A 0 A_FireBullets(2.0, 0.75, 1, 160,"CaliberPuff", 1)
      TNT1 A 0 A_PlaySound("Weapons/WolgirHEndFire",6)
      Goto Endo
   AltFire:
      HRNG A 0 A_JumpIfInventory("RawketAmmo",1,1)
	  Goto Nope
      HRNG A 0 A_PlaySound("Weapons/HornetOpen",6)
      HRNG ABCABC 2
      HRNM A 2
      HRNM B 8

      TNT1 A 0 A_PlaySound("Weapons/HornetMissile",1,0.7)
      TNT1 A 0 A_TakeInventory("RawketAmmo",1,TIF_NOTAKEINFINITE)
      TNT1 AAAAAA 0 A_FireCustomMissile("HornetShot",0,0,8,-2)

      TNT1 A 0 A_AlertMonsters
      TNT1 A 0 A_Recoil(8)
      
      TNT1 A 0 A_Light2
      HRNM C 1 A_ZoomFactor(0.95)
      HRNM D 1 A_ZoomFactor(0.97)
      HRNM E 1 A_ZoomFactor(0.98)
      HRNM F 1 A_ZoomFactor(0.99)
      HRNM G 1 A_ZoomFactor(0.995)

      TNT1 A 0 A_Light1
      HRNM H 2 A_ZoomFactor(1)
      
      HRNM IJKLM 1
      TNT1 A 0 A_Light0
	  HRNM NOPQQ 1 
      HRNM Q 8 A_PlaySound("Weapons/HornetClose",6)
      HRNM R 2
      HRNG ACBACBA 2
      Goto Ready
   Nope:
      TNT1 A 0 A_PlaySound("Weapons/HornetNope",6)
      HRNG A 5
      HRNG ABCABCA 2
      Goto Ready
  
  //DOUBLE LEVORVEL
  
  ZweiSelect:
    HR3G A 0 A_Raise
	HR3G 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)
  Zweihander:
    HR3G A 0 A_Lower
    HR3G A 1 A_Lower
	Loop
  ZweiReady:
  	HR3G A 0 A_GiveInventory("SynthFireActive",1)
	HR3G A 0 ACS_NamedExecuteAlways("SynthLeft")
	HR3G A 0 ACS_NamedExecuteAlways("SynthRight")
	HR3G A 0 A_GunFlash("Flash",GFF_NOEXTCHANGE)
	Goto LIdle
  Reload:
    HRNG A 0 A_JumpIfInventory("BasicUpgrade",1,"YESH")
    HRNG A 0 A_WeaponReady(WRF_NOFIRE)
	Goto Ready
  YESH:
	HRNG A 0 A_GiveInventory("SynthReload",1)
	Goto LIdle
	
  //LEFT LEVORVEL
  
  LIdle:
	HR2G A 0 A_JumpIfInventory("SynthFireLeft",1,"LFire")
    HR2G A 0 A_JumpIfInventory("SynthReload",1,"LReload")
    HR2G A 1 A_WeaponReady(WRF_NOFIRE|WRF_ALLOWRELOAD)
    Loop
  LFire:
    HR2G A 1 A_JumpIfInventory("Boolet",3,1)
	Goto LIdle
	HR2G BC 2
    HR2F A 0 A_AlertMonsters
    HR2F A 0 A_PlaySound("Weapons/FistMagnum",5,0.5)
    HR2F A 0 A_Recoil(2)
	HR2F A 0 A_TakeInventory("Boolet",3,TIF_NOTAKEINFINITE)
    TNT1 A 0 A_GiveInventory("BooletCasing",3)
    TNT1 A 0 A_JumpIfInventory("CaliberUpgrade",1,"CFireLeft")
    TNT1 A 0 A_FireBullets(2.0,0.75,2,60,"InvisPuff",0)
    HR2F A 0 A_FireBullets(2.0,0.75,-1,60,"BulletPuff",0)
  LEndo:
    HR2F A 0 A_Light2
	HR2F A 0 A_SetPitch(pitch-1.5)
    HR2F A 0 A_SetAngle(angle+1.5)
    HR2F A 1 Bright A_ZoomFactor(0.99)
	HR2F B 0 A_SetPitch(pitch-1.4)
    HR2F B 0 A_SetAngle(angle+1.4)
    HR2F B 1 Bright A_ZoomFactor(0.98)
    HR2R A 0 A_Light1
    HR2R A 0 A_SetPitch(pitch-1.2)
    HR2R A 0 A_SetAngle(angle+1.2)
    HR2R A 1 A_ZoomFactor(0.95)
    HR2R A 0 A_SetPitch(pitch-1.0)
    HR2R A 0 A_SetAngle(angle+1.0)
    HR2R B 1 A_ZoomFactor(0.935)
    HR2R A 0 A_SetPitch(pitch-0.8)
    HR2R A 0 A_SetAngle(angle+0.8)
    HR2R C 1 A_ZoomFactor(0.95)
    HR2R A 0 A_SetPitch(pitch-0.6)
    HR2R A 0 A_SetAngle(angle+0.6)
    HR2R D 1 A_ZoomFactor(0.94)
    HR2R A 0 A_SetPitch(pitch-0.4)
    HR2R A 0 A_SetAngle(angle+0.4)
	HR2R C 0 A_Light0  
    HR2R E 1 A_ZoomFactor(0.95)
    HR2R A 0 A_SetPitch(pitch-0.25)
    HR2R A 0 A_SetAngle(angle+0.25)
    HR2R F 1 A_ZoomFactor(0.96)
    HR2R A 0 A_SetPitch(pitch-0.125)
    HR2R A 0 A_SetAngle(angle+0.125)
    HR2R G 1 A_ZoomFactor(0.97)
    HR2R A 0 A_SetPitch(pitch-0.1)
    HR2R A 0 A_SetAngle(angle+0.1)
    HR2R H 1 A_ZoomFactor(0.98)
    HR2R I 1 A_ZoomFactor(0.99)
    HR2R J 1 A_ZoomFactor(0.995)
    HR2R K 1 A_ZoomFactor(1)
    HR2R LMNOPQR 1
    HR2G A 1
	HR2G A 0 A_JumpIfInventory("SynthFireLeft",1,"LFire")
    Goto LIdle
   CFireLeft:
    TNT1 A 0 A_FireBullets(2.0,0.75,2,120,"InvisPuff",0)
    HR2F A 0 A_FireBullets(2.0,0.75,-1,120,"CaliberPuff",0)
    TNT1 A 0 A_PlaySound("Weapons/WolgirHEndFire",6)
    Goto LEndo
	
   LReload:
    HR2G A 0 A_JumpIfInventory("RawketAmmo",1,1)
    Goto LNope
    HR2G A 0 A_PlaySound("Weapons/HornetOpen",6)
    HR2G ABCABC 2
    HR2M A 2 A_TakeInventory("SynthReload",1)
    HR2M B 8

    TNT1 A 0 A_PlaySound("Weapons/HornetMissile",1,0.7)
    TNT1 A 0 A_TakeInventory("RawketAmmo",1,TIF_NOTAKEINFINITE)
    TNT1 AAAAAA 0 A_FireCustomMissile("HornetShot",0,0,-8,-2)

    TNT1 A 0 A_AlertMonsters
    TNT1 A 0 A_Recoil(8)
      
    TNT1 A 0 A_Light2
    HR2M C 1 A_ZoomFactor(0.95)
    HR2M D 1 A_ZoomFactor(0.97)
    HR2M E 1 A_ZoomFactor(0.98)
    HR2M F 1 A_ZoomFactor(0.99)
    HR2M G 1 A_ZoomFactor(0.995)

    TNT1 A 0 A_Light1
    HR2M H 2 A_ZoomFactor(1)
      
    HR2M IJKLM 1
    TNT1 A 0 A_Light0
	HR2M NOPQQ 1 
    HR2M Q 8 A_PlaySound("Weapons/HornetClose",6)
    HR2M R 2
    HR2G ACBACBA 2
    Goto LIdle
	
  LNope:
    HR2G A 0 A_PlaySound("Weapons/HornetNope",6)
    HR2G A 5
    HR2G A 0 A_TakeInventory("SynthReload",1)
    HR2G ABCABCA 2
    Goto LIdle
  
  //RIGHT LEVORVEL
  
  Flash:
	TNT1 A 0 A_Light0 //I guess you put here the equal amount of time to the tics of select animation
  RIdle:
	HRNG A 0 A_JumpIfInventory("SynthFireRight",1,"RFire")
    HRNG A 0 A_JumpIfInventory("SynthReload",1,"RReload")
	HRNG A 1
    Loop
  RFire:
    HRNG A 1 A_JumpIfInventory("Boolet",3,1)
	Goto RIdle
	HRNG BC 2
    HRNF A 0 A_AlertMonsters
    HRNF A 0 A_PlaySound("Weapons/FistMagnum",5,0.5)
    HRNF A 0 A_Recoil(2)
	HRNF A 0 A_TakeInventory("Boolet",3,TIF_NOTAKEINFINITE)
    TNT1 A 0 A_GiveInventory("BooletCasing",3)
    TNT1 A 0 A_JumpIfInventory("CaliberUpgrade",1,"CFireRight")
    TNT1 A 0 A_FireBullets(2.0,0.75,2,60,"InvisPuff",0)
    HRNF A 0 A_FireBullets(2.0,0.75,-1,60,"BulletPuff",0)
  REndo:
    HRNF A 0 A_Light2
	HRNF A 0 A_SetPitch(pitch-1.5)
    HRNF A 0 A_SetAngle(angle-1.5)
    HRNF A 1 Bright A_ZoomFactor(0.99)
	HRNF B 0 A_SetPitch(pitch-1.4)
    HRNF B 0 A_SetAngle(angle-1.4)
    HRNF B 1 Bright A_ZoomFactor(0.98)
    HRNR A 0 A_Light1
    HRNR A 0 A_SetPitch(pitch-1.2)
    HRNR A 0 A_SetAngle(angle-1.2)
    HRNR A 1 A_ZoomFactor(0.95)
    HRNR A 0 A_SetPitch(pitch-1.0)
    HRNR A 0 A_SetAngle(angle-1.0)
    HRNR B 1 A_ZoomFactor(0.935)
    HRNR A 0 A_SetPitch(pitch-0.8)
    HRNR A 0 A_SetAngle(angle-0.8)
    HRNR C 1 A_ZoomFactor(0.95)
    HRNR A 0 A_SetPitch(pitch-0.6)
    HRNR A 0 A_SetAngle(angle-0.6)
    HRNR D 1 A_ZoomFactor(0.94)
    HRNR A 0 A_SetPitch(pitch-0.4)
    HRNR A 0 A_SetAngle(angle-0.4)
	HRNR C 0 A_Light0  
    HRNR E 1 A_ZoomFactor(0.95)
    HRNR A 0 A_SetPitch(pitch-0.25)
    HRNR A 0 A_SetAngle(angle-0.25)
    HRNR F 1 A_ZoomFactor(0.96)
    HRNR A 0 A_SetPitch(pitch-0.125)
    HRNR A 0 A_SetAngle(angle-0.125)
    HRNR G 1 A_ZoomFactor(0.97)
    HRNR A 0 A_SetPitch(pitch-0.1)
    HRNR A 0 A_SetAngle(angle-0.1)
    HRNR H 1 A_ZoomFactor(0.98)
    HRNR I 1 A_ZoomFactor(0.99)
    HRNR J 1 A_ZoomFactor(0.995)
    HRNR K 1 A_ZoomFactor(1)
    HRNR LMNOPQR 1
    HRNG A 1
	HRNG A 0 A_JumpIfInventory("SynthFireRight",1,"RFire")
    Goto RIdle
   CFireRight:
    TNT1 A 0 A_FireBullets(2.0,0.75,2,120,"InvisPuff",0)
    HRNF A 0 A_FireBullets(2.0,0.75,-1,120,"CaliberPuff",0)
    TNT1 A 0 A_PlaySound("Weapons/WolgirHEndFire",6)
    Goto REndo
   RReload:
    HRNG A 0 A_JumpIfInventory("RawketAmmo",1,1)
    Goto RNope
    HRNG A 0 A_PlaySound("Weapons/HornetOpen",6)
    HRNG ABCABC 2
    HRNM A 2 A_TakeInventory("SynthReload",1)
    HRNM B 8

    TNT1 A 0 A_PlaySound("Weapons/HornetMissile",1,0.7)
    TNT1 A 0 A_TakeInventory("RawketAmmo",1,TIF_NOTAKEINFINITE)
    TNT1 AAAAAA 0 A_FireCustomMissile("HornetShot",0,0,8,-2)

    TNT1 A 0 A_AlertMonsters
    TNT1 A 0 A_Recoil(8)
      
    TNT1 A 0 A_Light2
    HRNM C 1 A_ZoomFactor(0.95)
    HRNM D 1 A_ZoomFactor(0.97)
    HRNM E 1 A_ZoomFactor(0.98)
    HRNM F 1 A_ZoomFactor(0.99)
    HRNM G 1 A_ZoomFactor(0.995)

    TNT1 A 0 A_Light1
    HRNM H 2 A_ZoomFactor(1)
      
    HRNM IJKLM 1
    TNT1 A 0 A_Light0
	HRNM NOPQQ 1 
    HRNM Q 8 A_PlaySound("Weapons/HornetClose",6)
    HRNM R 2
    HRNG ACBACBA 2
    Goto RIdle
  RNope:
    HRNG A 0 A_PlaySound("Weapons/HornetNope",6)
    HRNG A 5
	HRNG A 0 A_TakeInventory("SynthReload",1)
    HRNG ABCABCA 2
    Goto RIdle
  Spawn:
    TNT1 A -1
    Stop
	}
}

actor HornetShot : OverpowerShot
{
  Speed 65
  Damage 30
  Renderstyle Normal
  Projectile
  -RIPPER
  DeathSound "Weapons/BustExplo"
  Obituary "%k mistook %o with a tree. No need for lumberjacks!"
  Scale 0.3
  States
  {
  Spawn:
    TNT1 A 0
    TNT1 A 0 A_SeekerMissile(2,3,SMF_LOOK|SMF_PRECISE,128,2)
    TNT1 A 0 A_ChangeVelocity (frandom(-5.5, 5.5), frandom(-5.5, 5.5), frandom(-2.75, 2.75), 0)
    HMIS A 1 Bright
    loop
   Death:
      TNT1 A 0 A_JumpIfInTargetInventory("NukerUpgrade",1,"NukerDeath")
      TNT1 A 0 A_StopSoundEx("SoundSlot5")
      TNT1 A 0 A_Explode(125,128)
      TNT1 A 0 A_SpawnItemEx("MissileExplode",0,0,0,0,0,0,0,128,0)
      TNT1 BCD 4
      stop
   NukerDeath:
      TNT1 A 0 A_StopSoundEx("SoundSlot5")
      TNT1 A 0 A_Explode(250,192)
      TNT1 A 0 A_SpawnItemEx("NukerMissileExplode",0,0,0,0,0,0,0,128,0)
      TNT1 BCD 4
      stop
  }
}