actor ProxBomb : BrutalWeapon 
{
  Inventory.PickupMessage "$GOTMINES"
  Obituary "%o blundered into %k's claymore mine."
  Weapon.AmmoUse 1
  Weapon.AmmoGive 1
  Weapon.AmmoType "proxbombammo"
  Weapon.SlotNumber 9
  Weapon.Selectionorder 8888
  Inventory.PickupSound "Claymore/Place"
  +WEAPON.NOALERT
  +UNDROPPABLE
  SCALE 0.4
  States
  {
  Ready:
  Selectanimation:
	TNT1 A 0 a_overlay(4,"DetonatorSelect",true)
    TNT1 A 0 A_Jumpifinventory("proxbombAMMO",1,1)
	goto SelectNoAmmo
    PR0X N 1 
	TNT1 A 0 A_JumpIfInventory("detonationmode", 1, 10)
	PR0X OPQRSTUV 1 A_WeaponReady(WRF_NOFIRE)	
	PR0X V 5 A_WeaponReady(WRF_NOFIRE)	
	goto ready3
	PR0X ABCDEFGH 1 A_WeaponReady(WRF_NOFIRE)	
	PR0X H 5 A_WeaponReady(WRF_NOFIRE)	
	goto ready3
	
SelectNoAmmo:
	TNT1 A 12
Ready3:
	"####" "#" 0 A_OVERLAY(3,"DETONATORSTAY",false)
	"####" "#" 0 A_JumpIfInventory("STARTDUALWIELD", 1, "changemode")
	"####" "#" 0 A_Jumpifinventory("kicking",1, "DOKICKPROXBOMB")
	"####" "#" 0 A_Jumpifinventory("proxbombAMMO",1,"HasAmmo")
	TNT1 A 1 A_WeaponReadyLit
	"####" "#" 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")
    loop
HasAmmo:
	"####" "#" 0 A_JumpIfInventory("detonationmode", 1, "DetoReady")
	PR0X V 1 A_WeaponReadyLit
	goto Ready3
	DetoReady:
	PR0X I 1 A_WeaponReadyLit
	goto Ready3


	goingtoaction:
		TNT1 A 0 A_PlaySound("weapons/changing")
		TNT1 A 0 A_TakeInventory("StartDualWield", 1)
		TNT1 A 0 A_TakeInventory("readythrow", 1)
		TNT1 A 0 A_JumpIfInventory("weargasmask", 1, "wearanimation")
		TNT1 A 0 A_JumpIfInventory("removegasmask", 1, "removeanimation")
		TNT1 A 0 A_JumpIfInventory("battledrugtoken",1,"drugshot")
		TNT1 A 0 A_JumpIfInventory("BANDAGETOKEN",1,"BANDAGE")
		goto repair	
	
  Deselect:
	CLAY A 0 A_OVERLAY(4,"DETONATORDESELECT")
	TNT1 A 0 a_Takeinventory("proxbombselected",1)
	TNT1 A 0 A_JumpIfInventory ("proxbombAMMO",1,1)
	GOTO DESELECTLOOP
	
	TNT1 A 0 A_JumpIfInventory("detonationmode", 1, 5)
	PR0X WWXY 1    //prox deselect
    goto Deselectloop

	PR0X JKLM 1     //remote deselect
	
   DeselectLoop:
   CLAY A 0 A_Lower
   loop

  Select: 
	TNT1 A 0 A_Overlay(-10,"FirstPersonLegsStand") 
 		TNT1 A 0 a_removelight(1)
		TNT1 A 0 A_removelight(2) 
	TNT1 A 0 SetPlayerProperty(0,0,2)
	TNT1 A 0 ACS_NAMEDEXECUTE("WEAPONSELECT",0)
	TNT1 A 0 A_SetRoll(0)
  SelectLoop:
	PINC A 0 A_Raise
	loop

  Fire:
	TNT1 A 0 A_JumpIfInventory ("proxbombAMMO",1,1)
	goto Ready3
	CLAY A 0 A_OVERLAY(4,"DETONATORTHROW")
	TNT1 A 0 A_JumpIfInventory("detonationmode", 1, "FIREREMOTE")
	PR0X VWXY 1
	TNT1 A 10
    TNT1 A 0 A_PLaySound ("GRNTOSS")
    TNT1 A 0 A_Firecustommissile("PROXBOMBdropped",0,1,0,0)
    THRO ABCDEFGHI 1
    goto Ready
	
 FIREREMOTE:
    PR0X JKLM 1
	TNT1 A 10
    TNT1 A 0 A_PlaySound ("Claymore/Place")
   TNT1 A 0 A_Firecustommissile("PROXBOMBdropped",0,1,0,0)
    THRO ABCDEFGHI 1
    goto Ready
	
	ALTFIRE:
	CLAY A 0 A_clearoverlays(3,3)
	TNT1 A 0 A_JumpIfInventory("proxbombammo", 1, 1)	
	goto shownothing
	TNT1 A 0 A_JumpIfInventory("detonationmode", 1, "ShowRemotes")
	
	ShowMines:
	CLAY A 0 A_OVERLAY(5,"DETONATORPRESS",true)
	PR0X V 17
	goto ready3
	
	ShowRemotes:
	CLAY A 0 A_OVERLAY(5,"DETONATORPRESS",true)
	PR0X H 17
	goto ready3
	
	ShowNothing:
	CLAY A 0 A_OVERLAY(5,"DETONATORPRESS",true)
	TNT1 A 17
	goto ready3
	
	Changemode:
		TNT1 A 0 a_Takeinventory("STARTDUALWIELD",1)
		TNT1 A 0 A_JumpIfInventory("proxbombammo", 1, 1)
		GOTO JustSwitch
		TNT1 A 0 A_JumpIfInventory("detonationmode", 1, "SwitchToMines")
		
	SwitchToRemote:
		TNT1 A 0 a_Giveinventory("detonationmode",1)
		CLAY A 0 A_OVERLAY(4,"DETONATORDESELECT")
		PR0X VWXY 1
		TNT1 A 2
		DETO A 0 a_playsound("GRNPIN")
		PROX ABCDEFFFFF 1
		DETO A 0 a_playsound("BOOP3")
		PROX EDCBA 1
		TNT1 A 4
		goto Ready
		
	SwitchToMines:
		TNT1 A 0 a_Takeinventory("detonationmode",1)
		CLAY A 0 A_OVERLAY(4,"DETONATORDESELECT")
		PR0X IJKLM 1
		TNT1 A 1
		DETO A 0 a_playsound("GRNPIN")
		PROX ABCDEFGHI 1
		DETO A 0 a_playsound("BOOP3")
		PROX JKLMNOPQ 1
		goto Ready
		
	JustSwitch:
		TNT1 A 0 A_JumpIfInventory("detonationmode", 1, 2)
		TNT1 A 0 a_Giveinventory("detonationmode",1)
		goto Ready3
		TNT1 A 0 a_Takeinventory("detonationmode",1)
		goto Ready3

///SPRINT

	CheckSprint:
		TNT1 A 0 A_WeaponReady(WRF_NOFIRE)
		CLAY G 0 A_JumpIfInventory("IsStandingStill", 1, "Ready3")
		CLAY G 0 A_JumpIfInventory("IsTacticalClass", 1, "StartSprint")
		Goto Ready
		
	StartSprint:
		TNT1 A 0 A_JumpIfInventory("LARGESTAMINA", 1, 2)
		TNT1 A 0 A_JumpIfInventory("UsedStamina", 70, "Trip")
		TNT1 A 0 A_JumpIfInventory("UsedStamina", 1400, "Trip")
		CLAY A 0 A_OVERLAY(4,"DETONATORDESELECT")
		TNT1 A 0 A_JumpIfInventory("proxbombammo", 1, 2)
		TNT1 A 0 A_Jump(256,"Sprinting")
		TNT1 A 0 A_JumpIfInventory("detonationmode", 1, "StartsprintREMOTE")	
		PR0X WWXY 1   A_WeaponReady(WRF_NOFIRE)	
		goto Sprinting
		
		StartSprintREMOTE:
		PR0X JKLM 1 A_WeaponReady(WRF_NOFIRE)		
		
	Sprinting:	
		CLAY G 0 offset(-9,32) 
		CLAY G 0 offset(-9,32) A_JumpIfInventory("IsStandingStill", 1, "Ready3")
		TNT1 A 0 A_JumpIfInventory("LARGESTAMINA", 1, 2)
		TNT1 A 0 A_JumpIfInventory("UsedStamina", 100, "StopSprintTired")
		CLAY G 0 offset(-9,32) A_JumpIfInventory("UsedStamina", 2000, "StopSprintTired")
		PLAY A 0 offset(-9,32) ACS_ExecuteAlways(852, 0, 0, 0, 0)//Makes player faster.
		CLAY G 0 offset(-9,32) A_JumpIfInventory("Powerstrength2", 1, 2)
		CLAY G 0 offset(-9,32) A_GiveInventory("UsedStamina", 3)
		CLAY G 0 offset(-9,32)
		DETO B  1 offset(-9,34) A_SetPitch(pitch -0.5)
		DETO B  1 offset(-6,36) A_SetPitch(pitch -0.5)
		DETO B  1 offset(-3,38) A_SetPitch(pitch -0.5)
		DETO B  1 offset(0,38) A_SetPitch(pitch -0.5)
		DETO B  1 offset(3,36) A_SetPitch(pitch -0.5)
		DETO B  1 offset(6,34) A_SetPitch(pitch -0.5)
		DETO B  1 offset(9,32) A_SetPitch(pitch -0.5)
		CLAY G 0 offset(9,32) A_WeaponReady(WRF_NOBOB)
		CLAY G 0 A_JumpIfInventory("Kicking",1,"DOKICKPROXBOMB")
        CLAY G 0 A_JumpIfInventory("Taunting",1,"Taunt")
        CLAY G 0 A_JumpIfInventory("Reloading",1,"Reload")
		CLAY G 0 offset(-9,32) A_GiveInventory("UsedStamina", 3)
		CLAY G 0 offset(9,33) A_SpawnItemEx("FootStep", 0, 0, 2, 0, 0, -4)
		DETO B  1 offset(9,34) A_SetPitch(pitch +0.5)
		DETO B  1 offset(6,36) A_SetPitch(pitch +0.5)
		DETO B  1 offset(3,38) A_SetPitch(pitch +0.5)
		DETO B  1 offset(0,38) A_SetPitch(pitch +0.5)
		DETO B  1 offset(-3,36) A_SetPitch(pitch +0.5)
		DETO B  1 offset(-6,34) A_SetPitch(pitch +0.5)
		DETO B  1 offset(-9,32) A_SetPitch(pitch +0.5)
		CLAY G 0 offset(-9,32) A_WeaponReady(WRF_NOBOB)
		CLAY G 0 offset(-9,32) A_JumpIfInventory("IsRunning", 1, "Sprinting")
		Goto StopSprint
		
	StopSprintTired:
		DETO B 1
		PLAY A 0 ACS_ExecuteAlways(853, 0, 0, 0, 0)//Makes player slower.
		CLAY G 0 A_PlaySound("Tired", 2)
		TNT1 A 0 A_Jumpifhealthlower(25,"rupturesprint")
		DETO B 25
		Goto Ready
	
	StopSprint:
		DETO B 1
		TNT1 A 0 A_JumpIfInventory("LARGESTAMINA", 1, 2)
		TNT1 A 0 A_JumpIfInventory("UsedStamina", 70, "StopSprintTired")
		TNT1 A 0 A_JumpIfInventory("UsedStamina", 1400, "StopSprintTired")
		PLAY A 0 ACS_ExecuteAlways(853, 0, 0, 0, 0)//Makes player slower.
		Goto Ready	
		
  Spawn:
    PROX S -1
    stop
	
/////// OVERLAYS

	DetonatorSelect:
	TNT1 A 7
	DETO ABCDEFGHH 1
	stop
	
	DetonatorDESelect:
	DETO GDCBA 1
	stop
	
	DetonatorStay:
	DETO G 1 
	stop
	
	Detonatorthrow:
	DETO G 14
	DETO FED 2 
	DETO CBA 1
	stop
	
	Detonatorpress:
	DETO JKLM 1
	DETO A 0 a_playsound("DRYFIRE")
	DETO A 0 A_SPAWNITEM("DETONATIONTRIGGER",0,0,0)
	DETO NOPPPPQRSTUVW 1
	stop

//// KICKING

	Dokickproxbomb:
		TNT1 A 0 A_JumpIfInventory("isdoomguy", 1, 4)
		TNT1 A 0 A_JumpIfInventory("LARGESTAMINA", 1, 2)
		TNT1 A 0 A_JumpifInventory("UsedStamina",95,4)
		TNT1 A 0 A_JumpifInventory("UsedStamina",1995,3)
		TNT1 A 0 A_overlay(3,"kickproxbomb")
		TNT1 A 0 a_Jump(256,"Dokick")
		goto Ready3
		TNT1 A 0 A_overlay(3,"kickproxbombtired")
		TNT1 A 0 a_Jump(256,"Dokick")
		goto Ready3	
		
	//prox mine	
	kickproxbomb:
		TNT1 A 0 A_JumpIfInventory("proxbombammo", 1, 1)
		goto kickdetonator
		TNT1 A 0 A_JumpIfInventory("detonationmode", 1, "kickremote")	
		PR0X WXY 1
		TNT1 A 12 
		PR0X YXW 1 
		TNT1 A 0 A_JumpIfInventory("airkicking", 1, 2)
		TNT1 A 0 A_JumpIfInventory("isSliding", 1, 2)
		stop
		PR0X W 10
		STOP
		PR0X WWXY 1    //prox deselect
		TNT1 A 6
		stop
		
	kickproxbombtired:
		TNT1 A 0 A_JumpIfInventory("proxbombammo", 1, 1)
		goto kickdetonatortired
		TNT1 A 0 A_JumpIfInventory("detonationmode", 1, "kickremotetired")	
		PR0X WXY 2
		TNT1 A 37
		PR0X YXW 2 
		STOP	
	
	//remote
	kickremote:
		PR0X EDC 1
		PR0X B 12 
		PR0X CDE 1 
		TNT1 A 0 A_JumpIfInventory("airkicking", 1, 2)
		TNT1 A 0 A_JumpIfInventory("isSliding", 1, 2)
		stop
		PR0X E 10
		STOP
		PR0X JKLM 1     //remote deselect
		TNT1 A 6
		stop
		
	kickremotetired:
		PR0X EDC 2
		PR0X B 37
		PR0X CDE 2 
		STOP	
		
	//no ammo
	kickDETONATOR:
		DETO EDC 1
		DETO B 12 
		DETO CDE 1 
		TNT1 A 0 A_JumpIfInventory("airkicking", 1, 2)
		TNT1 A 0 A_JumpIfInventory("isSliding", 1, 1)
		stop
		DETO E 10
		STOP
		
	kickDETONATORtired:
		DETO EDC 2
		DETO B 37
		DETO CDE 2 
		STOP	
  }
}

ACTOR ProxBombDropped
{
	Radius 4
	Height 4
	Projectile
	Speed 8
    Damage (random (2, 2))
	SCALE 0.4
    Gravity 0.9
	Projectile
	-NOGRAVITY
	+MISSILE
	-NOTELEPORT
	+floorclip
	+THRUSPECIES
	+BOUNCEONWALLS
	+BOUNCEONCEILINGS
	+BOUNCEONFLOORS
	+canbouncewater
	 BOUNCESOUND "Claymore/Place"
	Species "MARINES"
	damagefactor "GibRemoving", 0.0
	BounceFactor 0.6
	WallBounceFactor 0.6
    Health 5
	States
	{
	Spawn:
		PROX S 0
	Travel:
	PROX S 50
	Death:
		TNT1 A 0 A_jUMPIFINTARGETINVENTORY("DETONATIONMODE",1,2)
		TNT1 A 0 A_SPAWNITEM("ACTIVEPROXBOMB",0,0,0,0)	
		STOP
		TNT1 A 0 A_SPAWNITEM("REMOTEPROXBOMB",0,0,0,0)	
		STOP
	
	/*Crash:
	XDeath:
		TNT1 A 0 a_changeflag("SEEKERMISSILE",1)
		PROX S 1 
		TNT1 A 0 A_jUMPIFINTARGETINVENTORY("DETONATIONMODE",1,"StickRemote")
		
	StickMine:
	PROX S 2 A_PlaySound ("BEPBEP")
    PROX RSR 2
	PROX SR 1
	TNT1 A 1 A_PlaySound ("weapons/rocklx")
    TNT1 A 0 A_SpawnItem ("PROXBoom", 0, 8)
	stop
	
	StickRemote:
	PROX T 1 A_CHECKPROXIMITY("BOOM","DetonationTrigger", 2000,1, CPXF_NOZ | CPXF_COUNTDEAD)
    Loop
	*/
		
}}

ACTOR ProxBombGL : PROXBOMBDROPPED
{
SPEED 50
BounceFactor 0.2
WallBounceFactor 0.5
GRAVITY 0.7
states
{
Spawn:
		PROX S 0
		PROX S 0
Travel:
	PROX Y 10
	PROX V 4
	PROX W 4
	PROX X 4
	PROX U 10
	GOTO DEATH
}}


ACTOR ActiveProxbomb : switchabledecoration
{
  Health 1000
  Radius 16
  Height 16
  MaxTargetRange 48
  Scale 0.4
  painchance "disarm", 256
  SPECIES "PROXBOMBS"
   +USESPECIAL
  Activation THINGSPEC_Switch
  +SHOOTABLE
  +NOBLOOD
  +FRIENDLY
  Obituary "%o strayed too close to a mine."
  damagefactor "GibRemoving", 0.0	damagefactor "Trample", 0.0
	damagefactor "TeleportRemover", 0.0 damagefactor "use", 0.0
  	DamageFactor "CauseSplash", 0.0 DamageFactor "CauseObjectsToSplashSlime", 0.0 DamageFactor "CauseObjectsToSplashNukage", 0.0
	DamageFactor "CauseObjectsToSplashBlood", 0.0 DamageFactor "CauseObjectsToSplashLava", 0.0 damagefactor "Crush", 0.0
	 DamageFactor "plasma", 1000.0 DamageFactor "minor", 1000.0 DamageFactor "ExplosiveImpact", 1000.0 DamageFactor "Explosives", 1000.0 
	DamageFactor "Fire", 1000.0 DamageFactor "Shotgun", 1000.0 DamageFactor "Ssg", 1000.0 DamageFactor "bullet", 1000.0 DamageFactor "minigun", 1000.0 DamageFactor "railgun", 1000.0 DamageFactor "beartrap", 1000.0
  
  States
  {
  Spawn:
	CLAP A 0
    PROX R 1
	CLAP A 0 A_changeflag("nodamage",0)
	PROX R 1 A_PlaySound ("BEP")
   Goto waiting
   
   waiting:
    PROX R 1 A_LookEx (LOF_NOSOUNDCHECK, 0, 48, 70, 360, "SEE")
	TNT1 A 0 A_CHECKPROXIMITY("BOOM","DetonationTrigger", 2000,1, CPXF_NOZ | CPXF_COUNTDEAD)
    Loop
		
  See:
    PROX R 1 A_Chase ("Boom", 0, CHF_DONTMOVE)
	TNT1 A 0 A_CHECKPROXIMITY("BOOM","DetonationTrigger", 2000,1, CPXF_NOZ | CPXF_COUNTDEAD)
    Loop

death.plasma:
death.minor:
death.explosiveimpact:
death.explosives:
death.fire:
death.shotgun:
death.SSG:
death.bullet:
death.minigun:
death.railgun:
death.beartrap:
MELEE:
  Boom:
	PROX S 2 A_PlaySound ("BEPBEP")
    PROX RSR 2
	PROX SR 1
	TNT1 A 1 A_PlaySound ("weapons/rocklx")
    TNT1 A 0 A_SpawnItem ("PROXBoom", 0, 8)
	stop
	
  Death:
    PROX S 1
	TNT1 A 0
	goto waiting
	
 Active:
 Inactive:
	TNT1 A 0
	TNT1 A 0 A_PlaySound("CHGNPKUP", 6)
	TNT1 A 0 A_SpawnItem ("ProxBomb", 0, 7, 0, 0)
    stop
  }
}

ACTOR REMOTEProxbomb : ACTIVEPROXBOMB
{
STATES
{
Spawn:
	CLAP A 0
    PROX T 1
	CLAP A 0 A_changeflag("nodamage",0)
	PROX T 1 A_PlaySound ("BEP")
   Goto waiting

   waiting:
    PROX T 1 A_CHECKPROXIMITY("BOOM","DetonationTrigger", 2000,1, CPXF_NOZ | CPXF_COUNTDEAD)
    Loop
		
  See:
    PROX T 1 
    goto waiting
}}

actor PROXBOOM
{
  +NOINTERACTION
  Decal "Scorch"
  DEATHSOUND "DSBAREXP"
  States
  {
  Spawn:
    TNT1 A 0
  DEATH:
  TNT1 A 1
    TNT1 A 0 A_Explode(950, 100,0,1,75,10,30,"hitpuff", "ExplosiveImpact")
    TNT1 A 0 A_Explode(100, 200, XF_THRUSTZ , 0, 0, 0, 0, "bulletpuff","Kick")
	TNT1 A 0 A_SpawnItemEx ("ExplosionSplashSpawner", 0, 0, -20)
		TNT1 A 0 A_SpawnItemEx ("DetectFloorCrater",0,0,30,0,0,0,0,SXF_NOCHECKPOSITION,0)
	    TNT1 A 0 A_SpawnItemEx ("DetectCeilCrater",0,0,30,0,0,0,0,SXF_NOCHECKPOSITION,0)
		TNT1 A 0 A_SpawnItemEx ("ExplosionFlareSpawner",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
	    TNT1 A 0 A_SpawnItemEx ("UnderwaterExplosion",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
		
    TNT1 AAAAAAAAAA 0 A_CustomMissile ("BDExplosionparticlesBig", 0, 0, random (0, 360), 2, random (0, 360))
	TNT1 AAAAA 0 A_CustomMissile ("BDExplosionparticles2", 0, 0, random (0, 360), 2, random (0, 90))
	TNT1 AAAA 0 A_CustomMissile ("SmallExplosionFlames", 0, 0, random (0, 360), 2, random (0, 360))
	EXPL A 0 Radius_Quake (2, 24, 0, 15, 0)
	BEXP B 0 BRIGHT A_Scream
    TNT1 A 0 A_ALertMonsters
	TNT1 A 0 A_PlaySound("FAREXPL", 3)
	TNT1 A 0 A_SpawnItem("BarrelExplosionSmokeColumn")
	TNT1 AAAAA 12
    stop
  }
}

actor enemyproxbomb : activeproxbomb
{
-friendly
health 20
DamageFactor "disarm", 5000.0
  States
  {
  MELEE:
  Boom:
	PROX S 2 A_PlaySound ("BEPBEP")
    PROX RSR 2
	PROX SR 1
	PROX R 10
	PROX S 2 A_PlaySound ("BEP")
	PROX R 10	
	PROX R 1 A_PlaySound ("weapons/rocklx")
    TNT1 A 0 A_SpawnItem ("PROXBoom", 0, 8)
	stop
	
Active:
 Inactive:
	TNT1 A 0
	goto Boom
	
	pain.disarm:
	Death.Disarm:
	TNT1 A 0 A_SpawnItem("proxbomb")
	TNT1 A 0
	Stop
	
	}
}

actor EnemyPROXBOOM
{
  +NOINTERACTION
  States
  {
  Spawn:
    TNT1 A 0
    TNT1 A 0 A_Explode(950, 100)
    TNT1 A 0 A_Explode(100, 200, 0, 0, 0, 0, 0, "bulletpuff", "Kick")
	TNT1 A 0 A_SpawnItemEx ("ExplosionSplashSpawner", 0, 0, -20)
		TNT1 A 0 A_SpawnItemEx ("DetectFloorCrater",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
	    TNT1 A 0 A_SpawnItemEx ("DetectCeilCrater",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
		TNT1 A 0 A_SpawnItemEx ("ExplosionFlareSpawner",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
	    TNT1 A 0 A_SpawnItemEx ("UnderwaterExplosion",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
		
    TNT1 AAAAAAAAAA 0 A_CustomMissile ("BDExplosionparticlesBig", 0, 0, random (0, 360), 2, random (0, 360))
	TNT1 AAAAA 0 A_CustomMissile ("BDExplosionparticles2", 0, 0, random (0, 360), 2, random (0, 90))
	TNT1 AAAA 0 A_CustomMissile ("SmallExplosionFlames", 0, 0, random (0, 360), 2, random (0, 360))
	EXPL A 0 Radius_Quake (2, 24, 0, 15, 0)
	BEXP B 0 BRIGHT A_Scream
    TNT1 A 0 A_ALertMonsters
	TNT1 A 0 A_PlaySound("FAREXPL", 3)
	TNT1 A 0 A_SpawnItem("BarrelExplosionSmokeColumn")
	TNT1 AAAAA 12
    stop
  }
}

ACTOR ProxbombAmmo : Ammo
{
  scale 0.4
  Inventory.PickupMessage "$GOTMINES"
  Inventory.Amount 1
  Inventory.MaxAmount 6
  Ammo.BackpackAmount 1
  Ammo.BackpackMaxAmount 12
  Inventory.PickupSound "Claymore/Place"
  Inventory.Icon "PR0XZ0"
  tag"Proximity Bomb"
  HEALTH 10
  +NOTELEFRAG
  +FORCEXYBILLBOARD
  States
  {
  Spawn:
	PROX S 1
	
		Stay:
		TNT1 A 0 ACS_NamedExecuteAlways("BDShootableAmmo")//Checks if shootable ammo is enabled
		PROX S 4
		TNT1 A 0 A_JumpIfInventory("Clip1", 1, "NoShootable")
		PROX S -1
		Stop
	
	NoShootable:
		PROX S 1
		TNT1 A 0 A_ChangeFlag("SHOOTABLE", 0)
		PROX S -1
		Stop
		
	Death:
		TNT1 A 0
		TNT1 A 0 A_SpawnItemEx ("ExplosionSplashSpawner", 0, 0, -20)
        TNT1 A 0 A_SpawnItemEx ("DetectFloorCrater",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
	    TNT1 A 0 A_SpawnItemEx ("DetectCeilCrater",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
	    TNT1 A 0 A_SpawnItemEx ("UnderwaterExplosion",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
        TNT1 A 0 A_SpawnItemEx ("ExplosionFlareSpawner",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
        TNT1 AAAAAAAAA 0 A_CustomMissile ("ExplosionParticleHeavy", 0, 0, random (0, 360), 2, random (0, 180))
        TNT1 AAAAAAAAAAAAAAAAAA 0 A_CustomMissile ("ExplosionParticleHeavy", 0, 0, random (0, 360), 2, random (0, 360))
		TNT1 AAAAAAAAA 0 A_CustomMissile ("ExplosionParticleVeryFast", 0, 0, random (0, 360), 2, random (0, 360))
        TNT1 AAAA 0 A_CustomMissile ("MediumExplosionFlames", 0, 0, random (0, 360), 2, random (0, 360))
        EXPL AAAA 0 A_CustomMissile ("ExplosionSmokeFast22", 0, 0, random (0, 360), 2, random (0, 360))
		EXPL A 0 A_CustomMissile ("BigNeoSmoke", 0, 0, random (0, 360), 2, random (0, 360))
		TNT1 A 0 A_SpawnItemEx ("RocketExplosion",0,0,13,0,0,0,0,SXF_NOCHECKPOSITION,0)
		//TNT1 A 0 A_SpawnItemEx ("RocketPenetrator",cos(-pitch)*42,0,0+(sin(pitch)*42),cos(-pitch)*40,0,sin(pitch)*40,0,SXF_TRANSFERPITCH)
		//TNT1 AA 0 A_SpawnItem("SuperExpensiveParticleSpawner")
		EXPL AAA 0 A_CustomMissile ("BarrelKaboom", 0, 0, random (0, 360), 2, random (0, 360))
		TNT1 A 0 A_Explode(1600, 100,0,1,75,20,30,"bulletpuff", "ExplosiveImpact")
		TNT1 A 0 A_Explode(300, 200, XF_THRUSTZ , 0, 0, 0, 0, "bulletpuff","Kick")
		TNT1 A 2
		TNT1 A 0 A_SpawnItemEx ("LiquidExplosionEffectSpawner",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
		TNT1 A 0 A_PlaySound("FAREXPL", 3)
		TNT1 A 15
		TNT1 A 0 A_PlaySound("distantexp", 5)
		TNT1 AAAAA 4 A_CustomMissile ("HeavyExplosionSmoke", 2, 0, random (0, 360), 2, random (0, 360))
		Stop	
  }
}

ACTOR detonationmode : Inventory { Inventory.MaxAmount 1 }

ACTOR detonationTRIGGER
{
RADIUS 5
HEIGHT 5
+THRUACTORS
STATES
{
SPAWN:
TNT1 A 20
DEATH:
TNT1 A 1
STOP
}}
