



actor InhumaneIceExplosion: BarrelExplosion
{
	damagetype "IOS_Frost"
	States   {
		Death:
			TNT1 A 0
			TNT1 A 0 A_SpawnItem("WhiteShockwaveBig")
			TNT1 A 3
			TNT1 A 0 A_Explode(100,300) // radius half again as a barrel explosion
			TNT1 A 0 A_SetDamageType("ExplosiveImpact")
			TNT1 A 0 A_Explode(60,600)
			TNT1 A 0
			Stop
	}
}


actor IOSIceballTrail: IOSFireballTrail
{
	Translation "160:167=[170,209,253]:[104,115,185]", "224:231=[255,255,255]:[126,198,228]", "208:223=[129,210,224]:[104,115,185]"
}



// Sloppy, sloppy, sloppy. Palette shift fails on some red hues... 
// But you know what? It's better this way. Red and blue fire...
ACTOR IOSNuke
{
	Game Doom
	Projectile
	Radius 6
	Height 8
	Speed 50
	FastSpeed 70
	Damage 20
	+RANDOMIZE
	RenderStyle Translucent
	Alpha 1
	Scale 3.0
	SeeSound None
	DeathSound None


	//damagetype "IOS_Frost" //ice
	
	-NOBLOCKMAP // without this, A_RadiusGive does not see them and so projectile-destroying effects do not work. 	
	
	// changing from EFIR to a recolored volcabus missile
	//XScale 3.0
	//YScale 3.0
	// changing from a recolored volcabus missile to arecolored BFG ball
	
	//Scale 0.6
	//Translation "168:191=192:201", "17:17=193:193" // red to blue
	//Translation "160:167=[170,209,253]:[104,115,185]", "224:231=[255,255,255]:[126,198,228]", "208:223=[129,210,224]:[104,115,185]"	
	Translation "227:231=192:194", "112:127=192:198", "224:226=4:4" // bfg secondaries recolored bluish-white
	+BRIGHT
	
	States
	{
		Spawn:
			TNT1 A 1
			//TNT1 A 0 A_PlaySoundEx("weapons/rocklf", 1, 0, 2)
			TNT1 A 0 A_PlaySoundEx("misc/ios_nuke_launch", CHAN_VOICE, 1, 0)
			Goto Fly			
		Death:
			TNT1 A 0 A_explode(300, 600)
			//TNT1 A 0 A_SpawnItem ("BigRicoChet", 0, -15)
			TNT1 A 0 A_SpawnItemEx ("IcyNuclearMushroom",0,0,200,0,0,0,0,SXF_NOCHECKPOSITION,0)
			//TNT1 A 0 A_SpawnItemEx ("DetectFloorCraterIce",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
			//TNT1 A 0 A_SpawnItemEx ("DetectCeilCrater",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
			//TNT1 A 0 A_SpawnItemEx ("ExplosionFlareSpawnerIce",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
			//TNT1 A 0 A_SpawnItemEx ("BarrelExplosion",0,0,30,0,0,0,0,SXF_NOCHECKPOSITION,0)
			//TNT1 A 0 A_SpawnItemEx ("InhumaneIceExplosion",0,0,30,0,0,0,0,SXF_NOCHECKPOSITION,0)
			//TNT1 A 0 A_SpawnItemEx ("IceBarrelKaboom",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
			//TNT1 AAAAAAA 0 A_CustomMissile ("ExplosionIcyFlames", 0, 0, random (0, 360), 2, random (0, 360))
			//TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_CustomMissile ("ExplosionParticleHeavyIce", 0, 0, random (0, 360), 2, random (0, 180))
			//TNT1 AAAAAA 0 A_CustomMissile ("ExplosionParticleHeavyIce", 0, 0, random (0, 360), 2, random (0, 180))
			EXPL A 0 Radius_Quake (8, 120, 0, 120, 0)
			
			// This is a real nuke, an expanding ring of all-burning ice fire. Nothing will survive in the epicenter
			// where IceDeathsplosionPart is just IceCyberLordMissile2 with -NOGRAVITY
			TNT1 A 0 A_SpawnItemEx ("IceDeathsplosionPart",64,0,64,8,0,8,0,SXF_NOCHECKPOSITION, 0)
			TNT1 A 0 A_SpawnItemEx ("IceDeathsplosionPart",64,0,64,8,0,8,51,SXF_NOCHECKPOSITION, 0)
			TNT1 A 0 A_SpawnItemEx ("IceDeathsplosionPart",64,0,64,8,0,8,-51,SXF_NOCHECKPOSITION, 0)
			TNT1 A 0 A_SpawnItemEx ("IceDeathsplosionPart",64,0,64,8,0,8,102, SXF_NOCHECKPOSITION, 0)
			TNT1 A 0 A_SpawnItemEx ("IceDeathsplosionPart",64,0,64,8,0,8,-102, SXF_NOCHECKPOSITION, 0)
			TNT1 A 0 A_SpawnItemEx ("IceDeathsplosionPart",64,0,64,8,0,8,153, SXF_NOCHECKPOSITION, 0)
			TNT1 A 0 A_SpawnItemEx ("IceDeathsplosionPart",64,0,64,8,0,8,-153, SXF_NOCHECKPOSITION, 0)
			
			TNT1 A 0 A_PLaySoundEx("IOSNUKE1", CHAN_VOICE, 0, 1) // interrupts its flying sound
						
			
			//TNT1 A 0 A_CustomMissile ("SFXBigExplosionFlamesSpawner2", 10, 0, random (0, 360), 2, random (0, 40))
			//TNT1 AAAAAA 0 A_CustomMissile ("SFXBigExplosionFlamesNoSmoke", 10, 0, random (0, 360), 2, random (0, 40))
			BEXP B 0 BRIGHT A_Scream
			TNT1 A 0 A_ALertMonsters
			//TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_CustomMissile ("FastXIceChunk1", 0, 0, random (0, 360), 2, random (5, 90)) //ShrapnelParticle2
			EXP1 ABCDEFGHIJKLMN 3 BRIGHT
			Stop
		Fly:
			TNT1 A 0
			"----" A 0 A_JumpIf(CallAcs("IsBossDead"), "Death")
			BFE2 D 1 BRIGHT A_SpawnItem("IOSIceballTrail") // this sprite is a tiny 4-point star
			//TNT1 A 0 A_CustomMissile ("ShoqueAzul", random(-40,40), random(-40,40), random (0, 360), 2, random (0, 360)) // cacodemon explosion discharge
			TNT1 A 0 A_Jump(50, "FlyFlash")
			TNT1 A 0 A_Jump(50, "FlySparkBig")
			TNT1 A 0 A_Jump(64, "FlySpark")
			TNT1 A 0 A_Jump(50, "FlyFlashSmall")
			Loop
		FlySparkBig:
			TNT1 A 0
			BFE1 B 1 BRIGHT A_SpawnItem("IOSIceballTrail")
			TNT1 A 0 A_CustomMissile ("ShoqueAzul", random(-40,40), random(-40,40), random (0, 360), 2, random (0, 360)) // cacodemon explosion discharge
			Goto FlySpark
		FlySpark:
			// flash flashily into a large flash
			TNT1 A 0
			BFE2 A 1 BRIGHT A_SpawnItem("IOSIceballTrail")
			TNT1 A 0 A_CustomMissile ("ShoqueAzul", random(-40,40), random(-40,40), random (0, 360), 2, random (0, 360)) // cacodemon explosion discharge
			BFE2 B 1 BRIGHT A_SpawnItem("IOSIceballTrail")
			TNT1 A 0 A_CustomMissile ("ShoqueAzul", random(-40,40), random(-40,40), random (0, 360), 2, random (0, 360)) // cacodemon explosion discharge
			BFE2 C 1 BRIGHT A_SpawnItem("IOSIceballTrail")
			TNT1 A 0 A_CustomMissile ("ShoqueAzul", random(-40,40), random(-40,40), random (0, 360), 2, random (0, 360)) // cacodemon explosion discharge
			goto Fly
		FlyFlash:
			// big bfg explosion in reverse
			TNT1 A 0
			BFE1 E 1 BRIGHT A_SpawnItem("IOSIceballTrail")
			TNT1 A 0 A_CustomMissile ("ShoqueAzul", random(-40,40), random(-40,40), random (0, 360), 2, random (0, 360)) // cacodemon explosion discharge
			BFE1 D 1 BRIGHT A_SpawnItem("IOSIceballTrail")
			TNT1 A 0 A_CustomMissile ("ShoqueAzul", random(-40,40), random(-40,40), random (0, 360), 2, random (0, 360)) // cacodemon explosion discharge
			BFE1 C 1 BRIGHT A_SpawnItem("IOSIceballTrail")
			TNT1 A 0 A_CustomMissile ("ShoqueAzul", random(-40,40), random(-40,40), random (0, 360), 2, random (0, 360)) // cacodemon explosion discharge
			goto FlySparkBig	
		FlyFlashSmall:
			// big bfg explosion in reverse
			TNT1 A 0
			BFE1 E 1 BRIGHT A_SpawnItem("IOSIceballTrail")
			TNT1 A 0 A_CustomMissile ("ShoqueAzul", random(-40,40), random(-40,40), random (0, 360), 2, random (0, 360)) // cacodemon explosion discharge
			BFE1 D 1 BRIGHT A_SpawnItem("IOSIceballTrail")
			TNT1 A 0 A_CustomMissile ("ShoqueAzul", random(-40,40), random(-40,40), random (0, 360), 2, random (0, 360)) // cacodemon explosion discharge
			BFE1 E 1 BRIGHT A_SpawnItem("IOSIceballTrail")
			TNT1 A 0 A_CustomMissile ("ShoqueAzul", random(-40,40), random(-40,40), random (0, 360), 2, random (0, 360)) // cacodemon explosion discharge
			goto Fly
	}
}

ACTOR IcyNuclearMushroom: NuclearMushroom
{
	damagetype "IOS_Frost" //ice
	XScale 4.5
	YScale 4.5
	Translation "160:167=[170,209,253]:[104,115,185]", "224:231=[255,255,255]:[126,198,228]", "208:223=[129,210,224]:[104,115,185]"	
	States	{
		Spawn:
			BFEI ABCDEFGHIJKLMNOPQRSTUV 2 BRIGHT
			Stop
	}	
}

ACTOR ExplosionIcyFlames: ExplosionFlames
{
	Translation "160:167=[170,209,253]:[104,115,185]", "224:231=[255,255,255]:[126,198,228]", "208:223=[129,210,224]:[104,115,185]"	
	damagetype "IOS_Frost" //ice
	States
	{
    Spawn:
        EXPL AA 3 BRIGHT A_SpawnItem("BlueFlare",0,0)
		//EXPL AA 0 A_CustomMissile ("ExplosionSmokeHD", 0, 0, random (0, 360), 2, random (0, 360))
        EXPL BCDEFGH 3 BRIGHT
        Stop
	}
}

ACTOR ExplosionParticleHeavyIce: ExplosionParticleHeavy
{
  Translation "160:167=[170,209,253]:[104,115,185]", "224:231=[255,255,255]:[126,198,228]", "208:223=[129,210,224]:[104,115,185]"
}

/*
Actor ExplosionFlareSpawnerIce : ExplosionFlareSpawner
{
states
	{
	Spawn:
	    TNT1 A 0
		TNT1 A 0 A_SpawnItemEx("IceExplosionFlareEffect") 
	    TNT1 A 0 A_SpawnItemEx("IceExplosionFlareEffect", 36, 36) 
		TNT1 A 0 A_SpawnItemEx("IceExplosionFlareEffect", 36, -36) 
		TNT1 A 0 A_SpawnItemEx("IceExplosionFlareEffect", -36, 36) 
		TNT1 A 0 A_SpawnItemEx("IceExplosionFlareEffect", -36, -36)
		stop
	}
}

Actor IceExplosionFlareEffect : ExplosionFlareEffect
{
	Translation "160:167=[170,209,253]:[104,115,185]", "224:231=[255,255,255]:[126,198,228]", "208:223=[129,210,224]:[104,115,185]"
}

*/

actor IceBarrelKaboom: BarrelKaboom
{
	Game Doom
	States
	{
		Spawn:
		TNT1 A 1
		TNT1 AAAA 0 A_CustomMissile ("IceExplosionSpawner", 10, 0, random (0, 360), 2, random (10, 90))
		Stop
	}
}

Actor IceExplosionSpawner: ExplosionSpawner
{
	Translation "160:167=[170,209,253]:[104,115,185]", "224:231=[255,255,255]:[126,198,228]", "208:223=[129,210,224]:[104,115,185]"
	Decal none
	states	{
		Spawn:
			TNT1 AA 2 A_SpawnItem("SpawnedIceExplosion")
			//EXPL A 0 A_CustomMissile ("BigBlackSmokeLarger", 0, 0, random (0, 360), 2, random (20, 90))
			TNT1 AA 2 A_SpawnItem("SpawnedIceExplosion")
			Stop
		Death:
			MISG A 1
			TNT1 A 0 A_SpawnItemEx ("DetectCeilCrater",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
			TNT1 A 10
			Stop
		XDeath:
			MISG A 1
			TNT1 A 10
			Stop
	}
}

Actor SpawnedIceExplosion: SpawnedExplosion
{
	+NOCLIP
	+NOGRAVITY
	states	{
		Spawn:
			TNT1 A 0
			TNT1 A 2 A_PlaySound("FAREXPL")
			TNT1 A 0 A_CustomMissile ("HighExplosiveIceFlamesSmall", 0, 0, random (0, 360), 2, random (0, 90))
					Stop
	}
}

ACTOR HighExplosiveIceFlamesSmall: HighExplosiveFlamesSmall
{
	Translation "160:167=[170,209,253]:[104,115,185]", "224:231=[255,255,255]:[126,198,228]", "208:223=[129,210,224]:[104,115,185]"
}

ACTOR IceCyberLordMissile2: CyberLordMissile2
{
	Alpha 1.0
	RenderStyle Add
	Obituary "%o was frozen solid becoming one with the damned pit of Cocytus"
	Damagetype "IOS_Frost" //"Ice"
	Translation "160:167=[170,209,253]:[104,115,185]", "224:231=[255,255,255]:[126,198,228]", "208:223=[129,210,224]:[104,115,185]"
    States
    {
		Spawn:
		   // TNT1 A 0 A_CustomMissile ("ExplosionSmoke", 1, 0, random (0, 360), 2, random (50, 130))
			TNT1 A 0 A_CustomMissile ("IceCyberLordMissileTrail2", 1, 0, random (0, 360), 2, random (50, 130))
			TNT1 A 1
			TNT1 A 0 A_CustomMissile ("IceCyberLordMissileTrail2", 1, 0, random (0, 360), 2, random (0, 360))
			TNT1 A 0 A_EXPLODE(4, 200, 0) // 70 AOE DPS in its explosion radius
			TNT1 A 1
			"----" A 0 A_JumpIf(CallAcs("IsBossDead"), "Death")
			Loop
		Death:
			TNT1 AAAAAA 0 A_CustomMissile ("IceCyberLordMissileTrail3", 1, 0, random (0, 360), 2, random (50, 130))
			TNT1 A 0 A_CustomMissile ("IceExplosionFlames", 0, 0, random (0, 360), 2, random (0, 360))
			//TNT1 A 0 A_EXPLODE(100, 200, 0)
			TNT1 A 0 A_EXPLODE(75, 200, 0)
			TNT1 A 0 A_EXPLODE(25, 400, 0)
			TNT1 A 8
			
			TNT1 A 0 A_PlaySoundEx("misc/firebass", Auto, 0, 0)

			TNT1 AAAAAA 0 A_CustomMissile ("IceCyberLordMissileTrail3", 1, 0, random (0, 360), 2, random (50, 130))
			TNT1 A 0 A_CustomMissile ("IceExplosionFlames", 0, 0, random (0, 360), 2, random (0, 360))
			//TNT1 A 0 A_EXPLODE(100, 200, 0)
			TNT1 A 0 A_EXPLODE(75, 200, 0)
			TNT1 A 0 A_EXPLODE(25, 400, 0)
			TNT1 A 8

			TNT1 AAAAAA 0 A_CustomMissile ("IceCyberLordMissileTrail3", 1, 0, random (0, 360), 2, random (50, 130))
			TNT1 A 0 A_CustomMissile ("IceExplosionFlames", 0, 0, random (0, 360), 2, random (0, 360))
			//TNT1 A 0 A_EXPLODE(100, 200, 0)
			TNT1 A 0 A_EXPLODE(75, 200, 0)
			TNT1 A 0 A_EXPLODE(25, 400, 0)
			TNT1 A 8

			TNT1 AAAAAA 0 A_CustomMissile ("IceCyberLordMissileTrail3", 1, 0, random (0, 360), 2, random (50, 130))
			TNT1 A 0 A_CustomMissile ("IceExplosionFlames", 0, 0, random (0, 360), 2, random (0, 360))
			//TNT1 A 0 A_EXPLODE(100, 200, 0)
			TNT1 A 0 A_EXPLODE(75, 200, 0)
			TNT1 A 0 A_EXPLODE(25, 400, 0)
			TNT1 A 8
			
			Stop
			Stop
    }
}

Actor IceDeathsplosionPart: IceCyberLordMissile2 {
	-NOGRAVITY
	
}

ACTOR IceCyberLordMissileTrail2: CyberLordMissileTrail2
{
	Damagetype "IOS_Frost" //"Ice"
	Obituary "%o was frozen solid becoming one with the damned pit of Cocytus"
	Translation "160:167=[170,209,253]:[104,115,185]", "224:231=[255,255,255]:[126,198,228]", "208:223=[129,210,224]:[104,115,185]"
	States
    {
		Spawn:
			TNT1 A 2
			ANCB DEFGHI 2 BRIGHT //A_SpawnItem("BlueFlare")
			Stop
    }
}

ACTOR IceCyberLordMissileTrail3: CyberLordMissileTrail3
{
	Damagetype "IOS_Frost" //"Ice"
	Obituary "%o was frozen solid becoming one with the damned pit of Cocytus"
	Translation "160:167=[170,209,253]:[104,115,185]", "224:231=[255,255,255]:[126,198,228]", "208:223=[129,210,224]:[104,115,185]"
	States
    {
		Spawn:
			TNT1 A 2
			ANCB DDEEFFGGHHII 2 BRIGHT //A_SpawnItem("BlueFlare")
			Stop
	}
}

ACTOR IceExplosionFlames: ExplosionFlames
//+DOOMBOUNCE
//+CLIENTSIDEONLY
//+THRUACTORS
//+NOBLOCKMAP
{
	Translation "160:167=[170,209,253]:[104,115,185]", "224:231=[255,255,255]:[126,198,228]", "208:223=[129,210,224]:[104,115,185]"
	damagetype "IOS_Frost" //ice
	States
	{
		Spawn:
			EXPL AA 3 BRIGHT //A_SpawnItem("BlueFlare",0,0)
			//EXPL AA 0 A_CustomMissile ("ExplosionSmokeHD", 0, 0, random (0, 360), 2, random (0, 360))
			EXPL BCDEFGH 3 BRIGHT
			Stop
	}
}

ACTOR DetectFloorCraterIce : DetectFloorCrater
{
	States
	{
		Spawn:
			TNT1 A 0
			TNT1 A 0 ThrustThingZ(0,-10,0,1)
			TNT1 A 4
			Stop
			Death:
			TNT1 A 1
			TNT1 A 0 A_SpawnItem("Ice12SmallFireFocusSpawnerz")
			XXX1 A 2000
			Stop
	}
}

ACTOR Ice12SmallFireFocusSpawnerz : 12SmallFireFocusSpawnerz
{
	States
	{
		Spawn:
			TNT1 A 1
			TNT1 A 0 A_Jump(128, 4)
			//TNT1 A 0 A_SpawnItemEx("ExplosionSimpleSmokeColumn",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
			TNT1 A 0 A_SpawnItemEx("SmallIceFireFocus24",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
			TNT1 AAAA 0
			Stop
	}
}

ACTOR SmallIceFireFocus24: SmallFireFocus24
{
	Translation "160:167=[170,209,253]:[104,115,185]", "224:231=[255,255,255]:[126,198,228]", "208:223=[129,210,224]:[104,115,185]"
}


ACTOR IOSThunderboltFirer: FastProjectile 
{
	// deliberately NOT a seeker missile not to inherit targeting.
	// they find their target on their own
	
	Speed 1000
	
	+THRUACTORS
	Radius 120
	Damage (Random(0,0))
	Damagetype None
	SeeSound None
	DeathSound None
	
	States
	{
		Spawn:
			TNT1 A 1
			TNT1 AAAAA 1 A_Jump(80, "Fire")
		Fire:	
			TNT1 A 0 A_CustomMissile("IOSThunderboltSeeker", 0, 0, Random(0,360), CMF_AIMDIRECTION | CMF_ABSOLUTEPITCH | CMF_SAVEPITCH | CMF_TRACKOWNER, 0)
			TNT1 A 1
			Stop
		Death: // hit a wall
			TNT1 A 0 A_CustomMissile("IOSThunderboltFirerReflected", 0, 0, Random(110,250), CMF_AIMDIRECTION | CMF_ABSOLUTEPITCH | CMF_SAVEPITCH | CMF_TRACKOWNER, 0)	
			TNT1 A 1
			Stop
	
	}
}

ACTOR IOSThunderboltFirerReflected: IOSThunderboltFirer
{
	Speed 200
	Radius 110
	States
	{
		Death: // no luck, stop trying
			TNT1 A 0
			TNT1 A 1
			Stop
	}
}


ACTOR IOSThunderboltSeeker: FBD_RevenantBall { //revenantseekermissiles {
	-SHOOTABLE
	Radius 100 // to avoid hugging walls
	Speed 20
	Damage (Random(0,0))
	Damagetype Plasma
	SeeSound None
	DeathSound None
	States {
		Spawn: 
			TNT1 A 0
			TNT1 A 0 A_GiveInventory("ThunderboltLifetime", 320)
			// let it reach the arena proper before activating seeker. Otherwise, slams into edges much.
			TNT1 AAAAAAAAAAA 4 A_SpawnItemEx("IOSShortLivedThunderbolt", 0, 0, 0, 0, 0, -1000.0, 0, SXF_TRANSFERPOINTERS)
		FlyForth:
			TNT1 A 0
			"----" A 0 A_JumpIf(CallAcs("IsBossDead"), "Death")
			TNT1 A 0 A_JumpIf(CallAcs("GetXYDistanceToTracer") < 20, "Death")//A_JumpIfCloser(20, "Death")
			TNT1 A 4 //KYDB G 4 BRIGHT // big targetig crosshairs for debugging purposes
			TNT1 A 0 A_TakeInventory("ThunderboltLifetime", 4)
			TNT1 A 0 ACS_NamedExecuteAlways("FixThunderboltSeekerZ", 0, 0, 0, 0) // resets its Z to 700.0 and Zvel to 0.0
			
			// throw them downward from its position at insane speeds
			TNT1 A 0 A_SpawnItemEx("IOSShortLivedThunderbolt", 0, 0, 0, 0, 0, -1000.0, 0, SXF_TRANSFERPOINTERS) 
			TNT1 A 0 A_SeekerMissile (4, 8, SMF_LOOK)
			//SMF_PRECISE)
			TNT1 A 0 A_JumpIfInventory("ThunderboltLifetime", 1, "FlyForth")
			Goto Death
		Death:
			TNT1 A 0 A_SpawnItemEx("IOSThunderboltFinale", 0, 0, 0, 0, 0, -1000.0, 0, SXF_TRANSFERPOINTERS) 
			TNT1 A 0
			Stop
	}

}


ACTOR IOSStage3ThunderboltSeeker: IOSThunderboltSeeker
{
	States {
		Spawn: 
			TNT1 A 0
			TNT1 A 0 A_GiveInventory("ThunderboltLifetime", Random(70, 280))
			TNT1 A 10
			Goto FlyForth
	}		
}


ACTOR IOSShortLivedThunderbolt
{
	Radius 2
	Height 128
	Mass 400
	-SHOOTABLE
	-COUNTKILL
	+FORCEYBILLBOARD
	Renderstyle Add
	Alpha 0.99
	//YScale 12.0 // ceiling 800 / sprite 128 = 6.25 -- BUT sprites always they can stick up through the sky ceiling
	YScale 19.0 // ceiling 3500 / sprite height 180
	XScale 1.0
	DamageType Plasma
	Damage (Random(0,0))
	Obituary "%o was wiped out by an eldritch abomination"
	States
	{
		Spawn:
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_PLaySoundEx("lightning/snap", CHAN_VOICE)
			//THUNYSM
			TNT1 A 1 // let it reach the bottom and hit whatever it hits
			ZOT1 UVWXY 1 BRIGHT
			ZOT1 U 0 A_Explode(40, 100, 0)
			FIR3 UUU 0 BRIGHT A_CustomMissile ("LightningParticleSFX", 0, 0, random (0, 360), 2, random (60, 130))
			Goto Death
		Death:	
			TNT1 A 0
			Stop
	}
}

ACTOR IOSThunderboltFinale: IOSShortLivedThunderbolt
{
	//XScale 2.0
	XScale 5.0
	States {
		Spawn:
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_PLaySoundEx("THUNYBG", CHAN_VOICE, 0, 1)
			//ZOT1 ABCDE 1 BRIGHT
			ZOT1 UVWXY 1 BRIGHT
			FIR3 AAAAAAAAAAAAAAA 0 BRIGHT A_CustomMissile ("ShoqueAzul", random(-30,30), random(-30,30), random (0, 360), 2, random (60, 130)) // cacodemon explosion discharge
			//A_CustomMissile ("LightningParticleSFX", 0, 0, random (0, 360), 2, random (60, 130))
			ZOT1 A 1 BRIGHT
			TNT1 A 0 A_Explode(100, 100, 0)
			//ZOT1 ABCDEABCDE 1 A_CustomMissile ("ShoqueAzul", 0, 0, random (0, 360), 2, random (60, 130))
			//ZOT1 UVWXYUVWXY 1 A_CustomMissile ("ShoqueAzul", 0, 0, random (0, 360), 2, random (60, 130))
			//ZOT1 ABCDEABCDEABCDEABCDE 1 BRIGHT //A_FadeOut(0.1)
			TNT1 A 0 A_Jump(256, "Flash1", "Flash2", "Flash3", "Flash4", "Flash5")
		Flash1:
			ZOT1 A 5 BRIGHT
			Goto Death
		Flash2:
			ZOT1 B 5 BRIGHT
			Goto Death
		Flash3:
			ZOT1 C 5 BRIGHT
			Goto Death
		Flash4:
			ZOT1 D 5 BRIGHT
			Goto Death
		Flash5:
			ZOT1 E 5 BRIGHT
			Goto Death
	}	
}

Actor ThunderboltLifetime: Inventory
{
	inventory.maxamount 1000
}

/*
JAN. 2026: OBSOLETED
// Meteor seeker moves towards the player, 
//  then bursts into 3 meteor markers that fly short distance
//  bouncing off cliffs before spawning meteor launchers on the ceiling
//  who in turn launch nukes straight down.
// Results in nukes raining down through the cloud layer
//  in the area vaguely around the player

// Note that clouds descend *very slowly* during the battle
//  gradually making dodging them harder

ACTOR IOSStage3MeteorSeeker//: IOSThunderboltSeeker
// P.S. Completely changed the mechanic. Teleports to above target, 
// measures his speed then rains meteors the most inconvenient way:
// if you move, they lead you dropping ahead of you.
// if you stay put, they rain all around you corralling you
{
	Radius 100
	+NOTARGET
	+THRUACTORS
	+THRUGHOST
	+THRUSPECIES
	+MTHRUSPECIES
	+NOBLOCKMAP
	+NOGRAVITY
	+MISSILE
	+SEEKERMISSILE
	
	Speed 0
	var int user_x;
	var int user_y;
	var int user_spread;
	var int user_repeat;
	States {
		Spawn: 
			TNT1 A 0 NODELAY A_SetUserVar("user_repeat", 2 + CallAcs("FBD_GetGameSkill")) // from 3 on ITYTD to 6 on Hordes
		TryAttacking:	
			TNT1 A 0 A_Warp(AAPTR_TRACER, 0,0,700,0,WARPF_USECALLERANGLE,"Success1")
			Goto Cancel
		Success1:	
			TNT1 A 0 A_SetUserVar("user_x", x)
			TNT1 A 0 A_SetUserVar("user_y", y)
			TNT1 A 0 
			TNT1 A 35
			TNT1 A 0 A_Warp(AAPTR_TRACER, 0,0,700,0,WARPF_USECALLERANGLE,"Success2")
			Goto Cancel
		Success2:	
			TNT1 A 0 A_SetUserVar("user_x", x - user_x)
			TNT1 A 0 A_SetUserVar("user_y", y - user_y)
			// return to where we were one second ago
			TNT1 A 0 A_Warp(AAPTR_DEFAULT, - user_x, - user_y,0,0,WARPF_ABSOLUTEOFFSET | WARPF_NOCHECKPOSITION)
			TNT1 A 0 A_SetUserVar("user_spread", CallAcs("IosMeteorSeekerSpread"))
			TNT1 A 0 A_SetAngle(CallAcs("IosMeteorSeekerAngle") * 0.005493164) // 65535 => 360.0
			TNT1 A 0 A_CustomMissile("IOSStage3MeteorMarker", 0, 0, Random(-user_spread / 2, user_spread / 2), CMF_AIMDIRECTION | CMF_ABSOLUTEPITCH | CMF_SAVEPITCH | CMF_TRACKOWNER, 0)
			TNT1 A 0 A_SetUserVar("user_repeat", user_repeat - 1)
			TNT1 A 0 A_JumpIf(user_repeat > 0, "DoItAgain")
			Stop						
		DoItAgain:
			TNT1 A 70 
			TNT1 A 0 A_JumpIf(CallAcs("IsBossDead"), "Cancel") // boss killed
			Goto TryAttacking
		Cancel:
			TNT1 A 1
			Stop
	}		
}

ACTOR IOSStage3MeteorMarker
{
	Projectile
	Damage (Random(0,0))
	+THRUGHOST
	BounceType "Doom"
	BounceFactor 1.0
	+BOUNCEONWALLS
	+BOUNCEONFLOORS
	+BOUNCEONCEILINGS
	Radius 80
	Height 1
	Speed 50
	FastSpeed 60
	
	States
	{
		Spawn:
			TNT1 GGG 5 BRIGHT
			TNT1 GGG 5 BRIGHT A_Jump(64, "Death")
		Death:
			TNT1 A 0 A_JumpIf(CallAcs("IsBossDead"), "Cancel")
			TNT1 A 0 A_CustomMissile("IOSStage3MeteorLauncher",0,0,0,CMF_AIMDIRECTION | CMF_ABSOLUTEPITCH | CMF_TRACKOWNER, -90)
			TNT1 A 1
			Stop
		Cancel:
			TNT1 A 1 
			Stop
	}	
}


ACTOR IOSStage3MeteorLauncher: IOSStage3MeteorMarker
{
	Speed 0
	Radius 1
	Height 1
	+NOINTERACTION
	+CEILINGHUGGER
	States
	{
		Spawn:
			TNT1 A 1
			TNT1 A 0 A_CustomMissile("IOSMeteor", -60, 0, 0, CMF_AIMDIRECTION | CMF_ABSOLUTEPITCH | CMF_SAVEPITCH | CMF_TRACKOWNER, -90)
		Death:
			TNT1 A 1
			Stop
	}
}	
*/

ACTOR IOSMeteor: IOSNuke
{
	Speed 25
	FastSpeed 25
}

ACTOR LakeFreezingSound
{
	+NOBLOCKMAP
	-SHOOTABLE
	-NOGRAVITY
	States
	{
		Spawn:
			TNT1 A Random(35,70)
			TNT1 A 0 A_PlaySound("eday32/lakefreezing")
			TNT1 A 0 A_JumpIf(!waterlevel, "Death")
			Loop
		Death:
			TNT1 A 1
			Stop
	}
}

ACTOR IOSAntiMonsterNuke: IOSNuke
{
	// Boss does not *fight* monsters he aggroed at. He insta-nukes them.
	+SEEKERMISSILE
	States
	{
		Spawn:
			TNT1 A 1
			TNT1 A 0 A_PlaySoundEx("weapons/rocklf", 1, 0, 2)
			TNT1 A 0 A_Warp(AAPTR_TRACER,0,0,32,0,WARPF_NOCHECKPOSITION)
			Goto Death
	}
}

