////////////////////
// ECLIPSE PART1  //		
////////////////////

actor SunstarProp
{
scale 2.5
Translation "192:192=248:248", "198:198=249:249"
MONSTER
+INVULNERABLE
states
{
Stand:
S_U3 A -1

Spawn:
S_U2 N -1
stop
Bow:
S_U2 N -1
stop
NoticeHead:
S_U2 X -1
stop
Transformation:
S_U3 A 4
S_U3 B -1
Transform:
S_U3 D 0 A_PlaySoundEx("weapon/crashland", "Voice", 0, 1)
S_U3 DDDDDDD 1
S_U3 EEEEEEEEE 1
S_U3 FFFFFFFFFFFFFFF 1
S_U3 F 0 ACS_NamedExecute("EclipseTransformTranslation", 0) 
S_U3 F 0 A_SpawnItemEx("SunstarDyingFlamesSpawner",0,0,32)
LoopStart:
S_U3 GGGGGGGGGGGGGGGGG 1
S_U3 HHHHHHHHHHHHHHHH 1
S_U3 IIIIIIIIIIIIIII 1
S_U3 JJJJJJJJJJJJJJJ 1
S_U3 KKKKKKKKKKKKKKK 1
S_U3 LLLLLLLLLLLLLLL 1
S_U3 MMMMMMMMMMMMMMM 1
S_U3 NNNNNNNNNNNNNNN 1
S_U3 OOOOOOOOOOOOOOO 1
S_U3 PPPPPPPPPPPPPPP 1
S_U3 QQQQQQQQQQQQQQQ 1
S_U3 RRRRRRRRRRRRRRR 1
S_U3 SSSSSSSSSSSSSSS 1
S_U3 TTTTTTTTTTTTTTT 1
S_U3 UUUUUUUUUUUUUUU 1
S_U3 VVVVVVVVVVVVVVVV 1
Goto LoopStart

End:
S_U3 W 0 A_Quake(9, 10, 0, 1000, "")
S_U3 W 0 A_SpawnITemEx("WilyGolemExplosion", 5, 27, 30, 0, 0, 0, 0) 
S_U3 W 4 A_PlaySoundEx("misc/mm3explosion", "Voice", 0, 1)
S_U2 UV 4
S_U2 W 20
S_U3 X 145
S_U3 Y 7
S_U3 Z 7 A_PlaySoundEx("zandronum/connect", "Voice", 0, 1)
S_U3 "[" 7
BEC1 A -1
stop

Death:
BEC1 A 1 A_SpawnItemEx("BEclipseTentacleWarperAppear", -15, 0, 62)
stop

}
}

actor SunstarDyingFlamesSpawner
{
+NOINTERACTION
states
{
Spawn:
TNT1 A 0
TNT1 A 35 Thing_ChangeTID(0, 8500)
Looping:
TNT1 A 6 A_spawnItemEx("SunstarDyingFlames", random(32, 128), 0, -32, 0, 0, frandom(5, 10), random(0,360))
loop
Waiting:
TNT1 A -1
Evil:
TNT1 A 45
EvilLoop:
S_U3 W 0 A_Quake(3, 8, 0, 1000, "")
TNT1 A 0 A_SpawnItemEx("ShockFX",random(0,64),0,random(0,64),0,0,0,random(0,360))
TNT1 AAAA 2 A_SpawnItemEx("SunstarDyingDarkness",random(32,128),0,random(0,128),0,0,0,random(0,360))
loop
}
}

actor SunstarDyingFlames
{
+NOGRAVITY
+MISSILE
var int user_size;
renderstyle add
scale 2.5
states
{
Spawn:
FSWD F 0
TNT1 A 0 Thing_ChangeTID(0, 8501)
Flamey:
S_UN F 0 A_ScaleVelocity(0.95)
S_UN F 1 A_FadeOut(0.01)
loop
Hold:
S_UN F 0 A_FadeIn(0.25)
S_UN F -1 A_Stop
stop
Return:
S_UN F 0 ACS_NamedExecuteAlways("SunstarFlameIn", 0)
Returning:
S_UN F 1 A_ScaleVelocity(1.01)
loop
}
}

actor SunstarDyingDarkness
{
Scale 1.5
translation "198:198=0:0", "4:4=79:79"
renderstyle translucent
alpha 0.2
+MISSILE
+NOGRAVITY
states
{
Spawn:
GAMA P 0
GAMA P 0 ACS_NamedExecuteAlways("SunstarFlameIn", 0)
Looping:
GAMA PPPPQQQQ 1 A_ScaleVelocity(1.01)
GAMA P 0 A_FadeIn(0.2)
loop
}
}


actor SunstarERHead
{
scale 2.5
+NOGRAVITY
radius 10
-SOLID
states
{
Spawn:
BECL A 0
BECL A 0 A_ChangeVelocity(0, 0, -0.8, 0)
BECL BCBCBCBCBCBCBCBCBCB 5
BECL DEFEDEFEDE 4 A_Stop
BECL A 0 A_ChangeFlag("NOGRAVITY", 0)
Falling:
BECL G 1 A_JumpIf(z==0, "Land") 
loop
Land:
BECL H 65 A_PlaySoundEx("misc/basicland", "Voice", 0, 1)
BECL F 0 A_ChangeVelocity(0, 0, 4.0, 0)
BECL I 6
BECL J -1
Leap:
BECL K 6 //A_ChangeVelocity(8, 0, 0.0, CVF_RELATIVE)
BECL L 8 A_ChangeVelocity(14, 0, 16.0, CVF_REPLACE|CVF_RELATIVE)
BECL M -1 ACS_NamedExecute("ERHeadLeap",0)
stop
Hide:
TNT1 A -1
stop
}
}

actor BEclipseBoss
{
//$Category MM8BDM-Bosses
Height 58
Radius 34
Scale 2.5
Obituary "%o fell to the power of evil."
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_rd;

states
{
Spawn:
BEC1 A 0 A_JumpIf(true, "Looking")
BEC1 A 0 A_SpawnItemEx("BEclipseTentacleWarper")
BEC1 A -1
Looking:
BEC1 A 0 A_Stop
BEC1 A 1 A_Look
Goto Looking+1
See:
BEC1 A 0 A_JumpIfInventory("AstroCrushAmmo", 1, "TotalEclipseStart")
BEC1 AAA 3 A_FaceTarget
BEC1 A 0 A_JumpIfInTargetInventory("IsDead", 1, "Looking")
goto Charge
Charge:
BEC1 A 0 A_Stop
BEC1 AAAAAA 1 A_FaceTarget
ChargeBegin:
BEC1 A 1 A_FaceTarget
TNT1 A 1 A_SpawnItemEx("BEclipseDash")
SGOD A 0 A_TakeInventory("RollingCutterAmmo", 99)
ChargeSeek:
TNT1 A 0 A_FaceTarget
TNT1 A 2 A_ChangeVelocity(45.0, 0, 0, CVF_RELATIVE|CVF_REPLACE)
SGOD R 0 A_TakeInventory("AtomicFireAmmo", 99)
Charging:
TNT1 A 0 A_JumpIfInventory("RollingCutterAmmo", 1, "ChargeEnd")
TNT1 A 0 A_SpawnItemEx("BEclipseWallCheck", 0, 0, 0, 20)
TNT1 A 0 A_JumpIfCloser(70, "Choke")
TNT1 A 1 A_ChangeVelocity(45.0, 0, 0, CVF_RELATIVE|CVF_REPLACE)
loop
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("QuickBoomerangAmmo", 9999)
BEC1 K 0 A_Stop
SGOD A 0 Thing_Remove(600)
SGOD A 0 A_SpawnItemEx("BEclipseChoke", 0, 0, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
SGOD A 0 ACS_NamedExecuteAlways("eclipsechoke", 0)
BEC1 K 1 A_Recoil(50)
BEC1 K 1 A_Stop
SGOD A 0 A_TakeInventory("AtomicFireAmmo", 99)
SGOD A 0 A_PlaySoundEx("misc/junkmix", "SoundSlot7", 1, 1)
ChokeLoop:
//TNT1 A 0 A_SpawnItemEx("BEclipseWallCheck", 0, 0, 0, 20)
BEC1 K 1 A_ChangeVelocity(13.0, 0, 0, CVF_RELATIVE|CVF_REPLACE)
//BEC1 P 0 A_JumpIfInventory("ScrewCrusherAmmo", 1, "ChokeLeap")
BEC1 P 0 A_JumpIfInventory("QuickBoomerangAmmo", 35, "ChokeLeap")
BEC1 P 0 A_GiveInventory("QuickBoomerangAmmo", 1)//A_SpawnItemEx("SunstarThrowDistance",0,0,0,120)
loop
ChokeLeap: 
SGOD A 0 A_StopSoundEx("SoundSlot7")
BEC1 J 0 A_GiveInventory("AtomicFireAmmo", 1)
BEC1 J 15 A_ChangeVelocity(-25.0, 0, 20.0, CVF_RELATIVE|CVF_REPLACE)
BEC1 G 0 A_ChangeFlag("NOGRAVITY", 1)
BEC1 G 10 A_Stop
BEC1 G 0 A_ChangeVelocity(-3.0, 0, 4.0, CVF_RELATIVE|CVF_REPLACE)
BEC1 G 0 A_ChangeFlag("NOGRAVITY", 0)
SGOD A 0 A_TakeFromTarget("SunstarShield",9999)
SGOD B 0 A_ChangeFlag("NODAMAGE", 0)
BECH H 0 A_FaceTarget
TNT1 A 0 A_playSoundEx("misc/eclipsedarkshot", "Voice", 0, 1)
BEC1 H 1 A_CustomMissile("BEclipseFireball", 38, 8, 16)
BEC1 H 1 A_CustomMissile("BEclipseFireball", 38, 4, 8)
BEC1 H 1 A_CustomMissile("BEclipseFireball", 38, 0, 0)
BEC1 H 1 A_CustomMissile("BEclipseFireball", 38, -4, -8)
BEC1 H 1 A_CustomMissile("BEclipseFireball", 38, -8, -16)
BEC1 H 6 
BEC1 I 6
Falling:
BEC1 I 1 A_JumpIf(z-floorz==0, "LeapEnd")
loop
Tentacles:
BEC1 E 10 A_Quake(5, 120, 0, 1000)
BEC1 E 0 A_FaceTarget
BEC1 E 0 A_SpawnITemEx("BEclipseTentacleSpawner", 0, 0, 0, 50, 0, 0, 0)
BEC1 E 0 A_SpawnITemEx("BEclipseTentacleSpawner", 0, 0, 0, 50, 0, 0, 90)
BEC1 E 30 A_SpawnITemEx("BEclipseTentacleSpawner", 0, 0, 0, 50, 0, 0, -90)
BECH H 0 A_FaceTarget
BEC1 E 0 A_SpawnITemEx("BEclipseTentacleSpawner", 0, 0, 0, 50, 0, 0, 45)
BEC1 E 0 A_SpawnITemEx("BEclipseTentacleSpawner", 0, 0, 0, 50, 0, 0, -45)
BEC1 E 30 A_SpawnITemEx("BEclipseTentacleSpawner", 0, 0, 0, 50, 0, 0, 0)
BECH H 0 A_FaceTarget
BEC1 E 80 A_SpawnITemEx("BEclipseTentacleSpawner", 0, 0, 0, 50, 0, 0, 0)
BEC1 A 20
Goto Seek
LeapShot:
BEC1 G 0 A_FaceTarget
BEC1 G 10 A_ChangeVelocity(15.0, 0, 25.0, CVF_RELATIVE|CVF_REPLACE)
BEC1 G 0 A_ChangeFlag("NOGRAVITY", 1)
BEC1 G 10 A_Stop
BEC1 G 0 A_ChangeFlag("NOGRAVITY", 0)
BEC1 G 0 A_ChangeVelocity(-3.0, 0, 4.0, CVF_RELATIVE|CVF_REPLACE)
BECH H 0 A_FaceTarget
TNT1 A 0 A_playSoundEx("misc/eclipsedarkshot", "Voice", 0, 1)
BEC1 H 1 A_CustomMissile("BEclipseFireball", 38, 8, 16)
BEC1 H 1 A_CustomMissile("BEclipseFireball", 38, 4, 8)
BEC1 H 1 A_CustomMissile("BEclipseFireball", 38, 0, 0)
BEC1 H 1 A_CustomMissile("BEclipseFireball", 38, -4, -8)
BEC1 H 1 A_CustomMissile("BEclipseFireball", 38, -8, -16)
BEC1 H 6 
BEC1 I 3
BEC1 G 0 A_ChangeFlag("NOGRAVITY", 1)
BEC1 G 10 A_Stop
BEC1 G 0 A_ChangeFlag("NOGRAVITY", 0)
BEC1 G 0 A_ChangeVelocity(-3.0, 0, 4.0, CVF_RELATIVE|CVF_REPLACE)
BECH H 0 A_FaceTarget
TNT1 A 0 A_playSoundEx("misc/eclipsedarkshot", "Voice", 0, 1)
BEC1 H 1 A_CustomMissile("BEclipseFireball", 38, 8, 16)
BEC1 H 1 A_CustomMissile("BEclipseFireball", 38, 4, 8)
BEC1 H 1 A_CustomMissile("BEclipseFireball", 38, 0, 0)
BEC1 H 1 A_CustomMissile("BEclipseFireball", 38, -4, -8)
BEC1 H 1 A_CustomMissile("BEclipseFireball", 38, -8, -16)
Goto Falling
ChargeEnd:
BEC1 A 0 A_Stop
BEC1 A 0 Thing_Remove(600)
SGOD R 0 A_TakeInventory("QuickBoomerangAmmo", 99)
SGOD R 0 A_TakeInventory("AtomicFireAmmo", 99)
BEC1 A 0 A_Jump(64, "Charge")
Goto LeapShot

LeapEnd:
BEC1 A 0 A_Stop
BEC1 AAA 3 A_FaceTarget
Goto Tentacles

Seek:
BEC1 A 1 A_LookEx(0, 0, 0, 0, 360, "See")
loop

TotalEclipseStart:
BEC1 AA 1 A_GiveInventory("NapalmBombAmmo", 1)
TotalEclipseWalk:
BEC1 BBCCDD 1 A_ChangeVelocity(33.0, 0, 0, CVF_RELATIVE|CVF_REPLACE)
loop
TotalEclipsePower:
BEC1 A 0 A_GiveInventory("CopyVisionAmmo", 1)
BEC1 A 0 A_Stop
BEC1 A 0 A_Quake(5, 35, 0, 1100, "")
BEC3 OOOOPPPPOOOOPPPPOOOPPPOOPPPOOOPPOO 4
BEC3 O 0 A_ChangeFlag("NOGRAVITY", 1)
BEC3 O 0 A_ChangeVelocity(0, 0, 2, 0)
BEC3 QQQQQQQQQQQQ 4 
BEC3 Q 0 A_Stop
Goto TheEnd
TheEnd:
BEC3 O 0 A_SetUserVar("user_rd", user_rd + 18)
BEC3 O 0 A_Explode(5, user_rd, XF_NOTMISSILE, 0, user_rd)
BEC3 QQQQQQQQQQQQ 1 A_SpawnItemex("BEclipseEscapeExplosion", 0, 0, random(0, 512), 100, 0, 0, random(0,360))
loop
}

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", 5.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.0
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.0
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.0
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", 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
}




actor BEclipseChokeDamage
{
PROJECTILE
+NOINTERACTION
radius 2
height 2
states
{
Spawn:
TNT1 A 0
TNT1 A 1 A_Explode(6, 64, 0, 6)
stop
}
}

actor BEclipseWallCheck : SunstarWallCheck
{
	radius 4
	states
	{
	Spawn:
	PLAY A 5
	stop
	Death:
	//PLAY A 0 A_Log("I hit the wall!")
	PLAY A 0 A_GiveToTarget("RollingCutterAmmo", 1)
	stop
	}
}

actor BEclipseDash
{
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:
	BEC1 BBCCDD 1 A_Warp(AAPTR_TARGET, 0, 0, 0, 0, WARPF_COPYINTERPOLATION)
	loop
}
}

actor BEclipseTentacleWarper
{
+MISSILE
+NOINTERACTION
height 2
radius 2
scale 2.5
states
{
Spawn:
BECL N 0 A_JumpIFInTargetInventory("CopyVisionAmmo", 1, "BallStart")
BECL NNNNOOOOPPPP 1 A_Warp(AAPTR_TARGET, -16, 0, 52, 0, WARPF_COPYINTERPOLATION|WARPF_NOCHECKPOSITION)
loop
BallStart:
TNT1 A 0 ACS_NamedExecuteAlways("ballsizer", 0)
Ball:
ECLP DDDDEEEEFFFFGGGG 1 A_Warp(AAPTR_TARGET, -16, 0, 52, 0, WARPF_COPYINTERPOLATION|WARPF_NOCHECKPOSITION)
loop
}
}

actor BEclipseTentacleWarperAppear
{
+NOINTERACTION
-SOLID
scale 2.5
states
{
Spawn:
BEC2 U 0
BEC2 U 0 A_PlaySOundEx("misc/metalstab", "Voice", 0, 1)
BEC2 VWX 4
stop
}
}

actor BEclipseChoke : SunstarChoke
{
//renderstyle normal
reactiontime 12
states
	{
	Spawn:
	PLAY A 0
	PLAY A 0 A_PlaySoundEx("misc/sunstarchoke", "Voice", 0, 0)
	PLAY A 0 Thing_ChangeTID(0, 1102)
	Goto Lock
	Lock:
	PLAY A 0 A_SpawnItemEx("BEclipseChokeFX", 84, 0, 0, 0, random(-10,10), random(5,10), 0, 0, 0)  
	PLAY A 1 A_Warp(AAPTR_TARGET, 48, -48, 0, 0, WARPF_NOCHECKPOSITION)
	PLAY A 0 A_JumpIfInTargetInventory("AtomicFireAmmo", 1, "Death")
	loop
	Death:
	PLAY A 0 //A_PlaySoundEx("misc/quake", "Voice", 0, 1)
	stop
}
}

actor BEclipseChokeFX : WilyGolemGrindDebris
{
gravity 1.0
+THRUACTORS
}

actor BEclipseFireball
{
PROJECTILE
+RIPPER
damage (1)
radius 16
height 16
speed 40
//translation "208:208=0:0", "56:91=249:249"
scale 1.5
states
{
Spawn:
BECL QQRRSSRR 1 A_SpawnItemEx("BEclipseFireballTrail")
loop
Death:
BECL Q 0 A_PlaySoundEx("misc/sharkspinner", "Voice", 1, 0)
BECL Q 0 A_Quake(2, 30, 0, 1000) 
BECL QRSRQRSR 2
BECL Q 0 A_Jump(256, 1, 2 ,3)
BECL QRSR 2
TNT1 A 0 A_playSoundEx("weapon/solarblaze", 0, 0, 0)
BECL Q 0 A_Explode(10, 64, 0, 0, 10)
BECL Q 0 A_SpawnItemEx("BEclipseFireballMini",0,0,0,25,0,0,24*0)
BECL Q 0 A_SpawnItemEx("BEclipseFireballMini",0,0,0,25,0,0,24*2)
BECL Q 0 A_SpawnItemEx("BEclipseFireballMini",0,0,0,25,0,0,24*3)
BECL Q 0 A_SpawnItemEx("BEclipseFireballMini",0,0,0,25,0,0,24*4)
BECL Q 0 A_SpawnItemEx("BEclipseFireballMini",0,0,0,25,0,0,24*5)
BECL Q 0 A_SpawnItemEx("BEclipseFireballMini",0,0,0,25,0,0,24*6)
BECL Q 0 A_SpawnItemEx("BEclipseFireballMini",0,0,0,25,0,0,24*7)
BECL Q 0 A_SpawnItemEx("BEclipseFireballMini",0,0,0,25,0,0,24*8)
BECL Q 0 A_SpawnItemEx("BEclipseFireballMini",0,0,0,25,0,0,24*9)
BECL Q 0 A_SpawnItemEx("BEclipseFireballMini",0,0,0,25,0,0,24*10)
BECL Q 0 A_SpawnItemEx("BEclipseFireballMini",0,0,0,25,0,0,24*11)
BECL Q 0 A_SpawnItemEx("BEclipseFireballMini",0,0,0,25,0,0,24*12)
BECL Q 0 A_SpawnItemEx("BEclipseFireballMini",0,0,0,25,0,0,24*13)
BECL Q 0 A_SpawnItemEx("BEclipseFireballMini",0,0,0,25,0,0,24*14)
BECL Q 0 A_SpawnItemEx("BEclipseFireballMini",0,0,0,25,0,0,24*15)
BECL Q 0 A_StopSoundEx("Voice")
ASEX ABCDEF 2
stop
}
}

actor BEclipseFireballMini
{
scale 2.5
PROJECTILE
+THRUACTORS
translation "48:223=61:61", "227:227=63:63"
damage (4)
damagetype "Misc"
states
{
Spawn:
S_UN LK 4
TNT1 A 0 A_ChangeFlag("THRUACTORS", 0)
loop
}
}

actor BEclipseFireballTrail
{
translation "1:255=0:0"
renderstyle translucent
alpha 1.0
scale 1.0
//reactiontime 9
+NOINTERACTION
states
{
Spawn:
TNT1 A 0 A_FadeOut(0.1)
BECL R 1 A_SetScale(scalex - 0.1, scaley - 0.1)
loop
}
}

actor BEclipseTentacle
{
+FLOORHUGGER
scale 2.5
reactiontime 9
+MISSILE
damagetype "Boss"
states
{
Spawn:
BEC2 A 28
BEC2 G 0 A_SpawnItemEx("BEclipseTentacleDamager", 0, 0, 40)
"####" G 0 A_PlaySound("misc/mm3explosion", "Voice")
BEC2 BCDEF 2
BEC2 G 8
BEC2 G 0 A_Jump(256, 0, 2, 3, 4, 5, 6)
TentacleTime:
BEC2 HIHJKL 4 A_Countdown
loop
Death:
BEC2 JMN 3
BEC2 A 3
stop
}
}

actor BEclipseTentaclePerma : BEclipseTentacle
{
reactiontime 500
}

actor BEclipseTentacleDamager
{
PROJECTILE
+THRUACTORS
states
{
Spawn:
TNT1 AAAAAAAAAAAAA 5 A_Explode(5, 42, 0, 0, 42)
stop
}
}
actor BEclipseTentacleSpawner
{
renderstyle none
PROJECTILE
+THRUACTORS
states
{
Spawn:
PLAY A 2 A_SpawnITemex("BEclipseTentacle")
loop
}
}

actor BEclipseEscapeDebrisSpawner
{
+NOINTERACTION
reactiontime 250
states
{
Spawn:
TNT1 A 0 A_CountDown
TNT1 A 1 A_SpawnItemEx("BEclipseEscapeDebrisFX", random(-1028, 1028), random(-1028, 1028), 5000, 0, 0, 0, 0, SXF_NOCHECKPOSITION) 
loop
}
}

actor BEclipseEscapeDebrisFX
{
//PROJECTILE
-SOLID
height 2
radius 2
+THRUACTORS
-NOGRAVITY
gravity 0.2
scale 2.0

states
{
Spawn:
TNT1 A 2
TNT1 A 0 A_ChangeFlag("MISSILE", 1)
WGOL F 0 A_Jump(256, "FX1", "FX2", "FX3", "FX4", "FX5")
FX1:
BEC2 O -1
FX2:
BEC2 P -1
FX3:
BEC2 Q -1
FX4:
BEC2 R -1
FX5:
BEC2 S -1
stop
Death:
TNT1 A 0 A_SpawnItemEx("SharkTorpedoDeath", 0, 0, 0)
stop 
}
}

actor BEclipseEscapeBlockFX1
{
PROJECTILE
-NOGRAVITY
gravity 0.015
scale 2.5
alpha 0.0
states
{
Spawn:
BEC2 T 1 A_FadeIn(0.01)
loop
}
}


actor BEclipseEscapeBlockFX2 : BEclipseEscapeBlockFX1
{
states
{
Spawn:
BEC2 U 1
loop
}
}

actor BEclipseEscapeExplosions
{
+NOINTERACTION
states
{
Spawn:
TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAA 2 A_SpawnItemex("BEclipseEscapeExplosion", 500, 0, random(-512, 512), 100, 0, 0, random(0,360))
stop
}
}

actor BEclipseEscapeExplosion
{
-SOLID
+NOGRAVITY
+MISSILE
+THRUACTORS
radius 16
height 16
scale 2.5
states
{
Spawn:
TNT1 A 1
loop
Death:
TNT1 A 0 A_PlaySound("misc/mm3explosion", "Voice", 0.5)
ASEX A 0 A_ChangeFlag("NOINTERACTION", 1)
ASEX ABCDEF 2
stop
}
}

actor BEclipseEscapeExplosionsKill 
{
+NOINTERACTION
states
{
Spawn:
TNT1 AAAAA 1 A_SpawnItemex("BEclipseEscapeExplosion", 500, 0, random(-32, 32), 20, 0, 0, random(0,360))
stop
}
}

actor BEclipseTerraProp
{
Translation "192:192=117:117", "198:198=74:74"
scale 2.5
height 1
radius 1

states
{
Spawn:
TRR3 A -1
loop
Talking:
TRR3 BABABABABABABABAB 4
Goto Spawn
Tilt:
TRR3 C -1
Laugh:
TRR3 CCCCCCCCCCCDCDCDCD 4
TRR3 EFEFEFEFEF 4
TRR3 GHGH 4
LaughLoop:
TRR3 GGHH 2 A_SpawnItemex("BEclipseEscapeExplosion", 0, 0, random(64, 256), 10, 0, 0, random(45, 270))
loop
}
}

actor WilyStarEscapeProp
{
+NOGRAVITY
scale 2.0
states
{
Spawn:
INTC P -1 
goto Attack
Exploding:
INTC P 6 A_SpawnItemEx("WilyStarExplode", 1, random(-64, 64), random(-64, 64)) 
loop
Pod:
INTC P 6 A_SpawnItemEx("WilyStarEscapePod", 4, -12, -24)
Goto Exploding
Attack:
INTC P -1 A_SpawnItemEx("WilyStarAttack", 64, 1, -16) 
Goto Spawn
}
}

actor WilyStarExplode
{
scale 2.0
+NOINTERACTION
states
{
Spawn:
BEC3 RSTUVWX 2
stop
}
}

actor WilyStarEscapePod
{
scale 8.5
+NOINTERACTION
states
{
Spawn:
BEC3 YZ 2
loop
}
}

actor BlackTentacle /*: SwitchableDecoration*/ 11774
{
//$Category MM8BDM-Interactive Props
//$NotAngled
//$Arg0 Seek Players
//$Arg1 Upside down
//$Sprite BEC2H0
+FLOORHUGGER
scale 2.5
reactiontime 9
+SOLID
height 128
radius 38
damagetype "Misc"
+NOGRAVITY
states
{
Spawn:
TNT1 A 0
TNT1 A -1 A_ChangeFlag("SOLID", 0)
Active:
TNT1 A 0
TNT1 A 1 A_JumpIf(args[0], "Seek")
BEC2 G 0 A_JumpIf(args[1], "DownSpawn")
Goto Start
DownSpawn:
TNT1 A 1 ThrustThingZ(0, 99999, 0, 1)
BEC3 G 0
Goto Start
Start:
"####" G 0 A_ChangeFlag("SOLID", 1)
"####" G 0 A_Jump(256, 0, 2, 3, 4, 5, 6)
TentacleTime:
"####" HIHJKL 4 A_SpawnItemEx("BlackTentacleDamager", 0, 0, 64)//
loop
Seek:
TNT1 A 0 A_ChangeFlag("SOLID", 0) 
Seeking:
TNT1 A 1 A_LookEx(LOF_NOSOUNDCHECK , 0, 800, 0, 360, "Appear")
loop
Appear:
TNT1 A 0 A_ChangeFlag("SOLID", 1) 
BEC2 G 0 A_JumpIf(args[1], "Down")
goto Appearing
Down:
TNT1 A 1 ThrustThingZ(0, 99999, 0, 1)
BEC3 G 0
goto Appearing
Appearing:
"####" A 20
"####" G 0 A_PlaySoundEx("misc/mm3explosion", "Voice", 0, 1)
"####" BCDEF 2 //A_Explode(15, 60, XF_NOTMISSILE, 0, 60)
"####" G 4 A_SpawnItemEx("BlackTentacleDamager", 0, 0, 64)//A_Explode(5, 48, XF_NOTMISSILE, 0, 48)
Goto Start
Death:
"####" JMN 3
"####" A 3
stop
}
}

actor GiantBlackTentacle : BlackTentacle
{
scale 7.5
height 256
radius 64
-CANPASS
states
{
Spawn:
BEC2 HIHJKL 5 //A_Explode(5, 150, XF_NOTMISSILE, 0, 150)
loop
}
}

actor GiantBlackTentacleDown : GiantBlackTentacle
{
states
{
Spawn:
BEC3 HIHJKL 5// A_Explode(5, 150, XF_NOTMISSILE, 0, 150)
loop
}
}

actor BlackTentacleDamager
{
PROJECTILE
+THRUACTORS
states
{
Spawn:
TNT1 A 0
TNT1 A 1 A_Explode(2, 48, 0, 0, 48)
stop
}
}

actor WilyStarComboSwitch 11773
{
//$Category MM8BDM-Interactive Props
//$NotAngled
//$Arg0 Seconds until failure
//$Arg1 Script to execute when shot
//$Arg2 Arg1 of script when shot

scale 2.5
+SHOOTABLE
+NODAMAGE
+NOGRAVITY
//+ISMONSTER
painchance 256
var int user_time;
var int user_maxtime;
radius 32
height 32
health 100

mass 9999999999
translation "192:192=58:58", "198:198=60:60"

states
{
Spawn:
SSWI A 0
SSWI A 0 A_ChangeFlag("ISMONSTER", 1)
goto Deactivated+1
Deactivated:
SSWI A 0 ACS_NamedExecuteAlways("map_combolock", 0, 1)
SSWI A -1 A_ChangeFlag("CANTSEEK", 0)
stop
Pain:
SSWI A 0 A_JumpIfInventory("CutterFlag", 1, "Trigger")
SSWI A 0 ACS_NamedExecuteAlways("map_combolock", 0, 0)
Trigger:
SSWI A 0 A_GiveInventory("SparkChaserCantseek", 1)//A_ChangeFlag("CANTSEEK", 1)
SSWI A 0 A_PlaySoundEx("misc/timedswitchhit", "Voice")
SSWI A 0 A_SetUserVar("user_maxtime", (args[0] * 35) / 5)
SSWI A 0 A_SetUserVar("user_time", user_maxtime)
Phase1:
SSWI A 0 A_JumpIf(user_time < (user_maxtime / 3) * 2, "Phase2")
SSWI B 5
SSWI A 0 A_SetUserVar("user_time", user_time - 1)
SSWI A 0 A_JumpIf(user_time < (user_maxtime / 3) * 2, "Phase2")
SSWI C 5
SSWI A 0 A_SetUserVar("user_time", user_time - 1)
loop 
Phase2:
SSWI A 0 A_JumpIf(user_time < (user_maxtime / 3), "Phase3")
SSWI E 5
SSWI A 0 A_SetUserVar("user_time", user_time - 1)
SSWI A 0 A_JumpIf(user_time < (user_maxtime / 3), "Phase3")
SSWI F 5
SSWI A 0 A_SetUserVar("user_time", user_time - 1)
loop 
Phase3:
SSWI A 0 A_JumpIf(user_time <= 0, "Deactivated")
SSWI G 5
SSWI A 0 A_SetUserVar("user_time", user_time - 1)
SSWI A 0 A_JumpIf(user_time <= 0, "Deactivated")
SSWI H 5
SSWI A 0 A_SetUserVar("user_time", user_time - 1)
loop
Complete:
SSWI D -1 A_ChangeFlag("NOPAIN", 1)
stop
}
}
