actor DustCrusherBoss : MegaBuster
{
Weapon.AmmoUse 1
Weapon.AmmoGive 0
Weapon.SlotNumber 1
Obituary "%o got made into junk by %k's Dust Crusher."
Inventory.Pickupmessage "Power up! Yo momma!"
weapon.ammotype "CrushEmAmmo"
inventory.pickupsound "weapon/weaponup"
+WEAPON.AMMO_OPTIONAL
Scale 2.0
States
{
Spawn:
WEA2 K 1
loop
Ready:
DUSA A 0 ACS_ExecuteAlways(998,0,38)
Ready2:
DUSA D 1 A_WeaponReady
Goto Ready2
Deselect:
TNT1 A 0 A_SelectWeapon("DustBitterBoss")
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
TNT1 A 1 A_Lower
Loop
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
DUSA A 1 A_Raise
Loop
Fire:
DUSA A 0 A_JumpIfInventory("CrushEmAmmo",4,"FireJunk")
goto NoAmmoFire
FireJunk:
//DUSA A 0 A_PlaySoundEx("weapon/mbuster","Weapon")
DUSA A 0 A_PlaySoundEx("weapon/shoomp","Weapon")
DUSA A 0 A_FireCustomMissile("DustCrusherDust",0,0,8,0)
DUSA A 0 A_TakeInventory("CrushEmAmmo",4)
DUSA DD 6
DUSA D 16
DUSA A 0 A_Refire
Goto Ready2
AltFire:
//DUSA E 2 A_FireBullets (20, 20, 1, 0, "DustSucker", 0, 400)
DUSA E 0 A_FireCustomMissile("DustSucker",0,0,8,0)
DUSA E 0 A_FireCustomMissile("DustSucker2",random(-15,15),0,8,0,0,random(-10,10))
DUSA E 2
DUSA E 0 A_Refire
DUSA E 0 A_Jump(256,"Ready2")
Goto Ready2
NoAmmoFire:
DUSA A 0 A_PlaySoundEx("Weapon/Mbuster","Weapon")
DUSA A 0 A_FireCustomMissile("DustShot",0,0,8,-24)
DUSA BC 3
DUSA A 10
DUSA A 0 A_ReFire
DUSA A 0 A_Jump(256,"Ready2")
Goto Ready2
}
}

actor DustBitterBoss : DustCrusherBoss
{
States
{
Ready:
DUSA A 0 ACS_ExecuteAlways(998,0,38)
Ready2:
DUSA A 1 A_WeaponReady
Goto Ready2
Deselect:
TNT1 A 0 A_SelectWeapon("DustCrusherBoss")
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
TNT1 A 1 A_Lower
Loop
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
DUSA A 1 A_Raise
Loop
Fire:
DUSA A 0 A_JumpIfInventory("CrushEmAmmo",1,"DustBitShot")
goto NoAmmoFire
DustBitShot:
DUSA A 0 A_PlaySoundEx("weapon/mbuster","Weapon")
DUSA A 0 A_FireCustomMissile("DustBit12",random(-3,3),1,8,-24)
DUSA BC 3
DUSA A 3
DUSA A 0 A_Refire
Goto Ready+1
}
}

actor CrushEmAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 56
}

actor DustCrusherDust : DustCrusher
{
Translation "94:98=87:87"
damage (45)
speed 25
States
{
Death:
MMFX B 0 A_SpawnItemEx("DustBit1Dust",0,0,0,28,0,0,45)
MMFX B 0 A_SpawnItemEx("DustBit2Dust",0,0,0,28,0,0,-45)
MMFX B 0 A_SpawnItemEx("DustBit3Dust",0,0,0,28,0,0,225)
MMFX B 0 A_SpawnItemEx("DustBit4Dust",0,0,0,28,0,0,-225)
MMFX BCDE 2
stop
}
}

actor DustBit1Dust : DustBit1C
{
Translation "94:98=87:87"
//damage (20)
}

actor DustBit2Dust : DustBit2C
{
Translation "94:98=87:87"
//damage (20)
}

actor DustBit3Dust : DustBit3C
{
Translation "94:98=87:87"
//damage (20)
}

actor DustBit4Dust : DustBit4C
{
Translation "94:98=87:87"
//damage (20)
}

actor DustBit12 : DustBit1C
{
Translation "94:98=87:87"
damage (20)
states
{
Spawn:
DUSA A 0
DUSA A 0 A_Jump(256,"B","C","D","E")
B:
DUST B 1
loop
C:
DUST C 1
loop
D:
DUST D 1
loop
E:
DUST E 1
loop
}
}

actor DustShot : BassShot
{
Damage (15)
}

actor DustBits : CustomInventory
{
inventory.pickupmessage "Picked up some scrap metal."
inventory.pickupsound "item/energyup"
inventory.amount 1
inventory.maxamount 1
scale 2.5
+INVENTORY.AUTOACTIVATE
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_GiveInventory("Clip",1)
TNT1 A 0 ACS_ExecuteAlways(148,0)
TNT1 A 1 A_Jump(256, "One","Two","Three","Four")
stop
One:
DUST B 500
stop
Two:
DUST C 500
stop
Three:
DUST D 500
stop
Four:
DUST E 500
stop
Pickup:
DUST B 0 A_JumpIfInventory("DustCrusherBoss", 1, 2) 
DUST B 0 A_JumpIfInventory("JunkShieldBoss", 1, 1) 
fail
DUST B 0 A_GiveInventory("CrushEmAmmo",5)
DUST B 0 A_GiveInventory("TrunkAmmo",5)
DUST B 0 A_PlaySound("item/energyup", 3, 0.75)
DUST B 0
stop
Vacuumed:
TNT1 A 0 A_TakeInventory("Clip",1)
stop
}
}

/*
actor DustSucker : BulletPuff
{
+PUFFGETSOWNER
+ALWAYSPUFF
States
{
Crash:
TNT1 A 0
TNT1 A 0 ACS_ExecuteAlways(209,0)
goto Death
Spawn:
Melee:
Death:
XDeath:
TNT1 A 0
TNT1 A 0 A_CustomMissile("VacuumParticle", 0, 0, 0, 0)
TNT1 A 12
stop
}
}
*/

actor DustSucker : FastProjectile
{
PROJECTILE
+SKYEXPLODE
+DONTBLAST
//+PICKUP
Speed 450
Damage (0)
radius 8
height 8
States
{
Spawn:
//TNT1 A 0
TNT1 A 1
goto Death
XDeath:
TNT1 A 0 A_Stop
TNT1 A 1 ACS_ExecuteAlways(209,0)
//TNT1 A 1 A_JumpIfInventory("CrushEmAmmo", 2, "GiveLoop") 
goto Death
/*GiveLoop:
TNT1 A 0 A_GivetoTarget("CrushEmAmmo",1)
TNT1 A 0 A_TakeInventory("CrushEmAmmo",2)
TNT1 A 0 A_JumpIfInventory("CrushEmAmmo", 2, "GiveLoop") 
goto Death*/
Death:
TNT1 A 0 A_Stop
TNT1 A 1 A_SpawnItemEx("DustGrabber")
stop
}
}

actor DustSucker2 : DustSucker
{
+CLIENTSIDEONLY
//-PICKUP
States
{
Spawn:
//TNT1 A 0
TNT1 A 1
goto Death
XDeath:
Death:
TNT1 A 0 A_Stop
TNT1 A 1 A_CustomMissile("VacuumParticle", 0, 0, 0, 0)
stop
}
}

actor DustGrabber
{
Height 0
Radius 0
+NOINTERACTION
-SOLID
+NOGRAVITY
+MISSILE
States
{
Spawn:
TNT1 A 0
TNT1 A 2 Thing_ChangeTID(0,(ACS_ExecuteWithResult(147,0)+100))
stop
}
}

actor VacuumParticle
{
PROJECTILE
+CLIENTSIDEONLY
//+NOINTERACTION
//-SOLID
+NOGRAVITY
height 5
radius 5
Scale 2.5
Speed 35
States
{
Spawn:
COSS B 15
stop
}
}