actor StarCrashBoss : BaseMM8BDMWep_CBM
{
dropitem "StarCrashWepCDropped"
weapon.ammouse 1
Weapon.AmmoGive 0
Weapon.SlotNumber 7
Obituary "$OB_STARCRASH"
weapon.ammotype "SuperStarPowerAmmo"
+WEAPON.ALT_AMMO_OPTIONAL
States
{
Spawn:
C_05 E 1
loop
Ready:
STAC A 0 ACS_ExecuteAlways(998,0,804)
STAC A 0 //A_GunFlash
STAC A 0 A_ClearRefire
STAC A 0 A_JumpIfInventory("SuperStarPowerAmmo",6,"Ready2")
STAC A 7 A_WeaponReady(WRF_NOFIRE)
STAC A 0 A_GiveInventory("SuperStarPowerAmmo",2)
Goto Ready+3
Ready2:
STAC A 0 A_JumpIfInventory("SuperStarPowerAmmo",14,"Ready3")
STAC A 7 A_WeaponReady(WRF_NOPRIMARY)
STAC A 0 A_GiveInventory("SuperStarPowerAmmo",2)
loop
Ready3:
STAC A 7 A_WeaponReady
STAC A 0 A_GiveInventory("SuperStarPowerAmmo",2)
loop
Deselect:
STAC A 0 A_JumpIfInventory("ShieldCheck",1,24)
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
STAC A 1 A_Lower
Goto Deselect+1
STAC A 0
STAC A 0 A_TakeInventory("ShieldCheck",99)
//STAC A 0 A_TakeInventory("StarCheck",99)
STAC A 0 A_TakeInventory("StarCheck",99)
STAC A 0 A_TakeInventory("GuardUpFlag",99)
STAC A 0 A_TakeInventory("StarArmorPower",99)
STAC A 0 //A_FireCustomMissile("StarCrash",0,0,0,0)
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
Goto Deselect+1
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
STAC A 1 A_Raise
Loop
Fire:
STAC A 1 A_JumpIfInventory("ShieldCheck",1,"ShieldThrow")
//STAC A 0 A_JumpIfInventory("SuperStarPowerAmmo",14,"ShieldActive")

STAC A 0 A_JumpIfNoAmmo("NoAmmo")
//STAC A 0 A_TakeInventory("SuperStarPowerAmmo",1)
STAC A 0 A_PlaySoundEx("weapon/StarMain","Weapon")
STAC A 0 A_GiveInventory("SemiStunArmor",1)
//STAC A 0 A_GiveInventory("StarCheck",1)
STAC A 0 A_GiveInventory("GuardUpFlag",1)
STAC A 0 A_GiveInventory("StarArmorPower",1)
STAC A 0 A_GiveInventory("ShieldCheck",1)
goto ShieldActive
Hold:
STAC A 1
goto Ready+2
ShieldActive:
STAC AA 1 A_SpawnItemEx("StarCrash1B",0,0,28,momx,momy,momz,0,9,0)//SXF_ABSOLUTEMOMENTUM|SXF_TRANSFERTRANSLATION
STAC BB 1 A_SpawnItemEx("StarCrash2B",0,0,28,momx,momy,momz,0,9,0)
STAC A 0 A_SpawnItemEx("SMStarRadius",0,0,28)
STAC BB 1 A_SpawnItemEx("StarCrash3B",0,0,28,momx,momy,momz,0,9,0)
STAC BB 1 A_SpawnItemEx("StarCrash4B",0,0,28,momx,momy,momz,0,9,0)
STAC B 0 A_SpawnItemEx("SMStarRadius",0,0,28)
goto Shield
Shield:
STAC B 1 A_WeaponReady
STAC B 0 A_SpawnItemEx("StarCrash1B",0,0,28,momx,momy,momz,0,9,0)
STAC B 1 A_WeaponReady
STAC B 0 A_SpawnItemEx("StarCrash1B",0,0,28,momx,momy,momz,0,9,0)
STAC B 1 A_WeaponReady
STAC B 0 A_SpawnItemEx("StarCrash2B",0,0,28,momx,momy,momz,0,9,0)
STAC B 1 A_WeaponReady
STAC B 0 A_SpawnItemEx("StarCrash2B",0,0,28,momx,momy,momz,0,9,0)
STAC B 0 A_SpawnItemEx("SMStarRadius",0,0,28)
STAC B 1 A_WeaponReady
STAC B 0 A_SpawnItemEx("StarCrash3B",0,0,28,momx,momy,momz,0,9,0)
STAC B 1 A_WeaponReady
STAC B 0 A_SpawnItemEx("StarCrash3B",0,0,28,momx,momy,momz,0,9,0)
STAC B 1 A_WeaponReady
STAC B 0 A_SpawnItemEx("StarCrash4B",0,0,28,momx,momy,momz,0,9,0)
STAC B 1 A_WeaponReady
STAC B 0 A_SpawnItemEx("StarCrash4B",0,0,28,momx,momy,momz,0,9,0)
STAC B 0 A_SpawnItemEx("SMStarRadius",0,0,28)
STAC B 0 A_TakeInventory("SuperStarPowerAmmo",1)
STAA A 0 A_JumpIfNoAmmo("ShieldThrow")
loop

ShieldThrow:
STAC B 0 A_TakeInventory("ShieldCheck",999)
STAC B 5 A_GiveInventory("StarmanMain_CI",1)
STAC A 0 A_TakeInventory("SemiStunArmor",99)
STAC A 0 A_TakeInventory("GuardUpFlag",99)
STAC A 0 A_TakeInventory("StarArmorPower",99)
STAC C 5
STAC A 20
STAC A 1
//STAC A 0 A_TakeInventory("StarCheck",1)
goto Ready+2

AltFire:
STAC A 1 A_JumpIfInventory("ShieldCheck",1,"ShieldThrow")
//STAC A 0 A_JumpIfInventory("SuperStarPowerAmmo",6,1)
//goto NoAmmo
//STAC A 0 A_GiveInventory("StarCheck",1)
STAC A 0 A_PlaySoundEx("weapon/StarMain","Weapon")
STAC A 0 A_GiveInventory("StarmanAlt_CI",1)
STAC BC 3
STAC A 12
//STAC A 0 A_TakeInventory("StarCheck",1)
STAC A 0 //A_Refire
goto Ready+2

NoAmmo:
//STAC A 1 ACS_Execute(979,0)
STAC A 0 A_TakeInventory("ShieldCheck",999)
STAC A 0 A_TakeInventory("StarCheck",1)
STAC A 0 A_TakeInventory("GuardUpFlag",99)
STAC A 0 A_TakeInventory("StarArmorPower",99)
//STAC A 0 A_Refire
goto Ready+2
Flash:
TNT1 A 0 A_JumpIfInventory("FlightDisableFlag",1,2)
TNT1 A 0
TNT1 A 1 
stop
}
}

actor SuperStarPowerAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 28
+INVENTORY.IGNORESKILL
}

actor StarCheck : OnceC{}

actor StarArmorPower : BasePowerPro
{
damagefactor "Normal", 0.5
}

actor SMStarRadius : BasicExplosion
{
Damagetype "Starcrash"
Obituary "$OB_STARCRASH"
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_Explode(8,160,0)
stop
}
}

actor StarShieldRadius : SMStarRadius
{
//Damagetype "StarCrashB"
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_Explode(12,90,0)
stop
}
}

actor StarFlurryLauncher
{
Translation "192:192=217:217","198:198=222:222"
scale 2.5
PROJECTILE
+RIPPER
-SOLID
-NOGRAVITY
+NOINTERACTION
//+DONTBLAST
+FORCEXYBILLBOARD
damage (0)
radius 1
height 1
speed 0
states
{
Spawn:
STAC D 0
STAC D 0 ACS_ExecuteAlways(259,0,1)
STAC D 14
STAC DDDDEEEEFFFFGGGDDDEEEFFGGDDEFGDEFG 1
STAC D 0 A_PlaySoundEx("weapon/StarDakka","Weapon")
Shoot:
STAC HIHI 1 A_SpawnItemEx("StarFlurryShot",cos(-pitch)*4,frandom(-3,3),8+(sin(-pitch)*4),cos(-pitch)*frandom(10,15)+frandom(0,3),frandom(-3,3),sin(-pitch)*frandom(10,15)+frandom(-1,1),0,1)

STAC D 0 A_GiveInventory("WeaponCharge",1)
STAC D 0 A_JumpIfInventory("WeaponCharge",15,"StopFlurry")
loop
StopFlurry:
STAC D 0
stop
}
}

actor StarFlurryLauncherB : StarFlurryLauncher{translation "192:192=205:205", "198:198=74:74"}
actor StarFlurryLauncherR : StarFlurryLauncher{translation "192:192=171:171", "198:198=41:41"}
actor StarFlurryLauncherO : StarFlurryLauncher{translation "192:192=104:104", "198:198=128:128"}
actor StarFlurryLauncherP : StarFlurryLauncher{translation "192:192=229:229", "198:198=232:232"}

actor StarFlurryShot
{
PROJECTILE
Damagetype "StarCrash"
Obituary "$OB_STARFLURRY"
+DONTSPLASH
Damage (5)
Radius 10
Height 10
Speed 50
scale 2.5
States
{
Spawn:
STAP ABCD 2 
loop
}
}

actor StarCrashShield : StarCrash
{
Translation "192:192=217:217","198:198=222:222"
+RIPPER
Damage (2)
Speed 20
States
{
Spawn:
STAC D 2
STAC E 2 A_SpawnItemEx("StarShieldRadius",0,0,0)
STAC F 2
STAC G 2 A_SpawnItemEx("StarShieldRadius",0,0,0)
loop
}
}

actor StarCrashShieldB : StarCrashShield{translation "192:192=205:205", "198:198=74:74"}
actor StarCrashShieldR : StarCrashShield{translation "192:192=171:171", "198:198=41:41"}
actor StarCrashShieldO : StarCrashShield{translation "192:192=104:104", "198:198=128:128"}
actor StarCrashShieldP : StarCrashShield{translation "192:192=229:229", "198:198=232:232"}

actor StarCrash1B
{
-SOLID
+NOGRAVITY
+DONTSPLASH
+NOTIMEFREEZE
Radius 1
Height 1
Scale 2.5
States
{
Spawn:
STAC D 0
STAC D 1
stop
}
}
actor StarCrash2B : StarCrash1B
{
States
{
Spawn:
STAC E 0
STAC E 1
stop
}
}
actor StarCrash3B : StarCrash1B
{
States
{
Spawn:
STAC F 0
STAC F 1
stop
}
}
actor StarCrash4B : StarCrash1B
{
States
{
Spawn:
STAC G 0
STAC G 1
stop
}
}

actor StarmanMain_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("StarCrashShield",0,0,0,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("StarCrashShieldB",0,0,0,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("StarCrashShieldR",0,0,0,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("StarCrashShieldO",0,0,0,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("StarCrashShieldP",0,0,0,0)
goto Done
Done:
TNT1 A 0 A_TakeInventory("SuperStarPowerAmmo",14)
stop
}
}

actor StarmanAlt_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("StarFlurryLauncher",0,0,-8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("StarFlurryLauncherB",0,0,-8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("StarFlurryLauncherR",0,0,-8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("StarFlurryLauncherO",0,0,-8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("StarFlurryLauncherP",0,0,-8,0)
goto Done
Done:
TNT1 A 0 A_TakeInventory("SuperStarPowerAmmo",7)
stop
}
}