actor PolarisBoostUpgrade : BaseMM8BDMBusterUpgrade
{
inventory.amount 1
inventory.maxamount 1
inventory.pickupmessage "$PU_POLARISBOOST"
Tag "$TAG_POLARISBOOST"
inventory.icon "PBSTICON"
Inventory.PickupSound "item/1up"
Inventory.RespawnTics 525
scale 2.0
+COUNTITEM
+INVBAR
states
{
SpawnLoop:
PBST Z 1
loop
Use:
TNT1 A 0 A_PlaySoundEx("item/refill","Voice")
TNT1 A 0 A_GiveInventory("BusterGiven",1)
TNT1 A 0 A_GiveInventory("PolarisBoost",1)
TNT1 A 0 A_SelectWeapon("PolarisBoost")
stop
}
}


actor PolarisBoostUpgrade_Respawn : 8BDMItemRespawn
{
	translation "192:192=68:68", "198:198=120:120"
	mass 525
}
actor PolarisBoostUpgrade_RespawnShadow : 8BDMItemRespawnShadow
{
	mass 525
	States
	{
	Spawn:
		PBST Z 0
		goto Super::Spawn
	}
}

actor PolarisBoost_NormalBar : NormalBar {args 68,120}
actor PolarisBoost : BaseMM8BDMWep
{
Weapon.AmmoUse 1
Weapon.AmmoGive 30
Weapon.SlotNumber 1
Inventory.Pickupmessage "$PU_POLARISBOOST"
Obituary "$OB_POLARISBOOST"
Tag "$TAG_POLARISBOOST"
weapon.ammotype "PolarisBoostMeter"
inventory.icon "NULLICON"
Dropitem ""
States
{
Spawn:
PBST Z 1
stop
Ready:
PBST A 0 A_JumpIfInventory("BusterGiven",1,"TakeBusters")
Goto Ready2
TakeBusters:
PBST A 0 A_GiveInventory("TakeBuster", 1)
Goto Ready2
Ready2:
PBST A 0 ACS_NamedExecuteWithResult("core_weaponcolor",COLOR_POLARISBOOST)
PBST A 0 ACS_NamedExecuteAlways("vile_PolarisBoost",0)
PBST A 0 A_SpawnItemEx("Booster20",0,0,0,0,0,0,0,0)
Ready3:
PBST A 1 A_WeaponReady
goto Ready3
ReadyC: Goto Ready3
Deselect:
PBST A 0 
goto DeselectSwap
Select:
PBST A 0 
goto SelectSwap
Fire:
PBST A 0 A_PlaySoundEx("weapon/TriadMissileFire","Weapon")
PBST A 0 A_FireCustomMissile("PolarisShot",0,0,8,0)
PBST BC 2
PBST A 1
PBST A 0 A_Refire
goto Ready3
}
}

actor PolarisBoostMeter : Ammo
{
inventory.amount 1
inventory.maxamount 30
+INVENTORY.IGNORESKILL
}

actor PolarisBoost_F : Once {}

actor PolarisShot : MegaShot
{
+BRIGHT
Obituary "$OB_POLARISBOOST"
Damage (CallACS("vile_cbm_damage",10))
scale 5.0
States
{
Spawn:
TNT1 A 2
PBST D 18
Death:
PBST D 0 A_SpawnItemEx("SpurShotFlashyEndStar", 5, 0, -3, 0, 0, 0)
stop
}
}


actor Booster20 : BasicShieldWarper
{
speed 100
translation "192:192=101:101", "198:198=120:120"
States
{
Spawn:
TNT1 A 0
TNT1 A 0 ACS_NamedExecuteAlways("core_shieldwarper", 0, 1)
TNT1 A 0 A_GiveInventory("MM8BDMProjSpawnFuncClient",1)
TNT1 A 0 A_Jump(256, "Shield")
Goto Shield
Shield:
PBST E 1 A_Warp(AAPTR_TARGET, -12, 2.5, 12, 0, WARPF_COPYINTERPOLATION|WARPF_NOCHECKPOSITION)
loop
}
}


actor PolarisBoosting : CustomInventory
{
states
{
Pickup:
TNT1 A 0 A_SpawnItemEx("CSBoosterFX", 0, 0, 16, -momx/3, -momy/3, -momz/3)
TNT1 A 0 A_PlaySoundEx("Weapons/PolarisBooster", "Item")
TNT1 A 0 ACS_NamedExecuteAlways("vile_booster",0)
stop
}
}


actor CSBoosterFX
{
+BRIGHT
scale 1.5
+NOINTERACTION
+NOGRAVITY
states
{
Spawn:
BSTR ABCD 3
stop
}
}

actor PolarBoostPower : Powerup
{
Powerup.Duration 3
}