actor RighteousBison_NormalBar : NormalBar {args 144,5}

actor RighteousBisonUpgrade : BaseMM8BDMBusterUpgrade
{
inventory.amount 1
inventory.maxamount 1
inventory.pickupmessage "$PU_RIGHTEOUSBISON"
Tag "$TAG_RIGHTEOUSBISON"
inventory.icon "RCHBICON"
Inventory.PickupSound "item/1up"
Inventory.RespawnTics 350
scale 2.0
+COUNTITEM
+INVBAR
states
{
SpawnLoop:
RCHB Z 1 
loop
Use:
TRBB I 0 A_PlaySoundEx("item/refill","Voice")
TNT1 A 0 A_GiveInventory("BusterGiven",1)
TRBB I 0 A_GiveInventory("RighteousBison",1)
TRBB I 0 A_SelectWeapon("RighteousBison")
stop
}
}

actor RighteousBisonUpgrade_Respawn : 8BDMItemRespawn
{
	translation "192:192=144:144", "198:198=5:5"
	mass 350
}
actor RighteousBisonUpgrade_RespawnShadow : 8BDMItemRespawnShadow
{
	mass 350
	States
	{
	Spawn:
		RCHB Z 0
		goto Super::Spawn
	}
}

actor RighteousBison : BaseMM8BDMWep
{
Weapon.AmmoUse 1
Weapon.AmmoGive 4
Weapon.SlotNumber 1
scale 2.0
inventory.pickupmessage "$PU_RIGHTEOUSBISON"
Tag "$TAG_RIGHTEOUSBISON"
obituary "$OB_RIGHTEOUSBISON"
inventory.icon "NULLICON"
weapon.ammotype "RighteousBisonAmmo"
+WEAPON.AMMO_OPTIONAL
+WEAPON.DONTBOB
States
{
Spawn:
RCHB Z 1
stop
Ready:
RCHB B 0 A_JumpIfInventory("BusterGiven",1,"TakeBusters")
Goto Ready2
TakeBusters:
RCHB B 0 A_GiveInventory("TakeBuster", 1)
Goto Ready2
Ready2:
RCHB A 0 ACS_NamedExecuteWithResult("core_weaponcolor",COLOR_RIGHTEOUSBISON)//ACS_ExecuteAlways(998,0,COLOR_RIGHTEOUSBISON)
RCHB A 1 A_WeaponReady
Goto Ready2+1
ReadyC: Goto Ready2+1
Deselect:
RCHB A 0 
goto DeselectSwap
Select:
RCHB A 0 
goto SelectSwap
Fire:
RCHB A 0 A_PlaySoundEx("misc/eclipsepain1","Weapon")
RCHB B 2 A_FireCustomMissile("RighteousBisonShot",0,1,8,0)
RCHB CBA 5
RCHB A 0 A_JumpIfNoAmmo(2)
RCHB A 0 A_Refire
RCHB A 1 OffSet(0,24)
RCHB A 2 OffSet(0,16)
RCHB A 1 OffSet(0,44)
FireReload:
RCHB A 0 
RCHB A 0 A_PlaySoundEx("weapon/adapterreturn","Weapon")
RCHB A 3 OffSet(0,62)A_GiveInventory("RighteousBisonAmmo",1)
RCHB A 3 OffSet(0,57)
RCHB A 0 A_JumpIfInventory("RighteousBisonAmmo",4,1)
goto FireReload
RCHB A 2 OffSet(0,44)
RCHB A 3 A_WeaponReady(14)
goto Ready2+1

Flash:
TNT1 A 0 A_JumpIfInventory("IsDead",1,"NoFlash")
NoFlash:
TNT1 A 0
stop

NoAmmo:
RCHB A 1
Goto Ready3
}
}

actor RighteousBisonAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 4
+INVENTORY.IGNORESKILL
}

actor RighteousBisonShot : BasicProjectile
{
+BRIGHT
PROJECTILE
+LOOKALLAROUND
+SKYEXPLODE
+DONTREFLECT
+DONTBLAST
+RIPPER
//renderstyle add
radius 20
height 20
speed 25
damage (CallACS("vile_cbm_damage",14))
obituary "$OB_RIGHTEOUSBISON"
damagetype "RighteousBison"
States
{
Spawn:
RCHB F 1 A_SpawnItemEx("RighteousBisonFX")
loop
}
}

actor RighteousBisonFX : BasicGraphicEffect
{
+BRIGHT
renderstyle add
alpha 0.90
Scale 2.5
states
{
SpawnFrame:
RCHB GG 1
Spawn2:
RCHB G 0 A_SetScale(scaleX-0.3)
RCHB G 1 A_FadeOut(0.08)
loop
Death:
TNT1 A 0
stop
}
}


actor RighteousBisonDeathFX : BasicGraphicEffect
{
States
{
SpawnFrame:
PIXL A 0 A_SetScale(random(2.5,7.5),random(2.5,8))
SpawnFrameL:
PIXL A 0 A_SetScale(scalex-0.25,scaley+0.25)
PIXL A 1 A_FadeOut
loop
}
}