ACTOR WolfPrimary : Ammo
{
  Inventory.Amount 1
  Inventory.MaxAmount 12
  Inventory.Icon "ROCKA0"
  +INVENTORY.IGNORESKILL
}

ACTOR WolfSecondary : Ammo
{
  Inventory.PickupMessage "You picked up a drum of PPSH-41 ammunition." // "Picked up a clip."
  Inventory.PickupSound "bullpup/magin"
  Inventory.Amount 6
  Inventory.MaxAmount 72
  Ammo.BackpackAmount 24
  Ammo.BackpackMaxAmount 72
  Inventory.Icon "ROCKA0"
  +INVENTORY.IGNORESKILL
  States
  {
  Spawn:
    CLIP A -1
    Stop
  }
}

actor WolfRocket
{
  obituary "%o got decimated by %k's Annihilator."
  radius 5
  height 5
  speed 60
  damage (45)
  Damagetype ExplosiveDamage
  PROJECTILE
  +NOGRAVITY
  +RANDOMIZE
  -NOEXTREMEDEATH
  +FORCERADIUSDMG
  +CANBOUNCEWATER
  -NOTELEPORT
  -TELESTOMP
  SeeSound "law/propel"
  states
  {
  Spawn:
	MISL A 0
    MISL A 1 A_SpawnItemEx("LargeSmokePuff", -10, 0, 0, 0, 0, 0, 0, 128, 0)
    Loop
  XDeath:
    TNT1 A 0
    // TNT1 A 0 A_GiveToTarget("HitIndicator",1)
  Death:
	TNT1 A 0 A_StopSound
    TNT1 A 0 A_AlertMonsters
    TNT1 A 0 Radius_Quake(2,12,0,8,0)
    TNT1 A 0 A_SpawnItemEx("LAWExplosion")
    TNT1 AAAAAAAAAA 0 A_SpawnItemEx("ImpactSpark2", random(-32,32), random(-32,32), random(-32,32), random(-5,5), random(-5,5), random(-1,5), 0, 128, 0)
    TNT1 AAAAAAAAAA 0 A_SpawnItemEx("ImpactSpark2", random(-32,32), random(-32,32), random(-32,32), random(-5,5), random(-5,5), random(-1,5), 0, 128, 0)
    TNT1 A 20
    stop
  }
}

ACTOR "The Annihilator" : Weapon 11502
{
  +WEAPON.NOAUTOAIM
  Weapon.AmmoUse 0
  Weapon.AmmoGive2 6
  Weapon.AmmoType "WolfPrimary"
  Weapon.AmmoType2 "WolfSecondary"
  Obituary "\cJ%k \cG> \cKAnnihilator \cG> \cJ%o"
  Inventory.Pickupmessage "You picked up the Annihilator. Hell yes."
  Inventory.PickupSound "wolfrl/pickup"
  Weapon.BobStyle Smooth
  Weapon.BobSpeed 2.5
  Weapon.BobRangeX 0.5
  Weapon.BobRangeY 0.3
	//$Category ZT2 - Weapons
	//$Title The Annihilator
	//$Sprite PPSHF0
  Tag "The Annihilator"
  Scale 0.75
  Weapon.PreferredSkin "PyroSkin"
  +WEAPON.NOAUTOFIRE
  States
  {
  Ready:
	PPSS A 0 A_PlaySoundEx("wolfrl/select","SoundSlot6")
	WSSS ABCD 1
	PPSS A 0 A_JumpIfInventory("DoBlocking",1,"QuickMelee")
	PPSS A 0 A_JumpIfInventory("QuickGrenading",1,"ToGrenade")
	PPSS A 0 A_JumpIfInventory("IsReloading",1,"ReloadCheck")
    WSID A 1 A_WeaponReady
    Goto Ready+5
  ToGrenade:
	TNT1 A 0 A_JumpIfInventory("QuickGrenading",1,2)
	TNT1 A 0 A_Print("Why the fuck are you getting this?")
	GoTo Ready+5
	TNT1 A 0 A_JumpIfInventory("Type97Primary", 1, 3)
	TNT1 A 0 A_TakeInventory("QuickGrenading",999)
	TNT1 A 0 A_Print("No Grenades Left!")
	GoTo Ready+5
	WSSS DCBA 1
	TNT1 A 0 A_TakeInventory("QuickGrenading",999)
	TNT1 AAA 3
	97FI ABC 1
	97FI D 1
	97FI D 1 A_WeaponReady(WRF_NOPRIMARY | WRF_NOSECONDARY)
	//97FI D 0 A_JumpIfInventory("QuickGrenading",1,1)
	//97FI D 0 A_ReFire
	97FI E 0 A_PlaySoundEx("type97/pinpull","SoundSlot6")
	97FI EG 1
	97FI I 3
	97FI J 0 A_PlaySoundEx("type97/throw","SoundSlot6")
	97FI JKL 1
	TNT1 A 0 A_TakeInventory("Type97Primary",1)
	FRGN A 0 A_FireCustomMissile("Thrown97",random(-200,200)/100.00,0,0,16,0,random(-150,150)/100.00)
	TNT1 AAA 3
	WSSS ABCD 1
	TNT1 A 0 A_TakeInventory("QuickGrenading",999)
	Goto Ready+5
  QuickMelee:
	WSSS DCBA 1
	TNT1 AAA 3
	MCFI E 1
	MCFI E 0 A_PlaySoundEx("machete/fire","Weapon")
	MCFI FG 1
    MCFI H 0 A_CustomPunch(2*random(1, 10), TRUE, 0, "ZTMeleePuff")
	MCFI HIJ 1
	MCFI K 2
	TNT1 AAA 3
	WSSS ABCD 1
	TNT1 A 0 A_TakeInventory("DoBlocking",1)
	Goto Ready+5
  ToReady:
	NULL A 0
	Goto Ready+5
	NULL AAA 0
	NULL A 0 A_PlaySoundEx("dryfire/smg","SoundSlot6")
	Goto Ready+5
  Deselect:
	 WSSS DCBA 1
     TNT1 AAAAAAAAAA 0 A_Lower
	 TNT1 A 1 A_Lower
     Goto Deselect+4
  Select:
	 TNT1 A 0 ACS_ExecuteAlways(82,0,10,0,0)
     TNT1 A 0 A_Raise
     Wait
  //=======================================================================
  // AMMO CHECKING
  //=======================================================================
  ReloadCheck:
	 TNT1 A 0 A_TakeInventory("IsReloading",1)
	 TNT1 A 0 A_JumpIfInventory("Perk_Demo",1,"RCP")
	 TNT1 A 0 A_JumpIfInventory("WolfPrimary",6,"ToReady")
	 TNT1 A 0 A_JumpIfInventory("WolfSecondary",1,"ReloadAnim")
	 Goto ToReady
  RCP:
	 TNT1 A 0 A_JumpIfInventory("PerkLevel",10,"RCP10")
	 TNT1 A 0 A_JumpIfInventory("WolfPrimary",9,"ToReady")
	 TNT1 A 0 A_JumpIfInventory("WolfSecondary",1,"ReloadAnim")
	 Goto ToReady
  RCP10:
	 TNT1 A 0 A_JumpIfInventory("WolfPrimary",12,"ToReady")
	 TNT1 A 0 A_JumpIfInventory("WolfSecondary",1,"ReloadAnim")
	 Goto ToReady
  //=======================================================================
  ReloadAnim:
     9MRL A 0 ACS_ExecuteAlways(820,0,0,0,0)
	 WSRL ABCDE 1
	 WSRL F 6
	 WSRL GHIJK 1
	 WSRL L 6
	 WSRL L 0 A_PlaySoundEx("wolfrl/magout","SoundSlot6")
	 WSRL L 2
	 WSRL T 3
	 WSRL NOPQR 1
	 WSRL S 12
	 WSRL RQPO 1
	 WSRL N 0 A_PlaySoundEx("wolfrl/magin","SoundSlot6")
	 WSRL N 2
	 WSRL M 2
	 WSRL U 4
	 WSRL L 2
	 WSRL KJIHG 1
	 WSRL F 3
	 WSRL EDCBA 1
	 TNT1 A 0 A_TakeInventory("IsReloading",1)
	 Goto CalculateAmmo
  //=======================================================================
  // CALCULATE AMMO
  //=======================================================================
  CalculateAmmo:
     TNT1 A 0 A_JumpIfInventory("Perk_Demo",1,"CalculateAmmoPerk")
     TNT1 A 0 A_JumpIfInventory("WolfSecondary",1,2)
	 Goto Ready+5
	 TNT1 AAA 0
	 TNT1 A 0 A_JumpIfInventory("WolfPrimary",6,"ToReady")
	 TNT1 A 0 A_TakeInventory("WolfSecondary",1)
	 TNT1 A 0 A_GiveInventory("WolfPrimary",1)
	 Loop
  CalculateAmmoPerk:
     TNT1 A 0 A_JumpIfInventory("PerkLevel",10,"CalculateAmmoPerk10")
     TNT1 A 0 A_JumpIfInventory("WolfSecondary",1,2)
	 Goto Ready+5
	 TNT1 AAA 0
	 TNT1 A 0 A_JumpIfInventory("WolfPrimary",9,"ToReady")
	 TNT1 A 0 A_TakeInventory("WolfSecondary",1)
	 TNT1 A 0 A_GiveInventory("WolfPrimary",1)
	 Loop
  CalculateAmmoPerk10:
     TNT1 A 0 A_JumpIfInventory("WolfSecondary",1,2)
	 Goto Ready+5
	 TNT1 AAA 0
	 TNT1 A 0 A_JumpIfInventory("WolfPrimary",12,"ToReady")
	 TNT1 A 0 A_TakeInventory("WolfSecondary",1)
	 TNT1 A 0 A_GiveInventory("WolfPrimary",1)
	 Loop
  //=======================================================================
  Fire:
	 PPFI A 0 A_JumpIfInventory("WolfPrimary",1,1)
	 Goto ToReady+2
	 PPFI A 0 A_TakeInventory("WolfPrimary",1)
	 PPFI A 0 A_FireCustomMissile("WolfRocket")
	 PPFI A 0 A_FireCustomMissile("ShakeYourAssDouble")
	 BPSS A 0 A_FireCustomMissile("LongRifleCaseSpawn",5,0,16,-3)
	 PPFI A 0 A_PlaySound("wolfrl/fire", CHAN_WEAPON)
	 TNT1 A 0 A_SpawnItemEx("ShooterLight",0,0,0)
	 PPFI A 0 A_SetPitch(pitch-10)
	 WSFI A 1 bright
	 WSFI B 1
	 PPFI A 0 A_SetPitch(pitch+2)
	 WSFI B 2
	 PPFI A 0 A_SetPitch(pitch+2)
	 WSFI C 5
	 WSFI D 3
	 Goto Ready+5
  Spawn:
    PPSH F -1
    Stop
  }
}