actor SludgeBurstWep : BaseMM8BDMWep
{
//$Category MM8BDM-Weapons
//$Title Sludge Burst
//$Sprite DOSWI0
Weapon.AmmoUse 2
Weapon.AmmoGive 28
Weapon.SlotNumber 4
Inventory.Pickupmessage "$PU_SLUDGEBURST"
Obituary "$OB_SLUDGEBURST"
Tag "$TAG_SLUDGEBURST"
weapon.ammotype "SludgeBurstAmmo"
inventory.icon "SLUGBR"
States
{
SpawnLoop:
DOSW I -1
loop
Ready:
SLGE C 0 ACS_ExecuteAlways(998,0,DOSREBORN_COLOR_PETROL)
SLGE C 1 A_WeaponReady
Goto Ready+1
Deselect:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
SLGE C 1 A_Lower
Loop
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
SLGE C 1 A_Raise
Loop
Fire:
SLGE C 0 A_JumpIfNoAmmo("NoAmmo")
SLGE C 0 A_PlaySoundEx("weapon/concreteshot","Weapon")
SLGE C 0 A_FireCustomMissile("SludgyShot",0,0,8,0)
SLGE C 0 A_FireCustomMissile("SludgyShot",6*0.7,0,8,0,0,6*0.7)
SLGE C 0 A_FireCustomMissile("SludgyShot",6*0.7,0,8,0,0,-6*0.7)
SLGE C 0 A_FireCustomMissile("SludgyShot",-6*0.7,0,8,0,0,6*0.7)
SLGE C 0 A_FireCustomMissile("SludgyShot",-6*0.7,1,8,0,0,-6*0.7)
SLGE DEC 3
SLGE C 15
Goto Ready+1
NoAmmo:
SLGE C 1 ACS_Execute(979,0)
Goto Ready+1
}
}
actor SludgeBurstWepSH : SludgeBurstWep replaces SludgeBurstWep {+INVENTORY.RESTRICTABSOLUTELY Inventory.RestrictedTo megamans}

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

actor SludgyShot
{
PROJECTILE
-NOGRAVITY
Obituary "$OB_SLUDGEBURST"
Radius 12
Height 20
scale 2.5
gravity 1.8
damage (11)
speed 45
damagetype "SludgeBurst"
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_Jump(256,"Spawn1","Spawn2")
wait
Spawn1:
SLGE A 2 ThrustThingZ(0,20,0,1)
SLGE B 2
goto SpawnLoop
Spawn2:
SLGE B 2 ThrustThingZ(0,20,0,1)
SpawnLoop:
SLGE AB 2
loop
}
}

actor SludgeBurstVisionBlocker : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("SludgeBurstPowerup0",1,"SludgeBurst1")
TNT1 A 0 A_GiveInventory("SludgeBurstPowerup0",1)
TNT1 A 0 A_SpawnItemEX("SludgeBurstBlindHelper0")
TNT1 A 0 ACS_NamedExecuteAlways("DOSR_SludgeBurst",0,0)
stop
SludgeBurst1:
TNT1 A 0 A_JumpIfInventory("SludgeBurstPowerup1",1,"SludgeBurst2")
TNT1 A 0 A_GiveInventory("SludgeBurstPowerup1",1)
TNT1 A 0 A_SpawnItemEX("SludgeBurstBlindHelper1")
TNT1 A 0 ACS_NamedExecuteAlways("DOSR_SludgeBurst",0,1)
stop
SludgeBurst2:
TNT1 A 0 A_JumpIfInventory("SludgeBurstPowerup2",1,"SludgeBurst3")
TNT1 A 0 A_GiveInventory("SludgeBurstPowerup2",1)
TNT1 A 0 A_SpawnItemEX("SludgeBurstBlindHelper2")
TNT1 A 0 ACS_NamedExecuteAlways("DOSR_SludgeBurst",0,2)
stop
SludgeBurst3:
TNT1 A 0 A_JumpIfInventory("SludgeBurstPowerup3",1,"SludgeBurst4")
TNT1 A 0 A_GiveInventory("SludgeBurstPowerup3",1)
TNT1 A 0 A_SpawnItemEX("SludgeBurstBlindHelper3")
TNT1 A 0 ACS_NamedExecuteAlways("DOSR_SludgeBurst",0,3)
stop
SludgeBurst4:
TNT1 A 0 A_JumpIfInventory("SludgeBurstPowerup4",1,"Randomize")
TNT1 A 0 A_GiveInventory("SludgeBurstPowerup4",1)
TNT1 A 0 A_SpawnItemEX("SludgeBurstBlindHelper4")
TNT1 A 0 ACS_NamedExecuteAlways("DOSR_SludgeBurst",0,4)
stop
Randomize:
TNT1 A 0 A_Jump(256,"Restock0","Restock1","Restock2","Restock3","Restock4")
goto Restock0
Restock0:
TNT1 A 0 A_GiveInventory("SludgeBurstPowerup0",1)
stop
Restock1:
TNT1 A 0 A_GiveInventory("SludgeBurstPowerup1",1)
stop
Restock2:
TNT1 A 0 A_GiveInventory("SludgeBurstPowerup2",1)
stop
Restock3:
TNT1 A 0 A_GiveInventory("SludgeBurstPowerup3",1)
stop
Restock4:
TNT1 A 0 A_GiveInventory("SludgeBurstPowerup4",1)
stop
}
}

actor SludgeBurstPowerup0 : Powerup {Powerup.duration 50}
actor SludgeBurstPowerup1 : Powerup {Powerup.duration 50}
actor SludgeBurstPowerup2 : Powerup {Powerup.duration 50}
actor SludgeBurstPowerup3 : Powerup {Powerup.duration 50}
actor SludgeBurstPowerup4 : Powerup {Powerup.duration 50}

actor SludgeBurstBlindHelper0 
{
+MISSILE
-SOLID
+NOINTERACTION
+NOGRAVITY
+DONTBLAST
+DONTREFLECT
renderstyle none
radius 2
height 2
States
{
Spawn:
TNT1 A 0 
TNT1 A 3 A_GiveToTarget("SludgeBurstBlindFX",1)
TNT1 A 0 A_JumpIfInTargetInventory("SludgeBurstPowerup0",1,"Spawn")
stop
}
}

actor SludgeBurstBlindHelper1 : SludgeBurstBlindHelper0
{
States
{
Spawn:
TNT1 A 0 
TNT1 A 3 A_GiveToTarget("SludgeBurstBlindFX",1)
TNT1 A 0 A_JumpIfInTargetInventory("SludgeBurstPowerup1",1,"Spawn")
stop
}
}

actor SludgeBurstBlindHelper2 : SludgeBurstBlindHelper0
{
States
{
Spawn:
TNT1 A 0 
TNT1 A 3 A_GiveToTarget("SludgeBurstBlindFX",1)
TNT1 A 0 A_JumpIfInTargetInventory("SludgeBurstPowerup2",1,"Spawn")
stop
}
}

actor SludgeBurstBlindHelper3 : SludgeBurstBlindHelper0
{
States
{
Spawn:
TNT1 A 0 
TNT1 A 3 A_GiveToTarget("SludgeBurstBlindFX",1)
TNT1 A 0 A_JumpIfInTargetInventory("SludgeBurstPowerup3",1,"Spawn")
stop
}
}

actor SludgeBurstBlindHelper4 : SludgeBurstBlindHelper0
{
States
{
Spawn:
TNT1 A 0 
TNT1 A 3 A_GiveToTarget("SludgeBurstBlindFX",1)
TNT1 A 3 A_JumpIfInTargetInventory("SludgeBurstPowerup4",1,"Spawn")
stop
}
}

actor SludgeBurstBlindFX : CustomInventory
{
States
{
Pickup:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("SludgeBurstDrip",random(-24,24),random(-24,24),random(8,32))
stop
}
}

actor SludgeBurstDrip
{
Translation "44:44=3:3", "225:225=87:87"
+MISSILE
+DONTBLAST
+THRUACTORS
+DONTSPLASH
-NOGRAVITY
+CLIENTSIDEONLY
ReactionTime 4
Radius 4
Height 4
Speed 10
Scale 1.0
States
{
Spawn:
ACID D 4 A_CountDown
loop
Death:
ACID E 0 A_ChangeFlag("NOGRAVITY",1)
ACID E 0 A_Stop
ACID EF 5
stop
}
}