ACTOR SyringeShake : Inventory { Inventory.MaxAmount 16 }
ACTOR SyringeBlip : Boolean {}

ACTOR SyringeJuice : Ammo
{
  Inventory.Amount 1
  Inventory.MaxAmount 100
  Ammo.BackpackAmount 0
  Ammo.BackpackMaxAmount 100
}

ACTOR SyringeBoost : Health
{
  Inventory.Amount 25
}

ACTOR Syringe : Weapon
{
  Weapon.BobStyle Smooth
  Weapon.BobSpeed 2.5
  Weapon.BobRangeX 0.5
  Weapon.BobRangeY 0.3
  Weapon.SelectionOrder 1900
  Weapon.AmmoUse 0
  Weapon.AmmoGive 0
  Weapon.AmmoType "Clip"
  +WEAPON.AMMO_OPTIONAL
  Tag "Syringe"
  States
  {
  SelfHeal:
	TNT1 A 0 A_TakeInventory("PendingQuickness", 1)
    TNT1 A 0 A_JumpIfInventory("QuickHealing",1,1)
	Goto CannotSelect
	SRNG A 0 A_SetCrosshair(20)
	SRNG A 0 A_TakeInventory("SyringeShake", 99)
	SRNG H 0 A_PlaySoundEx("syringe/select", "SoundSlot5")
	SRNG ABCDEFGG 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	SRNG H 0 A_TakeInventory("SyringeJuice", 100)
	SRNG H 0 A_GiveInventory("SyringeBoost", 1)
	PUSL A 0 ACS_NamedExecuteAlways("VocalHeal",0)
	SRNG H 0 ACS_NamedExecuteAlways("SyringeFade", 0, 0, 0, 0)
	SRNG H 0 A_PlaySoundEx("syringe/inject", "SoundSlot6")
	SRNG HHHI 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	
  // Jittery
  Shake:
	SRNG A 0 A_JumpIfInventory("SyringeShake", 8, "ToShakeB")
	SRNG A 0 A_GiveInventory("SyringeShake", 1)
	SRNG A 0 A_Jump(256, "Shake1", "Shake2", "Shake3")
  Shake1:
	SRNG J 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	Goto Shake
  Shake2:
	SRNG K 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	Goto Shake
  Shake3:
	SRNG L 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	Goto Shake
	
  ToShakeB:
	SRNG I 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	
  // Less jittery
  ShakeB:
	SRNG A 0 A_JumpIfInventory("SyringeShake", 16, "PostShake")
	SRNG A 0 A_GiveInventory("SyringeShake", 1)
	SRNG A 0 A_Jump(256, "ShakeB1", "ShakeB2", "ShakeB3")
  ShakeB1:
	SRNG M 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	Goto ShakeB
  ShakeB2:
	SRNG N 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	Goto ShakeB
  ShakeB3:
	SRNG O 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	Goto ShakeB

  PostShake:
	SRNG PPPQQRSTUUVVVWXYZZ 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	SRNG H 0 A_PlaySoundEx("syringe/out", "SoundSlot5")
	SRNH AAABCDEFGHIIJJKLMNOOPP 1
	SRNG H 0 A_PlaySoundEx("syringe/insert", "SoundSlot5")
	SRNH PQRSTTUW 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	SRNG H 0 A_PlaySoundEx("syringe/deselect", "SoundSlot6")
	SRNH XYZ 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	SRNI AAB 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	TNT1 A 0 A_TakeInventory("QuickHealing",1)
	TNT1 A 0 ACS_NamedExecute("LastWeapon",0,0,0,0)
	Goto Deselect
  Ready:
    PPSS A 0
    Goto SelfHeal
  Deselect:
    TNT1 AAAAAAAAAAAAAA 0 A_Lower
	TNT1 A 1 A_Lower
    Loop
  CannotSelect:
    TNT1 A 0 A_TakeInventory("QuickHealing",1)
	TNT1 A 0 ACS_NamedExecute("LastWeapon",0,0,0,0)
	Goto Deselect
  Select:
	TNT1 A 0
    TNT1 A 0 A_JumpIfInventory("QuickHealing",1,1)
	Goto CannotSelect
    TNT1 AAAAAAAAAAAAAA 0 A_Lower
	TNT1 A 1 A_WeaponReady(WRF_NOFIRE)
	Goto Ready
	
  // We can't even fire this
  Fire:
    TNT1 A 1
    Goto Ready
  Spawn:
    PIST A -1
    Stop
  }
}