ACTOR GuncastEttin : Ettin replaces Ettin
{
  DropItem "Dosh1"
  DropItem "Dosh1"
  DropItem "Dosh10", 128
  DropItem "Dosh5", 128
  DropItem "Dosh25", 64
  States
  {
	Pain.SuperCloseCombat:
		TNT1 A 0 A_ChangeVelocity(frandom(-7.0,-10.0),0,frandom(1.0,3.0),CVF_RELATIVE)
		Goto Pain
	Pain.SuperShoelaces:
		TNT1 A 0 A_ChangeVelocity(frandom(-12.0,-16.0),0,frandom(8.0,11.0),CVF_RELATIVE)
		Goto Pain
	Death.SuperCloseCombat:
		TNT1 A 0 A_ChangeVelocity(frandom(-7.0,-10.0),0,frandom(1.0,3.0),CVF_RELATIVE)
		Goto XDeath
	Death.SuperShoelaces:
		TNT1 A 0 A_ChangeVelocity(frandom(-12.0,-16.0),0,frandom(8.0,11.0),CVF_RELATIVE)
		Goto XDeath
	Death.Acid:
		TNT1 A 0 A_NoBlocking
		TNT1 A 0 A_SpawnItemEx("EttinGib")
		Stop
	Crush:
		TNT1 AAAAAAAAAA 0 A_CustomMissile ("BloodTr255", 0, 0, random (0, 360), 2, random (0, 360))
		TNT1 A 0 A_PlaySound("misc/xdeath4")
		XBIG EEEEE 1 A_CustomMissile ("CeilBloodLauncherLong", 0, 0, random (0, 360), 2, random (50, 130))
		TNT1 A 0 A_CustomMissile ("GiantBloodSpot", 4, 0, random (0, 360), 2, random (0, 160))
		XBIG E -1
		Stop
	Death.Crow:
		TNT1 AA 0 A_SpawnItemEx("FlockOfCrows",0,0,0,0,0,0,0,0,128)
		Goto Super::Death
	Death:
		ETTN IJ 4
		ETTN K 4 A_Scream
		ETTN L 4 A_NoBlocking
		ETTN M 4 A_QueueCorpse
		ETTN NOP 4
	Looplet1:
		ETTN Q 0 A_JumpIfInventory("CorpseTrigger2",1,"CorpseBlastB")
		ETTN Q 1 A_JumpIfInventory("CorpseTrigger",1,"CorpseBlastA")
		Loop
	XDeath:
		ETTB A 4
		ETTB B 4 A_NoBlocking
		ETTB C 4 A_SpawnItemEx("EttinMace", 0, 0, 8.5, random[DropMace](-128, 127)*0.03125,
                           random[DropMace](-128, 127)*0.03125, 10+random[DropMace](0, 255)*0.015625, 0,
                           SXF_ABSOLUTEVELOCITY)
		ETTB D 4 A_Scream
		ETTB E 4 A_QueueCorpse
		ETTB FGHIJK 4
	Looplet2:
		ETTB L 0 A_JumpIfInventory("CorpseTrigger2",1,"CorpseBlastC")
		ETTB L 1 A_JumpIfInventory("CorpseTrigger",1,"CorpseBlastA")
		Loop
	CorpseBlastA:
		TNT1 A 0 A_SpawnItemEx("EttinBlast")
		Stop
	CorpseBlastB:
		TNT1 A 0 A_SpawnItemEx("EttinBlast")
		TNT1 A 0 A_TakeInventory("CorpseTrigger2",1)
		Goto Looplet1
	CorpseBlastC:
		TNT1 A 0 A_SpawnItemEx("EttinBlast")
		TNT1 A 0 A_TakeInventory("CorpseTrigger2",1)
		Goto Looplet2
  }
}

ACTOR EttinBlast : BlastShared
{
	States
	{
	Spawn:
		 TNT1 AA 0 A_Explode(150,128,0)
		 TNT1 A 0 A_PlaySound("Corpseblast/Hit")
		 TNT1 AAA 0 A_CustomMissile ("XDeath1", 6, 0, random (0, 360), 2, random (0, 160))
		 TNT1 AAA 0 A_CustomMissile ("XDeath2", 6, 0, random (0, 360), 2, random (0, 160))
		 TNT1 AAA 0 A_CustomMissile ("XDeath3", 6, 0, random (0, 360), 2, random (0, 160))
		 TNT1 AA 0 A_CustomMissile ("XDeath4", 6, 0, random (0, 360), 2, random (0, 160))
		 TNT1 AAAAAAAA 0 A_CustomMissile ("SuperWallRedBlood", 6, 0, random (0, 360), 2, random (-5, 5))
		 TNT1 AAAAAAA 0 A_CustomMissile ("Instestin", 6, 0, random (0, 360), 2, random (0, 160))
		 TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_CustomMissile ("Brutal_FlyingBlood", 6, 0, random (0, 360), 2, random (0, 160))
		 TNT1 AAAAAAAAAA 0 A_CustomMissile ("SuperGoreSpawner", 6, 0, random (0, 360), 2, random (50, 130))
		 Stop
	 }
}

ACTOR EttinGib : GibShared
{
	States
	{
		Spawn:
	     ETTN H 1
		"####" "#" 1 A_Playsound("Gumpop/Expand",5)
		"####" "###################################" 1 A_SetScale(ScaleX+frandom(0.01,0.025))
		"####" "#" 1 A_Playsound("Gumpop/Pop",5)
		 TNT1 AAA 0 A_CustomMissile ("XDeath1", 32, 0, random (0, 360), 2, random (0, 160))
		 TNT1 AAA 0 A_CustomMissile ("XDeath2", 32, 0, random (0, 360), 2, random (0, 160))
		 TNT1 AAA 0 A_CustomMissile ("XDeath3", 32, 0, random (0, 360), 2, random (0, 160))
		 TNT1 AA 0 A_CustomMissile ("XDeath4", 32, 0, random (0, 360), 2, random (0, 160))
		 TNT1 AAAAAAAA 0 A_CustomMissile ("SuperWallRedBlood", 40, 0, random (0, 360), 2, random (-5, 5))
		 TNT1 AAAAAAA 0 A_CustomMissile ("Instestin", 32, 0, random (0, 360), 2, random (0, 160))
		 TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_CustomMissile ("Brutal_FlyingBlood", 35, 0, random (0, 360), 2, random (0, 160))
		 TNT1 AAAAAAAAAA 0 A_CustomMissile ("SuperGoreSpawner", 32, 0, random (0, 360), 2, random (50, 130))
		TNT1 A 0 A_Gravity
		XBIG B 5 A_XScream
		XBIG C 5 A_BossDeath 
		XBIG D 5 A_NoBlocking
		XBIG E 5
		TNT1 A 0 A_CustomMissile ("GiantBloodSpot", 4, 0, random (0, 360), 2, random (0, 160))
		XBIG E -1
		Stop
	}
}