actor RemoteMineWep : BaseMM8BDMWep 10017
{
//$Category MM8BDM-Weapons
//$Title Remote Mine
//$Sprite REMIX0
Weapon.AmmoUse 2
Weapon.AmmoGive 28
Weapon.SlotNumber 5
Inventory.Pickupmessage "$PU_REMOTEMINE"
Obituary "$OB_REMOTEMINE"
Tag "$TAG_REMOTEMINE"
weapon.ammotype "RemoteMineAmmo"
inventory.icon "REMOI"
States
{
SpawnLoop:
REMI X -1
loop
Ready:
REMB A 0 ACS_ExecuteAlways(998,0,174)
REMB A 1 A_WeaponReady
Goto Ready+1
Deselect:
REMB A 0 A_TakeInventory("WeaponCharge", 9999)
REMB A 0 A_GiveInventory("RemoteMineFlag", 10)//A_JumpIfInventory("RemoteMineFlag",1,"RemoveFlag")
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
REMB A 1 A_Lower
Goto Deselect+1
RemoveFlag:
REMB A 0 A_GiveInventory("RemoteMineFlag", 10)
REMB A 10 
REMB A 0 A_TakeInventory("RemoteMineFlag", 10)
goto Deselect+1
Select:
REMB A 0 A_TakeInventory("RemoteMineFlag", 10)
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
REMB A 1 A_Raise
Goto Select+1
Fire:
REMB A 0 A_JumpIfInventory("WeaponCharge",5,"Boom")
REMB A 0 A_JumpIfInventory("WeaponCharge",5,"NoBombs")
REMB A 0 A_JumpIfNoAmmo("NoAmmo")
REMB A 0 A_PlaySoundEx("weapon/mbuster","Weapon")
REMB A 0 A_FireCustomMissile("RemoteMine",0,1,8,0)

REMB B 5
REMB C 5
REMB A 15 A_GiveInventory("WeaponCharge", 1)
REMB A 0 A_Refire
Goto Ready+1
Altfire:
Boom:
REMB A 0 A_TakeInventory("WeaponCharge", 999)
REMB A 0 A_GiveInventory("RemoteMineFlag", 10)
REMB DA 4
REMB A 0 A_TakeInventory("RemoteMineFlag", 10)
goto Ready+1
NoAmmo:
NoBombs:
REMB A 1 ACS_Execute(979,0)
REMB A 0 A_JumpIfInventory("WeaponCharge",1,"Boom")
Goto Ready+1
}
}

actor RemoteMineAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 28
+INVENTORY.IGNORESKILL
}

actor NoRemoteMineLatch : Once {}

actor RemoteMine 
{
PROJECTILE
+SKYEXPLODE
+HITTRACER
damagetype "RemoteMine"
Obituary "$OB_REMOTEMINE"
Radius 8
Height 8
scale 2.5
damage (0)
speed 25

var int user_stuck;
States
{
Spawn:
REMI A 0 A_JumpIf(ACS_NamedExecuteWithResult("core_targetexists")==0,"Exit")
REMI A 0 A_JumpIfInTargetInventory("RemoteMineFlag",10,"DetonateX")
REMI A 1 A_CheckFloor("Death")
REMI A 0 A_GiveToTarget("TargetMarker", 1)
REMI D 0 A_ChangeVelocity(cos(pitch)*19, 0, -sin(pitch)*19,CVF_RELATIVE)
REMI A 0 ACS_ExecuteAlways(989, 0, ACS_ExecuteWithResult(257)+100)
REMI A 0 A_ScaleVelocity(0.60)
REMI A 0 A_JumpIf(ACS_NamedExecuteWithResult("core_targetexists")==0,"Exit")
REMI A 0 A_JumpIfInTargetInventory("RemoteMineFlag",10,"DetonateX")
REMI A 1 A_JumpIfInTargetInventory("RemoteMineFlag",10,"DetonateX")
REMI A 0 A_JumpIfInTargetInventory("RemoteMineFlag",10,"DetonateX")
REMI A 0 A_CheckFloor("Death")
REMI A 0 A_GiveToTarget("TargetMarker", 1)
REMI D 0 A_ChangeVelocity(cos(pitch)*19, 0, -sin(pitch)*19,CVF_RELATIVE)
REMI A 0 ACS_ExecuteAlways(989, 0, ACS_ExecuteWithResult(257)+100)
REMI A 0 A_ScaleVelocity(0.60)
REMI A 1 A_CheckFloor("Death")
REMI A 0 A_GiveToTarget("TargetMarker", 1)
REMI D 0 A_ChangeVelocity(cos(pitch)*19, 0, -sin(pitch)*19,CVF_RELATIVE)
REMI A 0 ACS_ExecuteAlways(989, 0, ACS_ExecuteWithResult(257)+100)
REMI A 0 A_ScaleVelocity(0.60)
REMI A 0 A_JumpIf(ACS_NamedExecuteWithResult("core_targetexists")==0,"Exit")
REMI A 0 A_JumpIfInTargetInventory("RemoteMineFlag",10,"DetonateX")
REMI A 1 A_JumpIfInTargetInventory("RemoteMineFlag",10,"DetonateX")
REMI A 0 A_JumpIfInTargetInventory("RemoteMineFlag",10,"DetonateX")
REMI A 0 A_CheckFloor("Death")
REMI A 0 A_GiveToTarget("TargetMarker", 1)
REMI D 0 A_ChangeVelocity(cos(pitch)*19, 0, -sin(pitch)*19,CVF_RELATIVE)
REMI A 0 ACS_ExecuteAlways(989, 0, ACS_ExecuteWithResult(257)+100)
REMI A 0 A_ScaleVelocity(0.60)
REMI B 1 A_CheckFloor("Death")
REMI A 0 A_GiveToTarget("TargetMarker", 1)
REMI D 0 A_ChangeVelocity(cos(pitch)*19, 0, -sin(pitch)*19,CVF_RELATIVE)
REMI A 0 ACS_ExecuteAlways(989, 0, ACS_ExecuteWithResult(257)+100)
REMI A 0 A_ScaleVelocity(0.60)
REMI A 0 A_JumpIf(ACS_NamedExecuteWithResult("core_targetexists")==0,"Exit")
REMI A 0 A_JumpIfInTargetInventory("RemoteMineFlag",10,"DetonateX")
REMI B 1 A_JumpIfInTargetInventory("RemoteMineFlag",10,"DetonateX")
REMI A 0 A_JumpIfInTargetInventory("RemoteMineFlag",10,"DetonateX")
REMI A 0 A_CheckFloor("Death")
REMI A 0 A_GiveToTarget("TargetMarker", 1)
REMI D 0 A_ChangeVelocity(cos(pitch)*19, 0, -sin(pitch)*19,CVF_RELATIVE)
REMI A 0 ACS_ExecuteAlways(989, 0, ACS_ExecuteWithResult(257)+100)
REMI A 0 A_ScaleVelocity(0.60)
REMI B 1 A_CheckFloor("Death")
REMI A 0 A_GiveToTarget("TargetMarker", 1)
REMI D 0 A_ChangeVelocity(cos(pitch)*19, 0, -sin(pitch)*19,CVF_RELATIVE)
REMI A 0 ACS_ExecuteAlways(989, 0, ACS_ExecuteWithResult(257)+100)
REMI A 0 A_ScaleVelocity(0.60)
REMI A 0 A_JumpIf(ACS_NamedExecuteWithResult("core_targetexists")==0,"Exit")
REMI A 0 A_JumpIfInTargetInventory("RemoteMineFlag",10,"DetonateX")
REMI B 1 A_JumpIfInTargetInventory("RemoteMineFlag",10,"DetonateX")
REMI A 0 A_JumpIfInTargetInventory("RemoteMineFlag",10,"DetonateX")
REMI A 0 A_CheckFloor("Death")
REMI A 0 A_GiveToTarget("TargetMarker", 1)
REMI D 0 A_ChangeVelocity(cos(pitch)*19, 0, -sin(pitch)*19,CVF_RELATIVE)
REMI A 0 ACS_ExecuteAlways(989, 0, ACS_ExecuteWithResult(257)+100)
REMI A 0 A_ScaleVelocity(0.60)
REMI C 1 A_CheckFloor("Death")
REMI A 0 A_GiveToTarget("TargetMarker", 1)
REMI D 0 A_ChangeVelocity(cos(pitch)*19, 0, -sin(pitch)*19,CVF_RELATIVE)
REMI A 0 ACS_ExecuteAlways(989, 0, ACS_ExecuteWithResult(257)+100)
REMI A 0 A_ScaleVelocity(0.60)
REMI A 0 A_JumpIf(ACS_NamedExecuteWithResult("core_targetexists")==0,"Exit")
REMI A 0 A_JumpIfInTargetInventory("RemoteMineFlag",10,"DetonateX")
REMI C 1 A_JumpIfInTargetInventory("RemoteMineFlag",10,"DetonateX")
REMI A 0 A_JumpIfInTargetInventory("RemoteMineFlag",10,"DetonateX")
REMI A 0 A_CheckFloor("Death")
REMI A 0 A_GiveToTarget("TargetMarker", 1)
REMI D 0 A_ChangeVelocity(cos(pitch)*19, 0, -sin(pitch)*19,CVF_RELATIVE)
REMI A 0 ACS_ExecuteAlways(989, 0, ACS_ExecuteWithResult(257)+100)
REMI A 0 A_ScaleVelocity(0.60)
REMI C 1 A_CheckFloor("Death")
REMI A 0 A_GiveToTarget("TargetMarker", 1)
REMI D 0 A_ChangeVelocity(cos(pitch)*19, 0, -sin(pitch)*19,CVF_RELATIVE)
REMI A 0 ACS_ExecuteAlways(989, 0, ACS_ExecuteWithResult(257)+100)
REMI A 0 A_ScaleVelocity(0.60)
REMI A 0 A_JumpIf(ACS_NamedExecuteWithResult("core_targetexists")==0,"Exit")
REMI A 0 A_JumpIfInTargetInventory("RemoteMineFlag",10,"DetonateX")
REMI C 1 A_JumpIfInTargetInventory("RemoteMineFlag",10,"DetonateX")
REMI A 0 A_JumpIfInTargetInventory("RemoteMineFlag",10,"DetonateX")
REMI A 0 A_CheckFloor("Death")
REMI A 0 A_GiveToTarget("TargetMarker", 1)
REMI D 0 A_ChangeVelocity(cos(pitch)*19, 0, -sin(pitch)*19,CVF_RELATIVE)
REMI A 0 ACS_ExecuteAlways(989, 0, ACS_ExecuteWithResult(257)+100)
REMI A 0 A_ScaleVelocity(0.60)
REMI D 1 A_CheckFloor("Death")
REMI A 0 A_GiveToTarget("TargetMarker", 1)
REMI D 0 A_ChangeVelocity(cos(pitch)*19, 0, -sin(pitch)*19,CVF_RELATIVE)
REMI A 0 ACS_ExecuteAlways(989, 0, ACS_ExecuteWithResult(257)+100)
REMI A 0 A_ScaleVelocity(0.60)
REMI A 0 A_JumpIf(ACS_NamedExecuteWithResult("core_targetexists")==0,"Exit")
REMI A 0 A_JumpIfInTargetInventory("RemoteMineFlag",10,"DetonateX")
REMI D 1 A_JumpIfInTargetInventory("RemoteMineFlag",10,"DetonateX")
REMI A 0 A_JumpIfInTargetInventory("RemoteMineFlag",10,"DetonateX")
REMI A 0 A_CheckFloor("Death")
REMI A 0 A_GiveToTarget("TargetMarker", 1)
REMI D 0 A_ChangeVelocity(cos(pitch)*19, 0, -sin(pitch)*19,CVF_RELATIVE)
REMI A 0 ACS_ExecuteAlways(989, 0, ACS_ExecuteWithResult(257)+100)
REMI A 0 A_ScaleVelocity(0.60)
REMI D 1 A_CheckFloor("Death")
REMI A 0 A_GiveToTarget("TargetMarker", 1)
REMI D 0 A_ChangeVelocity(cos(pitch)*19, 0, -sin(pitch)*19,CVF_RELATIVE)
REMI A 0 ACS_ExecuteAlways(989, 0, ACS_ExecuteWithResult(257)+100)
REMI A 0 A_ScaleVelocity(0.60)
REMI A 0 A_JumpIf(ACS_NamedExecuteWithResult("core_targetexists")==0,"Exit")
REMI A 0 A_JumpIfInTargetInventory("RemoteMineFlag",10,"DetonateX")
REMI D 1 A_JumpIfInTargetInventory("RemoteMineFlag",10,"DetonateX")
REMI A 0 A_JumpIfInTargetInventory("RemoteMineFlag",10,"DetonateX")
REMI A 0 A_CheckFloor("Death")
REMI A 0 A_GiveToTarget("TargetMarker", 1)
REMI D 0 A_ChangeVelocity(cos(pitch)*19, 0, -sin(pitch)*19,CVF_RELATIVE)
REMI A 0 ACS_ExecuteAlways(989, 0, ACS_ExecuteWithResult(257)+100)
REMI A 0 A_ScaleVelocity(0.60)
loop
Crash:
XDeath:
REMI A 0 A_SetUserVar("user_stuck", 1)
Death:
REMI A 0 A_Stop
REMI A 0 A_PlaySound("weapon/rminestick")
Latch:
REMI A 0 A_Warp(AAPTR_TRACER,-4,0,28,0,WARPF_COPYINTERPOLATION)
REMI A 1 A_JumpIfInTargetInventory("RemoteMineFlag",10,"Detonate")
REMI A 0 //A_Warp(AAPTR_TRACER,-4,0,28,0,WARPF_COPYINTERPOLATION)
REMI A 1 A_JumpIfInTargetInventory("RemoteMineFlag",10,"Detonate")
REMI A 0 A_Warp(AAPTR_TRACER,-4,0,28,0,WARPF_COPYINTERPOLATION)
REMI A 1 A_JumpIfInTargetInventory("RemoteMineFlag",10,"Detonate")
REMI A 0 //A_Warp(AAPTR_TRACER,-4,0,28,0,WARPF_COPYINTERPOLATION)
REMI E 1 A_JumpIfInTargetInventory("RemoteMineFlag",10,"Detonate")
REMI A 0 A_Warp(AAPTR_TRACER,-4,0,28,0,WARPF_COPYINTERPOLATION)
REMI E 1 A_JumpIfInTargetInventory("RemoteMineFlag",10,"Detonate")
REMI A 0 //A_Warp(AAPTR_TRACER,-4,0,28,0,WARPF_COPYINTERPOLATION)
REMI E 1 A_JumpIfInTargetInventory("RemoteMineFlag",10,"Detonate")
REMI D 0 A_JumpIfInventory("CutterFlag", 100, "Detonate")
REMI D 0 A_JumpIfInventory("NoRemoteMineLatch", 1, "Detonate", AAPTR_TRACER)
REMI D 0 A_GiveInventory("CutterFlag", 1)
REMI B 0 A_JumpIf(ACS_NamedExecuteWithResult("core_targetexists")==0,"Exit")
REMI B 0 A_JumpIf(user_stuck==0,"Latch")
REMI B 0 A_JumpIf(ACS_NamedExecuteWithResult("core_targetexists",1)==0,"Exit")
Goto Latch
DetonateX:
REME A 0 A_Stop
Detonate:
REMI B 0 A_JumpIf(ACS_NamedExecuteWithResult("core_targetexists")==0,"Exit")
TNT1 A 0 //A_SpawnItemEx("RemoteMineExplosion")
REME A 0 A_Explode(9,100,0)
REME A 1 A_PlaySoundEx("weapon/rmineexplode", "Weapon")
REME B 1 A_Warp(AAPTR_TRACER,-4,0,28,0,WARPF_COPYINTERPOLATION)
REME A 1 A_Warp(AAPTR_TRACER,-4,0,28,0,WARPF_COPYINTERPOLATION)
REME C 1 A_Warp(AAPTR_TRACER,-4,0,28,0,WARPF_COPYINTERPOLATION)
REME A 1 A_Explode(9,100,0)
REME D 1 A_Warp(AAPTR_TRACER,-4,0,28,0,WARPF_COPYINTERPOLATION)
REME A 1 A_Warp(AAPTR_TRACER,-4,0,28,0,WARPF_COPYINTERPOLATION)
REME F 1 A_Warp(AAPTR_TRACER,-4,0,28,0,WARPF_COPYINTERPOLATION)
REME A 1 A_Explode(9,100,0)
REME G 1 A_Warp(AAPTR_TRACER,-4,0,28,0,WARPF_COPYINTERPOLATION)
REME A 1 A_Warp(AAPTR_TRACER,-4,0,28,0,WARPF_COPYINTERPOLATION)
REME H 1 A_Warp(AAPTR_TRACER,-4,0,28,0,WARPF_COPYINTERPOLATION)
REME A 1 A_Explode(9,100,0)
REME I 1 A_Warp(AAPTR_TRACER,-4,0,28,0,WARPF_COPYINTERPOLATION)
REME A 1 A_Warp(AAPTR_TRACER,-4,0,28,0,WARPF_COPYINTERPOLATION)
REME J 1 A_Warp(AAPTR_TRACER,-4,0,28,0,WARPF_COPYINTERPOLATION)
REME A 1 A_Explode(9,100,0)
REME K 1 A_Warp(AAPTR_TRACER,-4,0,28,0,WARPF_COPYINTERPOLATION)
REME A 1 A_Warp(AAPTR_TRACER,-4,0,28,0,WARPF_COPYINTERPOLATION)
REME L 1 A_Warp(AAPTR_TRACER,-4,0,28,0,WARPF_COPYINTERPOLATION)
REME A 1 A_Explode(9,100,0)
REME M 1 A_Warp(AAPTR_TRACER,-4,0,28,0,WARPF_COPYINTERPOLATION)
REME A 1 A_Warp(AAPTR_TRACER,-4,0,28,0,WARPF_COPYINTERPOLATION)
REME B 1 A_Warp(AAPTR_TRACER,-4,0,28,0,WARPF_COPYINTERPOLATION)
REME A 1 A_Explode(9,100,0)
REME C 1 A_Warp(AAPTR_TRACER,-4,0,28,0,WARPF_COPYINTERPOLATION)
REME A 1 A_Warp(AAPTR_TRACER,-4,0,28,0,WARPF_COPYINTERPOLATION)
REME D 1 A_Warp(AAPTR_TRACER,-4,0,28,0,WARPF_COPYINTERPOLATION)
REME A 1 A_Explode(9,100,0)
REME F 1 A_Warp(AAPTR_TRACER,-4,0,28,0,WARPF_COPYINTERPOLATION)
REME A 1 A_Warp(AAPTR_TRACER,-4,0,28,0,WARPF_COPYINTERPOLATION)
REME G 1 A_Warp(AAPTR_TRACER,-4,0,28,0,WARPF_COPYINTERPOLATION)
REME A 1 A_Explode(9,100,0)
REME H 1 A_Warp(AAPTR_TRACER,-4,0,28,0,WARPF_COPYINTERPOLATION)
REME ANAPOPO 1 A_Warp(AAPTR_TRACER,-4,0,28,0,WARPF_COPYINTERPOLATION)
stop
Exit:
TNT1 A 1
stop
}
}

actor RemoteMineExplosion
{
PROJECTILE
+NOINTERACTION
+BRIGHT
Obituary "$OB_REMOTEMINE"
damagetype "RemoteMine"
scale 2.5
states
{
Spawn:
REME A 0
REME A 0 A_Explode(15,100,0)
REME A 1 A_PlaySoundEx("weapon/rmineexplode", "Weapon")
REME B 1 
REME A 1
REME C 1
REME A 1 A_Explode(15,100,0)
REME D 1
REME A 1
REME F 1
REME A 1 A_Explode(15,100,0)
REME G 1
REME A 1
REME H 1
REME A 1 A_Explode(15,100,0)
REME I 1
REME A 1
REME J 1
REME A 1 A_Explode(15,100,0)
REME K 1
REME A 1
REME L 1
REME A 1 A_Explode(15,100,0)
REME M 1
REME A 1
REME B 1
REME A 1 A_Explode(15,100,0)
REME C 1
REME A 1
REME D 1
REME A 1 A_Explode(15,100,0)
REME F 1
REME A 1
REME G 1
REME A 1 A_Explode(15,100,0)
REME H 1
REME ANAPOPO 1
stop
}
}

actor RemoteMineFlag : Inventory
{
inventory.amount 1
inventory.maxamount 10
}