actor ClaymoreMine : Weapon 10200
{
  Inventory.PickupMessage "Picked up some claymore mines"
  Obituary "%o blundered into %k's claymore mine."
  Weapon.AmmoUse 1
  Weapon.AmmoGive 2
  Weapon.AmmoType "ClaymoreAmmo"
  Inventory.PickupSound "misc/i_pkup"
  +WEAPON.NOALERT
  States
  {
  Ready:
	CLAY A 0 A_JumpIfInventory("Kinfeammo",1,"UseKnife")
	CLAY A 0 A_JumpIfInventory("thrownade",1,"ThrowGrenade")
    CLAY A 1 A_WeaponReady
    loop
  ThrowGrenade:
     HNDG BCD 1
     HNDG E 1 A_PlaySound("weapons/grenadepin")
     HNDG FGHH 1
     HNDG I 1 A_PlaySound("weapons/grenadethr") 
     HNDG J 0 A_FireCustomMissile("ThrownGrenade",0,0,0,0)
     HNDG J 0 A_PlaySound("weapons/grenadethr")
     HNDG JKLMNOPQ 1
     HNDG Q 0 A_TakeInventory("thrownade")
     Goto Ready
  Useknife:
     KNFG A 0 A_jumpifinventory("Machete",1,"UseMachete")
     KNFG ABC 2
	 KNFG C 0 A_CustomPunch (110,1,0,"KnifePuff")
	 KNFG DEF 2
	 KNFG F 0 A_TakeInventory("Kinfeammo")
	 goto ready
  UseMachete:
     MHT4 ABC 2
	 MHT4 C 0 A_CustomPunch (450,1,0,"Machetepuff")
	 MHT4 DEFG 2
	 MHT4 G 0 A_TakeInventory("Kinfeammo")
	 goto ready
  Deselect:
    TNT1 A 0 A_JumpIfNoAmmo ("Deselect2")
    CLAY A 1 A_Lower
    loop
  Deselect2:
    TNT1 A 1 A_Lower
    loop
  Select: 
    CLAY A 1 A_Raise
    loop
  Fire:
    CLAY ABCDEFG 1
    TNT1 A 0 A_PlaySound ("Claymore/Place")
    TNT1 A 0 A_SpawnItem ("PlacedClaymore", 8)
    TNT1 A 0 A_JumpIfNoAmmo ("ChangeFist")
    TNT1 A 24
    CLAY GFEDCB 1
    CLAY A 1 A_ReFire
    goto Ready
  ChangeFist:
    TNT1 A 1 A_SelectWeapon("normalpistol")
    goto Ready
  Spawn:
    CLAA A -1
    stop
  }
}

ACTOR PlacedClaymore 10201
{
  Health 1
  Radius 16
  Height 16
  MaxTargetRange 48
  Scale 0.5
  +SHOOTABLE
  +NOBLOOD
  +FRIENDLY
  Obituary "%o strayed too close to a claymore."
  States
  {
  Spawn:
    CLAP A 1 A_LookEx (LOF_NOSOUNDCHECK, 0, 48, 0, 360)
    Loop
  See:
    CLAP A 1 A_Chase ("Melee", 0, CHF_DONTMOVE)
    Loop
  Melee:
    CLAP A 8 A_PlaySound ("Claymore/Trigger")
  Death:
    TNT1 A 1 A_PlaySound ("weapons/rocklx")
    TNT1 A 0 A_SpawnItem ("ClaymoreBoom", 0, 8)
    stop
  }
}


actor EnemyClaymore : PlacedClaymore 10202
{
  -FRIENDLY
  Translation "152:159=68:75", "9:12=76:79"
  States
  {
  Melee:
    CLAP A 16 A_PlaySound ("Claymore/Trigger")
  Death:
    TNT1 A 1 A_PlaySound ("weapons/rocklx")
    TNT1 A 0 A_SpawnItem ("EnemyClaymoreBoom", 0, 8)
    stop
  }
}

actor ClaymoreBoom
{
  +NOINTERACTION
  States
  {
  Spawn:
    TNT1 A 0
    TNT1 A 0 A_Explode
    MISL B 8 bright
    MISL C 6 bright
    MISL D 4 bright
    stop
  }
}

actor EnemyClaymoreBoom
{
  +NOINTERACTION
  States
  {
  Spawn:
    TNT1 A 0
    TNT1 A 0 A_Explode (100, 96)
    MISL B 8 bright
    MISL C 6 bright
    MISL D 4 bright
    stop
  }
}

ACTOR ClaymoreAmmo : Ammo
{
  Inventory.PickupMessage "Picked up some claymore mines."
  Inventory.Amount 2
  Inventory.MaxAmount 2
  Ammo.BackpackAmount 2
  Ammo.BackpackMaxAmount 2
  Inventory.Icon "CLAAA0"
  States
  {
  Spawn:
    CLAA A -1
    stop
  }
}


