actor JoeUpgrade : BaseMM8BDMBusterUpgrade
{
inventory.amount 1
inventory.maxamount 1
Tag "$TAG_JOEUPGRADE"
inventory.pickupmessage "$PU_JOEUPGRADE"
inventory.icon "JOEBUP"
Inventory.PickupSound "item/1up"
Inventory.RespawnTics 350
scale 2.0
+COUNTITEM
+INVBAR
states
{
SpawnLoop:
JOBS I 1 
loop
Use:
TRBB I 0 A_PlaySoundEx("item/refill","Voice")
TNT1 A 0 A_GiveInventory("BusterGiven",1)
TRBB I 0 A_GiveInventory("JoeBusterEnc",1)
TRBB I 0 A_SelectWeapon("JoeBusterEnc")
stop
}
}

actor JoeUpgrade_Respawn : 8BDMItemRespawn
{
	translation "192:192=4:4", "198:198=110:110"
	mass 350
}
actor JoeUpgrade_RespawnShadow : 8BDMItemRespawnShadow
{
	mass 350
	States
	{
	Spawn:
		JOBS I 0
		goto Super::Spawn
	}
}

actor JoeBusterEnc_MugshotColor : MugshotColor { args 4, 110 }
actor JoeBusterEnc : BaseMM8BDMWep
{
Weapon.AmmoUse 1
Weapon.AmmoGive 3
Weapon.SlotNumber 1
Inventory.Pickupmessage "$PU_JOEUPGRADE"
Obituary "$OB_JOEBUSTER"
Tag "$TAG_JOEBUSTER"
weapon.ammotype "BusterAmmo"
inventory.icon "NULLICON"
Dropitem ""
States
{
SpawnLoop:
JOBS I 1
stop
Ready:
JOBS F 0 A_TakeInventory("StopShield",1)
JOBS B 0 A_JumpIfInventory("BusterGiven",1,"TakeBusters")
Goto Ready2
TakeBusters:
TNT1 Q 0 A_GiveInventory("TakeBuster", 1)
Goto Ready2
Ready2:
JOBS F 0 ACS_NamedExecuteWithResult("core_weaponcolor",CLR_BUBBLEMAN)
JOBS F 0
JOBS F 0 A_TakeInventory("StopShield",1)
JOBS F 0 A_GunFlash
JOBS HGF 1 A_WeaponReady
Goto Ready2+6
Deselect:
JOBS F 0 A_GiveInventory("StopShield",1)
JOBS FFGH 1
JOBS F 0 
goto DeselectSwap
Select:
JOBS F 0
goto SelectSwap
Altfire:
JOBS F 0 A_JumpIfInventory("Vile_ClassAltfire", 1, "ClassAltfire")
JOBS F 0 A_JumpIf(CallACS("Vile_class_altfire"), "ClassAltfire")
JOBS F 1 A_JumpIfInventory("MM8BDMPlayer", 1, 1)
wait
JOBS F 0
Fire:
JOBS C 0 A_GiveInventory("StopShield",1)
JOBS FGC 1
Altfire.a:
JOBS C 0 A_PlaySoundEx("misc/devilfire","Weapon")
JOBS C 0 A_FireCustomMissile("JoeBShot",0,0,8,0)
JOBS DE 2
JOBS D 0 A_GiveInventory("WeaponCharge",1)
JOBS D 0 A_JumpIfInventory("WeaponCharge",3,2)
JOBS D 0 A_Refire("Altfire.a")
JOBS DC 2
JOBS C 10 A_TakeInventory("WeaponCharge",999)
JOBS CCCCC 1 A_Refire("Altfire.a")
goto Ready2+2
Flash:
TNT1 A 0 A_SpawnItemEx("ProtoShieldHitbox1",28,-16,8,0,0,0,0,1)
TNT1 A 0 A_SpawnItemEx("ProtoShieldHitbox2",28,-8,8,0,0,0,0,1)
TNT1 A 0 A_SpawnItemEx("ProtoShieldHitbox3",28,0,8,0,0,0,0,1)
TNT1 A 0 A_SpawnItemEx("ProtoShieldHitbox4",28,8,8,0,0,0,0,1)
TNT1 A 0 A_SpawnItemEx("ProtoShieldHitbox5",28,16,8,0,0,0,0,1)
FlashLoop:
TNT1 A 0 A_SpawnItemEx("JoeShieldFX",23,-10,8,momx,momy,momz,0,9,0)
TNT1 A 1 A_JumpIfInventory("StopShield",1,"NoFlash")
TNT1 A 0 A_JumpIfInventory("IsDead",1,"NoFlash")
loop
ReadyC:
JOBS F 0 A_TakeInventory("StopShield",1)
Goto Ready2+1
NoFlash:
TNT1 A 0 
Stop
ClassAltfire:
JOBS F 0 A_GiveInventory("StopShield")
goto Super::Altfire
}
}

actor JoeBShot : MegaShot
{
translation "210:210=110:110"
Damage (CallACS("vile_cbm_damage",13))
damagetype "JoeBusterEnc"
Obituary "$OB_JOEBUSTER"
States
{
Spawn:
TNT1 A 2
JOBS A 2 
JOBS A 0 A_ChangeFlag("THRUGHOST", 0)
JOBS A 1
goto spawn+3
Death:
MMJT EFG 2
stop
}
}

actor JoeShieldFX
{
-SOLID
+NOGRAVITY
+NOBLOCKMAP
+FIXMAPTHINGPOS
+NOTIMEFREEZE
Height 0
Radius 0
scale 2.5
+CLIENTSIDEONLY
+NOINTERACTION
States
{
Spawn:
TNT1 A 0
JOBS B 2
stop
}
}