actor AstroCrushBoss : BaseMM8BDMWep_CBM
{
dropitem "CopyVisionWepCDropped"
Weapon.AmmoUse 28
Weapon.AmmoGive 28
Weapon.AmmoUse2 56
Weapon.AmmoGive2 0
Weapon.SlotNumber 6
Obituary "$OB_ASTROCRUSH"
Inventory.Pickupmessage "AAAAAAASTRO CRUSH"
weapon.ammotype "CopyAmmoC"
weapon.ammotype2 "AstroAmmoC"
States
{
Spawn:
C_08 B 1
loop
Ready:
AHUG A 0 ACS_ExecuteAlways(998,0,861)
AHUG A 0 A_GunFlash
AHUG A 0 A_JumpIfInventory("AstroAmmoC",56,"Ready2")
AHUG A 0 A_SetTranslucent(1.0,0)
AHUG A 4 A_WeaponReady(WRF_NOSECONDARY)
AHUG A 0 A_GiveInventory("CopyAmmoC",1)
AHUG A 0 A_GiveInventory("AstroAmmoC",1)
Goto Ready+2
Ready2:
AHUG A 0 A_SetTranslucent(1.0,0)
AHUG A 4 A_WeaponReady
AHUG A 0 A_GiveInventory("CopyAmmoC",1)
loop
Deselect:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
AHUG A 1 A_Lower
Loop
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
AHUG A 1 A_Raise
Loop
Fire:
AHUG A 0 A_PlaySoundEx("weapon/mbuster","Weapon")
AHUG A 0 A_JumpIfInventory("CopyAmmoC",28,"Fire2")
AHUG B 0 A_GiveInventory("CopyAmmoC",2)
AHUG B 0 A_GiveInventory("AstroAmmoC",2)
AHUG B 2 A_GiveInventory("AstroMain_CI",1)
AHUG B 2 A_GiveInventory("TargetMarkerX",1)
AHUG CC 4
AHUG A 0
goto Ready+2
Fire2:
AHUG B 0 A_GiveInventory("AstroAmmoC",2)
AHUG B 0 A_GiveInventory("AstroMain_CI",1)
AHUG B 2 A_GiveInventory("AstroMain2_CI",1)
AHUG B 2 A_GiveInventory("TargetMarkerX",1)
AHUG CC 4
AHUG A 0
goto Ready+2
Altfire:
AHUG B 0 A_JumpIfNoAmmo("NoAmmo")
Meteors:
AHUG B 0
AHUG B 0 A_Stop
//AHUG B 0 A_ChangeFlag("NOGRAVITY", 1)
AHUG B 0 A_TakeInventory("AstroAmmoC",56)
AHUG B 0 A_GiveInventory("SelfStoppedTF",1)
AHUG B 0 A_GiveInventory("AstroAltFlag",1)
AHUG BBBCCCDDDEEEFFF 1 A_Stop
TNT1 A 0 A_GiveInventory("AstroAlt_CI",1)
TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 1 A_Stop
//AHUG B 0 A_ChangeFlag("NOGRAVITY", 0)
AHUG B 0 A_GiveInventory("SelfStoppedUnfreeze",1)
AHUG B 0 A_TakeInventory("AstroAltFlag",99)
AHUG GH 3
AHUG A 14
Goto Ready+2
NoAmmo:
AHUG A 0 ACS_Execute(979,0)
Goto Ready+2
Flash:
TNT1 A 0 A_JumpIfInventory("IsDead",1,"NoFlash")
TNT1 A 0 A_JumpIfInventory("FlightDisableFlag",1,"NoFlight")
TNT1 A 0 A_JumpIfInventory("StayLocked",1,"YesFlight")
TNT1 A 0 A_JumpIfInventory("AstroFlight",1,"Flight")
goto NoFlight
Flight:
TNT1 A 0 A_JumpIf(z-floorz>=160, "NoFlight")
TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(107,0)==1, "MaybeFlight")
YesFlight:
TNT1 A 1 SetPlayerProperty(0, 1, 3)
TNT1 A 0 A_JumpIfInventory("StaminaFlag",500,"Flash")
TNT1 A 0 A_JumpIf(z-floorz==0, "Recharge")
goto Flash
MaybeFlight:
TNT1 A 0 A_TakeInventory("StaminaFlag",20)
TNT1 A 0 A_JumpIfInventory("StaminaFlag",1,"YesFlight")
goto NoFlight
NoFlight:
TNT1 A 1 SetPlayerProperty(0, 0, 3)
TNT1 A 0 A_JumpIfInventory("StaminaFlag",500,"Flash")
TNT1 A 0 A_JumpIf(z-floorz==0, "Recharge")
Goto Flash
Recharge:
TNT1 A 0 A_GiveInventory("StaminaFlag",4)
Goto Flash

}
}

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

actor AstroAmmoC : Ammo
{
inventory.amount 1
inventory.maxamount 56
+INVENTORY.IGNORESKILL
}

actor AstroFlight : OnceC{}
actor AstroAltFlag : OnceC{}

actor AstroFlightItem : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
inventory.pickupmessage "Oh, how did you find me? I feel so embarrassed!"
inventory.icon "AstIcon"
scale 2.0
+INVBAR
states
{
Spawn:
ASTI X 1
loop
Use:
TNT1 A 0 A_PlaySoundEx("item/ItemUseMM9","SoundSlot6")
TNT1 A 0 A_JumpIfInventory("AstroFlight",1,"Take")
TNT1 A 0 A_GiveInventory("AstroFlight",1)
fail
Take:
TNT1 A 0 A_TakeInventory("AstroFlight",999)
fail
}
}

actor CopyVision_Astro
{
translation "192:192=229:229", "198:198=128:128", "0:8=128:128", "247:247=128:128"
PROJECTILE
scale 2.5
+DONTBLAST
+RIPPER
+NOGRAVITY
//Radius 16
//Height 56
Radius 12
Height 42
speed 0.01
+THRUGHOST
+DONTREFLECT
damage(0)
/*
-NOBLOCKMAP
-SHOOTABLE
+DONTRIP
health 9999
mass 0x7ffffffff
painchance 256
*/
reactiontime 18
States
{
Spawn:
//TFOG ABC 2
ASTM G 0 
ASTM G 0 ACS_ExecuteAlways(989, 0, ACS_ExecuteWithResult(257)+100, 32)
ASTM G 1 A_PlaySoundEx("weapon/copyvision", "weapon")
TNT1 A 1
ASTM G 1
TNT1 A 1
ASTM G 1
TNT1 A 1//6
//ASTM G 0 A_Changeflag("shootable",1)
goto Shoot
Shooting:
ASTM G 1
TNT1 A 1
ASTM G 1
TNT1 A 1
ASTM G 1
TNT1 A 1//6
Shoot:
ASTM G 1
TNT1 A 1//2
ASTM G 1// A_GiveToTarget("TargetMarkerX", 1)
TNT1 A 1
ASTM G 1 ACS_ExecuteAlways(989, 0, ACS_ExecuteWithResult(257)+100, 32)
TNT1 A 1//4
//ASTM G 0 A_CustomMissile("CopyShot",35,5,0,2,0)
ASTM G 0 A_PlaySoundEx("weapon/mbuster","Weapon")
//ASTM G 0 A_CustomMissile("CopyShotClone",32,0,0,2,-pitch)
ASTM G 0 A_SpawnItemEx("CopyShotClone",cos(-pitch)*8,0,32+(sin(-pitch)*8),cos(-pitch)*26,0,sin(-pitch)*26,0,1,0)
//ASTM G 0 A_SpawnItemEx("CopyShot_Astro",0,0,33,momx*100*26,momy*100*26,momz*100*26,0,SXF_ABSOLUTEMOMENTUM)
ASTM G 0 A_Countdown
ASTM G 0 A_JumpIf(ACS_ExecuteWithResult(C_CHECK_TARGET_OOC)==0,"Death")
goto Shooting
//Pain.MagicCard:
//COPY BA 3 A_TakeFromTarget("CopyFlag")
//Stop
Death:
//TFOG CBA 2
TNT1 A 6
Stop
}
}

actor CopyVision_Astro2 : CopyVision_Astro
{
reactiontime 1
States
{
Spawn:
//TFOG ABC 2
ASTM G 1
TNT1 A 1
ASTM G 1
TNT1 A 1
ASTM G 1
TNT1 A 1//6
goto Shoot
}
}

actor CopyVision_AstroB : CopyVision_Astro   { translation "192:192=205:205", "198:198=74:74", "0:8=74:74", "247:247=74:74"}
actor CopyVision_Astro2B : CopyVision_Astro2 { translation "192:192=205:205", "198:198=74:74", "0:8=74:74", "247:247=74:74"}
actor CopyVision_AstroR : CopyVision_Astro   { translation "192:192=171:171", "198:198=41:41", "0:8=41:41", "247:247=41:41"}
actor CopyVision_Astro2R : CopyVision_Astro2 { translation "192:192=171:171", "198:198=41:41", "0:8=41:41", "247:247=41:41"}
actor CopyVision_AstroO : CopyVision_Astro   { translation "192:192=104:104", "198:198=128:128", "0:8=128:128", "247:247=128:128"}
actor CopyVision_Astro2O : CopyVision_Astro2 { translation "192:192=104:104", "198:198=128:128", "0:8=128:128", "247:247=128:128"}
actor CopyVision_AstroP : CopyVision_Astro   { translation "192:192=229:229", "198:198=232:232", "0:8=232:232", "247:247=232:232"}
actor CopyVision_Astro2P : CopyVision_Astro2 { translation "192:192=229:229", "198:198=232:232", "0:8=232:232", "247:247=232:232"}


actor CopyShot_Astro
{
Translation "198:198=128:128"
PROJECTILE
+DONTBLAST
Obituary "$OB_ASTROSHOT"
Speed 26
Damage (10)
DamageType "CopyVision"
radius 5
height 5
scale 2.5
States
{
Spawn:
COPZ ABC 2 A_SpawnItemEx("CopyShot_AstroFX",0,0,0,0,0,0,0,1)
loop
Death:
TNT1 A 0 
stop
}
}


actor CopyShot_AstroB : CopyShot_Astro{translation "198:198=74:74"}
actor CopyShot_AstroR : CopyShot_Astro{translation "198:198=41:41"}
actor CopyShot_AstroO : CopyShot_Astro{translation "198:198=128:128"}
actor CopyShot_AstroP : CopyShot_Astro{translation "198:198=232:232"}

actor CopyShot_AstroFX
{
+NOINTERACTION
+CLIENTSIDEONLY
-SOLID
+NOGRAVITY
Height 1
Radius 1
Scale 2.5
States
{
Spawn:
TNT1 A 2
COPZ DEFG 2
stop
}
}

actor CopyShotClone : CopyShot_Astro
{
Damage (8)
obituary "$OB_COPYVISION"
States
{
Spawn:
TNT1 A 1
Spawn2:
COPZ ABC 2 A_SpawnItemEx("CopyShot_AstroFX",0,0,0,0,0,0,0,1)
loop
}
}

actor AstroCrushSpawnerB : BasicHelper
{
translation "198:198=128:128"
ReactionTime 10
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_SpawnItemEx("AstroCrushB",random(300,-300),random(256,-256),320,0,0,random(-20,-22),0,1)
TNT1 A 1 A_SpawnItemEx("AstroCrushB",random(300,-300),random(256,-256),320,0,0,random(-20,-22),0,1)
TNT1 A 1 A_CountDown
loop
}
}

actor AstroCrushSpawnerBB : AstroCrushSpawnerB{translation "198:198=74:74"}
actor AstroCrushSpawnerBR : AstroCrushSpawnerB{translation "198:198=41:41"}
actor AstroCrushSpawnerBO : AstroCrushSpawnerB{translation "198:198=128:128"}
actor AstroCrushSpawnerBP : AstroCrushSpawnerB{translation "198:198=232:232"}

actor AstroCrushB : AstroCrush
{
+DONTREFLECT
height 12
radius 24
Damage (6)
Scale 2.5
Reactiontime 20
States
{
Spawn:
COPZ H 0
COPZ H 0 A_ChangeVelocity(0,0,momz,CVF_RELATIVE|CVF_REPLACE)
COPZ HHHIIIJJJ 1 A_JumpIf(ceilingz-z>12, "Spawn2")
COPZ H 0 A_JumpIf(momz==0,"Death")
COPZ H 0 A_CountDown
Goto Spawn+2
Spawn2:
COPZ H 0 A_ChangeFlag("RIPPER", 0)
COPZ H 0 A_ChangeFlag("NOINTERACTION",0)
COPZ HIJ 3 A_ChangeVelocity(0,0,momz,CVF_RELATIVE|CVF_REPLACE) 
COPZ H 0 A_JumpIf(momz==0,"Death")
COPZ H 0 A_CountDown
Goto Spawn2+2
Death:
TA_C A 0 A_playSoundEx("weapon/astrocrush","Weapon")
//needs A_SetScale
TA_C A 0 A_Stop
TA_C A 0 A_ChangeFlag(NOGRAVITY,1)
TA_C A 0 A_Explode(32,160,0)//24 128//
TA_C ABCDEF 2
stop
}
}


actor AstroMain_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("CopyShot_Astro",0,0,0,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("CopyShot_AstroB",0,0,0,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("CopyShot_AstroR",0,0,0,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("CopyShot_AstroO",0,0,0,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("CopyShot_AstroP",0,0,0,0)
goto Done
}
}

actor AstroMain2_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("CopyVision_Astro",0,1,0,-30)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("CopyVision_AstroB",0,1,0,-30)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("CopyVision_AstroR",0,1,0,-30)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("CopyVision_AstroO",0,1,0,-30)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("CopyVision_AstroP",0,1,0,-30)
goto Done
}
}

actor AstroAlt_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("AstroCrushSpawnerB",0,1,0,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("AstroCrushSpawnerBB",0,1,0,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("AstroCrushSpawnerBR",0,1,0,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("AstroCrushSpawnerBO",0,1,0,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("AstroCrushSpawnerBP",0,1,0,0)
goto Done
}
}