actor DiveMineWepSH : BaseMM8BDMWep
{
//$Category MM8BDM-Weapons
//$Title Dive Mine
Weapon.AmmoUse 5
Weapon.AmmoGive 30
Weapon.SlotNumber 4
Inventory.Pickupmessage "$PU_DIVEMINE"
Obituary "$OB_DIVEMINE"
Tag "$TAG_DIVEMINE"
weapon.ammotype "DiveMineAmmo"
inventory.icon "XR4AICON"
+INVENTORY.RESTRICTABSOLUTELY Inventory.RestrictedTo megamans
States
{
SpawnLoop:
X_R4 A 1
loop
Ready:
AIRS D 0 ACS_ExecuteAlways(998,0,38)
AIRS D 1 A_WeaponReady
Goto Ready+1
Deselect:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
AIRS D 1 A_Lower
Loop
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
AIRS D 1 A_Raise
Loop
Fire:
AIRS D 0 A_JumpIfNoAmmo("NoAmmo")
AIRS D 0 A_PlaySoundEx("weapon/mbuster","Weapon")
AIRS D 0 A_JumpIfInventory("SpreadRuneFlag",1,"Spread")
TNT1 A 0 A_FireCustomMissile("DiveMine",24,0,0,0)
TNT1 A 0 A_FireCustomMissile("DiveMine",-24,0,0,0)
TNT1 A 0 A_FireCustomMissile("DiveMine",0,1,0,0)
AIRS EFD 3
AIRS D 14
AIRS D 0 A_Refire
Goto Ready+1
Spread:
TNT1 A 0 A_FireCustomMissile("DiveMine2",24,0,0,0)
TNT1 A 0 A_FireCustomMissile("DiveMine2",-24,1,0,0)
AIRS EFD 3
AIRS D 14
AIRS D 0 A_Refire
Goto Ready+1
NoAmmo:
AIRS D 1 ACS_Execute(979,0)
Goto Ready+1
}
}

actor DiveMine
{
damagetype "DiveMine"
Obituary "$OB_DIVEMINE"
+MISSILE
+NOGRAVITY
+NOTELEPORT
//+SHOOTABLE
+DONTDRAIN
+NOBLOOD
+DONTREFLECT
//+RIPPER
+BOUNCEONWALLS
+BOUNCEONFLOORS
+BOUNCEONCEILINGS
//+ALLOWBOUNCEONACTORS
//+BOUNCEONACTORS
+CANBOUNCEWATER
+NOTARGETSWITCH
+CANTSEEK
//+NOPAIN
//+THRUSPECIES
Species "DumbDiveMine"
+FLOATBOB

damagefactor "DiveMissile", 0.2
damagefactor "DiveMine", 1.0
PainChance "Normal", 0
PainChance "DiveMissile", 256
PainChance "DiveMine", 256

Health 20
mass 99999
reactiontime 1
damage (0)
Radius 18
Height 32
speed 30
scale 2.5
States
{
Spawn:
SCMN A 0
SCMN A 3 A_SetArg(4,14)
SCMN A 0 A_ChangeFlag("ALLOWBOUNCEONACTORS",0)//BOUNCEONACTORS
SCMN A 0 A_ChangeFlag("RIPPER",0)
SCMN A 0 A_ChangeFlag("SHOOTABLE",1)
SCMN AAA 1 A_ScaleVelocity(0.5)
Floating:
SCMN A 23
SCMN B 3
SCMN A 0 A_CountDownArg(4)
loop
DeathC:
SCMN B 1 A_CountDown
wait
Death:
SCMN B 0
SCMN B 0 //A_ChangeFlag("SHOOTABLE",0)//Bug that was supposed to be fixed
SCMN B 0 A_ChangeFlag("FLOATBOB",0)//Persists
SCMN B 0 //A_ChangeFlag("NOGRAVITY",1)//A_CountDown makes it fall down
SCMN B 0 A_Stop//1
SCMN B 0 A_PlaySoundEx("weapon/drillexplode", "Weapon")
SCMN B 0 A_SpawnItemEx("DiveMineExplode",0,0,16,0,0,0,0,1)
TNT1 A 1
stop
}
}

actor DiveMine2 : DiveMine
{
+THRUSPECIES
States
{
Spawn:
SCMN A 0
SCMN A 3 A_SetArg(4,14)
SCMN A 0 A_ChangeFlag("ALLOWBOUNCEONACTORS",0)//BOUNCEONACTORS
SCMN A 0 A_ChangeFlag("RIPPER",0)
SCMN A 0 A_ChangeFlag("SHOOTABLE",1)
SCMN AAA 1 A_ScaleVelocity(0.5)
Floating:
SCMN A 25 
SCMN B 1 A_Changeflag("THRUSPECIES",0)
SCMN A 0 A_CountDownArg(4)
loop
Death:
SCMN B 0
SCMN B 0 //A_ChangeFlag("SHOOTABLE",0)//Bug that was supposed to be fixed
SCMN B 0 A_ChangeFlag("FLOATBOB",0)//Persists
SCMN B 0 //A_ChangeFlag("NOGRAVITY",1)//A_CountDown makes it fall down
SCMN B 0 A_Stop//1
SCMN B 0 A_PlaySoundEx("weapon/drillexplode", "Weapon")
SCMN B 0 A_SpawnItemEx("DiveMineExplode2",0,0,16,0,0,0,0,1)
TNT1 A 1
stop
}
}

actor DiveMineExplode : BasicExplosion
{
Obituary "$OB_DIVEMINE"
damagetype "DiveMine"
Scale 2.5
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Explode(24,128,32)
BOMB CDEFGHIJKLMN 1
BOMB OPQR 1 
stop
}
}


actor DiveMineExplode2 : BasicExplosion
{
Obituary "$OB_DIVEMINE"
damagetype "DiveMine"
Scale 2.5
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Explode(12,128,32)
BOMB CDEFGHIJKLMN 1
BOMB OPQR 1 
stop
}
}


actor DiveMineAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 30
+INVENTORY.IGNORESKILL
}