actor DiveMineWep_NormalBar : NormalBar{args 4, 194}
actor DiveMineWep : BaseMM8BDMWep
{
Weapon.AmmoUse 5
Weapon.AmmoGive 30
Weapon.SlotNumber 4
Inventory.Pickupmessage "$PU_DIVEMINE"
Obituary "$OB_DIVEMINE"
Tag "$TAG_DIVEMINE"
weapon.ammotype "DiveMineAmmo"
inventory.icon "DMINICON"
States
{
SpawnLoop:
DMIN Z 1
loop
Ready:
DMIN A 0 ACS_NamedExecuteWithResult("core_weaponcolor",COLOR_DIVEMINE)
DMIN A 1 A_WeaponReady
Goto Ready+1
ReadyC: Goto Ready+1
Deselect:
DMIN A 0
goto DeselectSwap
Select:
DMIN A 0
goto SelectSwap
Fire:
DMIN A 0 A_JumpIfNoAmmo("NoAmmo")
DMIN A 0 A_PlaySoundEx("weapons/mm5/napalmbombfire","Weapon")
DMIN A 0 A_JumpIfInventory("PowerSpread",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)
DMIN BCA 3
DMIN A 14
DMIN A 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)
DMIN BCA 3
DMIN A 14
DMIN A 0 A_Refire
Goto Ready+1
NoAmmo:
DMIN A 1 ACS_NamedExecute("core_noammo",0)
Goto Ready+1
}
}

actor DiveMine : BasicProjectile
{
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:
DCMN A 0
DCMN A 3 A_SetArg(4,14)
DCMN A 0 A_ChangeFlag("ALLOWBOUNCEONACTORS",0)//BOUNCEONACTORS
DCMN A 0 A_ChangeFlag("RIPPER",0)
DCMN A 0 A_ChangeFlag("SHOOTABLE",1)
DCMN AAA 1 A_ScaleVelocity(0.5)
Floating:
DCMN A 23
DCMN B 3
DCMN A 0 A_CountDownArg(4)
loop
DeathC:
DCMN B 1 A_CountDown
wait
Death:
DCMN B 0
DCMN B 0 //A_ChangeFlag("SHOOTABLE",0)//Bug that was supposed to be fixed
DCMN B 0 A_ChangeFlag("FLOATBOB",0)//Persists
DCMN B 0 //A_ChangeFlag("NOGRAVITY",1)//A_CountDown makes it fall down
DCMN B 0 A_Stop//1
DCMN B 0 A_PlaySoundEx("weapon/drillexplode", "Weapon")
DCMN B 0 A_SpawnItemEx("DiveMineExplosion",0,0,16,0,0,0,0,1)
TNT1 A 1
stop
}
}

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

actor DiveMineExplosion : BasicExplosion
{
Obituary "$OB_DIVEMINE"
damagetype "DiveMine"
Scale 2.5
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Explode(CallACS("vile_cbm_damage",22),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(CallACS("vile_cbm_damage",22),128,32)
BOMB CDEFGHIJKLMN 1
BOMB OPQR 1 
stop
}
}


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