actor StarmanBossWeapon : MegaBuster
{
tag "PSI Abilities"
Weapon.AmmoUse 0
Weapon.AmmoGive 0
Weapon.SlotNumber 1
//Obituary "%o was sliced by \ctGhost of Starman\c- (%k)!"
Obituary "$OB_GSTSLASH"
+INVENTORY.UNDROPPABLE
weapon.ammotype "BossJumpCharge"
weapon.ammotype2 "BossRageCharge"
+WEAPON.AMMO_OPTIONAL
Scale 2.0
States
{
Spawn:
TNT1 A 0
stop
Ready:
SXH1 G 0 ACS_NamedExecuteAlways("GiveExecution",0)
SXH1 A 0 ACS_ExecuteAlways(991,0,501)
SXH1 G 1 A_WeaponReady(WRF_NOSWITCH)
SXH1 G 0 A_GunFlash
Goto Ready+1
Deselect:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
SXH1 G 1 A_Lower
Loop
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
SXH1 G 1 A_Raise
Loop
Fire:
CutYouDownToSize:
SXH1 H 2
SXH1 G 0 A_TakeInventory("WeaponCharge", 999)
SXH1 I 2 A_PlaySoundEx("weapon/slashclaw","Weapon")
SXH1 J 1 A_FireCustomMissile("StarmanSlash",0,1,0,0)
SXH1 JK 3
SXH1 K 3
SXH1 HH 4 Offset(-10,20)
SXH1 HG 3
Goto Ready+1

AlphaMeteor:
SXH1 GH 1
SXH1 H 0 A_PlaySoundEx("Starman/Casting","Weapon")
SXH1 H 1 A_FireCustomMissile("PSIStarStormAlphaPinpoint",0,1,0,0)
SXH1 H 3 Offset(-10,20)
SXH1 I 3
SXH1 IIIIIIIIII 4 Offset(-10,20)A_GiveInventory("BossJumpCharge",1)
SXH1 IHHHHGG 2 A_GiveInventory("BossJumpCharge",1)
SXH1 G 0 A_TakeInventory("WeaponCharge", 999)
SXH1 G 1 A_Refire
Goto Ready+1
AltFire:
SXH1 G 0 A_JumpIfInventory("BossRageCharge",500,"Rage")
SXH1 G 1
Goto Alphameteor
Rage:
SXH1 G 0 ACS_Execute(719,0,0)
SXH1 G 0 A_PlaySoundEx("Starman/Rage","Voice")
SXH1 G 0 A_PlaySoundEx("Starman/Starstorm","Weapon")
SXH1 G 0 A_TakeInventory("BossRageCharge",500)
SXH1 G 0 A_GiveInventory("StarmanImmune",1)
SXH1 G 0 
SXH1 NOPQR 3
TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 1 A_SpawnItemEx("PSIStarStormSpawner",random(340,-340),random(256,-256),8,0,0,random(-20,-22))
SXH1 LMG 5 ACS_ExecuteAlways(191,0,APROP_Speed,100,100)
SXH1 G 0 ACS_Execute(719,0,1)
goto Ready+1
NoAmmo:
SXH1 G 1 ACS_Execute(979,0)
Goto Ready+1
Flash:
TNT1 A 0
TNT1 A 1 A_FireCustomMissile("StarAimerFXMaker",0,0,0)
loop
}
}

actor PSIStarStormAlphaPinpoint : FastProjectile
{
PROJECTILE
+RIPPER
radius 3
height 3
speed 720
+DONTSPLASH
damage (0)
states
{
Spawn:
TNT1 A 1
goto NaturalDeath
NaturalDeath:
TNT1 A 0 A_SpawnItemEx("PSIStarStormAlphaFloor")
stop
Death:
TNT1 A 0 A_SpawnItemEx("PSIStarStormAlphaFloor", -32, 0, 0, 0, 0, 0)
stop
}
}

actor PSIStarStormAlphaFloor
{
Translation "192:192=34:34", "198:198=251:251"
species "StarManThing"
+THRUSPECIES
+MTHRUSPECIES
+FLOORHUGGER
+RIPPER
+sKYEXPLODE
+HEXENBOUNCE
BOUNCEFACTOR 0.0
WALLBOUNCEFACTOR 0.0
damage (0)
PROJECTILE
renderstyle translucent
xscale 0.25
yscale 2.5
states
{
Spawn:
TNT1 A 1
TNT1 A 0
PSIM YY 1
TNT1 A 0 A_Fadeout(0.05)
PSIM YY 1 A_SetScale(scalex + 0.125)
TNT1 A 0 A_Fadeout(0.05)
PSIM YY 1 A_SetScale(scalex + 0.25)
TNT1 A 0 A_Fadeout(0.05)
PSIM YY 1 A_SetScale(scalex + 0.25)
TNT1 A 0 A_Fadeout(0.05)
PSIM YY 1 A_SetScale(scalex + 0.325)
TNT1 A 0 A_Fadeout(0.05)
NormalVersion:
PSIM Y 1 A_Fadeout(0.05)
TNT1 A 0 A_Changeflag("FLOORHUGGER",0)
PSIM Y 1 A_Fadeout(0.05)
PSIM Y 1 ThrustThingZ(0,1600,0,0) //A_ChangeFlag("CEILINGHUGGER",1)
TNT1 A 0 A_Fadeout(0.05)
PSIM Y 1 ThrustThingZ(0,1600,0,0) //A_ChangeFlag("CEILINGHUGGER",1)
TNT1 A 0 A_Fadeout(0.05)
TNT1 A 0 A_SpawnItemEx("PSIStarStormAlpha", 0, 0, -8, 0, 0, -40)
TheEndDeath:
TNT1 A 0 A_ChangeFlag("FLOORHUGGER",1)
Ending:
PSIM Y 0
PSIM Y 1 A_FadeOut(0.05)
loop
}
}

actor PSIStarStormAlpha
{
translation "229:229=64:64", "128:128=76:76", "0:0=245:245"

Obituary "$OB_PKSTARSTORMA"
PROJECTILE
+DONTBLAST
+NOINTERACTION
damagetype "BossInstagib"
radius 7
height 7
scale 3.6
damage (20)
+SKYEXPLODE
reactiontime 15
states
{
Spawn:
ASTR B 0
ASTR B 0 A_SetTranslucent(0.01)
ASTR B 0 A_JumpIf(z-ceilingz >= -9, 2)
TNT1 A 0 A_ChangeFlag("NOINTERACTION", 0)
ASTR B 1 A_FadeIn(0.20)
ASTR B 0 A_JumpIf(z-ceilingz >= -9, 2)
TNT1 A 0 A_ChangeFlag("NOINTERACTION", 0)
ASTR C 1 A_FadeIn(0.20)
ASTR B 0 A_JumpIf(z-ceilingz >= -9, 2)
TNT1 A 0 A_ChangeFlag("NOINTERACTION", 0)
ASTR D 1 A_FadeIn(0.20)
ASTR B 0 A_JumpIf(z-ceilingz >= -9, 2)
TNT1 A 0 A_ChangeFlag("NOINTERACTION", 0)
ASTR B 1 A_FadeIn(0.20)
ASTR B 0 A_JumpIf(z-ceilingz >= -9, 2)
TNT1 A 0 A_ChangeFlag("NOINTERACTION", 0)
ASTR C 1 A_FadeIn(0.20)
StormyNight:
ASTR B 0 A_JumpIf(z-ceilingz >= -9, 2)
TNT1 A 0 A_ChangeFlag("NOINTERACTION", 0)
ASTR D 2 ThrustThingZ(0,14,1,1)
ASTR B 0 A_JumpIf(z-ceilingz >= -9, 2)
TNT1 A 0 A_ChangeFlag("NOINTERACTION", 0)
ASTR B 2 ThrustThingZ(0,14,1,1)
ASTR B 0 A_JumpIf(z-ceilingz >= -9, 2)
TNT1 A 0 A_ChangeFlag("NOINTERACTION", 0)
ASTR C 2 ThrustThingZ(0,14,1,1)
TNT1 A 0 A_CountDown
loop
Death:
ASTR D 0 A_Explode(25, 180, 0,0,135)
TNT1 A 0 A_PlaySoundEx("Starman/Exploding", "Weapon")
//TNT1 A 0 A_SpawnItemEx("FireStorm") // location checker
TNT1 AAAAAAAAAAA 0 A_SpawnItemEx("PSIStarStormAlphaMiniStar", 0, 0, -25, random(-10, 10), random(-12, 12), random(11, 22))
TNT1 AAAAA 3 A_SpawnItemEx("PSIStarStormAlphaGFX", random(-70, 70), random(-70, 70), random(-20, 50), 0, 0, 0)
stop
}
}

actor PSIStarStormAlphaGFX
{
+NOINTERACTION
PROJECTILE
scale 2.4
states
{
Spawn:
ASEX ABCDEF 1
stop
}
}

actor PSIStarStormAlphaMiniStar
{
scale 4.5
PROJECTILE
+NOINTERACTION
states
{
Spawn:
STAP CABCABC 2
Yes:
STAP AABBCC 1 A_FadeOut(0.1)
loop
Death:
TNT1 A 0
stop
}
}

actor StarmanSlash
{
Translation /*"4:4=0:0", */"208:208=0:0", "209:212=254:254", "104:111=245:245"
PROJECTILE
//+NOINTERACTION
+RIPPER
Radius 23 // 12 * 2 // 23 * 2
Height 21
scale 4.20
damage (25)
damagetype "StarManSlap"
speed 48
Obituary "$OB_GSTSLASH"
States
{
Spawn:
TNT1 A 0
SCLA HIJKL 1// A_SpawnItemEx("StarmanSlashHitbox", 0, 0, 0, 0, 0, 0, 0, SXF_ABSOLUTEMOMENTUM)
stop
}
}

actor StarManSlapProtect : PowerProtection
{ powerup.duration 3 damagefactor "StarmanSlap", 0.0}


actor PSIStarStormSpawner : FastProjectile
{
PROJECTILE
+RIPPER
radius 3
height 3
speed 0
+DONTSPLASH
damage (0)
states
{
Spawn:
TNT1 A 4
goto NaturalDeath
NaturalDeath:
TNT1 A 0 A_SpawnItemEx("PSIStarStormSpawner2")
stop
Death:
TNT1 A 0 A_SpawnItemEx("PSIStarStormSpawner2", -32, 0, 0, 0, 0, 0)
stop
}
}

actor PSIStarStormSpawner2
{
//+FLOORHUGGER
+RIPPER
+sKYEXPLODE
damage (0)
PROJECTILE
states
{
Spawn:
TNT1 A 1
TNT1 A 0 //A_JumpIf(ceilingz-floorz > 250, "NormalVersion")
/*LowCeilingOfDoomSpikes:
//TNT1 A 0 A_SpawnItemEx("FireStorm", 0, 0, 0, 0, 0, 0)
TNT1 A 0 A_SpawnItemEx("PSIStarStormAlpha", 0, 0, ceilingz-floorz-32, 0, 0, -14)
stop*/
NormalVersion:
//TNT1 A 0 A_SpawnItemEx("FireStorm", 0, 0, 0, 0, 0, 0) // this helps me locating the blast position
//TNT1 A 0 A_SpawnItemEx("PSIStarStormAlpha", -200, 0, 227, 14, 0, -23)
TNT1 A 1
TNT1 A 0 A_Changeflag("FLOORHUGGER",0)
TNT1 A 1 ThrustThingZ(0,1600,0,0) //A_ChangeFlag("CEILINGHUGGER",1)
Death:
TNT1 A 0 A_SpawnItemEx("PSIStarStorm", 0, 0, -8, 0, 0, -40)
stop
}
}

actor PSIStarStorm
{
PROJECTILE
+RIPPER
+NOINTERACTION
+DONTBLAST
damage (0)
height 8
radius 16
Scale 2.5
Reactiontime 10
damagetype "BossInstagib" // I just need a damagetype that doesn't give invul. to Tank, BUT that immeditatly
// kills on Death
Obituary "$OB_PKSTARSTORMOMEGA"
States
{
Spawn:
SXP1 M 0
SXP1 M 0 //A_ChangeVelocity(11,0,momz,CVF_RELATIVE|CVF_REPLACE)
SXP1 MMMNNNOOO 1 A_JumpIf(ceilingz-z>8, "Spawn2")
SXP1 O 0 A_JumpIf(momz==0,"Death")
SXP1 O 0 A_CountDown
Goto Spawn+2
Spawn2:
SXP1 M 0 A_ChangeFlag("RIPPER", 0)
SXP1 M 0 A_ChangeFlag("NOINTERACTION",0)
SXP1 MNO 3 //A_ChangeVelocity(11,0,momz,CVF_RELATIVE|CVF_REPLACE) 
SXP1 O 0 A_JumpIf(momz==0,"Death")
SXP1 O 0 A_CountDown
Goto Spawn2+2
Death:
TNT1 A 0 A_PlaySoundEx("Starman/Exploding", "Weapon")
SXP1 M 0 A_ChangeFlag(NOGRAVITY,1)
SXP1 M 0 A_Explode(175,192,0)
ASEX ABCDEF 2
stop
}
}

actor StarAimerFX1
{
Translation "192:192=34:34", "198:198=251:251"
PROJECTILE
+DONTBLAST
+DONTREFLECT
+CLIENTSIDEONLY
+FORCEYBILLBOARD
+PAINLESS
-NOGRAVITY
RenderStyle "Translucent"
Alpha 0.6
Radius 16
Height 16
speed 20
scale 1.5
states
{
Spawn:
BASB U 0
TNT1 A 1 
BASB U 0 ThrustThingZ(0,9000,0,1)
BASB U 0 A_SpawnItemEx("StarAimerFX2",0,0,0,momx,momy,momz,0,SXF_NOCHECKPOSITION | SXF_TRANSFERPITCH | SXF_ABSOLUTEVELOCITY | SXF_SETMASTER,0,6900)
DUOR T 1 Bright A_Stop
stop
Death:
TNT1 A 0
TNT1 A 0 //A_SetScale(2.5)
TNT1 A 0 //A_FadeIn(0.4)
TNT1 A 1 //Bright
stop
}
}

actor StarAimerFX2 : StarAimerFX1
{
+FLOORHUGGER
yscale 1.0
states
{
Spawn:
BASB U 0
TNT1 A 1
BASB U 0 //A_SpawnItemEx("StarAimerFX2",0,0,0,momx,momy,momz,0,SXF_NOCHECKPOSITION | SXF_TRANSFERTRANSLATION | SXF_TRANSFERPITCH | SXF_ABSOLUTEVELOCITY | SXF_SETMASTER,0,6900)
DUOR T 1 Bright A_Stop
stop
Death:
TNT1 A 0
TNT1 A 0 //A_SetScale(2.5)
TNT1 A 0 //A_FadeIn(0.4)
TNT1 A 1 //Bright
stop
}
}

actor StarAimerFX3 : StarAimerFX2
{
yscale 1.5
states
{
Spawn:
BASB U 0
TNT1 A 1
BASB U 0 //A_SpawnItemEx("StarAimerFX2",0,0,0,momx,momy,momz,0,SXF_NOCHECKPOSITION | SXF_TRANSFERTRANSLATION | SXF_TRANSFERPITCH | SXF_ABSOLUTEVELOCITY | SXF_SETMASTER,0,6900)
PSIM Z 1 Bright A_Stop
stop
Death:
TNT1 A 0
TNT1 A 0 //A_SetScale(2.5)
TNT1 A 0 //A_FadeIn(0.4)
TNT1 A 1 //Bright
stop
}
}

actor StarAimerFXMaker : FastProjectile
{
+RIPPER
species "StarManThing"
+THRUSPECIES
+MTHRUSPECIES
PROJECTILE
+CLIENTSIDEONLY
radius 3
height 3
speed 720
+DONTSPLASH
damage (0)
states
{
Spawn:
TNT1 A 1
goto NaturalDeath
NaturalDeath:
TNT1 A 0 A_SpawnItemEx("StarAimerFX2",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION | SXF_TRANSFERPITCH | SXF_ABSOLUTEVELOCITY | SXF_SETMASTER,0,6900)
TNT1 A 0 A_SpawnItemEx("StarAimerFX2",0,0,-(z-floorz),0,0,0,0,SXF_NOCHECKPOSITION | SXF_TRANSFERPITCH | SXF_ABSOLUTEVELOCITY | SXF_SETMASTER,0,6900)
TNT1 A 0 A_SpawnItemEx("StarAimerFX3",0,0,-(z-floorz),0,0,0,0,SXF_NOCHECKPOSITION | SXF_TRANSFERPITCH | SXF_ABSOLUTEVELOCITY | SXF_SETMASTER,0,6900)
stop
Death:
TNT1 A 0 A_SpawnItemEx("StarAimerFX2", -32, 0, 0, 0, 0, 0, 0,SXF_NOCHECKPOSITION | SXF_TRANSFERPITCH | SXF_ABSOLUTEVELOCITY | SXF_SETMASTER,0,6900)
TNT1 A 0 A_SpawnItemEx("StarAimerFX2", -32, 0, -(z-floorz), 0, 0, 0, 0,SXF_NOCHECKPOSITION | SXF_TRANSFERPITCH | SXF_ABSOLUTEVELOCITY | SXF_SETMASTER,0,6900)
TNT1 A 0 A_SpawnItemEx("StarAimerFX3", -32, 0, -(z-floorz), 0, 0, 0, 0,SXF_NOCHECKPOSITION | SXF_TRANSFERPITCH | SXF_ABSOLUTEVELOCITY | SXF_SETMASTER,0,6900)
stop
}
}