actor "KRISS Vector" : RGUWeapon
{
  obituary "%k took down %o with the Vector."
  inventory.pickupmessage "You got the KRISS Vector submachinegun."
  //attacksound "ump45/fire6"
  weapon.selectionorder 10
  weapon.ammotype "VectorClip"
  weapon.ammouse 1
  weapon.ammogive 0
  weapon.ammotype2 "VectorAmmo"
  weapon.ammouse2 0
  weapon.ammogive2 0
  -NOAUTOFIRE
  states
  {
  Ready:
    M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    GRNA L 0 A_TakeInventory("weapondropper",2)
    VECA A 0 A_PlaySoundEx("weapon/draw","SoundSlot5")
    VECA BC 2 A_WeaponReady(WRF_NOPRIMARY|WRF_ALLOWZOOM)
    VECG DEFG 2 A_WeaponReady(WRF_ALLOWZOOM)
    VECA HIJKL 2 A_WeaponReady(WRF_ALLOWZOOM)
	G18A I 0 A_JumpIfInventory("VectorToken",1,"Reload")
    VECA L 0 A_JumpIfNoAmmo("Reload")
	G18A I 0 A_JumpIfInventory("weapondropper",1,"DropWeapon")
    VECA L 0 A_JumpIfInventory("Aiming",1,5)
    VECA L 0 A_JumpIfInventory("Reloading",1,"Reload")
    VECA L 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    VECA L 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    VECA L 1 A_WeaponReady(WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+16
    VECF F 0 A_JumpIfInventory("Reloading",1,"Reload")
  ReadyAim:
    VECF F 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    VECF F 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	G18A I 0 A_JumpIfInventory("weapondropper",1,"AltFire3")
    VECF F 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+22
  Deselect:
    VECA L 0 A_PlaySoundEx("weapon/down","SoundSlot5")
    VECA L 0 A_TakeInventory("Aiming",1)
    VECA L 0 A_TakeInventory("Reloading",1)
    VECA L 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    VECA L 0 A_ZoomFactor(1.0)
    VECA L 0 A_Lower
    VECA L 1 A_Lower
    Goto Deselect+5
  Select:
    VECF A 0 A_Raise
    Loop
  Fire:
    VECB A 0 A_JumpIfInventory("Aiming",1,"FireAim")
    VECB A 0 A_JumpIfNoAmmo("ReloadStart")
    VECB A 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Fire_SteadyAim")
    VECB A 0 A_PlayWeaponSound("vector/fire")
    VECB A 0 A_FireCustomMissile("WeaponSmokePuffLight",0,0,10,-3)
    VECB A 0 BRIGHT A_GunFlash
    VECB A 1 BRIGHT A_FireCustomMissile("HHCBVECTOR", frandom(-6.00,6.00), 1, 0, 4, 0, frandom(-6.00,6.00))
	VECB A 0 A_SpawnItemEx("BulletCasing",Cos(Pitch)*30,11,32-(Sin(Pitch)*40),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    VECB A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    TNT1 A 0 A_JumpIfInventory("VectorClip",10,2)
    TNT1 A 0 A_PlaySound("m9/lock")
    VECB A 0 A_JumpIfNoAmmo("FireEmpty")
    VECB B 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    VECB C 0 A_JumpIfInventory("VectorAmmo",1,2)
    VECB C 1 A_ReFire
    Goto Ready+16
    VECB C 0 A_JumpIfNoAmmo("ReloadStart")
    VECB C 1 A_ReFire
    Goto Ready+16
  Hold:
    VECB A 0 A_JumpIfInventory("Aiming",1,"HoldAim")
    VECB A 0 A_JumpIfNoAmmo("ReloadStart")
    VECB A 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Hold_SteadyAim")
    VECB A 0 A_PlayWeaponSound("vector/fire")
    VECB A 0 A_FireCustomMissile("WeaponSmokePuffLight",0,0,10,-3)
    VECB A 0 BRIGHT A_GunFlash
    VECB A 1 BRIGHT A_FireCustomMissile("HHCBVECTOR", frandom(-8.50,8.50), 1, 0, 4, 0, frandom(-8.50,8.50))
	VECB A 0 A_SpawnItemEx("BulletCasing",Cos(Pitch)*30,11,32-(Sin(Pitch)*40),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    VECB A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    TNT1 A 0 A_JumpIfInventory("VectorClip",10,2)
    TNT1 A 0 A_PlaySound("m9/lock")
    VECB A 0 A_JumpIfNoAmmo("FireEmpty")
    VECB B 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    VECB C 0 A_JumpIfInventory("VectorAmmo",1,2)
    VECB C 1 A_ReFire
    Goto Ready+16
    VECB C 0 A_JumpIfNoAmmo("ReloadStart")
    VECB C 1 A_ReFire
    Goto Ready+16
  FireEmpty:
    VECB B 1
    VECB C 1 A_GiveInventory("VectorBolt",1)
    VECB C 0 A_JumpIfInventory("VectorAmmo",1,2)
    VECB C 0 A_ReFire
    Goto Ready+16
    VECB C 0 A_JumpIfNoAmmo("ReloadStart")
    VECB C 0 A_ReFire
    Goto Ready+16
  FireAim:
    VECF G 0 A_PlayWeaponSound("vector/fire")
    VECF G 0 A_FireCustomMissile("WeaponSmokePuffLight",0,0,0,-1)
    VECF G 0 BRIGHT A_GunFlash
    VECF G 1 BRIGHT A_FireCustomMissile("HHCBVECTOR", frandom(-1.60,1.60), 1, 0, 4, 0, frandom(-1.60,1.60))
	VECF G 0 A_SpawnItemEx("BulletCasing",Cos(Pitch)*30,3,33-(Sin(Pitch)*34),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    VECF G 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    TNT1 A 0 A_JumpIfInventory("VectorClip",10,2)
    TNT1 A 0 A_PlaySound("m9/lock")
    VECF G 0 A_JumpIfNoAmmo("FireAimEmpty")
    VECF H 1
    VECF I 0 A_JumpIfInventory("VectorAmmo",1,2)
    VECF I 1 A_ReFire
    Goto Ready+22
    VECF I 0 A_JumpIfNoAmmo("ReloadStart")
    VECF I 1 A_ReFire
    Goto Ready+22
  HoldAim:
    VECF G 0 A_PlayWeaponSound("vector/fire")
    VECF G 0 A_FireCustomMissile("WeaponSmokePuffLight",0,0,0,-1)
    VECF G 0 BRIGHT A_GunFlash
    VECF G 1 BRIGHT A_FireCustomMissile("HHCBVECTOR", frandom(-1.95,1.95), 1, 0, 4, 0, frandom(-1.95,1.95))
	VECF G 0 A_SpawnItemEx("BulletCasing",Cos(Pitch)*30,3,33-(Sin(Pitch)*34),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    VECF G 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    TNT1 A 0 A_JumpIfInventory("VectorClip",10,2)
    TNT1 A 0 A_PlaySound("m9/lock")
    VECF G 0 A_JumpIfNoAmmo("FireAimEmpty")
    VECF H 1
    VECF I 0 A_JumpIfInventory("VectorAmmo",1,2)
    VECF I 1 A_ReFire
    Goto Ready+22
    VECF I 0 A_JumpIfNoAmmo("ReloadStart")
    VECF I 1 A_ReFire
    Goto Ready+22
  FireAimEmpty:
    VECF H 1
    VECF I 1 A_GiveInventory("VectorBolt",1)
    VECF I 0 A_JumpIfInventory("VectorAmmo",1,2)
    VECF I 0 A_ReFire
    Goto Ready+22
    VECF I 0 A_JumpIfNoAmmo("ReloadStart")
    VECF I 0 A_ReFire
    Goto Ready+22
  Reload: //AltFire:
    VECC A 0 A_JumpIfInventory("VectorClip",30,2)
    VECC A 0 A_JumpIfInventory("VectorAmmo",1,"ReloadStart")
    VECC A 0 A_TakeInventory("Reloading",1)
    VECC A 0 A_JumpIfInventory("Aiming",1,"ReadyAim")
    Goto Ready+19
  ReloadStart:
    VECC A 0 ACS_NamedExecuteAlways("RefSpeak",0,0,0,0)
    VECC A 0 A_JumpIfInventory("Aiming",1,"ReloadStartAim")
    VECC A 3 A_JumpIfInventory("Perk1_SOH",1,"ReloadStart_SOH")
	VECC A 0 A_JumpIfInventory("VectorToken",1,"Reload2")
    VECC BCD 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    VECC E 3 A_PlaySoundEx("vector/clipout","SoundSlot5")
    VECC FGHIJK 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	VECC M 0 A_FireCustomMissile("SMGEmptyMagSpawner",0,0,0,1)
	VECC M 0 A_GiveInventory("VectorToken",1)
	goto Reload2
  Reload2:
    VECI LM 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    VECI N 3 A_TakeInventory("Reloading",1)
    VECI O 3 A_PlayWeaponSound("vector/clipin")
    Goto ReloadAmmo
  ReloadAmmo:
    VECI P 0 A_JumpIfInventory("VectorClip",30,"ReloadEnd")
	VECC W 0 A_TakeInventory("VectorToken",1)
    VECI P 0 A_JumpIfInventory("VectorAmmo",1,1)
    Goto ReloadEnd
    VECI P 0 A_GiveInventory("VectorClip",1)
    VECI P 0 A_TakeInventory("VectorAmmo",1)
    Goto ReloadAmmo
  ReloadEnd:
    VECI PQRS 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    VECI T 3 A_JumpIfInventory("VectorBolt",1,"ReloadEndBolt")
    VECH AB 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    VECA GHIJK 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    VECA L 0 A_ReFire
    Goto Ready+16
  ReloadEndBolt:
    VECI T 3 A_TakeInventory("VectorBolt",1)
    VECC UV 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    VECC W 3 A_PlayWeaponSound("vector/bolt")
    VECC XYZ 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    VECD ABCDE 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    VECA K 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    VECA L 0 A_ReFire
    Goto Ready+16
  Zoom:
  PostReloadAlt:
    G18A I 0 A_JumpIfInventory("VectorToken",1,"Reload")
    VECF F 0 A_ZoomFactor(1.2)
    VECF E 0 A_GiveInventory("Aiming",1)
	VECF A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    VECF ABCDEF 1
    Goto AltHold
  AltFireHoldAim:
    "####" "#" 0 A_JumpIfInventory("VectorClip",1,1)
	Goto Reload
    VECF G 0 A_PlayWeaponSound("vector/fire")
	VECI T 3 A_TakeInventory("VectorClip",1)
    VECF G 0 A_FireCustomMissile("WeaponSmokePuffLight",0,0,0,-1)
    VECF G 0 BRIGHT A_GunFlash
    VECF G 1 BRIGHT A_FireCustomMissile("HHCBVECTOR", frandom(-1.95,1.95), 1, 0, 4, 0, frandom(-1.95,1.95))
	VECF G 0 A_SpawnItemEx("BulletCasing",Cos(Pitch)*30,3,33-(Sin(Pitch)*34),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    VECF G 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    TNT1 A 0 A_JumpIfInventory("VectorClip",10,2)
    TNT1 A 0 A_PlaySound("m9/lock")
    VECF H 1
    "####" "#" 0 A_JumpIfInventory("VectorClip",1,1)
	Goto Reload
    VECF I 1 A_ReFire
    Goto Ready+22
  AltHold:
    VECF F 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
	M4CA C 0 A_JumpIfInventory("FireHeld",1,"AltFireHoldAim")
	M4CA C 0 A_JumpIfInventory("Reloading",1,"Reload")
	U45A L 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    U45A L 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	G18A I 0 A_JumpIfInventory("weapondropper",1,"AltFire3")
	M4CA F 0 A_Refire("AltHold")
	M4CA C 0 A_JumpIfInventory("Aiming",1,"AltFire2")
	Goto Ready+18
  AltFire:
    GRNA L 0 A_TakeInventory("weapondropper",2)
    G18A I 0 A_JumpIfInventory("VectorToken",1,"Reload")
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"AltHold")
    VECF A 0 A_JumpIfInventory("Aiming",1,"AltFire2")
    VECF A 0 A_ZoomFactor(1.2)
    VECF AB 1
    VECF B 0 A_GiveInventory("Aiming",1)
    VECF CDEF 1
    VECF F 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    VECF F 0 A_Refire
    Goto Ready+22
  AltFire2:
    VECF F 0 A_ZoomFactor(1.0)
    VECF FE 1
    VECF E 0 A_TakeInventory("Aiming",1)
    VECF DCBA 1
    VECF A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
	VECA LLLL 1
    M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+16
  AltFire3:
    VECF F 0 A_ZoomFactor(1.0)
    VECF FE 1
    VECF E 0 A_TakeInventory("Aiming",1)
    VECF DCBA 1
    VECF A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    VECF A 0 A_Refire
	goto DropWeapon
  ReloadStartAim:
    VECF F 0 A_ZoomFactor(1.0)
    VECF FE 1
    VECF E 0 A_TakeInventory("Aiming",1)
    VECF DCBA 1
    VECF A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    Goto ReloadStart+2
  Flash:
    TNT1 A 2 bright A_Light1
    TNT1 A 0 bright A_Light0
    stop
  Spawn:
    WEAP A 0
    WEAP A 0 A_SpawnItem("VectorDrop")
    stop
  Fire_SteadyAim:
    VECB A 0 A_PlayWeaponSound("vector/fire")
    VECB A 0 A_FireCustomMissile("WeaponSmokePuffLight",0,0,10,-3)
    VECB A 0 BRIGHT A_GunFlash
    VECB A 1 BRIGHT A_FireCustomMissile("HHCBVECTOR", frandom(-4.00,4.00), 1, 0, 4, 0, frandom(-4.00,4.00))
	VECB A 0 A_SpawnItemEx("BulletCasing",Cos(Pitch)*30,11,32-(Sin(Pitch)*40),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    VECB A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    TNT1 A 0 A_JumpIfInventory("VectorClip",10,2)
    TNT1 A 0 A_PlaySound("m9/lock")
    VECB A 0 A_JumpIfNoAmmo("FireEmpty")
    VECB B 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    VECB C 0 A_JumpIfInventory("VectorAmmo",1,2)
    VECB C 1 A_ReFire
    Goto Ready+16
    VECB C 0 A_JumpIfNoAmmo("ReloadStart")
    VECB C 1 A_ReFire
    Goto Ready+16
  Hold_SteadyAim:
    VECB A 0 A_PlayWeaponSound("vector/fire")
    VECB A 0 A_FireCustomMissile("WeaponSmokePuffLight",0,0,10,-3)
    VECB A 0 BRIGHT A_GunFlash
    VECB A 1 BRIGHT A_FireCustomMissile("HHCBVECTOR", frandom(-6.50,6.50), 1, 0, 4, 0, frandom(-6.50,6.50))
	VECB A 0 A_SpawnItemEx("BulletCasing",Cos(Pitch)*30,11,32-(Sin(Pitch)*40),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    VECB A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    TNT1 A 0 A_JumpIfInventory("VectorClip",10,2)
    TNT1 A 0 A_PlaySound("m9/lock")
    VECB A 0 A_JumpIfNoAmmo("FireEmpty")
    VECB B 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    VECB C 0 A_JumpIfInventory("VectorAmmo",1,2)
    VECB C 1 A_ReFire
    Goto Ready+16
    VECB C 0 A_JumpIfNoAmmo("ReloadStart")
    VECB C 1 A_ReFire
    Goto Ready+16
  ReloadStart_SOH:
    VECC A 0 A_JumpIfInventory("VectorToken",1,"Reload3")
    VECC A 2
    VECC BCD 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    VECC E 2 A_PlaySoundEx("vector/clipout","SoundSlot5")
    VECC FGHIJK 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	VECC M 0 A_FireCustomMissile("SMGEmptyMagSpawner",0,0,0,1)
	VECC M 0 A_GiveInventory("VectorToken",1)
	goto Reload3
  Reload3:
    VECI LM 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    VECI N 2 A_TakeInventory("Reloading",1)
    VECI O 2 A_PlayWeaponSound("vector/clipin")
    Goto ReloadAmmo_SOH
  ReloadAmmo_SOH:
    VECI P 0 A_JumpIfInventory("VectorClip",30,"ReloadEnd_SOH")
	VECC W 0 A_TakeInventory("VectorToken",1)
    VECI P 0 A_JumpIfInventory("VectorAmmo",1,1)
    Goto ReloadEnd_SOH
    VECI P 0 A_GiveInventory("VectorClip",1)
    VECI P 0 A_TakeInventory("VectorAmmo",1)
    Goto ReloadAmmo_SOH
  ReloadEnd_SOH:
    VECI PQRS 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    VECI T 2 A_JumpIfInventory("VectorBolt",1,"ReloadEndBolt_SOH")
    VECH AB 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    VECA GHIJK 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    VECA L 0 A_ReFire
    Goto Ready+16
  ReloadEndBolt_SOH:
    VECI T 2 A_TakeInventory("VectorBolt",1)
    VECC U 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    VECC V 2 A_PlayWeaponSound("vector/bolt")
    VECC WXYZ 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    VECD ABCDE 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    VECA K 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    VECA L 0 A_ReFire
    Goto Ready+16
  FragGrenade:
    U45F A 0 ACS_NamedExecuteAlways("RefSpeak",0,1,0,0)
    U45F A 0 A_ZoomFactor(1.0)
    U45A L 0 A_TakeInventory("Aiming",1)
    U45A L 0 A_TakeInventory("Reloading",1)
    U45F A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
	M4CA J 0 A_JumpIfInventory("ThrowingStun",1,"StunGrenade")
	M4CA J 0 A_JumpIfInventory("ThrowingIncd",1,"IncGrenade")
    U45A L 0 A_JumpIfInventory("Perk1_SOH_Pro",1,"FragGrenade_SOH")
    GRNA ABC 2
    GRNA D 2 A_PlaySound("grenade/pinpull")
    GRNA EFGH 2
    TNT1 A 15
    TNT1 A 0 A_PlaySound("grenade/throw")
    GRNA A 0 A_PlaySoundEx("us/grenades","Voice")
    GRNA IJK 2
    GRNA L 0 A_TakeInventory("GrenadeAmmo",1)
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
    U45A L 0 A_TakeInventory("Aiming",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    GRNA L 2 A_FireCustomMissile("FragGrenade",frandom(-2.00,2.00),0,0,16,0,frandom(-1.50,1.50))
    GRNA MN 2
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  FragGrenade_SOH:
    GRNA ABC 1
    GRNA D 1 A_PlaySound("grenade/pinpull")
    GRNA EFGH 1
    TNT1 A 10
    TNT1 A 0 A_PlaySound("grenade/throw")
    GRNA A 0 A_PlaySoundEx("us/grenades","Voice")
    GRNA IJK 1
    GRNA L 0 A_TakeInventory("GrenadeAmmo",1)
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
    U45A L 0 A_TakeInventory("Aiming",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    GRNA L 1 A_FireCustomMissile("FragGrenade",frandom(-2.00,2.00),0,0,16,0,frandom(-1.50,1.50))
    GRNA MN 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  KnifeAttack:
    GRNA L 0 A_TakeInventory("weapondropper",2)
    U45F A 0 A_ZoomFactor(1.0)
    U45A L 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    U45A L 0 A_TakeInventory("Aiming",1)
    U45A L 0 A_TakeInventory("Reloading",1)
    U45F A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    U45A L 0 A_JumpIfInventory("Perk1_SOH_Pro",1,"KnifeAttack_SOH")
    U45C A 0 A_JumpIfInventory("Perk3_Commando",1,"KnifeAttack_Commando")
    KNFA A 0 ACS_NamedExecuteAlways("RefSlash",0,0,0,0)
    KNFA AB 1
    KNFA B 0 A_PlaySound("knife/swing")
    KNFA C 1 A_CustomPunch(102,1,0,"KnifePuff",104)
    KNFA DEFGHIJKL 1
    TNT1 A 20
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  KnifeAttack_Commando:
    KNFA A 0 ACS_NamedExecuteAlways("RefSlash",0,0,0,0)
    KNFA AB 1
    KNFA B 0 A_PlaySound("knife/swing")
    KNFA C 1 A_CustomPunch(102,1,0,"KnifePuff",160)
    KNFA DEFGHIJKL 1
    TNT1 A 20
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  KnifeAttack_SOH:
    U45C A 0 A_JumpIfInventory("Perk3_Commando",1,"KnifeAttack_SOH_Commando")
    KNFA A 0 ACS_NamedExecuteAlways("RefSlash",0,0,0,0)
    KNFA AB 1
    KNFA B 0 A_PlaySound("knife/swing")
    KNFA C 1 A_CustomPunch(102,1,0,"KnifePuff",104)
    KNFA DEFGHIJKL 1
    TNT1 A 10
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  KnifeAttack_SOH_Commando:
    KNFA A 0 ACS_NamedExecuteAlways("RefSlash",0,0,0,0)
    KNFA AB 1
    KNFA B 0 A_PlaySound("knife/swing")
    KNFA C 1 A_CustomPunch(102,1,0,"KnifePuff",160)
    KNFA DEFGHIJKL 1
    TNT1 A 10
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  StunGrenade:
    U45A L 0 A_JumpIfInventory("Perk1_SOH_Pro",1,"StunGrenade_SOH")
    GRNA ABC 2
    GRNA D 2 A_PlaySound("grenade/pinpull")
    GRNA EFGH 2
    TNT1 A 15
    TNT1 A 0 A_PlaySound("grenade/throw")
    GRNA A 0 A_PlaySoundEx("us/grenades","Voice")
    GRNA IJK 2
    GRNA L 0 A_TakeInventory("StunAmmo",1)
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
	GRNA L 0 A_TakeInventory("ThrowingStun",1)
	GRNA L 0 A_TakeInventory("ThrowingIncd",1)
    U45A L 0 A_TakeInventory("Aiming",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    GRNA L 2 A_FireCustomMissile("StunGrenade",frandom(-2.00,2.00),0,0,16,0,frandom(-1.50,1.50))
    GRNA MN 2
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  IncGrenade:
    U45A L 0 A_JumpIfInventory("Perk1_SOH_Pro",1,"IncGrenade_SOH")
    GRNA ABC 2
    GRNA D 2 A_PlaySound("grenade/pinpull")
    GRNA EFGH 2
    TNT1 A 15
    TNT1 A 0 A_PlaySound("grenade/throw")
    GRNA A 0 A_PlaySoundEx("us/grenades","Voice")
    GRNA IJK 2
    GRNA L 0 A_TakeInventory("IncdAmmo",1)
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
	GRNA L 0 A_TakeInventory("ThrowingStun",1)
	GRNA L 0 A_TakeInventory("ThrowingIncd",1)
    U45A L 0 A_TakeInventory("Aiming",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    GRNA L 2 A_FireCustomMissile("IncGrenade",frandom(-2.00,2.00),0,0,16,0,frandom(-1.50,1.50))
    GRNA MN 2
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  StunGrenade_SOH:
    GRNA ABC 1
    GRNA D 1 A_PlaySound("grenade/pinpull")
    GRNA EFGH 1
    TNT1 A 10
    TNT1 A 0 A_PlaySound("grenade/throw")
    GRNA A 0 A_PlaySoundEx("us/grenades","Voice")
    GRNA IJK 1
    GRNA L 0 A_TakeInventory("StunAmmo",1)
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
	GRNA L 0 A_TakeInventory("ThrowingStun",1)
	GRNA L 0 A_TakeInventory("ThrowingIncd",1)
    U45A L 0 A_TakeInventory("Aiming",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    GRNA L 1 A_FireCustomMissile("StunGrenade",frandom(-2.00,2.00),0,0,16,0,frandom(-1.50,1.50))
    GRNA MN 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  IncGrenade_SOH:
    GRNA ABC 1
    GRNA D 1 A_PlaySound("grenade/pinpull")
    GRNA EFGH 1
    TNT1 A 10
    TNT1 A 0 A_PlaySound("grenade/throw")
    GRNA A 0 A_PlaySoundEx("us/grenades","Voice")
    GRNA IJK 1
    GRNA L 0 A_TakeInventory("IncdAmmo",1)
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
	GRNA L 0 A_TakeInventory("ThrowingStun",1)
	GRNA L 0 A_TakeInventory("ThrowingIncd",1)
    U45A L 0 A_TakeInventory("Aiming",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    GRNA L 1 A_FireCustomMissile("IncGrenade",frandom(-2.00,2.00),0,0,16,0,frandom(-1.50,1.50))
    GRNA MN 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  DropWeapon:
    VECA KJIHGFEDCBA 2 A_WeaponReady(WRF_NOPRIMARY)
    VECA A 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	M4CC F 0 A_JumpIfInventory("weapondropper",2,"ThrowWeapon")
    KNFA A 0 ACS_NamedExecuteAlways("RefDropW",0,0,0,0)
	GRNA L 0 A_TakeInventory("weapondropper",1)
	M4CB A 0 A_FireCustomMissile("VectorDropped",0,0,7,2)
	stop
  ThrowWeapon:
    GRNA IKMN 1
	KNFA B 0 A_PlaySound("knife/swing")
    KNFA A 0 ACS_NamedExecuteAlways("RefDropW",0,0,0,0)
	GRNA L 0 A_TakeInventory("weapondropper",2)
	M4CB A 0 A_FireCustomMissile("VectorThrown",0,0,7,2)
	stop
  }
}

actor VectorClip : Ammo
{
    inventory.icon "CLIPA0"
    inventory.amount 0
    inventory.maxamount 30
    ammo.backpackamount 0
    ammo.backpackmaxamount 30
    +IGNORESKILL
}

actor VectorBolt : Inventory
{
    inventory.amount 0
    inventory.maxamount 1
}

actor "KRISS Vector Ex Mags" : "KRISS Vector"
{
  obituary "%k took down %o with the Vector."
  inventory.pickupmessage "You got the KRISS Vector submachinegun."
  //attacksound "ump45/fire6"
  weapon.selectionorder 10
  weapon.ammotype "VectorClip2"
  weapon.ammouse 1
  weapon.ammogive 0
  weapon.ammotype2 "VectorAmmo"
  weapon.ammouse2 0
  weapon.ammogive2 0
  -NOAUTOFIRE
  states
  {
  Ready:
    M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    GRNA L 0 A_TakeInventory("weapondropper",2)
    VECA A 0 A_PlaySoundEx("weapon/draw","SoundSlot5")
    VECA BC 2 A_WeaponReady(WRF_NOPRIMARY|WRF_ALLOWZOOM)
    VECG DEFG 2 A_WeaponReady(WRF_ALLOWZOOM)
    VECA HIJKL 2 A_WeaponReady(WRF_ALLOWZOOM)
	G18A I 0 A_JumpIfInventory("VectorToken",1,"Reload")
    VECA L 0 A_JumpIfNoAmmo("Reload")
	G18A I 0 A_JumpIfInventory("weapondropper",1,"DropWeapon")
    VECA L 0 A_JumpIfInventory("Aiming",1,5)
    VECA L 0 A_JumpIfInventory("Reloading",1,"Reload")
    VECA L 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    VECA L 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    VECA L 1 A_WeaponReady(WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+16
    VECF F 0 A_JumpIfInventory("Reloading",1,"Reload")
  ReadyAim:
    VECF F 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    VECF F 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	G18A I 0 A_JumpIfInventory("weapondropper",1,"AltFire3")
    VECF F 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+22
  Fire:
    VECB A 0 A_JumpIfInventory("Aiming",1,"FireAim")
    VECB A 0 A_JumpIfNoAmmo("ReloadStart")
    VECB A 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Fire_SteadyAim")
    VECB A 0 A_PlayWeaponSound("vector/fire")
    VECB A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,10,-3)
    VECB A 0 BRIGHT A_GunFlash
    VECB A 1 BRIGHT A_FireCustomMissile("HHCBVECTOR", frandom(-6.00,6.00), 1, 0, 4, 0, frandom(-6.00,6.00))
	VECB A 0 A_SpawnItemEx("BulletCasing",Cos(Pitch)*30,11,32-(Sin(Pitch)*40),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    VECB A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    TNT1 A 0 A_JumpIfInventory("VectorClip2",10,2)
    TNT1 A 0 A_PlaySound("m9/lock")
    VECB A 0 A_JumpIfNoAmmo("FireEmpty")
    VECB B 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    VECB C 0 A_JumpIfInventory("VectorAmmo",1,2)
    VECB C 1 A_ReFire
    Goto Ready+16
    VECB C 0 A_JumpIfNoAmmo("ReloadStart")
    VECB C 1 A_ReFire
    Goto Ready+16
  Hold:
    VECB A 0 A_JumpIfInventory("Aiming",1,"HoldAim")
    VECB A 0 A_JumpIfNoAmmo("ReloadStart")
    VECB A 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Hold_SteadyAim")
    VECB A 0 A_PlayWeaponSound("vector/fire")
    VECB A 0 A_FireCustomMissile("WeaponSmokePuffLight",0,0,10,-3)
    VECB A 0 BRIGHT A_GunFlash
    VECB A 1 BRIGHT A_FireCustomMissile("HHCBVECTOR", frandom(-8.50,8.50), 1, 0, 4, 0, frandom(-8.50,8.50))
	VECB A 0 A_SpawnItemEx("BulletCasing",Cos(Pitch)*30,11,32-(Sin(Pitch)*40),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    VECB A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    TNT1 A 0 A_JumpIfInventory("VectorClip2",10,2)
    TNT1 A 0 A_PlaySound("m9/lock")
    VECB A 0 A_JumpIfNoAmmo("FireEmpty")
    VECB B 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    VECB C 0 A_JumpIfInventory("VectorAmmo",1,2)
    VECB C 1 A_ReFire
    Goto Ready+16
    VECB C 0 A_JumpIfNoAmmo("ReloadStart")
    VECB C 1 A_ReFire
    Goto Ready+16
  FireAim:
    VECF G 0 A_PlayWeaponSound("vector/fire")
    VECF G 0 A_FireCustomMissile("WeaponSmokePuff",0,0,0,-1)
    VECF G 0 BRIGHT A_GunFlash
    VECF G 1 BRIGHT A_FireCustomMissile("HHCBVECTOR", frandom(-1.60,1.60), 1, 0, 4, 0, frandom(-1.60,1.60))
	VECF G 0 A_SpawnItemEx("BulletCasing",Cos(Pitch)*30,3,33-(Sin(Pitch)*34),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    VECF G 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    TNT1 A 0 A_JumpIfInventory("VectorClip2",10,2)
    TNT1 A 0 A_PlaySound("m9/lock")
    VECF G 0 A_JumpIfNoAmmo("FireAimEmpty")
    VECF H 1
    VECF I 0 A_JumpIfInventory("VectorAmmo",1,2)
    VECF I 1 A_ReFire
    Goto Ready+22
    VECF I 0 A_JumpIfNoAmmo("ReloadStart")
    VECF I 1 A_ReFire
    Goto Ready+22
  HoldAim:
    VECF G 0 A_PlayWeaponSound("vector/fire")
    VECF G 0 A_FireCustomMissile("WeaponSmokePuffLight",0,0,0,-1)
    VECF G 0 BRIGHT A_GunFlash
    VECF G 1 BRIGHT A_FireCustomMissile("HHCBVECTOR", frandom(-1.95,1.95), 1, 0, 4, 0, frandom(-1.95,1.95))
	VECF G 0 A_SpawnItemEx("BulletCasing",Cos(Pitch)*30,3,33-(Sin(Pitch)*34),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    VECF G 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    TNT1 A 0 A_JumpIfInventory("VectorClip2",10,2)
    TNT1 A 0 A_PlaySound("m9/lock")
    VECF G 0 A_JumpIfNoAmmo("FireAimEmpty")
    VECF H 1
    VECF I 0 A_JumpIfInventory("VectorAmmo",1,2)
    VECF I 1 A_ReFire
    Goto Ready+22
    VECF I 0 A_JumpIfNoAmmo("ReloadStart")
    VECF I 1 A_ReFire
    Goto Ready+22
  Fire_SteadyAim:
    VECB A 0 A_PlayWeaponSound("vector/fire")
    VECB A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,10,-3)
    VECB A 0 BRIGHT A_GunFlash
    VECB A 1 BRIGHT A_FireCustomMissile("HHCBVECTOR", frandom(-4.00,4.00), 1, 0, 4, 0, frandom(-4.00,4.00))
	VECB A 0 A_SpawnItemEx("BulletCasing",Cos(Pitch)*30,11,32-(Sin(Pitch)*40),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    VECB A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    TNT1 A 0 A_JumpIfInventory("VectorClip2",10,2)
    TNT1 A 0 A_PlaySound("m9/lock")
    VECB A 0 A_JumpIfNoAmmo("FireEmpty")
    VECB B 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    VECB C 0 A_JumpIfInventory("VectorAmmo",1,2)
    VECB C 1 A_ReFire
    Goto Ready+16
    VECB C 0 A_JumpIfNoAmmo("ReloadStart")
    VECB C 1 A_ReFire
    Goto Ready+16
  Hold_SteadyAim:
    VECB A 0 A_PlayWeaponSound("vector/fire")
    VECB A 0 A_FireCustomMissile("WeaponSmokePuffLight",0,0,10,-3)
    VECB A 0 BRIGHT A_GunFlash
    VECB A 1 BRIGHT A_FireCustomMissile("HHCBVECTOR", frandom(-6.50,6.50), 1, 0, 4, 0, frandom(-6.50,6.50))
	VECB A 0 A_SpawnItemEx("BulletCasing",Cos(Pitch)*30,11,32-(Sin(Pitch)*40),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    VECB A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    TNT1 A 0 A_JumpIfInventory("VectorClip2",10,2)
    TNT1 A 0 A_PlaySound("m9/lock")
    VECB A 0 A_JumpIfNoAmmo("FireEmpty")
    VECB B 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    VECB C 0 A_JumpIfInventory("VectorAmmo",1,2)
    VECB C 1 A_ReFire
    Goto Ready+16
    VECB C 0 A_JumpIfNoAmmo("ReloadStart")
    VECB C 1 A_ReFire
    Goto Ready+16
  Reload: //AltFire:
    VECC A 0 A_JumpIfInventory("VectorClip2",45,2)
    VECC A 0 A_JumpIfInventory("VectorAmmo",1,"ReloadStart")
    VECC A 0 A_TakeInventory("Reloading",1)
    VECC A 0 A_JumpIfInventory("Aiming",1,"ReadyAim")
    Goto Ready+19
  ReloadStart:
    VECC A 0 ACS_NamedExecuteAlways("RefSpeak",0,0,0,0)
    VECC A 0 A_JumpIfInventory("Aiming",1,"ReloadStartAim")
    VECC A 3 A_JumpIfInventory("Perk1_SOH",1,"ReloadStart_SOH")
	VECC A 0 A_JumpIfInventory("VectorToken",1,"Reload2")
    VECC BCD 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    VECC E 3 A_PlaySoundEx("vector/clipout","SoundSlot5")
    VECC FGHIJK 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	VECC M 0 A_FireCustomMissile("SMGEmptyMagExtSpawner",0,0,0,1)
	VECC M 0 A_GiveInventory("VectorToken",1)
	goto Reload2
  Reload2:
    VECI LM 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    VECC N 3 A_TakeInventory("Reloading",1)
    VECC O 3 A_PlayWeaponSound("vector/clipin")
    Goto ReloadAmmo
  ReloadAmmo:
    VECC P 0 A_JumpIfInventory("VectorClip2",45,"ReloadEnd")
	VECC W 0 A_TakeInventory("VectorToken",1)
    VECC P 0 A_JumpIfInventory("VectorAmmo",1,1)
    Goto ReloadEnd
    VECC P 0 A_GiveInventory("VectorClip2",1)
    VECC P 0 A_TakeInventory("VectorAmmo",1)
    Goto ReloadAmmo
  ReloadEnd:
    VECC PQRS 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    VECC T 3 A_JumpIfInventory("VectorBolt",1,"ReloadEndBolt")
    VECE AB 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    VECA GHIJK 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    VECA L 0 A_ReFire
    Goto Ready+16
  ReloadEndBolt:
    VECC T 3 A_TakeInventory("VectorBolt",1)
    VECC UV 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    VECC W 3 A_PlayWeaponSound("vector/bolt")
    VECC XYZ 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    VECD ABCDE 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    VECA K 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    VECA L 0 A_ReFire
    Goto Ready+16
  ReloadStart_SOH:
    VECC A 0 A_JumpIfInventory("VectorToken",1,"Reload3")
    VECC A 2
    VECC BCD 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    VECC E 2 A_PlaySoundEx("vector/clipout","SoundSlot5")
    VECC FGHIJK 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	VECC M 0 A_FireCustomMissile("SMGEmptyMagExtSpawner",0,0,0,1)
	VECC M 0 A_GiveInventory("VectorToken",1)
	goto Reload3
  Reload3:
    VECI LM 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    VECC N 2 A_TakeInventory("Reloading",1)
    VECC O 2 A_PlayWeaponSound("vector/clipin")
    Goto ReloadAmmo_SOH
  ReloadAmmo_SOH:
    VECC P 0 A_JumpIfInventory("VectorClip2",45,"ReloadEnd_SOH")
	VECC W 0 A_TakeInventory("VectorToken",1)
    VECC P 0 A_JumpIfInventory("VectorAmmo",1,1)
    Goto ReloadEnd_SOH
    VECC P 0 A_GiveInventory("VectorClip2",1)
    VECC P 0 A_TakeInventory("VectorAmmo",1)
    Goto ReloadAmmo_SOH
  ReloadEnd_SOH:
    VECC PQRS 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    VECC T 2 A_JumpIfInventory("VectorBolt",1,"ReloadEndBolt_SOH")
    VECE AB 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    VECA GHIJK 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    VECA L 0 A_ReFire
    Goto Ready+16
  ReloadEndBolt_SOH:
    VECC T 2 A_TakeInventory("VectorBolt",1)
    VECC U 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    VECC V 2 A_PlayWeaponSound("vector/bolt")
    VECC WXYZ 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    VECD ABCDE 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    VECA K 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    VECA L 0 A_ReFire
    Goto Ready+16
  ReloadStartAim:
    VECF F 0 A_ZoomFactor(1.0)
    VECF FE 1
    VECF E 0 A_TakeInventory("Aiming",1)
    VECF DCBA 1
    VECF A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    Goto ReloadStart+2
  PostReloadAlt:
    G18A I 0 A_JumpIfInventory("VectorToken",1,"Reload")
    VECF F 0 A_ZoomFactor(1.2)
    VECF E 0 A_GiveInventory("Aiming",1)
	VECF A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    VECF ABCDEF 1
    Goto AltHold
  AltFireHoldAim:
    "####" "#" 0 A_JumpIfInventory("VectorClip2",1,1)
	Goto Reload
    VECF G 0 A_PlayWeaponSound("vector/fire")
	VECI T 3 A_TakeInventory("VectorClip2",1)
    VECF G 0 A_FireCustomMissile("WeaponSmokePuffLight",0,0,0,-1)
    VECF G 0 BRIGHT A_GunFlash
    VECF G 1 BRIGHT A_FireCustomMissile("HHCBVECTOR", frandom(-1.95,1.95), 1, 0, 4, 0, frandom(-1.95,1.95))
	VECF G 0 A_SpawnItemEx("BulletCasing",Cos(Pitch)*30,3,33-(Sin(Pitch)*34),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    VECF G 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    TNT1 A 0 A_JumpIfInventory("VectorClip2",10,2)
    TNT1 A 0 A_PlaySound("m9/lock")
    VECF H 1
    "####" "#" 0 A_JumpIfInventory("VectorClip2",1,1)
	Goto Reload
    VECF I 1 A_ReFire
    Goto Ready+22
  }
}

actor VectorClip2 : Ammo
{
    inventory.icon "CLIPA0"
    inventory.amount 0
    inventory.maxamount 45
    ammo.backpackamount 0
    ammo.backpackmaxamount 45
    +IGNORESKILL
}

actor VectorExMags : Inventory
{
    inventory.amount 0
    inventory.maxamount 1
}

actor VectorPickup : CustomInventory
{
  inventory.pickupmessage "You got the KRISS Vector submachinegun."
  inventory.pickupsound "vector/bolt"
  +INVENTORY.AUTOACTIVATE
  //inventory.respawntics 70
  scale 0.12
  States
  {
  Spawn:
    WEAP A -1
    stop
  Pickup:
    WEAP A 0
    WEAP A 0 A_JumpIf((ACS_NamedExecuteWithResult("RefCheckVar",0,0,0)) == 1, "PickupStay")
    WEAP A 0 A_JumpIfInventory("KRISS Vector",1,"AmmoPickup") // If the player already has this weapon, they get more ammo for it
    WEAP A 0 A_JumpIfInventory("KRISS Vector Ex Mags",1,"AmmoPickup")
    WEAP A 0 A_JumpIfInventory("Perk1_OneManArmy",1,"OneManArmy")
    WEAP A 0 A_JumpIfInventory("MaxWeaponsFilled",82,"FailPickup2")
	WEAP A 0 A_GiveInventory("MaxWeaponsFilled",19)
    WEAP A 0 ACS_NamedExecuteWithResult("RefPickU",10,0,0)
    stop
  PickupStay:
    WEAP A 0
    WEAP A 0 A_JumpIfInventory("KRISS Vector",1,"FailPickup") // If the player already has this weapon, they get more ammo for it
    WEAP A 0 A_JumpIfInventory("KRISS Vector Ex Mags",1,"FailPickup")
    WEAP A 0 A_JumpIfInventory("Perk1_OneManArmy",1,"OneManArmy")
    WEAP A 0 A_JumpIfInventory("MaxWeaponsFilled",82,"FailPickup2")
	WEAP A 0 A_GiveInventory("MaxWeaponsFilled",19)
    WEAP A 0 ACS_NamedExecuteWithResult("RefPickU",10,0,0)
    WEAP A 0 ACS_NamedExecuteWithResult("RefPickC",10,0,0)
    WEAP A 0 A_PlaySound("vector/bolt")
    fail
  AmmoPickup:
    WEAP A 0
    WEAP A 0 A_JumpIfInventory("VectorAmmo",0,"FailPickup")
    WEAP A 0 A_GiveInventory("VectorAmmo",30)
    stop
  OneManArmy:
    WEAP A 0
	WEAP A 0 A_JumpIfInventory("MaxWeaponsFilled",119,"FailPickup2")
	WEAP A 0 A_GiveInventory("MaxWeaponsFilled",19)
	WEAP A 0 ACS_NamedExecuteWithResult("RefPickU",10,0,0)
	stop
  FailPickup:
    WEAP A 1
    fail
  FailPickup2:
    WEAP A 1
    WEAP A 0 ACS_NamedExecuteAlways("RefSlots",0,9,0,0)
    fail
  }
}

actor VectorDrop : VectorPickup
{
  States
  {
  Spawn:
    WEAP A -1
    stop
  Pickup:
    WEAP A 0
    WEAP A 0 A_JumpIfInventory("KRISS Vector",1,"AmmoPickup") // If the player already has this weapon, they get more ammo for it
    WEAP A 0 A_JumpIfInventory("KRISS Vector Ex Mags",1,"AmmoPickup")
    WEAP A 0 A_JumpIfInventory("Perk1_OneManArmy",1,"OneManArmy")
    WEAP A 0 A_JumpIfInventory("MaxWeaponsFilled",82,"FailPickup2")
	WEAP A 0 A_GiveInventory("MaxWeaponsFilled",19)
    WEAP A 0 ACS_NamedExecuteWithResult("RefPickU",10,0,0)
    stop
  }
}

actor VectorDrop2 : VectorDrop
{
  States
  {
  Spawn:
    WEAP A -1
    stop
  Pickup:
    WEAP A 0
    WEAP A 0 A_JumpIfInventory("KRISS Vector",1,"AmmoPickup") // If the player already has this weapon, they get more ammo for it
    WEAP A 0 A_JumpIfInventory("KRISS Vector Ex Mags",1,"AmmoPickup")
    WEAP A 0 A_JumpIfInventory("Perk1_OneManArmy",1,"OneManArmy")
    WEAP A 0 A_JumpIfInventory("MaxWeaponsFilled",82,"FailPickup2")
	WEAP A 0 A_GiveInventory("MaxWeaponsFilled",19)
    WEAP A 0 ACS_NamedExecuteWithResult("RefPickU",10,0,0)
    stop
  AmmoPickup:
    WEAP A 0
    stop
  }
}

actor HHCBVECTOR : HHBullet
{
  damage (random(15,21))
  Speed 300
  States
  {
  Spawn:
    TNT1 A 20
    stop
  Death:
    TNT1 A 0 A_SpawnItemEx("ImpactSmokePuff", 0, 0, 0, 0, 0, 0, 0, 128, 0)
    TNT1 A 5 A_PlaySound("generic/ricochet")
    stop
  XDeath:
    TNT1 A 0 A_GiveToTarget("HitIndicator",1)
    TNT1 A 5 A_PlaySound("generic/ricochets")
    stop
  Crash:
    TNT1 A 0 A_GiveToTarget("HitIndicator",1)
    TNT1 A 0 A_SpawnItemEx("ImpactSmokePuff_2", 0, 0, 0, 0, 0, 0, 0, 128, 0)
    TNT1 A 5 A_PlaySound("generic/ricochet")
    stop
  }
}