actor RevolverUpgrade : BaseMM8BDMBusterUpgrade
{
inventory.amount 1
inventory.maxamount 1
inventory.pickupmessage "$PU_REVOLVERUPGRADE"
Tag "$TAG_REVOLVERUPGRADE"
inventory.icon "RVLBUP"
Inventory.PickupSound "item/1up"
Inventory.RespawnTics 350
scale 2.0
+COUNTITEM
+INVBAR
states
{
SpawnLoop:
RVLB A 1 
loop
Use:
TRBB I 0 A_PlaySoundEx("item/refill","Voice")
TNT1 A 0 A_GiveInventory("BusterGiven",1)
TRBB I 0 A_GiveInventory("RevolverBusterEnc",1)
TRBB I 0 A_SelectWeapon("RevolverBusterEnc")
stop
}
}

actor RevolverUpgrade_Respawn : 8BDMItemRespawn
{
	translation "192:192=71:71", "198:198=76:76"
	mass 350
}
actor RevolverUpgrade_RespawnShadow : 8BDMItemRespawnShadow
{
	mass 350
	States
	{
	Spawn:
		RVLB A 0
		goto Super::Spawn
	}
}

actor RevolverBusterEnc_MugshotColor : MugshotColor { args 71, 76 }
actor RevolverBusterEnc_NormalBar : NormalBar{args 71, 76}
actor RevolverBusterEnc_ScriptBar : ScriptBar{}
actor RevolverBusterEnc : BaseMM8BDMWep 
{
Weapon.AmmoUse 5 
Weapon.AmmoGive 30 
Weapon.SlotNumber 1 
Obituary "$OB_REVOLVERBUSTER" 
Tag "$TAG_REVOLVERBUSTER"
Inventory.Pickupmessage "$PU_REVOLVERUPGRADE"
weapon.ammotype "RevolverBusterAmmoEnc" 
inventory.pickupsound "weapon/weaponup" 
inventory.icon "NULLICON"
+WEAPON.AMMO_OPTIONAL
+WEAPON.DONTBOB
Scale 2.0
Dropitem ""
States
{
SpawnLoop: 
RVLB A 0 
Stop
Ready:
MAEB B 0 A_JumpIfInventory("BusterGiven",1,"TakeBusters")
Goto Ready2
TakeBusters:
TNT1 Q 0 A_GiveInventory("TakeBuster", 1)
Goto Ready2
Ready2:
RVLB B 0 ACS_NamedExecuteWithResult("core_weaponcolor",CLR_REVOLVERBUSTER)
RVLB B 2 A_WeaponReady
Goto Ready2+1
Deselect: 
RVLB B 0
goto DeselectSwap
Select: 
RVLB B 0
Goto SelectSwap
Fire:
RVLB B 0 A_JumpIfNoAmmo("NoAmmo")
RVLB C 1
RVLB B 0 A_PlaySoundEx("misc/fakeshot","Weapon") 
RVLB B 0 A_FireCustomMissile("RevolverBusterEncProjectile",0,5,15,0) 
RVLB CCDE 1
RVLB B 0 A_Refire("FireH")
RVLB B 0 A_JumpIfNoAmmo("NoAmmo")
Goto Ready2+1
Altfire:
RVLB B 0 A_JumpIfInventory("Vile_ClassAltfire", 1, "ClassAltfire")
RVLB B 0 A_JumpIf(CallACS("Vile_class_altfire"), "ClassAltfire")
RVLB B 1 A_JumpIfInventory("MM8BDMPlayer", 1, 1)
wait
RVLB B 0
RVLB B 0 A_JumpIfInventory("RevolverBusterAmmoEnc",30,"Altfire.b")
RVLB B 0 A_TakeInventory("RevolverBusterAmmoEnc",99)
RVLB B 0 A_PlaySoundEX("weapon/RevolverBusterReload","Weapon")
RVLB CDEBCDEBCDEBCDE 2
RVLB BCDEBCDEBCDEBC 2 A_GiveInventory("RevolverBusterAmmoEnc",2)
RVLB B 0 A_GiveInventory("RevolverBusterAmmoEnc",30)
Goto Ready2+1
Altfire.B:
RVLB B 0 A_JumpIfNoAmmo("NoAmmo")
RVLB C 1
RVLB B 0 A_PlaySoundEx("misc/fakeshot","Weapon") 
RVLB B 0 A_FireCustomMissile("RevolverBusterEncProjectile",0,5,15,0) 
RVLB CCDE 1
RVLB B 3
RVLB B 0 A_Refire("Altfire.b")
RVLB B 0 A_JumpIfNoAmmo("NoAmmo")
Goto Ready2+1
Noammo:
RVLB B 0 A_JumpIfInventory("RevolverBusterAmmoEnc",30,"FullAmmo")
RVLB B 0 A_TakeInventory("RevolverBusterAmmoEnc",99)
RVLB B 0 A_PlaySoundEX("weapon/RevolverBusterReload","Weapon")
RVLB CDEBCDEBCDEBCDE 2
RVLB BCDEBCDEBCDEBC 2 A_GiveInventory("RevolverBusterAmmoEnc",2)
RVLB B 0 A_GiveInventory("RevolverBusterAmmoEnc",30)
Goto Ready2+1
FullAmmo:
RVLB B 0
Goto Ready2+1
FireH:
RVLB B 1 A_RailWait
RVLB B 0 A_JumpIfInventory("IsBot", 1, "BotFire")
RVLB B 0 A_Refire("FireH")
Goto Ready2+1
BotFire:
RVLB B 2 A_RailWait
Goto Ready2+1
ReadyC:
Goto Ready2+1
ClassAltfire:
RVLB B 0 
goto Super::Altfire
}
}

actor RevolverBusterAmmoEnc : Ammo 
{
inventory.amount 1
inventory.maxamount 30
}

actor RevolverBusterEncProjectile : BasicProjectile
{
PROJECTILE 
Radius 8 
Height 8
scale 2.75
damage (CallACS("vile_cbm_damage",20)) 
DamageType "FakeRevolving"
Obituary "$OB_REVOLVERBUSTER" 
+FORCEXYBILLBOARD 
+DontBlast
bouncecount 8
speed 65
States
{
Spawn:
RVLB G 1 
loop
Death:
MMJT EFG 2
stop
}
}