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 1
  Weapon.AmmoType2 "RawketAmmo"
  Weapon.AmmoGive2 0
  Weapon.AmmoUse2 1
  Weapon.Kickback 100
  Weapon.SlotNumber 2
  +WEAPON.CHEATNOTWEAPON
  +NOALERT
  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:
      //TNT1 A 0 A_JumpIfInventory("BasicUpgrade",1,"ZweiFire")
	  
      HRNF A 0 A_AlertMonsters
      //HRNF A 0 A_PlaySoundEx("Weapons/HornetFire","Weapon")
      HRNF A 0 A_PlaySound("Weapons/HornetAdd",0)
      HRNF A 0 A_Recoil(1)
      HRNF A 0 A_ZoomFactor(0.7)
      
      TNT1 A 0 A_GiveInventory("BooletCasing")
      TNT1 A 0 A_JumpIfInventory("CaliberUpgrade",1,"CFire")
      
      HRNF A 0 A_FireBullets(2.0, 0.75, 1, 80, "BulletPuff")
   Endo:
      HRNF A 0 A_Light2
      HRNF A 0 A_ZoomFactor(0.98)
      HRNF A 1 Bright A_SetPitch(pitch-0.75)
      HRNF A 0 Bright A_SetAngle(angle-0.75)
      HRNF A 0 A_ZoomFactor(0.985)
      HRNF B 1 Bright A_SetPitch(pitch-0.5)
      HRNF B 0 Bright A_SetAngle(angle-0.5)
      HRNR A 0 A_Light1
      HRNR A 1 A_ZoomFactor(0.99)
      HRNR B 1 A_ZoomFactor(0.995)
      HRNR C 1 A_ZoomFactor(1)
	  HRNR C 0 A_Light0
      HRNR DEFGHI 1
      HRNG A 1
      HRNG BC 1
      HRNG A 1
      HRNG A 3 A_ReFire
      Goto Ready
   CFire:
      HRNF A 0 A_FireBullets(2.0, 0.75, 1, 160,"CaliberPuff", 1)
      TNT1 A 0 A_PlaySoundEx("Weapons/WolgirHEndFire","SoundSlot6")
      Goto Endo
   AltFire:
      HRNG A 0 A_JumpIfInventory("RawketAmmo",1,1)
	  Goto Nope
      HRNG A 0 A_PlaySoundEx("Weapons/HornetOpen","SoundSlot6")
      HRNG ABCABC 2
      HRNA A 2
      HRNA B 8

      TNT1 A 0 A_PlaySound("Weapons/HornetMissile",1,0.7)
      TNT1 AAAAA 0 A_FireCustomMissile("HornetShot",0,0,12,-2)
      TNT1 A 0 A_FireCustomMissile("HornetShot",0,1,12,-2)

      TNT1 A 0 A_AlertMonsters
      TNT1 A 0 A_Recoil(8)
      
      HRNF A 0 A_Light2
      HRNM A 1 A_ZoomFactor(0.95)
      HRNM B 1 A_ZoomFactor(0.97)
      HRNM C 1 A_ZoomFactor(0.98)
      HRNM D 1 A_ZoomFactor(0.99)
      HRNM E 1 A_ZoomFactor(0.995)
      HRNR A 0 A_Light1

      HRNM E 2 A_ZoomFactor(1) //Zenithal Point
      
      HRNM EDCBA 1
	  HRNR C 0 A_Light0
      HRNA C 1
      HRNA C 6 A_PlaySoundEx("Weapons/HornetClose","SoundSlot6")
      HRNA D 2
      HRNG ACBACBA 2
      Goto Ready
   Nope:
      TNT1 A 0 A_PlaySoundEx("Weapons/HornetNope","SoundSlot6")
      HRNG A 5
      HRNG ABCABCA 2
      Goto Ready
  
  //DOUBLE LEVORVEL
  
  ZweiSelect:
    HR2G Z 0 A_Raise
	HR2G Z 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:
    HR2G Z 0 A_Lower
    HR2G Z 1 A_Lower
	Loop
  ZweiReady:
  	HR2G A 0 A_GiveInventory("SynthFireActive",1)
	HR2G A 0 ACS_ExecuteAlways(720)
	HR2G A 0 ACS_ExecuteAlways(721)
	HR2G A 0 A_Gunflash
	Goto LIdle
  Reload:
	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")
	TNT1 A 0 A_JumpIfInventory("RO_GotoReload", 1, "Reload")
    HR2G A 1 A_WeaponReady(WRF_NOFIRE)
    Loop
  LFire:
    HR2G A 1 A_JumpIfInventory("Boolet",1,1)
	Goto LIdle
    //HRNF A 0 A_PlaySoundEx("Weapons/HornetFire","Weapon")
    HRNF A 0 A_AlertMonsters
    HRNF A 0 A_PlaySound("Weapons/HornetAdd",0)
    HRNF A 0 A_Recoil(1)
    HRNF A 0 A_ZoomFactor(0.98)
	HRNF A 0 A_TakeInventory("Boolet",1,TIF_NOTAKEINFINITE)
      
    TNT1 A 0 A_GiveInventory("BooletCasing")
    TNT1 A 0 A_JumpIfInventory("CaliberUpgrade",1,"CFireLeft")
      
    HRNF A 0 A_FireBullets(2.0, 0.75, -1, 80, "BulletPuff",0)
   LEndo:
    HR2F A 0 A_Light2
    HR2F A 0 A_ZoomFactor(0.98)
    HR2F A 1 Bright A_SetPitch(pitch-0.75)
    HR2F A 0 Bright A_SetAngle(angle+0.75)
    HR2F A 0 A_ZoomFactor(0.985)
    HR2F B 1 Bright A_SetPitch(pitch-0.5)
    HR2F B 0 Bright A_SetAngle(angle+0.5)
    HR2F A 0 A_Light1
    HR2R A 1 A_ZoomFactor(0.99)
    HR2R B 1 A_ZoomFactor(0.995)
    HR2R C 1 A_ZoomFactor(1)
    HR2F A 0 A_Light0
    HR2R DEFGHI 1
    HR2G A 1
    HR2G BC 1
    HR2G A 1
	HR2G A 3 A_JumpIfInventory("SynthFireLeft",1,"LFire")
    Goto LIdle
   CFireLeft:
    HRNF A 0 A_FireBullets(2.0,0.75,-1,160,"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
    HR2A A 2 A_TakeInventory("SynthReload",1)
    HR2A 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,-12,-2)

    TNT1 A 0 A_AlertMonsters
    TNT1 A 0 A_Recoil(8)

    TNT1 A 0 A_Light2
    HR2M A 1 A_ZoomFactor(0.95)
    HR2M B 1 A_ZoomFactor(0.97)
    HR2M C 1 A_ZoomFactor(0.98)
    HR2M D 1 A_ZoomFactor(0.99)
    HR2M E 1 A_ZoomFactor(0.995)

    TNT1 A 0 A_Light1
    HR2M E 2 A_ZoomFactor(1) //Zenithal Point
      
    HR2M EDCBA 1
    TNT1 A 0 A_Light0
    HR2A C 1
    HR2A C 6 A_PlaySound("Weapons/HornetClose",6)
    HR2A D 2
    HR2G ACBACBA 2
	HR2G A 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",1,1)
	Goto RIdle
	//HRNF A 0 A_PlaySoundEx("Weapons/HornetFire","Weapon")
    HRNF A 0 A_AlertMonsters
    HRNF A 0 A_PlaySound("Weapons/HornetAdd",0)
    HRNF A 0 A_Recoil(1)
    HRNF A 0 A_ZoomFactor(0.98)
	HRNF A 0 A_TakeInventory("Boolet",1,TIF_NOTAKEINFINITE)
      
    TNT1 A 0 A_GiveInventory("BooletCasing")
    TNT1 A 0 A_JumpIfInventory("CaliberUpgrade",1,"CFireRight")
      
    HRNF A 0 A_FireBullets(2.0, 0.75, -1, 80, "BulletPuff",0)
   REndo:
    HRNF A 0 A_Light2
    HRNF A 0 A_ZoomFactor(0.98)
    HRNF A 1 Bright A_SetPitch(pitch-0.75)
    HRNF A 0 Bright A_SetAngle(angle-0.75)
    HRNF A 0 A_ZoomFactor(0.985)
    HRNF B 1 Bright A_SetPitch(pitch-0.5)
    HRNF B 0 Bright A_SetAngle(angle-0.5)
    HRNR A 0 A_Light1
    HRNR A 1 A_ZoomFactor(0.99)
    HRNR B 1 A_ZoomFactor(0.995)
    HRNR C 1 A_ZoomFactor(1)
	HRNR C 0 A_Light0
    HRNR DEFGHI 1
    HRNG A 1
    HRNG BC 1
    HRNG A 1
	HRNG A 3 A_JumpIfInventory("SynthFireRight",1,"RFire")
    Goto RIdle
   CFireRight:
    HRNF A 0 A_FireBullets(2.0,0.75,-1,160,"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
    HRNA A 2 A_TakeInventory("SynthReload",1)
    HRNA 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,12,-2)

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

    TNT1 A 0 A_Light1
    HRNM E 2 A_ZoomFactor(1) //Zenithal Point
      
    HRNM EDCBA 1
    TNT1 A 0 A_Light0
    HRNA C 1
    HRNA C 6 A_PlaySound("Weapons/HornetClose",6)
    HRNA D 2
    HRNG ACBACBA 2
	HRNG A 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 of 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
  }
}