
// *** MODIFIED BY CHEBMASTER
// I mark most important places modified by me with //***Che -- unless I forget to.


actor MotherdemonBase 

	// Motherdemon inherits from this, recolored to black (see below)
	// Beastmaster inherits from this retaining the original pink color
{
	//***Che radius, height and maxdropoffheight (n/a for flying ones) MUST be kept consistent with FBD_TrySpawn in FBD_CORE.acs!
	
	//$category "FBD Bosses"
	game Doom
	obituary "%o was obliterated by the mother of all demons."
	health 10000
	radius 60
	height 110
	mass 1000
	scale 1.1
	painchance 20
	reactiontime 8
	speed 24
	seesound "mother/sight"
	attacksound "mother/attack"
	painsound "mother/pain"
	deathsound "mother/death"
	activesound "mother/active"
	MONSTER
	+BOSS
	+FLOAT
	+NOGRAVITY
	+DONTMORPH
	+NORADIUSDMG
	+MISSILEMORE
	+TELESTOMP
	DamageFactor "CauseSplash", 0.0 DamageFactor "CauseObjectsToSplashSlime", 0.0 DamageFactor "CauseObjectsToSplashNukage", 0.0
	DamageFactor "CauseObjectsToSplashBlood", 0.0 DamageFactor "CauseObjectsToSplashLava", 0.0
	+MISSILEEVENMORE
	+LOOKALLAROUND
	+FORCEXYBILLBOARD
	+NOTARGET
	
	+NOICEDEATH
	
	PainChance "Head", 40
	PainChance "HeadPlasma", 64
	PainChance "Bullet792", 30 // machineguns and snip[er rifles not aimed
	PainChance "SniperBullet", 30 // sniper rifle aimed	
	PainChance "Decaptate", 64
	PainChance "HeadStun", 255 // compensated by going into special attack right after
	PainChance "KillMe", 64
	damagefactor "Killme", 1.0 // AOE inflicted by captured marines
	PainChance "Taunt", 255
	PainChance "Cut", 5
	DropItem "DemonStrengthRune" 25
	Painchance "Fatality", 90	
	DamageFactor "Argent", 0.0
	
	
	var int user_head_tid;
	var int user_head_type;
	var int user_head_rel;
	var int user_head_scale;
	var int user_head_xyzf; /* 
		a packed value: 
		bits 0..7 =x+128, clamped to -128..127
		bits 8..15 =y+128, clamped to -128..127
		bits 16..23 =z, clamped to 1..255
		bit 29 is a command to assume an unique TID, used in monster-on-monster headshotting
		A zero value is a command to terminate
	*/
	
	var int user_sleeping;
	var int user_item_no;
	var int user_serverside_sfchk; // deprecated, will remove later
	
	var int user_stunlock_limit; // clamped to -2..4, increases after each attack decreases on every flinch
	
	states
	{
		Spawn:
			MOTH A 1 NODELAY ACS_NamedExecuteWithResult("FBD_RunMonster", 16, 110) // motherdemon headbox, scale 110%
			"----" A 0 A_SetUserVar("user_stunlock_limit", 4)
			"----" A 0 A_GiveInventory("TargetIsAGreatTerribleBoss")
			"----" A 0 A_GiveInventory("TargetIsABoss")
			
			// sprite's head height 36 radius 13 (x 1.1 = h 40 r 14)
			// bodybox h 110 r 60
			
			MOTH A 1 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 57, 0, 58)
		Stand:
			// uses the H sprite with head ducked low
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 62, 0, 41)
			MOTH H 9 A_Look
			Loop
		Idle:
			//***Todo: add idle wandering
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 57, 0, 58)
			MOTH A 9 A_Look
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 64, -16, 47)
			MOTH B 9 A_Look
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 57, 0, 58)
			MOTH C 9 A_Look // the C frame is a clone of A frame
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 61, 15, 47)
			MOTH D 9 A_Look
			loop
		See:
			TNT1 A 0
			Goto Chasing
		Chasing:	
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 57, 0, 58)
			MOTH AAA 3 A_Chase
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 64, -16, 47)
			MOTH BBB 3 A_Chase
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 57, 0, 58)
			MOTH CCC 3 A_Chase
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 61, 15, 47)
			MOTH DDD 3 A_Chase
			loop
		Missile:
			MOTH E 1 A_FaceTarget
			TNT1 A 0 A_Jump(96, "SuperAttack")
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 51, 0, 68)
			MOTH E 4 A_FaceTarget
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 55, 0, 63)
			MOTH F 4 A_FaceTarget
			MOTH E 0 A_PlaySoundEx ("Mother/attack", "Body")
			MOTH G 0 bright A_CustomMissile (MotherFire,0,0,0,2,0)
			MOTH G 0 bright A_CustomMissile (MotherFire,0,0,90,2,0)
			MOTH G 0 bright A_CustomMissile (MotherFire,0,0,-90,2,0)
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 57, 0, 58)
			MOTH G 14 bright A_CustomMissile (MotherFire,0,0,180,2,0)
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 51, 0, 68)
			MOTH E 8 A_FaceTarget
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 55, 0, 63)
			MOTH F 8 A_FaceTarget
			"----" A 1 A_Jump(256, "Balls1", "Balls2", "Balls3", "Balls4", "Balls5")
		Balls1:
			// absolutely devastating whole-arena mass resurrection
			// superarchvile's special x 2
			MOTH F 0 bright A_CustomMissile (GhostPain,0.0000152587890625 * user_head_scale * 60.0,-25,35) 
			MOTH F 0 bright A_CustomMissile (GhostPain,0.0000152587890625 * user_head_scale * 60.0,25,-35)
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 57, 0, 58)
			MOTH G 14 bright
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 51, 0, 68)
			MOTH E 8
			goto See		
		Balls2:
			// anti-tank missiles doing BFG type damage
			MOTH F 0 bright A_CustomMissile (VileChaosBall,0.0000152587890625 * user_head_scale * 90.0,-25,35)
			MOTH F 0 bright A_CustomMissile (VileChaosBall,0.0000152587890625 * user_head_scale * 45.0,-25,35)
			MOTH F 0 bright A_CustomMissile (VileChaosBall,0.0000152587890625 * user_head_scale * 90.0,25,-35)
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 57, 0, 58)
			MOTH G 14 bright A_CustomMissile (VileChaosBall,0.0000152587890625 * user_head_scale * 45.0,25,-35)
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 51, 0, 68)
			MOTH E 8
			goto See		
		Balls3:
			MOTH F 0 bright A_CustomMissile (NoxinantFireball,0.0000152587890625 * user_head_scale * 90.0,-25,35)
			MOTH F 0 bright A_CustomMissile (NoxinantFireball,0.0000152587890625 * user_head_scale * 45.0,-25,35)
			MOTH F 0 bright A_CustomMissile (NoxinantFireball,0.0000152587890625 * user_head_scale * 90.0,25,-35)
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 57, 0, 58)
			MOTH G 14 bright A_CustomMissile (NoxinantFireball,0.0000152587890625 * user_head_scale * 45.0,25,-35)
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 51, 0, 68)
			MOTH E 8
			goto See		
		Balls4:
			MOTH F 0 bright A_CustomMissile (ImmolantFireball,0.0000152587890625 * user_head_scale * 90.0,-25,35)
			MOTH F 0 bright A_CustomMissile (ImmolantFireball,0.0000152587890625 * user_head_scale * 45.0,-25,35)
			MOTH F 0 bright A_CustomMissile (ImmolantFireball,0.0000152587890625 * user_head_scale * 90.0,25,-35)
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 57, 0, 58)
			MOTH G 14 bright A_CustomMissile (ImmolantFireball,0.0000152587890625 * user_head_scale * 45.0,25,-35)
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 51, 0, 68)
			MOTH E 8
			goto See
		Balls5:
			MOTH F 0 bright A_CustomMissile (FriginantFireball,0.0000152587890625 * user_head_scale * 90.0,-25,35)
			MOTH F 0 bright A_CustomMissile (FriginantFireball,0.0000152587890625 * user_head_scale * 45.0,-25,35)
			MOTH F 0 bright A_CustomMissile (FriginantFireball,0.0000152587890625 * user_head_scale * 90.0,25,-35)
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 57, 0, 58)
			MOTH G 14 bright A_CustomMissile (FriginantFireball,0.0000152587890625 * user_head_scale * 45.0,25,-35)
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 51, 0, 68)
			MOTH E 8
			goto See	

		SuperAttack:
			TNT1 A 0
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 62, 0, 41)
			MOTH H 8 A_FaceTarget
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 54, 0, 62)
			MOTH I 8 A_FaceTarget
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 33, 0, 77)
			MOTH J 8 A_FaceTarget
			"----" A 0 A_PlaySoundEx ("Mother/attack", "Body")
			
			"----" A 0 bright A_CustomMissile ("SuperMotherBall",0.0000152587890625 * user_head_scale * 100.0)
			
			"----" A 0 bright A_CustomMissile (MotherFire,0,0,35,2,0)
			"----" A 0 bright A_CustomMissile (MotherFire,0,0,70,2,0)
			"----" A 0 bright A_CustomMissile (MotherFire,0,0,-70,2,0)
			"----" A 0 bright A_CustomMissile (MotherFire,0,0,-35,2,0)
			
			"----" A 0 A_CustomMissile("MotherCacoBall", 0.0000152587890625 * user_head_scale * 40.0, 0, 0, CMF_AIMDIRECTION )
			"----" A 0 A_CustomMissile("MotherCacoBall", 0.0000152587890625 * user_head_scale * 40.0, 0, 45, CMF_AIMDIRECTION )
			"----" A 0 A_CustomMissile("MotherCacoBall", 0.0000152587890625 * user_head_scale * 40.0, 0, 90, CMF_AIMDIRECTION )
			"----" A 0 A_CustomMissile("MotherCacoBall", 0.0000152587890625 * user_head_scale * 40.0, 0, 135, CMF_AIMDIRECTION )
			"----" A 0 A_CustomMissile("MotherCacoBall", 0.0000152587890625 * user_head_scale * 40.0, 0, 180, CMF_AIMDIRECTION )
			"----" A 0 A_CustomMissile("MotherCacoBall", 0.0000152587890625 * user_head_scale * 40.0, 0, 225, CMF_AIMDIRECTION )
			"----" A 0 A_CustomMissile("MotherCacoBall", 0.0000152587890625 * user_head_scale * 40.0, 0, 270, CMF_AIMDIRECTION )
			"----" A 0 A_CustomMissile("MotherCacoBall", 0.0000152587890625 * user_head_scale * 40.0, 0, 315, CMF_AIMDIRECTION )			
			
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 62, 0, 41)
			MOTH H 8 A_FaceTarget
			goto See
			
		AfterAttack:
			"----" A 0 A_SetUserVar("user_stunlock_limit", user_stunlock_limit < 4 ? user_stunlock_limit + 1 : user_stunlock_limit)
			"----" A 0 A_JumpIf(user_stunlock_limit <= 0, "See")
			"----" A 0 A_ChangeFlag("NOPAIN", 0)
			goto See	
		
		FuriousRetaliation:
			"----" A 0 A_ChangeFlag("NOPAIN", 1)
			"----" A 0 A_SetUserVar("user_stunlock_limit", user_stunlock_limit > -2 ? user_stunlock_limit - 1 : -2)
			Goto SuperAttack
		
		Pain:
			"----" A 0
			// Just pain
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 43, 10, 75)
			MOTH K 10
			"----" A 0 A_Pain
			"----" A 0 A_SetUserVar("user_stunlock_limit", user_stunlock_limit - 1)
			"----" A 0 A_JumpIf(user_stunlock_limit < 0, "FuriousRetaliation") 
			
			MOTH K 10
			goto See
			
		Pain.Head:
		Pain.HeadStun:
		Pain.HeadPlasma:
		Pain.Decaptate:
			// uses the H sprite with head ducked low
			"----" A 0
			// Just pain
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 62, 0, 41)
			MOTH H 10
			"----" A 0 A_Pain
			"----" A 0 A_SetUserVar("user_stunlock_limit", user_stunlock_limit - 1)
			"----" A 0 A_JumpIf(user_stunlock_limit < 0, "FuriousRetaliation") 
			
			MOTH H 10
			goto See			

		Death:
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 43, 10, 75)
			MOTH K 10
			MOTH I 0 A_Scream
			MOTH L 0 A_NoBlocking
			MOTH KKKKKKKK 12 A_CustomMissile ("ExplosionSpawner", random (50, 90), 0, random (0, 360), 2, random (0, 90))

			TNT1 AA 0 A_CustomMissile ("XDeath1", 32, 0, random (0, 360), 2, random (0, 90))
			TNT1 AA 0 A_CustomMissile ("XDeath2", 32, 0, random (0, 360), 2, random (0, 90))
			TNT1 AA 0 A_CustomMissile ("XDeath3", 32, 0, random (0, 360), 2, random (0, 90))

			TNT1 AAAA 0 A_CustomMissile ("ExplosionSpawner", random (50, 90), 0, random (0, 360), 2, random (0, 90))
			//TNT1 AAAAAA 0 A_CustomMissile ("Bloodmist", 35, 0, random (0, 360), 2, random (0, 90))
			//TNT1 AAAAAAAAAAAAAAA 0 A_CustomMissile ("BloodmistExtraBig", 15, 0, random (0, 360), 2, random (10, 90))
			TNT1 A 0 A_CustomMissile ("CyberXDeath", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))

			MOTH L 3
			MOTH L 3
			MOTH MNOPQRST 4
			"----" A 1 A_Jump(256, "Aftermath")
			Wait
			
		Death.Head:
		Death.HeadStun:
		Death.HeadPlasma:
		Death.Decaptate:	
			//***Che a new frankenframe Y, a clone of L with head mauled. 
			// Must follow to N instead of M because M has a less damaged head than this
			
			TNT1 A 0 ACS_NamedExecuteWithResult("DeleteHeadboxMkII")
			TNT1 AAA 0 A_CustomMissile ("Brains6Big", 0.0000152587890625 * user_head_scale * 95.0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 AAA 0 A_CustomMissile ("Brains7Big", 0.0000152587890625 * user_head_scale * 120.0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 AAAAA 0 A_CustomMissile ("XDeath3b", 0.0000152587890625 * user_head_scale * 95.0, 0, random (0, 360), CMF_AIMDIRECTION, random (50, 90))
			TNT1 AAAAA 0 A_CustomMissile ("XDeath2b", 0.0000152587890625 * user_head_scale * 95.0, 0, random (0, 360), CMF_AIMDIRECTION, random (50, 90))
			TNT1 AA 0 A_CustomMissile ("MeatDeath", 0.0000152587890625 * user_head_scale * 80.0, 0, random (0, 360), CMF_AIMDIRECTION, random (50, 90))
			// 0.0000152587890625 is 1/65536 (1.0 in fixed point)
			MOTH YYYY 2 A_SpawnItemEx("MuchBlood3", 0, 0, 0.0000152587890625 * user_head_scale * 80.0)
			MOTH YYYYYY 3 A_SpawnItemEx("MuchBlood", 0, 0, 0.0000152587890625 * user_head_scale * 80.0)
			
			MOTH Y 0 A_Scream
			MOTH Y 0 A_NoBlocking
			
			
			MOTH YYYYYYYY 12 A_CustomMissile ("ExplosionSpawner", random (50, 90), 0, random (0, 360), 2, random (0, 90))

			TNT1 AA 0 A_CustomMissile ("XDeath1", 32, 0, random (0, 360), 2, random (0, 90))
			TNT1 AA 0 A_CustomMissile ("XDeath2", 32, 0, random (0, 360), 2, random (0, 90))
			TNT1 AA 0 A_CustomMissile ("XDeath3", 32, 0, random (0, 360), 2, random (0, 90))

			TNT1 AAAA 0 A_CustomMissile ("ExplosionSpawner", random (50, 90), 0, random (0, 360), 2, random (0, 90))
			//TNT1 AAAAAA 0 A_CustomMissile ("Bloodmist", 35, 0, random (0, 360), 2, random (0, 90))
			//TNT1 AAAAAAAAAAAAAAA 0 A_CustomMissile ("BloodmistExtraBig", 15, 0, random (0, 360), 2, random (10, 90))
			TNT1 A 0 A_CustomMissile ("CyberXDeath", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			
			MOTH NOPQRST 4
			"----" A 1 A_Jump(256, "Aftermath")
			Wait
		
		Aftermath: // boss death function overridable by descendant classes
			"----" A 1
			"----" A -1
			Stop
		
		
		Crush:
			POL5 A 0
			POL5 A 0 A_PlaySound ("Misc/Gibbed")
			POL5 A -1
			Stop
	}
}

actor FBD_Motherdemon: MotherdemonBase 17776 // regular boss suitable for potpourri swaps
{
	Translation "16:36=80:111", "37:44=5:8", "45:47=0:0"
}

actor Motherdemon: FBD_Motherdemon 2548 // final boss that ends the map on kill
{
	States
	{
		See:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecute("FBD_DisplayBossHealth", 0, 0, 0, 0) //Health Bar
			Goto Chasing

		Aftermath: 
			"----" A 300
			"----" A 0 A_BossDeath
			"----" A 20 A_BrainDie // end the level
			Stop
	}
}



actor MotherFire
{
	game Doom
	height 8
	scale 0.8
	radius 6
	damage 5
	speed 15
	renderstyle Translucent
	alpha 0.5
	//***Che wtf is this damage type?
	//damagetype "Vertigo"
	seesound "skeleton/attack"
	deathsound "null"
	PROJECTILE
	+RANDOMIZE
	+NODAMAGETHRUST
	+FLOORHUGGER
	+THRUACTORS
	ActiveSound "KYRDTRCH"
	var int user_starting_z;
	states
	{
		Spawn:
			TNT1 A 1
			TNT1 A 0 A_SetUserVar("user_starting_z", z)
		Fly:
			TNT1 A 1
			TNT1 A 0 A_JumpIf(z > user_starting_z + 64 || z < user_starting_z - 64, "Death")
			TNT1 A 0 A_CustomMissile ("FireballExplosionFlames", random (0, 8), 0, random (0, 360), 2, random (80, 100))
			TNT1 A 1
			TNT1 A 0 A_JumpIf(z > user_starting_z + 64 || z < user_starting_z - 64, "Death")
			TNT1 A 0 A_CustomMissile ("FireballExplosionFlames", random (0, 8), 0, random (0, 360), 2, random (80, 100))			
			TNT1 A 0 A_CustomMissile("MotherFlames", 32, 0, 0, 2 | CMF_TRACKOWNER, -90)
			TNT1 A 0 A_LoopActiveSound
			
			loop
		Death:
			TNT1 A 0
			TNT1 A 0 A_StopSound(CHAN_VOICE)
			stop
	}
}

ACTOR MotherFlames: FlamethrowerBurningStuffShortLived { // also no self damage AND no sound
	Species "Motherdemons"
	+DONTHARMSPECIES
}


ACTOR MotherCacoBall : FBD_CacoBall
{
	Species "Motherdemons" // to avoid exploding against the headbox right away
}

ACTOR MotherBallSmokeTrail: OldschoolRocketSmokeTrailDarker
{
	Scale 1.0 // 5 times bigger
}

ACTOR SuperMotherBall : FBD_CacoBall
{
	Radius 8
	Height 8
	Speed 20
	FastSpeed 25
	Projectile
	+RANDOMIZE
	+FORCEXYBILLBOARD
	RenderStyle Add
	Alpha 0.95
	//Scale 1.0
	Scale 1.5 // immense flare, cacodemon ball but 5 times bigger
	
	Species "Motherdemons" // to avoid exploding against the headbox right away
	SeeSound "baron/attack"
	ActiveSound "KYROAR01"
	DeathSound "FAREXPL"
	States
	{
		Spawn:
			//BLHD CD 1 BRIGHT
			PBAL W 2 BRIGHT
			//TNT1 A 0 A_CustomMissile ("FireballExplosionFlames", 0, 0, random (0, 360), 2, random (80, 100))
			"----" A 0 A_JumpIf(z - floorz < 20, "Proximity")
			"----" A 0 A_CustomMissile ("MotherBallSmokeTrail", 2, 0, random (160, 210), 2, random (-30, 30))
			"----" A 0 A_LoopActiveSound
			PBAL D 2 BRIGHT
			"----" A 0 A_JumpIf(z - floorz < 20, "Proximity")
			"----" A 0 A_CustomMissile ("MotherBallSmokeTrail", 2, 0, random (160, 210), 2, random (-30, 30))
			"----" A 0 A_LoopActiveSound
			PBAL E 2 BRIGHT
			"----" A 0 A_JumpIf(z - floorz < 20, "Proximity")
			"----" A 0 A_CustomMissile ("MotherBallSmokeTrail", 2, 0, random (160, 210), 2, random (-30, 30))
			"----" A 0 A_LoopActiveSound			
			
			Loop
		Proximity:
			"----" A 1 A_Die // doesn't do anything on Zandronum client
			Wait
		Death:
			TNT1 A 0
			TNT1 A 0 A_StopSound(CHAN_VOICE)
			TNT1 A 0 A_Scream
			TNT1 AAAA 0 A_CustomMissile ("ExplosionParticleHeavy", 0, 0, random (0, 360), 2, random (0, 180))
			TNT1 AAAAAA 0 A_CustomMissile ("ExplosionParticle", 0, 0, random (0, 360), 2, random (0, 180))
			//TNT1 AAAA 0 A_CustomMissile ("BarrelKaboomNoSound", 0, 0, random (0, 360), 2, random (40, 90))
			TNT1 A 0 A_SpawnItem("ExplosionSpawner")
			TNT1 A 0 A_Explode(200, 200, 0)
			//***Che CMF_TRACKOWNER is obligatory when firing missiles from a missile's Death state,
			//  otherwise inflictor information is lost and damage is counted as environmental.
			TNT1 A 0 A_CustomMissile("MotherCacoBall", 10, 0, 0, CMF_AIMDIRECTION | CMF_TRACKOWNER )
			TNT1 A 0 A_CustomMissile("MotherCacoBall", 10, 0, 45, CMF_AIMDIRECTION | CMF_TRACKOWNER )
			TNT1 A 0 A_CustomMissile("MotherCacoBall", 10, 0, 90, CMF_AIMDIRECTION | CMF_TRACKOWNER )
			TNT1 A 0 A_CustomMissile("MotherCacoBall", 10, 0, 135, CMF_AIMDIRECTION | CMF_TRACKOWNER )
			TNT1 A 0 A_CustomMissile("MotherCacoBall", 10, 0, 180, CMF_AIMDIRECTION | CMF_TRACKOWNER )
			TNT1 A 0 A_CustomMissile("MotherCacoBall", 10, 0, 225, CMF_AIMDIRECTION | CMF_TRACKOWNER )
			TNT1 A 0 A_CustomMissile("MotherCacoBall", 10, 0, 270, CMF_AIMDIRECTION | CMF_TRACKOWNER )
			TNT1 A 0 A_CustomMissile("MotherCacoBall", 10, 0, 315, CMF_AIMDIRECTION | CMF_TRACKOWNER )
			//TNT1 AAAAAAAAAAAAAAA 1 A_CustomMissile ("BluePlasmaFire", 17, 0, random (0, 360), 2, random (0, 360))
			//TNT1 A 15
			
			//***Che this asset wasn't being used!
			X004 BCDEFGHIJKLMNOP 1 BRIGHT
			TNT1 A 0 A_PlaySound("distantexp", 5)
			X004 QRSTUVWXYZ 1 BRIGHT
						
			Stop
	}
}

