const int CBM_FetchMyHealth = 6142;
const int CBM_HealMyThing = 6143;


actor ETank : CustomInventory 10091
{
//$Category MM8BDM-Assists
//$Title E-Tank
inventory.amount 1
//Inventory.RespawnTics 350
inventory.maxamount 1
inventory.pickupmessage "$PU_ETANK"
Tag "$TAG_ETANK"
inventory.icon "ETANK"
Inventory.PickupSound "item/1up"
+INVBAR
+COUNTITEM
scale 2.0
States
{
Spawn:
EBAL F 0 
EBAL F 0 Thing_ChangeTID(0,999)
EBAL FE 6
Goto Spawn+2
Use:
EBAL E 0 A_JumpIf(ACS_ExecuteWithResult(CBM_FetchMyHealth,2),"Success")
fail
Success:
EBAL E 0 A_PlaySound("item/energyup")
EBAL E 0 A_PlaySoundEx("item/refill","Voice")
EBAL E 0 ACS_ExecuteAlways(CBM_HealMyThing,0,0,30000)
EBAL E 0 A_TakeInventory("ETank",1)
fail
Death:
TNT1 A 0
stop
}
}

actor LTank : ETank
{
inventory.pickupmessage "$PU_LTANK"
+INVENTORY.AUTOACTIVATE
-INVBAR
States
{
Spawn:
EBAL K 0 
EBAL K 0 Thing_ChangeTID(0,999)
EBAL KE 6
Goto Spawn+2
Use:
EBAL E 0 A_JumpIfHealthLower(100,"Success")
fail
Success:
EBAL E 0 A_PlaySound("item/energyup")
EBAL E 0 A_PlaySoundEx("item/refill","Voice")
EBAL E 0 ACS_ExecuteAlways(CBM_HealMyThing,0,0,30000)
EBAL E 0 A_TakeInventory("ETank",1)
fail
Death:
TNT1 A 0
stop
}
}

actor WTank : CustomInventory 10151
{
//$Category MM8BDM-Assists
//$Title W-Tank
inventory.amount 1
inventory.maxamount 5
//Inventory.RespawnTics 350
inventory.pickupmessage "$PU_WTANK"
Tag "$TAG_WTANK"
inventory.icon "WTANK"
Inventory.PickupSound "item/1up"
+INVENTORY.RESTRICTABSOLUTELY Inventory.RestrictedTo megamans
+INVBAR
+COUNTITEM
reactiontime 525
scale 2.0
States
{
Spawn:
EBAL H 0
EBAL H 0 Thing_ChangeTID(0,999)
EBAL HHHHHHEEEEEE 1 A_Countdown
Goto Spawn+2
Death:
EBAL HHHHH 1 A_Fadeout(0.2)
stop
Use:
TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(984,0),"Success")
fail
Success:
EBAL E 0 A_PlaySound("item/energyup")
EBAL E 0 A_PlaySoundEx("item/refill","Voice")
EBAL E 0 ACS_Execute(992, 0, 100)
EBAL E 0 A_TakeInventory("WTank",1)
fail
}
}

actor MTank : CustomInventory 10154
{
//$Category MM8BDM-Assists
//$Title M-Tank
inventory.amount 1
inventory.maxamount 1
//Inventory.RespawnTics 450
inventory.pickupmessage "$PU_MTANK"
Tag "$TAG_MTANK"
inventory.icon "MTANK"
Inventory.PickupSound "item/1up"
-INVBAR
+COUNTITEM
scale 2.0
States
{
Spawn:
EBAL G 0 
EBAL G 0 Thing_ChangeTID(0,999)
EBAL GE 6
Goto Spawn+2
Use:
EBAL E 0 A_PlaySound("item/energyup")
EBAL E 0 A_PlaySoundEx("item/refill","Voice")
EBAL E 0 ACS_ExecuteAlways(CBM_HealMyThing,0,0,30000)
EBAL E 0 ACS_ExecuteAlways(992, 0, 0, 1)
Death:
TNT1 A 0
stop
}
}

actor MTankAuto : CustomInventory
{
//$Category MM8BDM-Assists
//$Title M-Tank
inventory.amount 1
inventory.maxamount 1
//Inventory.RespawnTics 450
inventory.pickupmessage "$PU_MTANK"
Tag "$TAG_MTANK"
inventory.icon "MTANK"
Inventory.PickupSound "item/1up"
+INVBAR
+COUNTITEM
+INVENTORY.AUTOACTIVATE
scale 2.0
States
{
Spawn:
EBAL G 0 
EBAL G 0 Thing_ChangeTID(0,999)
EBAL GE 6
Goto Spawn+2
Use:
EBAL E 0 A_PlaySound("item/energyup")
EBAL E 0 A_PlaySoundEx("item/refill","Voice")
EBAL E 0 ACS_ExecuteAlways(CBM_HealMyThing,0,0,30000)
EBAL E 0 ACS_ExecuteAlways(992, 0, 0, 1)
Death:
TNT1 A 0
stop
}
}

actor PartyBall 11104
{
//$Category MM8BDM-Health/Energy
+NOGRAVITY
+SHOOTABLE
+FLOATBOB
+NOBLOOD
//+ACTIVATEPCROSS
health 1
mass 999999
height 64
radius 32
scale 2.5

States
{
Spawn:
PRTB A 0
PRTB A 0 A_JumpIf(ACS_ExecuteWithResult(975,0)==2 || ACS_ExecuteWithResult(975,2)>0,"NoBanana")
goto Spawn2
Spawn2:
PRTB AB 2
loop
Death:
PRTB C 0 A_PlaySoundEx("misc/partyball", "Auto")
PRTB C 0 A_ChangeFlag("NOGRAVITY", 1)
PRTB C 0 A_ChangeFlag("FLOATBOB", 1)
PRTB C 0 A_SpawnItemEx("PartyBallRespawner",0,0,0,0,0,0)
PRTB C 1 ThrustThingZ(0, 20, 0, 0)
PRTB C 0 A_SpawnItemEx("ConfettiSpawner",0,0,0,random(-3,3),random(-3,3))
PRTB C 1 A_SpawnItemEx("RandomItem",0,0,0,random(-3,3),random(-3,3))
PRTB CDCD 2
Explode:
PRTB C 0 A_Stop
PRTB CDCDCDCD 2
PRTB C 0 A_ChangeFlag("FLOATBOB", 0)
NAPA E 0 A_PlaySoundEx("weapon/crackerexplode", "Weapon")
NAPA EFGHIJKLMNOPQRS 1
stop
NoBanana:
TNT1 A 0 A_ChangeFlag("Shootable", 0)
TNT1 A 35 
Goto NoBanana+1
}
}

actor PartyBallRespawner
{
-SOLID
+NOINTERACTION
+NOGRAVITY
Scale 2.5
States
{
Spawn:
TNT1 A 0
TNT1 AA 500
TFOG A 3 
TFOG BC 2
TNT1 A 0 A_SpawnItemEx("PartyBall",0,0,0)
stop
}
}

actor ConfettiSpawner 
{
//+CLIENTSIDEONLY
+NOINTERACTION
+NOGRAVITY
Height 1
Radius 1
-SOLID
ReactionTime 10
States
{
Spawn:
TNT1 A 1 A_SpawnItemEx("Confetti",random(-16, 16),random(-16, 16),Random(8, 16),random(-3,3), random(-3,3), random(1,-1),0)
TNT1 A 0 A_SpawnItemEx("Confetti",random(-16, 16),random(-16, 16),Random(8, 16),random(-3,3), random(-3,3), random(1,-1),0)
TNT1 A 0 A_SpawnItemEx("Confetti",random(-16, 16),random(-16, 16),Random(8, 16),random(-3,3), random(-3,3), random(1,-1),0)
TNT1 A 0 A_CountDown
Loop
}
}

actor Confetti
{
+MISSILE
+DONTBLAST
+CLIENTSIDEONLY
+LOWGRAVITY
+RIPPER
+DONTSPLASH
damage 0
height 2
radius 2
scale 2.0
States
{
Spawn:
PCNF A 0
PCNF A 0 A_Jump(85,"Spawn2")
PCNF A 0 A_Jump(85,"Spawn3")
Spawn1:
PCNF A 5
PCNF BCD 5 A_ChangeVelocity(momx*0.9, momy*0.9, momz, CVF_REPLACE)
PCNF ABCDABCD 5 
PCNF AAAAABBBBBCCCCCDDDDD 1 A_Fadeout
stop
Spawn2:
PCNF E 5
PCNF FEF 5 A_ChangeVelocity(momx*0.9, momy*0.9, momz, CVF_REPLACE)
PCNF EFEFEFEF 5
PCNF EEEEEFFFFFEEEEEFFFFF 1 A_Fadeout
stop
Spawn3:
PCNF G 5
PCNF HI 5 A_ChangeVelocity(momx*0.9, momy*0.9, momz, CVF_REPLACE)
PCNF GHIGHIGH 5
PCNF HHHHHIIIIIGGGGGHHHHHIIIII 1 A_Fadeout
stop
}
}

actor RandomItem
{
+NOINTERACTION
+NOGRAVITY
-SOLID
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_Jump(128, "Tanks")
TNT1 A 1 A_Jump(192, "Assists")
TNT1 A 1 A_Jump(256, "Pickups")
stop

Tanks:
TNT1 A 1 A_Jump(128, "METanks")
TNT1 A 1 A_Jump(256, "WTank")
stop

	METanks:
	TNT1 A 1 A_Jump(192, "ETank")
	TNT1 A 1 A_Jump(40, "MTank")
	TNT1 A 1 A_Jump(256, "Pickups")
	stop

Assists:
TNT1 A 1 A_Jump(192, "AssistWeps")
TNT1 A 1 A_Jump(192, "AssistOther")
TNT1 A 1 A_Jump(256, "Pickups")
stop

AssistWeps:
TNT1 A 1 A_Jump(128, "TrebleBeat", "EddieBomber")
TNT1 A 1 A_Jump(256, "TangoSummon")
stop

	TrebleBeat:
	TNT1 A 1 A_Jump(192, "TrebleSentry")
	TNT1 A 1 A_Jump(192, "BeatSupport")
	TNT1 A 1 A_Jump(256, "EnergyBalancer")
	stop
	
AssistOther:
TNT1 A 1 A_Jump(128, "ReggaeCall")
TNT1 A 1 A_Jump(256, "EnergyBalancer")
stop

Pickups:
TNT1 A 1 A_Jump(96,
"BigHealth",
"BigWeaponEnergy"
)
TNT1 A 1 A_Jump(256,
"SmallHealth",
"WeaponEnergy"
)
stop

ETank:
TNT1 A 1 A_SpawnItemEx("ETank")
stop
WTank:
TNT1 A 1 A_SpawnItemEx("WTank")
stop
MTank:
TNT1 A 1 A_SpawnItemEx("MTank")
PRTB C 0 A_SpawnItemEx("DoveSpawner",0,0,0,random(-3,3),random(-3,3))
stop
TangoSummon:
TNT1 A 1 A_SpawnItemEx("TangoSummon")
stop
TrebleSentry:
TNT1 A 1 A_SpawnItemEx("TrebleSentry")
stop
EddieBomber:
TNT1 A 1 A_SpawnItemEx("EddieBomber")
stop
BeatSupport:
TNT1 A 1 A_SpawnItemEx("BeatSupport")
stop
ReggaeCall:
TNT1 A 1 A_SpawnItemEx("ReggaeCall")
stop
EnergyBalancer:
TNT1 A 1 A_SpawnItemEx("EnergyBalancer")
stop
SmallHealth:
TNT1 A 1 A_SpawnItemEx("SmallHealth")
stop
BigHealth:
TNT1 A 1 A_SpawnItemEx("BigHealth")
stop
WeaponEnergy:
TNT1 A 1 A_SpawnItemEx("WeaponEnergy")
stop
BigWeaponEnergy:
TNT1 A 1 A_SpawnItemEx("BigWeaponEnergy")
stop
}
}