
ACTOR FlamethrowerMissileSlow: FlamethrowerMissile
{
	radius 20
	height 30
	speed 12
}


ACTOR FireBreather 17738
{
	-COUNTKILL
	-SHOOTABLE
	+NOINTERACTION
	+NOGRAVITY
	
	radius 40
	
	States
	{
		Spawn:
			FIR3 A 0
		Stay:	
			TNT1 A 350
			Loop
		Flamethrower:
			// this state is reached via ACS map script
			TNT1 A Random(0,5)
			TNT1 A 0 A_PlaySound("BREATHOF")
			TNT1 AAAAAAAAAAAA 2 A_CustomMissile("FlamethrowerMissileSlow",30,0,0,CMF_AIMDIRECTION,15)
			Goto Stay
	}
}

ACTOR Glacier 17739
{
	
	/* 
		actor SpawnedExplosionNuke 
			- inflicts 512 Fire damage over time of 7 seconds in a radius of 800
		
		actor NuclearRocket 
			- spawns 33x SpawnedExplosionNuke in a random spread of 400..600, up to 15K fire damage (realistically around 5K) - max reach 1400
			- inflicts:
				- 1000 direct hit Plasma damage
				- 90 aoe Plasma damage, radius 1500 full damage radius 1400
				- 24K aoe Plasma damage, radius 1000 full damage radius 900
				- 100 aoe Fire damage in a radius of 5000 226
				
		Thus, glacier takes 25K Plasma + 5..15K Fire
		
		Whereas, conventional weapons:
		plasma: 600 shots of 55 = 33K
		railgun: 60 shots of 400 = 24K
		minigun: 600 shots of 16 = 9.6K
		assault rifle: 600 shots of 20 = 12K
		machinegun: 300 shots of 50 = 15K
		rocket launcher: 100 shots of 300 = 30K
		BFG: 12 shots of 3420 = 41K (x0.5 = 21.5k)
		BFG10k: 120 shots of 300 = 36K
		shotgun: 100 shots of 117 = 11.7K
		super shotgun: 50 shots of 274 = 13.7K
		flamethrower: 199 shots of (60 + 192) = 50K (x0.3 = 15k)
		Unmaker: 499 shots of (70 + 96) = 82K (x0.5, x0.3 = 31k)
		
	*/
	
	Health 25000
	Mass 99999
	
	MONSTER
	-COUNTKILL
	+NOTARGET // prevent NPCs with their infinite ammo doing it
	+NEVERTARGET
	+BOSS //(minimum damage from BFG 9000, screams of pain heard full volume from any distance)
	+NOICEDEATH
	Speed 0
	Radius 512
	Height 568
	SeeSound None
	PainSound "eday32/lakefreezing"
	DeathSound "eday32/rumble_sto"
	ActiveSound None
	PainChance 255
	DamageFactor "Ice", 0.0
	DamageFactor "Frost", 0.0
	DamageFactor "ExplosiveImpact", 0.0 // no splash from rockets or bfg10k
	DamageFactor "Fire", 0.3 // only scratch damage from flame
	DamageFactor "Desintegrate", 0.5 // resistant to BFG and Unmaker
	DamageFactor "Cut", 0.2 // otherwise it could be cheesed using Dragonslayer (~1600 damage per swing)
	DamageFactor "Extreme", 0.2 // the same story, Dragonslayer inflicts up to 400 Extreme damage per swing
	
	BloodType "Glacier_Blood", "Glacier_Blood", "Glacier_Blood"
	States
	{
		Spawn:
			TNT1 A 1 
		Idle:
			TNT1 A 30 A_ClearTarget
			TNT1 A 0 ACS_NamedExecuteWithResult("MarkBossAsleep", 0)
			TNT1 A 0 A_Look
			Loop
		See:
			TNT1 A 10 ACS_NamedExecuteWithResult("MarkBossAwake", 0) 
			TNT1 A 0 A_CheckSight("Idle")
			Loop
		Pain:
			TNT1 A 0 A_Pain
			TNT1 A 0 A_ChangeFlag("NOPAIN", 1) // limit to one in 5 seconds
			TNT1 A 175 ACS_NamedExecuteWithResult("GlacierHurt") // spawns extra boss cubes
			TNT1 A 0 A_ChangeFlag("NOPAIN", 0)
			Goto See
		Death:
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_Scream
			TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_CustomMissile ("XIceChunk2c", Random(0,500), Random(-500,500), random (-45, 45), 2, random (0, 160))
			TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("SnowDust313", Random(400,500), Random(-500,500),Random(0,500), 0,0,0, 0,SXF_NOCHECKPOSITION)
			TNT1 A 300
			Stop
	}
}

ACTOR IcePlug : Glacier 17749 {
	Radius 128
	Height 2000 //64
	// tried using a 64-high plug hanging in a 2000-deep pit 
	// but the result was glitchy: the hanging plug was sagging
	// under dragonslayer strikes desyncing from the 3d floor
	// that represents the plug visuals
	DeathSound "DSBOTTLE"
	Health 3000
	Tag "$ICEPLUG"
	//+NOGRAVITY
	States 
	{
		Spawn:
		Idle:
		See:
			TNT1 A 30
			Loop
		Pain:
			TNT1 A 0 A_Pain
			TNT1 A 175
			Goto Idle
		Death:
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_Scream
			// the 3d floor representing the plug visually:
			TNT1 A 0 Ceiling_LowerByValue(245, 1024, 2048)//ACS_NamedExecuteWithResult("IcePlugDies")
			TNT1 AAAAAAAA 0 A_CustomMissile ("XIceChunk2c", Random(0,48), Random(-64,64), random (-45, 45), 2, random (0, 180))
			TNT1 AAAAAA 0 A_SpawnItemEx("SnowDust313", Random(-64,64), Random(-120,120),Random(0,48), 0,0,0, 0,SXF_NOCHECKPOSITION)
			TNT1 A 300
			Stop
	}
}

ACTOR XIceChunk2c: XIceChunk2b // see Frozen.txt
{
	Speed 40
}

ACTOR SnowDust313
{
	+NOBLOCKMAP
	+NOGRAVITY
	-SHOOTABLE
	+GHOST
	+THRUGHOST
	states	{
		Spawn:
			TNT1 A 0
			Goto Death
		Death:
			TNT1 A 0 A_CustomMissile ("DestroyedBuildingSmoke", 0, 0, random (0, 360), 2, random (0, 40))
			TNT1 A 0 A_CustomMissile ("DestroyedBuildingSmokeSpawner", 0, 0, random (0, 360), 2, random (0, 40))
			Stop
	}
}

ACTOR Glacier_Blood
{
	-SHOOTABLE
	+THRUACTORS
	-ALLOWPARTICLES
	+NOBLOCKMAP
	+NOBLOODDECALS
	-BLOODSPLATTER
	+CLIENTSIDEONLY	
	states	{
		Spawn:
			TNT1 A 0 NODELAY A_CustomMissile ("DestroyedBuildingSmoke", 0, 0, 0, 2, random (-40,0))
			TNT1 AAAA 0 A_CustomMissile ("XIceChunk1", 48, 0, random (-60, 60), 2, random (-60,35))
			TNT1 AAA 0 A_CustomMissile ("XIceChunk2", 48, 0, random (-60, 60), 2, random (-60,35))
			TNT1 AA 0 A_CustomMissile ("XIceChunk3", 48, 0, random (-60, 60), 2, random (-60,35))
			Stop
	}
}

ACTOR Map313Victim1 17745 //***Che in hindsight, this is too much. Replaced it with the half variant
{
	+FRIENDLY
	
	//+DONTTHRUST
	//Script error, "chebskies-EDAY-2.pk3:map313actors.txt" line 202:
	//"DONTTHRUST" is an unknown flag
	//Execution could not continue.
	
    Radius 12
    Height 56
	Health 190
    Mass 999999
    +SHOOTABLE
	+SOLID
	+NOTAUTOAIMED
	+NOTARGET
	+NOPAIN
	+NOGRAVITY +SOLID +FLOAT +DONTFALL
	//+THRUACTORS
	bloodtype "DeadBlood"
	States
	{
		Spawn:
			CMCC T 0
			TNT1 A 0 A_SpawnItemEx("DripingBloodLeavesPool", 0, 0, 15, 0, 0)
		Stand:
			CMCC T Random(30, 90)
			TNT1 A 0 A_SpawnItemEx("DripingBlood", 0, 0, 15, 0,0,0, 0,SXF_NOCHECKPOSITION,0)
			loop
		Death:
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_XScream
			TNT1 A 0 A_SpawnItemEx ("Map313Victim1Half",0,0,23, 0,0,0, 0,SXF_NOCHECKPOSITION,0)
			TNT1 A 0 A_SpawnItemEx ("MeatDeath",0,0,16, 0,0,0, 0,SXF_NOCHECKPOSITION,0)
			TNT1 A 0 A_SpawnItemEx ("RipGuts",0,0,24, 0,0,0, 0,SXF_NOCHECKPOSITION,0)
			TNT1 A 30
			Stop
	}
}

ACTOR Map313Victim1Half: Map313Victim1 17746
{
	Height 32
	States
	{
		Spawn:
			CMCC U 0
			TNT1 A 0 A_SpawnItemEx("DripingBloodLeavesPool", 0, 0, -2, 0,0,0, 0,SXF_NOCHECKPOSITION,0)
		Stand:
			CMCC U Random(30, 45)
			TNT1 A 0 A_SpawnItemEx("DripingBlood", 0, 0, -2, 0,0,0, 0,SXF_NOCHECKPOSITION,0)
			loop
		Death:
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_Scream
			TNT1 A 0 A_SpawnItemEx ("MeatDeath",0,0,16, 0,0,0, 0,SXF_NOCHECKPOSITION,0)
			CMCC V -1
			Stop
	}	
}


ACTOR Map313BP 17748
{
	+SHOOTABLE
	-SOLID
	+NOTAUTOAIMED
	+NOTARGET
	+NOPAIN
	Radius 2
	Height 56
	Mass 9999
	States
	{
		Spawn:
			CAPT N 1
			CAPT N -1
			Stop
	}
}



ACTOR Map313Spawner
{
	Radius 20
	Height 60
	-ISMONSTER
	-NOGRAVITY
	+NOBLOOD
	-SHOOTABLE
	+THRUACTORS
	+THRUGHOST
	+GHOST
	
	+WINDTHRUST // served via ATMCs, must have it
	
	var int user_level;
	
	Scale 1.0
	States {
		Spawn:
			BOSF B 0 NODELAY A_SetUserVar("user_level", 0)
		WaitInCloset:
			TNT1 A 5 
			TNT1 A 0 A_JumpIf(x > 5568, "WaitInCloset") 
		WaitTilOutOfSight:
			TNT1 A 0 A_CheckSight("Deploy")
			TNT1 A 15 ACS_NamedExecuteWithResult("FaceClosestPlayer")
			Loop
		Deploy:
			TNT1 A 5 ACS_NamedExecuteWithResult("FaceClosestPlayer")
			TNT1 A 0 A_JumpIf(!CallAcs("SpawnerSpawnMob", user_level), "WaitTilOutOfSight")
			TNT1 A 30
			Stop
	}	
}

Actor ChainsawSatanist: WeakChainsawTraitor 17849
{
	Health 90
	Tag "$CHAINSAW_CHAOSITE"
	Obituary "$CHAINSAW_CHAOSITE_O"
	// bright red skin, grayish-green armor
	Translation "112:123=152:159", "124:127=9:12", "63:79=176:191", "48:62=168:174"
}

Actor AxeMurderSatanist: WeakAxeTraitor 17848
{
	Health 90
	Tag "$AXE_CHAOSITE"
	Obituary "$AXE_CHAOSITE_O"
	Translation "112:123=152:159", "124:127=9:12", "63:79=176:191", "48:62=168:174"
}

Actor SatanistBossCubeSpawner: AbstractBossCubeSpawner // see Abstract.txt
{
	States
	{
		DoSummon:	
			TNT1 A 0 A_GiveInventory("SummonsCount", 1, AAPTR_TRACER)
			TNT1 A 0 A_SpawnItemEx("TeleportationFog")
			TNT1 A 0 A_Jump(100, "AxeMurdererInstead")
			TNT1 A 1 A_SpawnItemEx("ChainsawSatanist",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0,user_stid)
			Stop
		AxeMurdererInstead:
			TNT1 A 1 A_SpawnItemEx("AxeMurderSatanist",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0,user_stid)
			Stop
	}
}


		






ACTOR Map313LunchHorn
{
	+NOINTERACTION
	+NOGRAVITY
	+NOCLIP
	States
	{
		Spawn:
			TNT1 A 1
			TNT1 A 350 A_PlaySound("KY313WVH") // 10 seconds
			Stop
	}
}

ACTOR Map313IOSAngryBellow
{
	+NOINTERACTION
	+NOGRAVITY
	+NOCLIP
	States
	{
		Spawn:
			TNT1 A 1
			TNT1 A 30 A_PlaySound(CHAN_VOICE, "eday313/iosfrustrated")
			TNT1 A 30
			Stop
	}
}

ACTOR Map313GrizzlyITYTD: CyberDevastator 17740
{
	//black with darker golden guns - perfect for the very dark cave with black walls he resides in!
	Translation "16:31=96:111", "5:12=0:0", "32:47=5:8", "1:2=0:0", "80:88=160:167", "89:95=[132,66,0]:[0,0,0]", "96:111=0:0", "3:3=0:0", "168:191=[187,0,0]:[0,0,0]"
	Tag "$MAP313_GRIZZLY" // "Grizzly CyberBeast"
	
	MaxStepHeight 70 // he can fall into the acid pit when he leap-stomps - must be able to walk out.
	
	// all other stats are the same -- meaning on "im too young to die" you face... merely a full-power devastator.
}

ACTOR Map313Grizzly: Map313GrizzlyITYTD 17741
{
	Health 13000
}

ACTOR Map313StrategistITYTD: SupremeMastermind 17742
{
	+QUICKTORETALIATE // because prone to firing at some unreachable pinkie behind bars while you whittle his entire health down, unopposed.
	Obituary "$MAP313_STRATEGIST_O" //"%o was destroyed by the Mastermind Strategist."
	Tag "$MAP313_STRATEGIST_ITYTD" //"Mastermind Strategist"
	
	MaxStepHeight 64 // the edges of lava pits won't stop him (depth 48) allowing him to run between them
	MaxDropOffHeight 64		

	PainChance "Eat", 255
	States
	{
		Pain.Eat:
			TNT1 A 0
			Goto MissileBfg9000OhNoes // Pinkies are *fucked*. One bite and he goes BFG (nopain while firing it).
	}
}

ACTOR Map313Strategist: Map313StrategistITYTD 17743
{
	+QUICKTORETALIATE
	-NOTARGET
	Mass 500000
	Speed 40 // the same INSANE speed as the E3M8 boss -- he is FAST. He is EVERYWHERE.
	
	Health 9000
	Tag "$MAP313_STRATEGIST" //"Great Mastermind Strategist"
}


