// BOSSES

/////////////
// SUNSTAR //		
/////////////

actor SunstarBoss_Awoken
{
//$Category MM8BDM-Bosses
Height 58
Radius 34
Scale 2.5
Obituary "%o was no match for the Doomsday Weapon."
Translation "192:192=248:248", "198:198=249:249"
//+INVULNERABLE
Health 2000
mass 99999999
damagefactor "Misc", 0.0

MONSTER
floatspeed 0
-COUNTKILL
-SOLID
-CANPASS
+NOBLOOD
+LOOKALLAROUND
+SLIDESONWALLS
//+NOTARGETSWITCH
+NOPAIN
-DROPOFF
+BRIGHT
painchance 256

var int user_attackcount;
var int user_timeslow;

states
{
Spawn:
SGOD A 0 A_Stop
SGOD A 0 A_GiveInventory("VBossFlags", 1)
SGOD A 0 A_SpawnItemex("SunstarSpecialHitBox")
SGOD A 1 A_Look
Goto Spawn+2
See:
SGOD B 0 A_GiveInventory("CutterFlag", random(0,3))
SGOD B 0 A_JumpIfInventory("CutterFlag", 7, "Attack")
SGOD B 0 A_FaceTarget
SGOD B 0 A_JumpIfCloser(70, "Choke")
SGOD A 0 A_JumpIfInventory("TimeStopperAmmo", 1, "TimeStopped")
SGOD BBBBBBBBB 1 A_ChangeVelocity(2.7 - (0.02 * user_timeslow), 0, 0, CVF_RELATIVE|CVF_REPLACE)
SGOD B 0 A_JumpIfCloser(70, "Choke")
SGOD A 0 A_JumpIfInventory("TimeStopperAmmo", 1, "TimeStopped")
SGOD CCCCCCCCC 1 A_ChangeVelocity(2.7 - (0.02 * user_timeslow), 0, 0, CVF_RELATIVE|CVF_REPLACE)
SGOD B 0 A_FaceTarget
SGOD B 0 A_JumpIfCloser(70, "Choke")
SGOD A 0 A_JumpIfInventory("TimeStopperAmmo", 1, "TimeStopped")
SGOD DDDDDDDDD 1 A_ChangeVelocity(2.7 - (0.02 * user_timeslow), 0, 0, CVF_RELATIVE|CVF_REPLACE)
SGOD B 0 A_JumpIfCloser(70, "Choke")
SGOD A 0 A_JumpIfInventory("TimeStopperAmmo", 1, "TimeStopped")
SGOD EEEEEEEEE 1 A_ChangeVelocity(2.7 - (0.02 * user_timeslow), 0, 0, CVF_RELATIVE|CVF_REPLACE)
loop
Shot:
SGOD A 4 A_Stop
SGOD F 6 A_FaceTarget
SGOD F 0 A_CustomMissile("SunstarSplitShot", 35, 26, 0, 2, 0)
SGOD G 6 A_FaceTarget
SGOD A 0 A_TakeInventory("AirShooterAmmo", 99)
SGOD A 6 A_GiveInventory("AirShooterAmmo", 1)
SGOD B 0 A_TakeInventory("CutterFlag", 9999)
SGOD A 25 A_FaceTarget
Goto Seek
Seek:
SGOD A 1 A_LookEx(0, 0, 0, 0, 360, "See")
loop
Attack:
SGOD B 0 A_GiveInventory("AirShooterAmmo", random(1,3))
SGOD B 0 A_JumpIfInventory("AirShooterAmmo", 4, "Shot")
Charge:
SGOD A 0 A_Stop
TNT1 A 0 A_JumpIf(CallACS("TC_GetActivePlayerCount")<=0, "PlayerDead")
SGOD AAAAAAA 1 A_FaceTarget
TNT1 A 1 A_SpawnItemEx("Sunstar_Gallop")
ChargeSeek:
TNT1 A 0 A_FaceTarget
TNT1 A 0 A_JumpIfCloser(312, "Charging")
TNT1 A 1 A_ChangeVelocity(43.0, 0, 0, CVF_RELATIVE|CVF_REPLACE)
TNT1 A 0 A_JumpIf(CallACS("TC_GetActivePlayerCount")<=0, "PlayerDead")
loop
Charging:
TNT1 A 0 A_JumpIf(CallACS("TC_GetActivePlayerCount")<=0, "PlayerDead")
TNT1 A 0 A_JumpIfInventory("AtomicFireAmmo", 1, "ChargeEnd")
TNT1 A 0 A_SpawnItemEx("SunstarWallCheck", 0, 0, 0, 20)
TNT1 A 0 A_JumpIfCloser(70, "Choke")
TNT1 A 1 A_ChangeVelocity(43.0 - user_timeslow, 0, 0, CVF_RELATIVE|CVF_REPLACE)
TNT1 A 0 A_JumpIfCloser(312, "Charging")
Goto ChargeEnd
Choke:
//SGOD A 0 A_GiveToTarget("SunstarShield", 1)
SGOD B 0 A_JumpIfInTargetInventory("IsDead", 1, "Spawn")
SGOD B 0 A_ChangeFlag("NODAMAGE", 1)
SGOD B 0 A_TakeInventory("LeafShieldAmmo", 9999)
SGOD A 0 A_Stop
SGOD A 0 Thing_Remove(600)
SGOD A 0 A_FaceTarget
SGOD A 0 A_SpawnItemEx("SunstarChoke", 0, 0, 0, 0, 0, 0, 0)
SGOD A 0 ACS_NamedExecuteAlways("sunstarchoke", 0)
SGOD A 0 
SGOD M 1 A_Recoil(50)
SGOD M 9 A_Stop
SGOD MNOO 20 
SGOD PPPPP 1 A_SetAngle(angle + 35)
ThrowLoop:
SGOD P 1 A_SetAngle(angle + 35)
SGOD P 0 A_JumpIfInventory("ScrewCrusherAmmo", 1, "Throw")
SGOD P 0 A_SpawnItemEx("SunstarThrowDistance",0,0,0,120)
loop
Throw: 
SGOD R 0 A_PlaySoundEx("misc/kingswing", "Voice", 0 ,1)
SGOD P 0 A_GiveInventory("LeafShieldAmmo", 1)
SGOD Q 5
SGOD RRR 5
SGOD A 0 A_TakeFromTarget("SunstarShield",9999)
SGOD B 0 A_ChangeFlag("NODAMAGE", 0)
SGOD A 30
SGOD R 0 A_TakeInventory("ScrewCrusherAmmo", 99)
SGOD B 0 A_TakeInventory("AtomicFireAmmo", 9999)
SGOD A 0 A_TakeInventory("CutterFlag", 999)
Goto Seek 
ChargeEnd:
PLAY A 0 ACS_NamedExecute("sunstarmapcard",0)
SGOD A 0 Thing_Remove(600)
SGOD A 10 A_Stop
SGOD AAAAAAAAAAAAA 1 A_FaceTarget(6.5)
SGOD B 0 A_TakeInventory("AtomicFireAmmo", 9999)
SGOD A 0 A_TakeInventory("CutterFlag", 999)
Goto Seek
Phase2:
SGOD C 0 A_TakeInventory("TimeSlowAmmo", 9999)
SGOD C 0 A_TakeInventory("TimeStopperAmmo", 9999)
SGOD C 0 A_ChangeFlag("INVULNERABLE", 1)
SGOD C 0 A_Stop
SGOD C 0 A_ChangeFlag("NOINTERACTION", 1)
SGOD C 8 A_FaceTarget
Phasing:
SGOD A 1 A_FaceTarget
loop
Sparks:
SGOD A -1 A_SpawnItemEx("SunstarSpark", 0, -16, 45, 0, -5, 5, 0)
AScratch:
SGOD A 0 Thing_Remove(600)
S_U2 KL 8 
S_U2 M 120 A_GiveInventory("BossHealth2", 2)
S_U2 L 8
S_U2 K -1
Pose:
SGOD S -1
stop
Leaving:
TNT1 A 3
stop
PlayerDead:
SGOD A 0 A_Stop
SGOD A 0 Thing_Remove(600)
SGOD A 1 A_GiveInventory("AtomicFireAmmo", 1)
loop

Timestopped:
S_U2 KL 6 A_Stop
S_U2 M 45
SGOD A 0 A_PlaySoundEx("weapon/centaurflash", "Voice")
SGOD S 25 A_TakeInventory("TimeStopperAmmo", 999)
SGOD S 0 A_FaceTarget
Goto Seek
}

damagefactor "ChargeBuster", 1.0
damagefactor "ArrowBuster", 1.0
damagefactor "BassBuster", 1.0
damagefactor "DuoFist1", 1.0
damagefactor "DuoFist2", 1.0
damagefactor "DuoFist3", 1.0
damagefactor "LaserBuster", 1.0
damagefactor "MegaArm", 1.0
damagefactor "Buster", 1.0
damagefactor "ProtoBuster", 1.0
damagefactor "ProtoBuster2", 1.0
damagefactor "ProtoBuster3", 1.0
damagefactor "SuperAdaptor", 1.0
damagefactor "TrebleBoost", 1.0

damagefactor "FireStorm", 1.0
damagefactor "FireSpin", 1.0
damagefactor "HyperBomb", 0.5
damagefactor "IceSlasher", 0.25
damagefactor "OilSlider", 1.0
damagefactor "OilFlame", 1.0
damagefactor "RollingCutter", 0.6
damagefactor "SuperArm", 1.1
damagefactor "ThunderBeam", 1.0
damagefactor "TimeSlow", 1.0

damagefactor "AirShooter", 1.0
damagefactor "AtomicFire1", 1.0
damagefactor "AtomicFire2", 1.0
damagefactor "AtomicFire3", 0.5
damagefactor "BubbleLead", 1.0
damagefactor "CrashBomb", 1.0
damagefactor "LeafShield", 1.0
damagefactor "MetalBlade", 0.8
damagefactor "Instagib", 1.0
damagefactor "QuickBoomerang", 0.8
damagefactor "TimeStopper", 1.0

damagefactor "GeminiLaser", 1.0
damagefactor "HardKnuckle", 1.1
damagefactor "MagnetMissile", 1.0
damagefactor "NeedleCannon", 1.0
damagefactor "SearchSnake", 1.0
damagefactor "ShadowBlade", 0.5
damagefactor "SparkShock", 1.0
damagefactor "TopSpin", 1.0

damagefactor "DiveMissile", 1.0
damagefactor "DrillBomb", 1.0
damagefactor "DustCrusher", 1.0
damagefactor "DustCrusherBit", 1.0
damagefactor "FlashStopper", 1.0
damagefactor "PharaohShot1", 1.0
damagefactor "PharaohShot2", 1.0
damagefactor "PharaohShot3", 1.0
damagefactor "PharaohShotHold", 1.0
damagefactor "RainFlush", 1.0
damagefactor "RingBoomerang", 1.0

damagefactor "ChargeKick", 1.0
damagefactor "CrystalEye", 1.0
damagefactor "CrystalEyeBit", 1.0
damagefactor "GravityHold", 1.0
damagefactor "GyroAttack", 1.0
damagefactor "NapalmBomb", 1.0
damagefactor "PowerStone", 1.0
damagefactor "StarCrash", 1.0
damagefactor "WaterWave", 1.0

damagefactor "BlizzardAttack", 1.0
damagefactor "CentaurFlash", 1.0
damagefactor "FlameBlast", 1.0
damagefactor "KnightCrush", 1.0
damagefactor "PlantBarrier", 1.0
damagefactor "SilverTomahawk", 1.0
damagefactor "WindStorm", 1.0
damagefactor "YamatoSpear", 0.5

damagefactor "DangerWrap", 1.0
damagefactor "FreezeCracker", 1.0
damagefactor "FreezeCrackerBit", 1.0
damagefactor "JunkShield", 1.0
damagefactor "NoiseCrush1", 1.0
damagefactor "NoiseCrush2", 1.0
damagefactor "ScorchWheel", 1.0
damagefactor "SlashClaw", 1.0
damagefactor "ThunderBolt", 1.0
damagefactor "WildCoil", 1.0
damagefactor "WildCoil2", 1.0

damagefactor "AstroCrush", 1.0
damagefactor "FlameSword", 1.0
damagefactor "FlameSwordSpark", 1.0
damagefactor "FlashBomb", 0.2
damagefactor "HomingSniper", 1.0
damagefactor "IceWave", 1.0
damagefactor "MegaBall", 1.0
damagefactor "ThunderClaw", 0.5
damagefactor "ThunderClawPegHelp", 0.0
damagefactor "TornadoHold", 1.0
damagefactor "WaterBalloon", 1.0

damagefactor "BlackHoleBomb", 1.2
damagefactor "ConcreteShot", 1.0
damagefactor "HornetChaser", 1.0
damagefactor "JewelSatellite", 1.0
damagefactor "LaserTrident", 1.0
damagefactor "MagmaBazooka1", 1.1
damagefactor "MagmaBazooka2", 1.1
damagefactor "PlugBall", 1.0
damagefactor "TornadoBlow", 1.0

damagefactor "CopyVision", 1.0
damagefactor "IceWall", 0.0
damagefactor "LightningBolt", 1.1
damagefactor "MagicCard", 1.0
damagefactor "RemoteMine", 0.4
damagefactor "SpreadDrill", 0.1
damagefactor "SpreadDrill2", 0.5
damagefactor "SpreadDrill3", 1.0
damagefactor "TenguBlade", 0.8
damagefactor "WaveBurner", 1.0

damagefactor "ChillShot", 1.0
damagefactor "ChillSpike", 1.0
damagefactor "CommandoBomb", 0.5
damagefactor "ReboundStriker", 1.0
damagefactor "SolarBlaze", 1.0
damagefactor "ThunderWool", 0.5
damagefactor "TripleBlade", 1.0
damagefactor "WaterShield", 1.0
damagefactor "WheelCutter", 1.0

damagefactor "BlackHole", 1.0
damagefactor "BreakDash", 1.0
damagefactor "BubbleBomb", 1.0
damagefactor "DeepDigger", 1.0
damagefactor "ElectricShock", 1.0
damagefactor "GrabBuster", 1.0
damagefactor "PhotonMissile", 1.0
damagefactor "SaltWater", 1.0
damagefactor "SparkChaser", 1.0

damagefactor "BalladeCracker", 1.0
damagefactor "MirrorBuster1", 1.0
damagefactor "MirrorBuster2", 1.0
damagefactor "MirrorBuster3", 1.0
damagefactor "Sakugarne", 1.0
damagefactor "ScrewCrusher", 1.0

damagefactor "WireAdaptor", 1.0
damagefactor "Beat", 1.0
damagefactor "EddieBomber", 1.0
damagefactor "Reggae", 1.0
damagefactor "Tango", 1.0

damagefactor "BlastRune", 0.2
damagefactor "DawnBreaker", 0.8

}

actor SunstarSpark
{
PROJECTILE
scale 1.0
states
{
Spawn:
MMFX A 1
TNT1 A 1
MMFX A 1
TNT1 A 1
MMFX A 1
TNT1 A 1
MMFX A 1
TNT1 A 1
stop
}
}

actor SunstarThrowDistance// : FastProjectile
{
renderstyle none
PROJECTILE
+THRUACTORS
+DONTBLAST
states
{
Spawn:
PLAY A 1
PLAY A 1 A_GiveToTarget("ScrewCrusherAmmo", 1)
stop
Death:
PLAY H 2
stop
}
}


actor SunstarSpecialHitBox
{
+NOGRAVITY
Health 100
+SHOOTABLE
radius 32
height 32
-SOLID
+MISSILE
painchance 256
+NOTARGETSWITCH
Damagefactor "Misc", 0.0
renderstyle none
+NODAMAGE
+THRUACTORS
states
{
Spawn:
PLAY A 0
PLAY A 0 A_ChangeFlag("MISSILE", 0)
PLAY A 0 A_JumpIfInTargetInventory("BossHealth2", 1, "Death")
PLAY A 1 A_GivetoTarget("BossHealth2", 1)
Warping:
PLAY A 0 A_JumpIfInTargetInventory("BossHealth2", 2, "Death")
PLAY A 1 A_Warp(AAPTR_TARGET, 0, 0, 0, 0, WARPF_COPYINTERPOLATION)
loop
Pain.TimeSlow:
//PLAY A 0 A_CheckFlag("INVULNERABLE", "Warping", AAPTR_TARGET)
PLAY A 1 ACS_NamedExecute("BossTimeSlow", 0, 1)
TimeSlowed:
PLAY A 0 A_Warp(AAPTR_TARGET, 0, 0, 0, 0, WARPF_COPYINTERPOLATION)
PLAY A 3 A_SpawnItemEx("TimeSlowGFX", random(16, 48), 0, Random(16,48), 0, 0, 0, random(0, 359))
PLAY A 0 A_JumpIfInTargetInventory("TimeSlowAmmo", 1, "TimeSlowed")
Goto Warping
Pain.TimeStopper:
PLAY A 0 A_CheckFlag("INVULNERABLE", "Warping", AAPTR_TARGET)
PLAY A 0 A_ChangeFlag("INVULNERABLE", 1)
PLAY A 0 A_GiveToTarget("TimeStopperAmmo", 1)
TimeStopped:
PLAY A 1 A_Warp(AAPTR_TARGET, 0, 0, 0, 0, WARPF_COPYINTERPOLATION)
PLAY A 0 A_SpawnItemEx("TimeStopGFX", random(8, 64), 0, random(0, 74), 0, 0, 0, random(0, 359))
PLAY A 0 A_JumpIfInTargetInventory("TimeStopperAmmo", 1, "TimeStopped")
PLAY AAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("TimeStopGFX", 0, 0, 48, 20, 0, random(-20, 20), random(0, 359))
PLAY A 0 A_ChangeFlag("INVULNERABLE", 0)
Goto Warping
Death:
PLAY A 0
stop
}
}

actor SunstarBoss
{
//$Category MM8BDM-Bosses
Height 58
Radius 34
Scale 2.5
Obituary "%o was no match for \c[sunstar]Sunstar\c-."
Translation "192:192=248:248", "198:198=249:249"
//+INVULNERABLE
Health 4000
gravity 2.0

mass 99999999
damagefactor "Misc", 0.0

MONSTER
floatspeed 0
-COUNTKILL
-SOLID
-CANPASS
+NOBLOOD
+LOOKALLAROUND
+SLIDESONWALLS
+NOTARGETSWITCH
+NOPAIN
-DROPOFF
+BRIGHT
painchance 256

var int user_attackcount;
var int user_beam;
var int user_timeslow;

states
{
	Spawn:
	SGOD A 0 A_Stop
	SGOD A 0 ACS_NamedExecute("SetBossHP", 0)
	SGOD A 0 A_SpawnItemex("SunstarSpecialHitBox")
	SGOD A 0 A_GiveInventory("VBossFlags", 1)
	SGOD A 1 A_Look
	Goto Spawn+2
	See:
	SGOD F 0 A_TakeInventory("IceSlasherAmmo", 9999)
	NovaCooldownSee:
	TNT1 A 0 A_JumpIfCloser(105, "Choke")
	SGOD AAAAAA 3 A_FaceTarget(20)
	TNT1 A 0 A_JumpIfCloser(105, "Choke")
	Goto Leap
	
	Leap:
	SGOD A 0 A_JumpIfInventory("TimeStopperAmmo", 1, "TimeStopped")
	SGOD A 0 A_FaceTarget
	SGOD A 0 A_Jump(256, "LeapLeft", "LeapRight")
	LeapLeft:
	SGOD X 5 A_ChangeVelocity(random(15, 25) - user_timeslow, random(-8, -15) - user_timeslow, 20, CVF_RELATIVE)
	Goto Falling
	LeapRight:
	SGOD X 5 A_ChangeVelocity(random(15, 25) - user_timeslow, random(8, 15) - user_timeslow, 20, CVF_RELATIVE)
	Goto Falling
	Falling:
	SGOD X 0 A_FaceTarget(5)
	SGOD X 1 A_JumpIf(z-floorz == 0, "Land")
	loop
	Land:
	SGOD A 5 A_Stop
	SGOD A 0 A_JumpIfInventory("TimeStopperAmmo", 1, "TimeStopped")
	TNT1 A 0 A_JumpIfCloser(70, "Choke")
	Goto ChooseMove
	
	Seek:
	SGOD A 0 A_SetGravity(2.0)
	SGOD A 1 A_LookEx(0, 0, 0, 0, 360, "See")
	loop
	
	ChooseMove:
	SGOD B 0 A_JumpIfInTargetInventory("IsDead", 1, "Seek")
	//goto RollStart//goto NovaBeamChargeAngry
	SGOD A 0 A_JumpIfInventory("AstroCrushAmmo", 1, "SungodWrathStart")
	SGOD A 1 A_Jump(256, "StarShot", "Shot", "Charge", "NovaBeamCharge")
	Goto NovaBeamCharge//SungodWrathStart
	
	StarShot:
	SGOD A 0 A_JumpIf(CallACS("SunstarPosition")>320, "Shot")
	SGOD A 4 A_Stop
	SGOD F 6 A_FaceTarget
	SGOD F 0 A_FaceTarget
	SGOD F 0 A_PlaySoundEx("misc/wilyball", "Voice")
	SGOD F 8 A_SpawnItemEx("SunStarStarSpawnerFX", 10, 26, 40)
	SGOD F 0 A_FaceTarget
	SGOD F 0 A_JumpIfHealthLower(2000, "StarShotFireAngry")
	StarShotFire:
	SGOD G 0 A_SpawnItemEx("SunstarStarSpawner", 10, 26, 40, 0, -20)
	SGOD G 0 A_SpawnItemEx("SunstarStarSpawner", 10, 26, 40, 0, 20)
	Goto StarFired
	StarShotFireAngry:
	SGOD G 0 A_SpawnItemEx("SunstarStarSpawnerAngry", 10, 26, 40, 0, -20)
	SGOD G 0 A_SpawnItemEx("SunstarStarSpawnerAngry", 10, 26, 40, 0, 20)
	StarFired:
	SGOD F 0 A_PlaySoundEx("misc/wilybeam", "Voice")
	SGOD GGG 8 A_FaceTarget
	SGOD A 35 A_FaceTarget
	Goto Seek
	
	Shot:
	SGOD A 0 A_Jump(256, "TripleShot", "GroundShot")
	
	TripleShot:
	SGOD F 0 A_JumpIfHealthLower(2000, "TripleShotAngry")
	SGOD A 4 A_Stop
	SGOD F 6 A_FaceTarget
	SGOD F 0 A_CustomMissile("SunstarNovaShot", 35, 26, 0, 2, 0)
	SGOD GGG 8 A_FaceTarget
	SGOD F 0 A_CustomMissile("SunstarNovaShot", 35, 26, 0, 2, 0)
	SGOD GGG 8 A_FaceTarget
	SGOD F 0 A_CustomMissile("SunstarNovaShot", 35, 26, 0, 2, 0)
	SGOD GGG 8 A_FaceTarget
	SGOD A 35 A_FaceTarget
	Goto Seek
	
	TripleShotAngry:
	SGOD A 0 A_FaceTarget
	SGOD A 1 A_SetGravity(0.8)
	TripleShotLeap:
	SGOD X 14 A_ChangeVelocity(10, random(-12, 12), 10, CVF_RELATIVE)
	SGOD X 0 A_FaceTarget
	SGOD Y 10 A_CustomMissile("SunstarNovaShotAngry", 35, 26, 0, 0, 0)
	Goto TripleShotFalling
	TripleShotFalling:
	SGOD X 1 A_FaceTarget
	SGOD X 0 A_JumpIf(z-floorz==0, "TripleShotLand")
	loop
	TripleShotLand:
	SGOD A 1 A_Stop
	SGOD A 1 A_SetGravity(2.0)
	SGOD A 2 A_FaceTarget
	SGOD A 0 A_GiveInventory("WildCoilAmmo", 1)
	SGOD A 0 A_JumpIfInventory("WildCoilAmmo", 3, "TripleShotAngryEnd")
	Goto TripleShotAngry
	TripleShotAngryEnd:
	SGOD A 0 A_TakeInventory("WildCoilAmmo", 99)
	SGOD AA 15 A_FaceTarget
	Goto Seek
	
	GroundShot:
	SGOD F 0 A_JumpIfHealthLower(2000, "RollStart")
	SGOD A 4 A_Stop
	S_U2 JJ 2 A_FaceTarget
	SGOD F 0 A_SpawnItemEx("SunstarGroundShot", 0, 26) 
	S_U2 JJJJJ 2 A_FaceTarget
	S_U2 JJ 35 A_FaceTarget
	SGOD A 5
	Goto Seek
	
	RollStart:
	TRRA H 0 A_GiveInventory("NoRemoteMineLatch", 1)
	SGOD A 0 A_JumpIfInventory("IceSlasherAmmo", 1, "ChooseMove")
	SGOD A 0 A_FaceTarget
	SGOD X 5 A_ChangeVelocity(-50, 0, 20, CVF_RELATIVE|CVF_REPLACE)
	SunstarRollLeap:
	SGOD X 1 A_JumpIf(z-floorz==0, "SunstarRollLand")
	loop
	SunstarRollLand:
	SGOD A 1 A_Stop
	SGOD A 2 A_FaceTarget
	SGOD A 0 A_GiveToTarget("SunstarShield", 1)
	S_U2 F 4 A_ChangeFlag("INVULNERABLE", 1)
	SGOD A 0 A_TakeInventory("TimeStopperAmmo", 999)
	SGOD A 0 A_PlaySoundEx("misc/sunstarwrathpillar", "Voice", 0, 1)
	S_U2 FCFDFEFCFDFEFCFDFEFCFDFEFCFDFEFCFDFEFCFD 1
	S_U2 CCDDEE 1
	S_U2 E 0 A_SpawnItemEx("SunstarRollBall", 0, 0, 0, 0, 0, 18, 0) 
	S_U2 E 1 ACS_NamedExecuteAlways("SunstarBall")
	SunstarRolling:
	TNT1 A 1 A_ChangeVelocity(18 - user_timeslow, 0, 0, CVF_RELATIVE|CVF_REPLACE)
	loop
	SunstarRollEnd:
	TRRA H 0 A_TakeInventory("NoRemoteMineLatch", 1)
	S_U2 A 1 A_Stop
	S_U2 FCFDFE 1
	SGOD A 0 A_TakeFromTarget("SunstarShield",9999)
	S_U2 F 4 A_ChangeFlag("INVULNERABLE", 0)
	SGOD AAAA 5 A_FaceTarget
	Goto Seek
	
	NovaBeamCharge:
	SGOD A 1 A_JumpIfInventory("IceSlasherAmmo", 1, "ChooseMove")
	SGOD F 0 A_GiveInventory("SunstarDamageProtector", 1)
	SGOD F 0 A_GiveInventory("IceSlasherAmmo", 1)
	SGOD F 0 A_JumpIfHealthLower(2000, "NovaBeamChargeAngry")
	SGOD F 5 A_FaceTarget
	SGOD F 1 ACS_NamedExecuteAlways("SunstarNovaBeam", 0)
	SGOD F 0 A_PlaySoundEx("misc/sunstarbeamcharge", "SoundSlot6", 0, 1)
	NovaBeamCharging:
	SGOD F 0 A_FaceTarget
	SGOD F 1 A_JumpIfInventory("GeminiLaserAmmo", 1, "NovaBeamFire")
	loop
	NovaBeamFire:
	SGOD F 0 A_SpawnItemEx("SunstarDamager")
	SGOD F 0 A_PlaySoundEx("misc/sunstarbeam", "SoundSlot6", 0, 1)
	SGOD GGGG 2 A_SpawnItemEx("SunstarNovaBeamSpawn", 82, 4, 14) 
	NovaBeamEndAngry:
	SGOD F 0 A_PlaySoundEx("misc/sunstarbeam", "SoundSlot6", 0, 1)
	NovaBeamEnd:
	SGOD GGGG 2 A_SpawnItemEx("SunstarNovaBeamSpawn", 82, 4, 14) 
	SGOD G 0 A_SpawnItemEx("SunstarNovaBeamEndFXSpawn", 0, 4, 14) 
	SGOD F 0 A_TakeInventory("SunstarDamageProtector", 999)
	SGOD G 35 A_SetUserVar("user_beam", 0)
	SGOD F 10 A_TakeInventory("GeminiLaserAmmo", 999)
	Goto NovaCooldownSee
	NovaBeamChargeAngry:
	SGOD A 5 A_FaceTarget
	SGOD S 1 ACS_NamedExecuteAlways("SunstarNovaBeam", 0)
	SGOD F 0 A_PlaySoundEx("misc/sunstarbeamcharge", "SoundSlot6", 0, 1)
	NovaBeamChargingAngry:
	SGOD S 0 A_FaceTarget
	SGOD S 1 A_JumpIfInventory("GeminiLaserAmmo", 1, "NovaBeamFireAngry")
	loop
	NovaBeamFireAngry:
	SGOD F 0 A_PlaySoundEx("misc/sunstarbeamloop", "SoundSlot6", 1, 1)
	SGOD GGGG 2 A_SpawnItemEx("SunstarNovaBeamSpawn", 82, 4, 14) 
	NovaBeamFireAngryLoop:
	SGOD F 0 A_FaceTarget
	SGOD F 0 A_SetUserVar("user_beam", user_beam+10)
	SGOD F 0 A_SetAngle(angle - sin(user_beam)*40)
	SGOD F 0 A_SpawnItemEx("SunstarDamager")
	SGOD G 2 A_SpawnItemEx("SunstarNovaBeamSpawn", 82, 4, 14) 
	SGOD G 0 A_JumpIf(user_beam>620, "NovaBeamEndAngry")
	loop
	
	Charge:
	SGOD A 1 A_Stop
	SGOD AAAAAAA 1 A_FaceTarget
	ChargeStart:
	TNT1 A 1 A_SpawnItemEx("Sunstar_Gallop")
	ChargeSeek:
	TNT1 A 0 A_FaceTarget
	TNT1 A 0 A_JumpIfCloser(312, "Charging")
	TNT1 A 1 A_ChangeVelocity(43.0 - user_timeslow, 0, 0, CVF_RELATIVE|CVF_REPLACE)
	loop
	Charging:
	TNT1 A 0 A_JumpIfInTargetInventory("IsDead", 1, "ChargeEnd")
	TNT1 A 0 A_JumpIfInventory("AtomicFireAmmo", 1, "ChargeEnd")
	TNT1 A 0 A_SpawnItemEx("SunstarWallCheck", 0, 0, 0, 20)
	TNT1 A 0 A_JumpIfCloser(70, "Choke")
	TNT1 A 1 A_ChangeVelocity(33.0 - user_timeslow, 0, 0, CVF_RELATIVE|CVF_REPLACE)
	TNT1 A 0 A_JumpIfCloser(312, "Charging")
	Goto ChargeEnd
	Choke:
	SGOD B 0 A_JumpIfInTargetInventory("IsDead", 1, "Seek")
	SGOD A 0 A_GiveToTarget("SunstarShield", 1)
	SGOD B 0 A_ChangeFlag("NODAMAGE", 1)
	SGOD B 0 A_TakeInventory("LeafShieldAmmo", 9999)
	SGOD A 1 A_Stop
	SGOD A 0 Thing_Remove(600)
	SGOD A 0 A_FaceTarget
	SGOD A 0 A_SpawnItemEx("SunstarChoke2", 0, 0, 0, 0, 0, 0, 0)
	SGOD A 0 ACS_NamedExecuteAlways("sunstarchoke", 0)
	SGOD M 10
	SGOD PPPPPPP 1 A_SetAngle(angle + 35)
	ThrowLoop:
	SGOD P 1 A_SetAngle(angle + 35)
	SGOD P 0 A_JumpIfInventory("ScrewCrusherAmmo", 1, "Throw")
	SGOD P 0 A_SpawnItemEx("SunstarThrowDistance",0,0,0,120)
	loop
	Throw:
	SGOD R 0 A_PlaySoundEx("misc/kingswing", "Voice", 0 ,1)
	SGOD P 0 A_GiveInventory("LeafShieldAmmo", 1)
	SGOD Q 5
	SGOD RRR 5
	SGOD A 0 A_TakeFromTarget("SunstarShield",9999)
	SGOD B 0 A_ChangeFlag("NODAMAGE", 0)
	SGOD A 20 A_TakeInventory("ScrewCrusherAmmo", 999)
	SGOD B 0 A_TakeInventory("AtomicFireAmmo", 9999)
	SGOD A 0 A_TakeInventory("CutterFlag", 999)
	Goto Seek 
	ChargeEnd:
	SGOD A 0 Thing_Remove(600)
	SGOD A 10 A_Stop
	SGOD B 0 A_TakeInventory("AtomicFireAmmo", 9999)
	SGOD A 0 A_TakeInventory("CutterFlag", 999)
	Goto Seek
	
	SungodWrathStart:
	TRRA H 0 A_GiveInventory("NoRemoteMineLatch", 1)
	SGOD A 0 A_GiveToTarget("SunstarShield", 1)
	SGOD A 0 A_ChangeFlag("INVULNERABLE", 1)
	SGOD S 0 A_TakeInventory("TimeStopperAmmo", 999)
	SGOD A 1 ACS_NamedExecuteAlways("SunstarWrath", 0)
	SungodWrathMove:
	SGOD I 0 A_PlaySoundEx("misc/bigstomp", "Voice", 0, 1)
	SGOD IJKL 4 A_ChangeVelocity(28.0,0,0,CVF_RELATIVE|CVF_REPLACE)
	loop
	SungodWrathRise:
	SGOD A 0 A_SpawnITemEx("SunstarAreaFlamesWarper", 0, 0, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
	SGOD A 1 A_Stop
	SGOD AAAASSS 5 A_FaceTarget(30)
	SGOD A 0 A_Quake(3, 35*5, 0, 5000, 0)
	SGOD A 0 A_ChangeVelocity(0, 0, 2, 0)
	SGOD S 25 A_ChangeFlag("NOGRAVITY", 1) 
	SungodWrathStarting:
	SGOD TU 3
	loop
	SungodWrath:
	SGOD A 0 A_SpawnItemEx("SungodWrathAttack")
	SGOD A 0 A_SpawnITemEx("SungodWrathSun", 0, 0, -32)
	SungodWrathLoop:
	SGOD VVVWWW 1 A_FaceTarget
	loop
	SungodWrathEnd:
	SGOD S 1 A_ChangeVelocity(0.0,0,-3,CVF_RELATIVE|CVF_REPLACE)
	SGOD S 0 A_JumpIf(z==0, "SungodWrathContinue")
	loop
	SungodWrathContinue:
	SGOD A 0 A_TakeInventory("AstroCrushAmmo", 999)
	SGOD A 0 A_TakeFromTarget("SunstarShield",9999)
	SGOD A 0 A_ChangeFlag("INVULNERABLE", 0)
	SGOD A 0 A_ChangeFlag("NOGRAVITY", 0)
	TRRA H 0 A_TakeInventory("NoRemoteMineLatch", 9999)
	SGOD A 10 A_FaceTarget
	Goto Seek
	
	Death:
	SGOD C 0 A_TakeInventory("TimeSlowAmmo", 9999)
	SGOD C 0 A_TakeInventory("TimeStopperAmmo", 9999)
	SGOD A 0 Thing_Remove(600)
	SGOD H 0 A_SetGravity(0.35)
	SGOD H 0 A_Stop
	SGOD H 0 A_FaceTarget
	SGOD H 1 A_ChangeVelocity(-5, 0, 5, CVF_REPLACE|CVF_RELATIVE)
	SGOD A 0 Thing_Remove(600) // redundancy
	SGOD H 0 A_GiveInventory("BossHealth2", 2)
	SGOD H 0 A_StopSoundEx("SoundSlot6")
	SGOD H 0 SetPlayerProperty(1, 2, 5)
	SGOD H 1 SetPlayerProperty(1, 1, 0)
	SGOD A 0 Thing_Remove(600) // redundancy
	Dying:
	SGOD H 0 A_SpawnItemEx("KingExplode", random(-48,48), random(-48,48), random(0,48))
	SGOD HHHHHHHHH 1 A_JumpIf(z-floorz==0, "Death2") 
	loop
	Death2:
	S_UN N 0 A_Stop
	S_UN N 0 ACS_NamedExecuteAlways("SunstarDeath", 0)
	S_UN N 0 A_Quake(5, 5, 0, 1000)
	S_UN N 0 A_PlaySoundEx("misc/fatland", "Voice", 0, 1)
	S_U2 N -1 A_GiveInventory("SkullBarrierAmmo", 1)
	stop
	
	Timestopped:
	S_U2 KL 6 A_Stop
	S_U2 M 45
	SGOD A 0 A_PlaySoundEx("weapon/centaurflash", "Voice")
	SGOD S 25 A_TakeInventory("TimeStopperAmmo", 999)
	SGOD S 0 A_FaceTarget
	Goto ChargeStart
}

damagefactor "Normal", 2.0
damagefactor "ChargeBuster", 1.0
damagefactor "ArrowBuster", 1.0
damagefactor "BassBuster", 1.0
damagefactor "DuoFist1", 1.0
damagefactor "DuoFist2", 1.0
damagefactor "DuoFist3", 1.0
damagefactor "LaserBuster", 1.0
damagefactor "MegaArm", 1.9
damagefactor "Buster", 0.5
damagefactor "ProtoBuster", 1.0
damagefactor "ProtoBuster2", 1.0
damagefactor "ProtoBuster3", 1.0
damagefactor "SuperAdaptor", 1.0
damagefactor "TrebleBoost", 1.0

damagefactor "FireStorm", 1.0
damagefactor "FireSpin", 1.0
damagefactor "HyperBomb", 0.5
damagefactor "IceSlasher", 0.5
damagefactor "OilSlider", 1.0
damagefactor "OilFlame", 1.0
damagefactor "RollingCutter", 0.6
damagefactor "SuperArm", 1.0
damagefactor "ThunderBeam", 1.0
damagefactor "TimeSlow", 1.0

damagefactor "AirShooter", 1.0
damagefactor "AtomicFire1", 1.0
damagefactor "AtomicFire2", 1.0
damagefactor "AtomicFire3", 1.0
damagefactor "BubbleLead", 1.0
damagefactor "CrashBomb", 1.0
damagefactor "LeafShield", 1.0
damagefactor "MetalBlade", 0.65
damagefactor "Instagib", 1.0
damagefactor "QuickBoomerang", 0.8
damagefactor "TimeStopper", 1.0

damagefactor "GeminiLaser", 1.0
damagefactor "HardKnuckle", 1.0
damagefactor "MagnetMissile", 1.0
damagefactor "NeedleCannon", 1.0
damagefactor "SearchSnake", 1.0
damagefactor "ShadowBlade", 0.5
damagefactor "SparkShock", 1.0
damagefactor "TopSpin", 0.5

damagefactor "DiveMissile", 1.0
damagefactor "DrillBomb", 1.0
damagefactor "DustCrusher", 1.0
damagefactor "DustCrusherBit", 1.0
damagefactor "FlashStopper", 1.0
damagefactor "PharaohShot1", 1.0
damagefactor "PharaohShot2", 1.0
damagefactor "PharaohShot3", 1.0
damagefactor "PharaohShotHold", 1.0
damagefactor "RainFlush", 1.0
damagefactor "RingBoomerang", 1.0

damagefactor "ChargeKick", 1.0
damagefactor "CrystalEye", 1.0
damagefactor "CrystalEyeBit", 1.0
damagefactor "GravityHold", 1.0
damagefactor "GyroAttack", 1.0
damagefactor "NapalmBomb", 1.0
damagefactor "PowerStone", 1.0
damagefactor "StarCrash", 1.0
damagefactor "WaterWave", 1.0

damagefactor "BlizzardAttack", 1.0
damagefactor "CentaurFlash", 1.0
damagefactor "FlameBlast", 1.0
damagefactor "KnightCrush", 1.0
damagefactor "PlantBarrier", 1.0
damagefactor "SilverTomahawk", 1.0
damagefactor "WindStorm", 0.5
damagefactor "YamatoSpear", 0.5

damagefactor "DangerWrap", 1.0
damagefactor "FreezeCracker", 1.0
damagefactor "FreezeCrackerBit", 1.0
damagefactor "JunkShield", 1.0
damagefactor "NoiseCrush1", 1.0
damagefactor "NoiseCrush2", 1.0
damagefactor "ScorchWheel", 1.0
damagefactor "SlashClaw", 1.0
damagefactor "ThunderBolt", 1.0
damagefactor "WildCoil", 1.0
damagefactor "WildCoil2", 1.0

damagefactor "AstroCrush", 1.0
damagefactor "FlameSword", 1.0
damagefactor "FlameSwordSpark", 1.0
damagefactor "FlashBomb", 0.2
damagefactor "HomingSniper", 1.0
damagefactor "IceWave", 1.0
damagefactor "MegaBall", 1.0
damagefactor "ThunderClaw", 0.5
damagefactor "ThunderClawPegHelp", 0.0
damagefactor "TornadoHold", 1.0
damagefactor "WaterBalloon", 1.0

damagefactor "BlackHoleBomb", 1.0
damagefactor "ConcreteShot", 1.0
damagefactor "HornetChaser", 1.0
damagefactor "JewelSatellite", 1.0
damagefactor "LaserTrident", 1.0
damagefactor "MagmaBazooka1", 1.0
damagefactor "MagmaBazooka2", 1.0
damagefactor "PlugBall", 1.0
damagefactor "TornadoBlow", 1.0

damagefactor "CopyVision", 1.0
damagefactor "IceWall", 0.0
damagefactor "LightningBolt", 0.2
damagefactor "MagicCard", 1.0
damagefactor "RemoteMine", 0.4
damagefactor "SpreadDrill", 0.1
damagefactor "SpreadDrill2", 0.5
damagefactor "SpreadDrill3", 1.0
damagefactor "TenguBlade", 0.8
damagefactor "WaveBurner", 1.0

damagefactor "ChillShot", 1.0
damagefactor "ChillSpike", 1.0
damagefactor "CommandoBomb", 0.5
damagefactor "ReboundStriker", 1.0
damagefactor "SolarBlaze", 1.0
damagefactor "ThunderWool", 0.5
damagefactor "TripleBlade", 1.0
damagefactor "WaterShield", 1.0
damagefactor "WheelCutter", 1.0

damagefactor "BlackHole", 1.0
damagefactor "BreakDash", 1.0
damagefactor "BubbleBomb", 1.0
damagefactor "DeepDigger", 1.0
damagefactor "ElectricShock", 1.0
damagefactor "GrabBuster", 1.0
damagefactor "PhotonMissile", 1.0
damagefactor "SaltWater", 1.0
damagefactor "SparkChaser", 1.0

damagefactor "BalladeCracker", 1.0
damagefactor "MirrorBuster1", 1.0
damagefactor "MirrorBuster2", 1.0
damagefactor "MirrorBuster3", 1.0
damagefactor "Sakugarne", 1.0
damagefactor "ScrewCrusher", 1.0

damagefactor "WireAdaptor", 1.0
damagefactor "Beat", 1.0
damagefactor "EddieBomber", 1.0
damagefactor "Reggae", 1.0
damagefactor "Tango", 1.0

damagefactor "BlastRune", 0.2
damagefactor "DawnBreaker", 0.8
}

actor SunstarDamageProtector : PowerProtection
{
damagefactor "Normal", 0.5
powerup.duration -10
}

//actor SunstarShield : BossHealth8 {}

actor SunstarRollBall
{
+MISSILE
+HEXENBOUNCE
+THRUACTORS
bouncefactor 1.0
scale 2.5
gravity 2.0
states
{
	Spawn:
	TNT1 A 0
	TNT1 A 0 Thing_ChangeTID(0,200)
	SGOD A 0 A_PlaySoundEx("misc/sunstarexplode", "Voice", 0, 1)
	Roll:
	S_U2 G 0 A_SpawnItemEx("SunstarBallFX1")
	S_U2 G 2 A_SpawnItemEx("SunstarBallDamager", 0, 0, 32)
	S_U2 G 0 A_SpawnItemEx("SunstarBallFX2")
	S_U2 H 2 A_SpawnItemEx("SunstarBallDamager", 0, 0, 32)
	S_U2 G 0 A_SpawnItemEx("SunstarBallFX3")
	S_U2 I 2 A_SpawnItemEx("SunstarBallDamager", 0, 0, 32)
	loop
}
}


actor SunstarBallFX1 
{
scale 2.5
alpha 1.0
-SOLID
+NOGRAVITY
+NOINTERACTION
states
{
Spawn:
S_U2 G 1 A_FadeOut(0.1)
loop
}
}


actor SunstarBallFX2 : SunstarBallFX1
{
states
{
Spawn:
S_U2 H 1 A_FadeOut(0.1)
loop
}
}


actor SunstarBallFX3 : SunstarBallFX1
{
states
{
Spawn:
S_U2 I 1 A_FadeOut(0.1)
loop
}
}

actor SunstarBallDamager
{
+MISSILE
+NOINTERACTION
damagetype "Misc"
states
{
Spawn:
TNT1 A 0
TNT1 A 1 A_Explode(5, 40, 0, 0, 40)
stop
}
}


actor SunstarGroundShot
{
PROJECTILE
+FLOORHUGGER
+SEEKERMISSILE
+HEXENBOUNCE
scale 2.8
Damage (5)
+THRUACTORS
Damagetype "Misc"
wallbouncefactor 1.0
reactiontime 20
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_PlaySoundEx("misc/sunstarwrathpillar", "Voice", 0, 0)
S_U2 AAABBBAAABBBAAABBB 1 A_Warp(AAPTR_TARGET, 32, 35, 0)
S_U2 A 0 A_ChangeVelocity(20.0,0,0,CVF_RELATIVE)
Seek:
S_U2 A 0 A_Countdown
S_U2 A 0 A_PlaySound("misc/sunstargroundflame")
S_U2 A 0 A_SpawnItemEx("SunstarGroundTrail")
S_U2 A 0 A_Explode(10, 16, 0, 0, 16)
S_U2 AAAA 1 A_SeekerMissile(1, 2, SMF_CURSPEED|SMF_LOOK)
S_U2 A 0 A_PlaySound("misc/sunstargroundflame")
S_U2 A 0 A_SpawnItemEx("SunstarGroundTrail")
S_U2 BBBB 1 A_SeekerMissile(1, 2, SMF_CURSPEED|SMF_LOOK)
loop
}
}

actor SunstarGroundTrail
{
PROJECTILE
+FLOORHUGGER
Damage (6)
height 4
radius 16
scale 2.0
reactiontime 125
states
{
Spawn:
S_UN QQQQRRRR 1 A_CountDown
loop
}
}

actor SunstarChoke
{
	renderstyle none
	PROJECTILE
	+THRUACTORS
	+DONTBLAST
	height 16
	radius 16
	reactiontime 20
	scale 5.0
	states
	{
	Spawn:
	PLAY A 0
	PLAY A 0 A_PlaySoundEx("misc/sunstarchoke", "Voice", 0, 0)
	PLAY A 1 Thing_ChangeTID(0, 1202)
	PLAY A 0 A_Warp(AAPTR_TARGET, 48, 0, 32, 0, WARPF_NOCHECKPOSITION)
	PLAY A 20 A_FaceTarget
	PLAY A 30 A_ChangeVelocity(0, 0, 0.32)
	PLAY A 20 A_Stop
	Goto Swish
	Swish:
	PLAY A 0 A_Warp(AAPTR_TARGET, 48, 0, 42, 0, WARPF_NOCHECKPOSITION)
	PLAY A 1 A_FaceTarget
	PLAY A 0 A_JumpIfInTargetInventory("LeafShieldAmmo", 1, "Fly")
	loop
	Fly:
	PLAY A 0 A_FaceTarget
	PLAY A 0 A_ChangeVelocity(-60, 0, 0, CVF_REPLACE|CVF_RELATIVE)
	Flying:
	PLAY A -1
	stop
	Death:
	PLAY A 0 A_GiveToTarget("LeafShieldAmmo", 1)
	PLAY A 0 A_Explode(reactiontime, 128, 0, 0, 20)
	PLAY A 0 A_PlaySoundEx("misc/quake", "Voice", 0, 1)
	PLAY A 0 ACS_NamedExecute("sunstarmapcard",0)
	PLAY AA 0 A_SpawnItemEx("SunstarChokeFX", 0, random(-10,10),random(0,60), random(8,20), 0, 0, random(-20, -30), 0, 0) 
	PLAY AA 0 A_SpawnItemEx("SunstarChokeFX", 0, random(-10,10),random(0,60), random(8,20), 0, 0, random(20, 30), 0, 0) 
	stop
	}
}

actor SunstarChoke2 : SunstarChoke
{
reactiontime 12
states
	{
	Spawn:
	PLAY A 0
	PLAY A 0 A_PlaySoundEx("misc/sunstarchoke", "Voice", 0, 0)
	PLAY A 0 Thing_ChangeTID(0, 1202)
	PLAY A 0 A_Warp(AAPTR_TARGET, 48, 0, 32, 0, WARPF_NOCHECKPOSITION)
	PLAY A 10 A_FaceTarget
	//PLAY A 30 A_ChangeVelocity(0, 0, 0.32)
	//PLAY A 20 A_Stop
	Goto Swish
}
}

actor SunstarChokeFX
{
	PROJECTILE
	+THRUACTORS
	+DOOMBOUNCE
	+RANDOMIZE
	-NOGRAVITY
	scale 2.0
	bouncecount 2
	states
	{
		Spawn:
		TNT1 A 0
		TNT1 A 0 A_Jump(128, "FX2")
		FX1:
		S_UN Z 1
		TNT1 A 1
		loop
		FX2:
		S_UN Y 1
		TNT1 A 1
		loop
	}
}


actor SunstarDamager
{
PROJECTILE
+NOINTERACTION
states
{
Spawn:
TNT1 A 0
TNT1 A 1 A_Explode(20, 128, 0)
stop
}
}

actor SungodWrathSun
{
PROJECTILE
+NOINTERACTION
states
{
	Spawn:
	S_UN A 0
	S_UN A 0 A_PlaySoundEx("misc/sunstarwrathloop", "SoundSlot6", 1, 1)
	S_UN A 0 Thing_ChangeTID(0, 1210)
	S_UN A 0 ACS_NamedExecuteAlways("SunstarSun",0)
	Warp:
	S_UN A 0 A_Explode(20, 256, 0, 0, 20)
	S_UN AAABBBCCCDDD 1 A_Warp(AAPTR_TARGET, -48, 0, 48, 0, WARPF_COPYINTERPOLATION)
	loop
	Death:
	S_UN A 0
	stop
}
}

actor SungodWrathAttack
{
+MISSILE
+NOINTERACTION
+NOGRAVITY
states
{
Spawn:
TNT1 A 35
TNT1 A 0 A_SpawnItemEx("SungodWrathSpewer")
Drip:
TNT1 A 1 A_SpawnItemEx("SungodWrathLava", random(0, 12), 0, 48, 9.5, 0, 0, random(0,360))
TNT1 A 0 A_GiveInventory("CutterFlag", 1)
TNT1 A 0 A_JumpIfInventory("CutterFlag", 160, "Wave")
loop
Wave:
TNT1 A 28 A_SpawnItemEx("SungodWrathWaveStartFX", 0, 0, 0, 1)
TNT1 A 0 A_GiveToTarget("ScorchWheelAmmo", 1)
TNT1 A 0 A_SpawnItemEx("SungodWrathWaveSpawn")
stop
}
}



actor SungodWrathWaveStartFX
{
gravity 500.0
+THRUACTORS
var int user_rotation;
speed 1
renderstyle none 
states
	{
	Spawn:
	PLAY A 3
	Ring:
	PLAY A 1 A_JumpIfInTargeTInventory("ScorchWheelAmmo", 1, "Death")
	PLAY A 0 A_SetUSerVar("user_rotation", user_rotation + 18)
	PLAY A 0 A_SpawnITemeX("SungodWrathWaveFX", 0, 0, 0, 7, 0, 0, user_rotation)
	PLAY A 0 A_JumpIf(user_rotation > 360, "Reset")
	loop
	Reset:
	PLAY A 5 A_SetUSerVar("user_rotation", 0)
	goto Ring
	Death:
	PLAY A 0
	stop
}
}

actor SungodWrathWaveFX
{
PROJECTILE
+NOINTERACTION
Scale 3.5
//renderstyle add
states
{
Spawn:
S_UN KKKLLLKKKLLLKKKKLLL 1
Fade:
S_UN KKKLLL 1 A_FadeOut(0.2)
loop
}
}

actor SungodWrathLava
{
PROJECTILE
height 8
radius 8
scale 1.5
damage (10)
-NOGRAVITY
gravity 0.4
+SKYEXPLODE
alpha 1.0
renderstyle translucent
states
{
Spawn:
S_UN HHJJ 2 A_ChangeVelocity(-0.6 - frandom(0, 0.8), 0, 0, CVF_RELATIVE)// A_FadeIn(0.15)
loop
Death:
TNT1 A 0 A_PlaySound("misc/lava")
S_UN STSTSTSTSTSTSTST 4
stop
}
}


actor SungodWrathWaveSpawn
{
+MISSILE
+NOINTERACTION
-NOGRAVITY
+FLOORHUGGER
+LOOKALLAROUND
scale 4.0
renderstyle none
states
{
Spawn:
TNT1 A 0
TNT1 A 1 A_RearrangePointers(AAPTR_NULL, AAPTR_TARGET)
Looking:
TNT1 A 1 A_LookEx(0, 0, 0, 0, 360, "See")
loop
See:
TNT1 A 0 A_FaceTarget
TNT1 A 0 A_PlaySoundEx("misc/sunstarwrathwave", "Voice", 0, 1)
TNT1 A 1 A_RearrangePointers(AAPTR_MASTER)
TNT1 A 0 A_SpawnItemEx("SungodWrathWave", 40, 0, 0, 0, 0, 0, 0)
TNT1 A 0 A_SpawnItemEx("SungodWrathWave", 40, 27*1, 0, 0, 0, 0, 0)
TNT1 A 0 A_SpawnItemEx("SungodWrathWave", 40, 27*2, 0, 0, 0, 0, 0)
TNT1 A 0 A_SpawnItemEx("SungodWrathWave", 40, 27*3, 0, 0, 0, 0, 0)
TNT1 A 0 A_SpawnItemEx("SungodWrathWave", 40, -27*1, 0, 0, 0, 0, 0)
TNT1 A 0 A_SpawnItemEx("SungodWrathWave", 40, -27*2, 0, 0, 0, 0, 0)
TNT1 A 0 A_SpawnItemEx("SungodWrathWave", 40, -27*3, 0, 0, 0, 0, 0)

TNT1 A 0 A_SpawnItemEx("SungodWrathWave", 40, 0, 0, 0, 0, 0, 90)
TNT1 A 0 A_SpawnItemEx("SungodWrathWave", 40, 27*1, 0, 0, 0, 0, 90)
TNT1 A 0 A_SpawnItemEx("SungodWrathWave", 40, 27*2, 0, 0, 0, 0, 90)
TNT1 A 0 A_SpawnItemEx("SungodWrathWave", 40, 27*3, 0, 0, 0, 0, 90)
TNT1 A 0 A_SpawnItemEx("SungodWrathWave", 40, -27*1, 0, 0, 0, 0, 90)
TNT1 A 0 A_SpawnItemEx("SungodWrathWave", 40, -27*2, 0, 0, 0, 0, 90)
TNT1 A 0 A_SpawnItemEx("SungodWrathWave", 40, -27*3, 0, 0, 0, 0, 90)

TNT1 A 0 A_SpawnItemEx("SungodWrathWave", 40, 0, 0, 0, 0, 0, 90*2)
TNT1 A 0 A_SpawnItemEx("SungodWrathWave", 40, 27*1, 0, 0, 0, 0, 90*2)
TNT1 A 0 A_SpawnItemEx("SungodWrathWave", 40, 27*2, 0, 0, 0, 0, 90*2)
TNT1 A 0 A_SpawnItemEx("SungodWrathWave", 40, 27*3, 0, 0, 0, 0, 90*2)
TNT1 A 0 A_SpawnItemEx("SungodWrathWave", 40, -27*1, 0, 0, 0, 0, 90*2)
TNT1 A 0 A_SpawnItemEx("SungodWrathWave", 40, -27*2, 0, 0, 0, 0, 90*2)
TNT1 A 0 A_SpawnItemEx("SungodWrathWave", 40, -27*3, 0, 0, 0, 0, 90*2)

TNT1 A 0 A_SpawnItemEx("SungodWrathWave", 40, 0, 0, 0, 0, 0, 90*3)
TNT1 A 0 A_SpawnItemEx("SungodWrathWave", 40, 27*1, 0, 0, 0, 0, 90*3)
TNT1 A 0 A_SpawnItemEx("SungodWrathWave", 40, 27*2, 0, 0, 0, 0, 90*3)
TNT1 A 0 A_SpawnItemEx("SungodWrathWave", 40, 27*3, 0, 0, 0, 0, 90*3)
TNT1 A 0 A_SpawnItemEx("SungodWrathWave", 40, -27*1, 0, 0, 0, 0, 90*3)
TNT1 A 0 A_SpawnItemEx("SungodWrathWave", 40, -27*2, 0, 0, 0, 0, 90*3)
TNT1 A 0 A_SpawnItemEx("SungodWrathWave", 40, -27*3, 0, 0, 0, 0, 90*3)

BASS A 100
BASS A 1 A_SetAngle(angle + 90)
TNT1 A 0 A_PlaySoundEx("misc/sunstarwrathpillar", "Voice", 0, 1)
BASS A 600 ACS_NamedExecuteAlways("SunstarFlamePillarSpawn", 0)
BASS A 0 ACS_NamedExecuteAlways("SunstarWrathEnd", 0)
stop
}
}

actor SungodWrathSpewer : SungodWrathWaveSpawn
{
states
{
Spawn:
TNT1 A 55
spew:
TNT1 A 0 A_SpawnItemEx("SungodWrathFloorHugger", 0, 0, 0, 0, 0, 0, 0)
TNT1 A 0 A_SpawnItemEx("SungodWrathFloorHugger", 0, 0, 0, 0, 0, 0, 90)
TNT1 A 0 A_SpawnItemEx("SungodWrathFloorHugger", 0, 0, 0, 0, 0, 0, 90*2)
TNT1 A 0 A_SpawnItemEx("SungodWrathFloorHugger", 0, 0, 0, 0, 0, 0, 90*3)
TNT1 A 3 A_SetAngle(angle + 32 + frandom(0,6))
TNT1 A 0 A_JumpIFInTargetInventory("ScorchWheelAmmo", 1, "Death")
loop
Death:
TNT1 A 1
stop
}
}

actor SungodWrathFloorHugger
{
PROJECTILE
Damagetype "Misc"
Radius 18
Height 18
scale 2.0
damage (6)
+FLOORHUGGER
+DONTREFLECT
+RANDOMIZE
states
{
Spawn:
TNT1 A 2
Find:
S_U2 AAABBB 1 A_ChangeVelocity(18.0, 0, 0, CVF_REPLACE|CVF_RELATIVE)
loop
}
}

actor SungodWrathFlamePillarPoint
{
PROJECTILE
+NOINTERACTION
renderstyle none
var int user_speed;
states
{
Spawn:
PLAY A 25
PLAY AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 1 A_SetAngle(angle + (user_speed * 0.002))
Rotate:
PLAY A 1 A_SetAngle(angle + (user_speed * 0.005))
loop
Death:
PLAY A 0
stop
}
}

actor SungodWrathFlamePillar
{
PROJECTILE
Damagetype "Misc"
scale 2.5
+THRUACTORS
+NOINTERACTION
radius 2
states
{
Spawn:
S_U2 TTTTSSSSRRRR 1 //A_Warp(AAPTR_TRACER, 0, 0, 0, 0, WARPF_WARPINTERPOLATION)
Pillar:
S_U2 OPQ 4 A_SpawnITemEx("SungodWrathFlamePillarDamager", 0, 0, 0)
loop
Death:
S_U2 RRRRSSSSTTTT  1
stop
}
}


actor SungodWrathFlamePillarDamager
{
PROJECTILE
height 128
Damagetype "Misc"
radius 30
damage (8)
states
{
SPawn:
TNT1 A 1
stop
}
}

actor SungodWrathWave
{
PROJECTILE
+RIPPER
+THRUACTORS
Damage (3)
scale 4.5
+FLOORHUGGER
radius 3
states
{
Spawn:
S_UN KK 1
S_UN K 0 A_ChangeVelocity(35, 0, 0, CVF_RELATIVE)
Flying:
S_UN KL 1 A_SpawnItemEx("SungodWrathCarpet", random(-4, 4), 0, 0, 0, 0, 0, 0, 0, 32)
loop
}
}

actor SungodWrathCarpet
{
PROJECTILE
+NOGRAVITY
+THRUACTORS
scale 2.5
damagetype "Misc"
radius 2
states
{
Spawn:
S_UN A 0
S_UN A 0 Thing_ChangeTID(0, 1210)
Hot:
S_UN QR 4 A_Explode(2, 16, 0)
loop
Death:
S_UN QQQQRRRR 1 A_FadeOut(0.1)
loop
}
}

actor SunStarSunGodsWrathArena
{
-SOLID
+NOINTERACTION
-NOGRAVITY
var int user_rotation;
states
	{
	Spawn:
	PLAY A 0 A_SetUSerVar("user_rotation", user_rotation + 1)
	PLAY A 0 A_SpawnITemeX("SunStarSunGodsWrathArenaFX", 520)
	PLAY A 0 A_SetAngle(user_rotation * 12.0)
	PLAY A 0 A_JumpIf(user_rotation > 30, "Death")
	loop
	Death:
	PLAY A 0
	stop
	}
}

actor SunStarSunGodsWrathArenaFX
{
radius 10
+NOINTERACTION
-SOLID
+RANDOMIZE
states
{
Spawn:
S_UN HIJI 4
loop
}
}

actor SunStarStarSpawnerFX
{
scale 2.0
+NOGRAVITY
+NOINTERACTION
states
{
Spawn:
S_UN AABBCCDD 1 A_SetScale(scalex - 0.25, scaley  - 0.25)
stop
}
}

actor SunstarStarSpawner
{
PROJECTILE
//-NOGRAVITY
//+HEXENBOUNCE

Speed 20
states
{
Spawn:
PLAY A 0
S_UN EEFF 2 A_SpawnItemEx("SunstarStar", 0, 0, 0, 5, 0, -18)
loop
}
}

actor SunstarStar : SunstarStarSpawner
{
-NOGRAVITY
bouncetype Classic
wallbouncefactor 0
height 32
radius 32
bouncefactor 1.0
gravity 2.0
scale 2.5
Damage (10)
states
{
Spawn:
S_UN EFG 4
S_UN E 0 A_Jump(256, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 ,17 ,18 ,19 ,20, 21, 22, 23)
Bouncing:
S_UN HHHHIIIIJJJJIIIIHHHHGGGG 1//A_SpawnItemEx("SunstarStar", 0, 0, 0, 0, 20, velz)
loop
}
}


actor SunstarStarSpawnerAngry : SunstarStarSpawner
{
states
{
Spawn:
PLAY A 0
S_UN EEFF 2 A_SpawnItemEx("SunstarStarAngry", 0, 0, 0, 5, 0, -28)
loop
}
}


actor SunstarStarAngry : SunstarStar
{
gravity 4.0
}

actor SunstarNovaBeamSpawn
{
+MISSILE
height 8
radius 8
+THRUGHOST
scale 2.5
states
{
Spawn:
S_UN M 0
S_UN M 0 A_SpawnItemEx("SunstarNovaBeamWallHitFX",0,0,0,1200)
S_UN M 0 A_SpawnItemEx("SunstarNovaBeamDamager", 32)
S_UN M 0 A_SpawnItemEx("SunstarNovaBeam", 10)
S_UN MN 1
stop
Death:
TNT1 A 0
stop
}
}

actor SunstarNovaBeam : SunstarNovaBeamSpawn
{
+CLIENTSIDEONLY
states
{
Spawn:
S_UN M 0
S_UN M 0 A_JumpIfCloser(1200, "Appear")
stop
Appear:
S_UN M 0 A_SpawnItemEx("SunstarNovaBeam", 10)
S_UN OP 1
stop
}
}

actor SunstarNovaBeamEndFXSpawn : SunstarNovaBeamSpawn
{
+CLIENTSIDEONLY
renderstyle none
states
{
Spawn:
S_UN M 0
S_UN M 0 A_JumpIfCloser(1200, "Appear")
stop
Appear:
S_UN MM 0 A_SpawnItemEx("SunstarNovaBeamEndFX", 0, random(-48, 48), random(-48, 52), random(5, 10), 0, 0, 0, 0, 128)
S_UN M 0 A_SpawnItemEx("SunstarNovaBeamEndFXSpawn", 10)
S_UN OP 1
stop
}
}

actor SunstarNovaBeamEndFX
{
+NOINTERACTION
-SOLID
+MISSILE
+CLIENTSIDEONLY
scale 1.5
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Jump(128, 3)
S_UN JIHGFE 3 A_FadeOut(0.02)
stop
}
}

actor SunstarNovaBeamDamager
{
PROJECTILE
+RIPPER 
+THRUGHOST
+THRUACTORS
Damage (0)
Height 40
Radius 18
Damagetype "Beam"
renderstyle none
states
{
Spawn:
S_UN M 0
S_UN M 0 A_JumpIfCloser(1200, "Appear")
stop
Appear:
S_UN M 0 A_SpawnItemEx("SunstarNovaBeamDamager", 32)
S_UN MN 1 A_Explode(1, 40, 0, 0, 40)
stop
Death:
TNT1 A 0
stop
}
}

actor SunstarNovaBeamWallHitFX : FastProjectile
{
PROJECTILE
+THRUACTORS
Speed 1000
radius 32
states
{
Spawn:
TNT1 A 5
stop
Death:
TNT1 A 0 A_Quake(3, 5, 0, 1000)
TNT1 AAAAAA 0 A_SpawnItemEx("SunstarNovaBeamExplosionFX", random(-32, 32), random(-64, 64), random(0, 100))
TNT1 A 0 A_PlaySoundEx("weapon/coilexplode", "Voice")
TNT1 A 15 A_SpawnItemEx("SunstarChokeFX2", random(-256,256), random(-256,256),250, 0, 0, -5, 0, 0) 
stop
}
}

actor SunstarChokeFX2 : SunstarChokeFX
{
bouncefactor 0.2
}

actor SunstarNovaBeamExplosionFX
{
+NOINTERACTION
+NOGRAVITY
scale 2.5
	states
	{
	Spawn:
	MMFX BCDE 2
	stop
	}
}

actor SunstarSplitShot
{
scale 2.5
PROJECTILE
+RIPPER
Damage (3)
Height 8
Radius 20
Speed 30
damagetype "Misc"
States
{
Spawn:
S_UN K 0
S_UN F 0 A_PlaySoundEx("misc/sunstarshot", "Voice", 0, 0)
Firing:
S_UN KL 4
loop
Death:
TNT1 A 2 A_PlaySoundEx("misc/sunstarexplode", "Voice", 0, 0)
PLAY A 0 A_SpawnItemEx("SunstarSplitShot2", 0, 0, 0, 18, 0, 0, 180 - 75)
PLAY A 0 A_SpawnItemEx("SunstarSplitShot2", 0, 0, 0, 18, 0, 0, 180 + 55)
PLAY A 0 A_SpawnItemEx("SunstarSplitShot2", 0, 0, 0, 18, 0, 0, 180 + 35)
PLAY A 0 A_SpawnItemEx("SunstarSplitShot2", 0, 0, 0, 18, 0, 0, 180 + 15)
PLAY A 0 A_SpawnItemEx("SunstarSplitShot2", 0, 0, 0, 18, 0, 0, 180 - 15)
PLAY A 0 A_SpawnItemEx("SunstarSplitShot2", 0, 0, 0, 18, 0, 0, 180 - 35)
PLAY A 0 A_SpawnItemEx("SunstarSplitShot2", 0, 0, 0, 18, 0, 0, 180 - 55)
TNT1 A 40 A_SpawnItemEx("SunstarSplitShot2", 0, 0, 0, 18, 0, 0, 180 - 75)
stop
}
}

actor SunstarSplitShot2 : SunstarSplitShot
{
-RIPPER
+THRUACTORS
damagetype "Misc"
Damage (10)
scale 2.5
height 40
States
{
Spawn:
S_UN KL 4
S_UN KL 0 A_ChangeFlag("THRUACTORS", 0)
loop
Death:
TNT1 A 2
stop
}
}

actor SunstarNovaShot : SunstarSplitShot
{
Speed 40
states
{
Spawn:
S_UN K 0
S_UN F 0 A_PlaySoundEx("misc/sunstarshot", "Voice", 0, 0)
Firing:
S_UN KL 4
loop
Death:
TNT1 A 2 A_PlaySoundEx("misc/sunstarexplode", "Voice", 0, 0)
PLAY A 0 A_SpawnItemEx("SunstarSplitShot2", 0, 0, 0, 10, 0, 0, 180 - 75)
PLAY A 0 A_SpawnItemEx("SunstarSplitShot2", 0, 0, 0, 10, 0, 0, 180 + 55)
PLAY A 0 A_SpawnItemEx("SunstarSplitShot2", 0, 0, 0, 10, 0, 0, 180 + 35)
PLAY A 0 A_SpawnItemEx("SunstarSplitShot2", 0, 0, 0, 10, 0, 0, 180 + 15)
PLAY A 0 A_SpawnItemEx("SunstarSplitShot2", 0, 0, 0, 10, 0, 0, 180 - 15)
PLAY A 0 A_SpawnItemEx("SunstarSplitShot2", 0, 0, 0, 10, 0, 0, 180 - 35)
PLAY A 0 A_SpawnItemEx("SunstarSplitShot2", 0, 0, 0, 10, 0, 0, 180 - 55)
TNT1 A 40 A_SpawnItemEx("SunstarSplitShot2", 0, 0, 0, 10, 0, 0, 180 - 75)
stop
}
}

actor SunstarNovaShotAngry : SunstarNovaShot
{
Speed 20
states
{
Spawn:
S_UN K 0
S_UN F 0 A_PlaySoundEx("misc/sunstarshot", "Voice", 0, 0)
Firing:
S_UN KL 4
loop
Death:
TNT1 A 2 A_PlaySoundEx("misc/sunstarexplode", "Voice", 0, 0)
TNT1 A 0 A_JumpIf(z<15, "Clip")
PLAY A 0 A_SpawnItemEx("SunstarSplitShot2", 0, 0, 0, 15, 0, 0, 30 * 0)
PLAY A 0 A_SpawnItemEx("SunstarSplitShot2", 0, 0, 0, 15, 0, 0, 30 * 1)
PLAY A 0 A_SpawnItemEx("SunstarSplitShot2", 0, 0, 0, 15, 0, 0, 30 * 2)
PLAY A 0 A_SpawnItemEx("SunstarSplitShot2", 0, 0, 0, 15, 0, 0, 30 * 3)
PLAY A 0 A_SpawnItemEx("SunstarSplitShot2", 0, 0, 0, 15, 0, 0, 30 * 4)
PLAY A 0 A_SpawnItemEx("SunstarSplitShot2", 0, 0, 0, 15, 0, 0, 30 * 5)
PLAY A 0 A_SpawnItemEx("SunstarSplitShot2", 0, 0, 0, 15, 0, 0, 30 * 6)
PLAY A 0 A_SpawnItemEx("SunstarSplitShot2", 0, 0, 0, 15, 0, 0, 30 * 7)
PLAY A 0 A_SpawnItemEx("SunstarSplitShot2", 0, 0, 0, 15, 0, 0, 30 * 8)
PLAY A 0 A_SpawnItemEx("SunstarSplitShot2", 0, 0, 0, 15, 0, 0, 30 * 9)
PLAY A 0 A_SpawnItemEx("SunstarSplitShot2", 0, 0, 0, 15, 0, 0, 30 * 10)
PLAY A 0 A_SpawnItemEx("SunstarSplitShot2", 0, 0, 0, 15, 0, 0, 30 * 11)
PLAY A 0 A_SpawnItemEx("SunstarSplitShot2", 0, 0, 0, 15, 0, 0, 30 * 12)
TNT1 A 40
stop
Clip:
PLAY A 0 A_SpawnItemEx("SunstarSplitShot2", 0, 0, 28, 15, 0, 0, 30 * 0)
PLAY A 0 A_SpawnItemEx("SunstarSplitShot2", 0, 0, 28, 15, 0, 0, 30 * 1)
PLAY A 0 A_SpawnItemEx("SunstarSplitShot2", 0, 0, 28, 15, 0, 0, 30 * 2)
PLAY A 0 A_SpawnItemEx("SunstarSplitShot2", 0, 0, 28, 15, 0, 0, 30 * 3)
PLAY A 0 A_SpawnItemEx("SunstarSplitShot2", 0, 0, 28, 15, 0, 0, 30 * 4)
PLAY A 0 A_SpawnItemEx("SunstarSplitShot2", 0, 0, 28, 15, 0, 0, 30 * 5)
PLAY A 0 A_SpawnItemEx("SunstarSplitShot2", 0, 0, 28, 15, 0, 0, 30 * 6)
PLAY A 0 A_SpawnItemEx("SunstarSplitShot2", 0, 0, 28, 15, 0, 0, 30 * 7)
PLAY A 0 A_SpawnItemEx("SunstarSplitShot2", 0, 0, 28, 15, 0, 0, 30 * 8)
PLAY A 0 A_SpawnItemEx("SunstarSplitShot2", 0, 0, 28, 15, 0, 0, 30 * 9)
PLAY A 0 A_SpawnItemEx("SunstarSplitShot2", 0, 0, 28, 15, 0, 0, 30 * 10)
PLAY A 0 A_SpawnItemEx("SunstarSplitShot2", 0, 0, 28, 15, 0, 0, 30 * 11)
PLAY A 0 A_SpawnItemEx("SunstarSplitShot2", 0, 0, 28, 15, 0, 0, 30 * 12)
TNT1 A 40
stop
}
}


actor Sunstar_Gallop
{
Height 58
Radius 34
Scale 2.5
-SOLID
+NOINTERACTION
Translation "192:192=248:248", "198:198=249:249"
states
{
	Spawn:
	TNT1 A 0
	TNT1 A 0 Thing_ChangeTID(0, 600)
	Warping:
	SGOD I 0 A_PlaySoundEx("misc/bigstomp", "Voice", 0, 1)
	SGOD I 0 A_SpawnItemEx("SunstarGallopFX1")
	SGOD II 1 A_Warp(AAPTR_TARGET, 0, 0, 0, 0, WARPF_COPYINTERPOLATION)
	SGOD I 0 A_SpawnItemEx("SunstarGallopFX2")
	SGOD JJ 1 A_Warp(AAPTR_TARGET, 0, 0, 0, 0, WARPF_COPYINTERPOLATION)
	SGOD I 0 //A_PlaySoundEx("misc/bigstomp", "Voice", 0, 1)
	SGOD I 0 A_SpawnItemEx("SunstarGallopFX3")
	SGOD KK 1 A_Warp(AAPTR_TARGET, 0, 0, 0, 0, WARPF_COPYINTERPOLATION)
	SGOD I 0 A_SpawnItemEx("SunstarGallopFX4")
	SGOD LL 1 A_Warp(AAPTR_TARGET, 0, 0, 0, 0, WARPF_COPYINTERPOLATION)
	loop
}
}

actor SunstarGallopFX1
{
alpha 0.8
Scale 2.5
+NOINTERACTION
Translation "192:192=248:248", "198:198=249:249"
-SOLID
states
{
Spawn:
SGOD I 1 A_FadeOut(0.06)
loop
}
}

actor SunstarGallopFX2 : SunstarGallopFX1 
{
states
{
Spawn:
SGOD J 1 A_FadeOut(0.06)
loop
}
}
actor SunstarGallopFX3 : SunstarGallopFX1 
{
states
{
Spawn:
SGOD K 1 A_FadeOut(0.06)
loop
}
}
actor SunstarGallopFX4 : SunstarGallopFX1 
{
states
{
Spawn:
SGOD L 1 A_FadeOut(0.06)
loop
}
}

actor SunstarWallCheck
{
	PROJECTILE
	+THRUACTORS
	renderstyle none
	radius 32
	states
	{
	Spawn:
	PLAY A 5
	stop
	Death:
	//PLAY A 0 A_Log("I hit the wall!")
	PLAY A 0 A_GiveToTarget("AtomicFireAmmo", 1)
	stop
	}
}

actor SunstarAreaFlamesWarper
{
+MISSILE
+NOINTERACTION
-SOLID
height 2
radius 2
scale 5.0
renderstyle none
states
{
Spawn:
PLAY A 1 A_JumpIfInTargetInventory("ReboundStrikerAmmo", 1, "Warp")
loop
Warp:
TNT1 A 1 A_Warp(AAPTR_TARGET, 0, 0, 0, 0, WARPF_NOCHECKPOSITION)
PLAY A 0 //A_JumpIfInTargetInventory("NoRemoteMineLatch", 1, "Warp")
TNT1 A 0 A_SpawnItemEx("SunstarAreaFlames", random(0, 150), 0, random(0, 32), 0, 0, random(1, 3), random(0,360))
PLAY A 0 A_JumpIfInTargetInventory("ReboundStrikerAmmo", 1, "Warp")
stop
}
}

actor SunstarAreaFlames
{
+NOINTERACTION
+MISSILE
var int user_size;
renderstyle add
states
{
Spawn:
FSWD D 0
FSWD D 0 A_SetUserVar("user_size", random(1, 8))
FSWD D 0 A_SetScale(user_size * 0.1, user_size * 0.1)
Flamey:
S_UN F 1 A_FadeOut(0.04)
loop
}
}
