
actor TacticalInsertion : RGUWeapon
{
  weapon.selectionorder 500
  inventory.pickupmessage "Snagged an item."
  states
  {
  Ready:
    M14A K 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    M14A K 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    TACT A 1 A_WeaponReady
    loop
  Deselect:
    TACT A 1 A_Lower
    loop
  Select:
    TACT A 1 A_Raise
	TACT A 0 ACS_ExecuteAlways(602,0,0,0,0)
    loop
  Fire:
    TACT A 0 A_JumpIf(ACS_ExecuteWithResult(610,0,0,0) == 1, "Fire2")
    TACT ABCD 3
    TACT E 3 A_PlayWeaponSound("tactical/insert")
    TACT FGHLMNOP 3
    TACT Q 3 A_PlayWeaponSound("tactical/insert")
    TACT RIHLMNOP 3
    TACT Q 3 A_PlayWeaponSound("tactical/insert")
    TACT R 3 A_PlaySound("tactical/flare")
    TACT IJK 3
    TNT1 A 35 ACS_ExecuteAlways(608,0,0,0,0)
    goto Ready
  Fire2:
    TACT A 35 ACS_ExecuteAlways(611,0,0,0,0)
    goto Ready
  AltFire:
    TACT A 35 ACS_ExecuteAlways(628,0,0,0,0)
    goto Ready
  Spawn:
    BKPK A 1
    stop
  FragGrenade:
    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_ExecuteAlways(602,0,0,0,0)
    U45A L 0 A_JumpIfInventory("Perk1_SOH_Pro",1,"FragGrenade_SOH")
    GRNA A 2 A_PlaySound("grenade/pinpull")
    GRNA BCDEFGH 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("FragGrenadeAmmo",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",0,0,0,16)
    GRNA MN 2 
    goto Ready+1
  FragGrenade_SOH:
    GRNA A 1 A_PlaySound("grenade/pinpull")
    GRNA BCDEFGH 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("FragGrenadeAmmo",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",0,0,0,16)
    GRNA MN 1 
    goto Ready+1
  KnifeAttack:
    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_ExecuteAlways(602,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_ExecuteAlways(599,0,0,0,0)
    KNFA AB 1
    KNFA B 0 A_PlaySound("knife/swing")
    KNFA CDE 1 A_CustomPunch(34,1,0,"KnifePuff",96)
    KNFA FGHIJKL 1 
    TNT1 A 30
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    goto Ready+1
  KnifeAttack_Commando:
    KNFA A 0 ACS_ExecuteAlways(599,0,0,0,0)
    KNFA AB 1
    KNFA B 0 A_PlaySound("knife/swing")
    KNFA CDE 1 A_CustomPunch(34,1,0,"KnifePuff",160)
    KNFA FGHIJKL 1 
    TNT1 A 30
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    goto Ready+1
  KnifeAttack_SOH:
    U45C A 0 A_JumpIfInventory("Perk3_Commando",1,"KnifeAttack_SOH_Commando")
    KNFA A 0 ACS_ExecuteAlways(599,0,0,0,0)
    KNFA AB 1
    KNFA B 0 A_PlaySound("knife/swing")
    KNFA CDE 1 A_CustomPunch(34,1,0,"KnifePuff",96)
    KNFA FGHIJKL 1 
    TNT1 A 20
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    goto Ready+1
  KnifeAttack_SOH_Commando:
    KNFA A 0 ACS_ExecuteAlways(599,0,0,0,0)
    KNFA AB 1
    KNFA B 0 A_PlaySound("knife/swing")
    KNFA CDE 1 A_CustomPunch(34,1,0,"KnifePuff",160)
    KNFA FGHIJKL 1 
    TNT1 A 20
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    goto Ready+1
  }
}

ACTOR TacticalInsertionPlaced
{
  Game Doom
  Radius 4
  Height 4
  +NOBLOCKMAP
  States
  {
  Spawn:
    CAND A 105 bright A_SpawnItemEx("WeaponSmokePuff", 0, 0, 14, 0, 0, 0, 0, 128, 0)
    loop
  Death:
    CAND A 35 bright
    stop
  }
}

//Gives the TacticalInsertion
actor TacticalInsertionPickup : CustomInventory
{
  inventory.pickupmessage "Tactical Insertion! \cgPlace on the ground to mark your next \cdrespawn."  
  inventory.pickupsound "misc/w_pkup"
  +INVENTORY.AUTOACTIVATE
  inventory.respawntics 1050
  scale 0.75
  States
  {
  Spawn:
    BKPK A -1
    stop
  Pickup:
    BKPK A 0 A_GiveInventory("TacticalInsertion",1)
    stop
  }
}

actor "Revival Kit" : RGUWeapon
{
  weapon.selectionorder 500
  inventory.pickupmessage "Snagged an item."
  states
  {
  Ready:
    M14A K 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    M14A K 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    TACT A 1 A_WeaponReady
    loop
  Deselect:
    TACT A 1 A_Lower
    loop
  Select:
    TACT A 1 A_Raise
	TACT A 0 ACS_ExecuteAlways(602,0,0,0,0)
    loop
  Fire:
    TACT ABCD 3
    TACT E 3 A_PlayWeaponSound("ranger/open")
    TACT FGHLMNOP 3
    TACT Q 3 A_PlayWeaponSound("ranger/insert")
    TACT R 0 A_PlaySound("scar/bolt")
    TACT R 3  A_FireBullets (1.0, 1.0, 0, 5, "RevivePuff", 0, 256)
    TACT IJK 3
    TNT1 A 35 
    goto Ready
  Spawn:
    BKPK A 1
    stop
  FragGrenade:
    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_ExecuteAlways(602,0,0,0,0)
    U45A L 0 A_JumpIfInventory("Perk1_SOH_Pro",1,"FragGrenade_SOH")
    GRNA A 2 A_PlaySound("grenade/pinpull")
    GRNA BCDEFGH 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("FragGrenadeAmmo",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",0,0,0,16)
    GRNA MN 2 
    goto Ready+1
  FragGrenade_SOH:
    GRNA A 1 A_PlaySound("grenade/pinpull")
    GRNA BCDEFGH 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("FragGrenadeAmmo",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",0,0,0,16)
    GRNA MN 1 
    goto Ready+1
  KnifeAttack:
    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_ExecuteAlways(602,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_ExecuteAlways(599,0,0,0,0)
    KNFA AB 1
    KNFA B 0 A_PlaySound("knife/swing")
    KNFA CDE 1 A_CustomPunch(34,1,0,"KnifePuff",96)
    KNFA FGHIJKL 1 
    TNT1 A 30
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    goto Ready+1
  KnifeAttack_Commando:
    KNFA A 0 ACS_ExecuteAlways(599,0,0,0,0)
    KNFA AB 1
    KNFA B 0 A_PlaySound("knife/swing")
    KNFA CDE 1 A_CustomPunch(34,1,0,"KnifePuff",160)
    KNFA FGHIJKL 1 
    TNT1 A 30
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    goto Ready+1
  KnifeAttack_SOH:
    U45C A 0 A_JumpIfInventory("Perk3_Commando",1,"KnifeAttack_SOH_Commando")
    KNFA A 0 ACS_ExecuteAlways(599,0,0,0,0)
    KNFA AB 1
    KNFA B 0 A_PlaySound("knife/swing")
    KNFA CDE 1 A_CustomPunch(34,1,0,"KnifePuff",96)
    KNFA FGHIJKL 1 
    TNT1 A 20
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    goto Ready+1
  KnifeAttack_SOH_Commando:
    KNFA A 0 ACS_ExecuteAlways(599,0,0,0,0)
    KNFA AB 1
    KNFA B 0 A_PlaySound("knife/swing")
    KNFA CDE 1 A_CustomPunch(34,1,0,"KnifePuff",160)
    KNFA FGHIJKL 1 
    TNT1 A 20
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    goto Ready+1
  }
}

actor RevivePuff : BulletPuff
{
  renderstyle Translucent
  alpha 0.5
  +NOBLOCKMAP
  +NOGRAVITY
  -ALLOWPARTICLES
  damagetype "Revive"
  +NOEXTREMEDEATH
  +PUFFONACTORS
  states
  {
  Spawn:
    TNT1 A 1
    TNT1 A 0 A_GiveToTarget("HitIndicator",1)
    PUFF A 0 A_Explode(5,64)
    stop
  }
}
