Actor InsanityArachnophyte : InsanitySpider
{
  Scale 1.1
  Speed 20
  +QUICKTORETALIATE
  +FLOAT
  +NOGRAVITY	
  -FLOORCLIP
  +BRIGHT
  Mass 2500
  DropItem "BossLifeEssence" 256 25
  DropItem "BossArmorBonusMax" 256 1
  DropItem "DemonAmmoBox" 128 200
  DropItem "BFG10K " 100
  Obituary "%o didn't take cover from an Insanity Arachnophyte's barrage."
  Tag "\c[i7]Insanity Arachnophyte\c-"
  var int user_script;
  States
  {
  Spawn:
	TNT1 A 0 A_JumpIf(user_script == 1,3)
	TNT1 A 0 ACS_NamedExecuteAlways("InsanitySentientFire",0)
	TNT1 A 0 A_SetUserVar("user_script",1)
	INAP AB 2 A_Look
	Loop
  See:
	TNT1 A 0 A_SpawnItemEx("InsanePhyteGhostA",0,0,0,0,0,0,0,128)
	INAP A 2 A_Chase
	TNT1 A 0 A_SpawnItemEx("InsanePhyteGhostB",0,0,0,0,0,0,0,128)	
	INAP B 2 A_Chase
	TNT1 A 0 A_Jump(40,"Evade")
	Loop
  Evade:
	TNT1 A 0 A_Jump(128,3)
	TNT1 A 0 ThrustThing(Angle*256/360+64,30,0,0)
	TNT1 A 0 A_Jump(256,2)
	TNT1 A 0 ThrustThing(Angle*256/360+192,30,0,0)
	TNT1 A 0 A_SpawnItemEx("InsanePhyteGhostA",0,0,0,0,0,0,0,128)
	INAP A 2 A_Chase
	TNT1 A 0 A_SpawnItemEx("InsanePhyteGhostB",0,0,0,0,0,0,0,128)	
	INAP B 2 A_Chase
	TNT1 A 0 A_SpawnItemEx("InsanePhyteGhostA",0,0,0,0,0,0,0,128)
	INAP A 2 A_Chase
	TNT1 A 0 A_SpawnItemEx("InsanePhyteGhostB",0,0,0,0,0,0,0,128)	
	INAP B 2 A_Chase
	TNT1 A 0 A_SpawnItemEx("InsanePhyteGhostA",0,0,0,0,0,0,0,128)
	INAP A 2 A_Chase
	TNT1 A 0 A_SpawnItemEx("InsanePhyteGhostB",0,0,0,0,0,0,0,128)	
	INAP B 2 A_Chase
	TNT1 A 0 A_SpawnItemEx("InsanePhyteGhostA",0,0,0,0,0,0,0,128)
	INAP A 2 A_Chase
	TNT1 A 0 A_SpawnItemEx("InsanePhyteGhostB",0,0,0,0,0,0,0,128)	
	INAP B 2 A_Chase
	TNT1 A 0 A_Stop
	Goto See
  Missile:
	TNT1 A 0 A_Jump(100,"BFG15k")
	TNT1 A 0 A_Jump(50,"BFG10k")
  DemonTech:
	INAP A 20 A_FaceTarget
	TNT1 AA 0 A_GiveInventory("OverseerStrafe")
	TNT1 A 0 A_FaceTarget
	TNT1 A 0 A_CustomMissile("InsanitySpiderDemontech",39,0,frandom(-10,10),CMF_OFFSETPITCH,frandom(-1,1))
	INAP C 2 A_PlaySoundEx("weapons/demontechfire","Weapon")
	TNT1 A 0 A_FaceTarget
	TNT1 A 0 A_CustomMissile("InsanitySpiderDemontech",39,0,frandom(-10,10),CMF_OFFSETPITCH,frandom(-1,1))
	INAP D 2 A_PlaySoundEx("weapons/demontechfire","Weapon")
	TNT1 A 0 A_SpidRefire
	Goto DemonTech+1
  ExplosiveMinigun:
	INAP A 20 A_FaceTarget
	TNT1 AA 0 A_GiveInventory("OverseerStrafe")
	TNT1 A 0 A_FaceTarget
	TNT1 A 0 A_SpawnItemEx("OrangeShellCasing",10,0,40, Random(2, 6), 0, Random(1, 3), Random(80, 90), 128)
	TNT1 A 0 A_CustomMissile("SentientExplosiveTracer",39,0,frandom(-8,8))
	INAP G 2 Bright A_PlaySound("sentient/fire")
	TNT1 A 0 A_FaceTarget
	TNT1 A 0 A_SpawnItemEx("OrangeShellCasing",10,0,40, Random(2, 6), 0, Random(1, 3), Random(80, 90), 128)
	TNT1 A 0 A_CustomMissile("SentientExplosiveTracer",39,0,frandom(-8,8))
	INAP H 2 Bright A_PlaySound("sentient/fire")
	TNT1 A 0 A_SpidRefire
	Goto ExplosiveMinigun+1
  BFG15k:
	TNT1 A 0 A_PlaySound("weapons/charge15k")
	INAP CCCCC 5 A_FaceTarget
	TNT1 A 0 A_CustomMissile("InsanitySpider15k",39,0,frandom(-7,7))
	TNT1 AA 0 A_GiveInventory("OverseerStrafe")
	INAP D 4 A_FaceTarget
	TNT1 AA 0 A_GiveInventory("OverseerStrafe")
	INAP C 4 A_FaceTarget
	TNT1 A 0 A_SpidRefire
	Goto BFG15k+6
  BFG10k:
	TNT1 A 0 A_PlaySound("weapons/charge15k")
	INAP CCCCCCC 5 A_FaceTarget
	TNT1 A 0 A_PlaySound("weapons/bfg15kfire")
	TNT1 A 0 A_CustomMissile("Sentient10K",39,0,frandom(-7,7))
	TNT1 AA 0 A_GiveInventory("OverseerStrafe")
	INAP D 4 A_FaceTarget
	TNT1 AA 0 A_GiveInventory("OverseerStrafe")
	INAP C 4 A_FaceTarget
	TNT1 A 0 A_SpidRefire
	Goto BFG10k+8
  Pain:
	INAP E 6 A_Pain
	TNT1 A 0 A_Jump(128,"Missile")
	Goto See
  Death:	
	TNT1 A 0 A_Scream
	INAP E 20 A_Fall
    TNT1 AA 0 A_SpawnItemEx("GibbedGenerator",Random(10,-10),Random(10,-10),Random(20,60),0,0,0,0,128,0)	
	TNT1 AAA 0 A_CustomMissile("BigRedBloodCloud", random(10,80), 0, random(0,360), 2, random(0,360))	
	INAP FFFFF 2 A_CustomMissile("Kaboom", random(10,60), random(30,-30), random(0,360), 2, random(0,360))
    TNT1 AA 0 A_SpawnItemEx("GibbedGenerator",Random(10,-10),Random(10,-10),Random(20,60),0,0,0,0,128,0)	
	TNT1 AAA 0 A_CustomMissile("BigRedBloodCloud", random(10,80), 0, random(0,360), 2, random(0,360))	
    INAP GGGGG 2 A_CustomMissile("Kaboom", random(10,60), random(30,-30), random(0,360), 2, random(0,360))
    TNT1 AA 0 A_SpawnItemEx("GibbedGenerator",Random(10,-10),Random(10,-10),Random(20,60),0,0,0,0,128,0)	
	TNT1 AAA 0 A_CustomMissile("BigRedBloodCloud", random(10,80), 0, random(0,360), 2, random(0,360))
    INAP HHHHH 2 A_CustomMissile("Kaboom", random(10,60), random(30,-30), random(0,360), 2, random(0,360))
    TNT1 AA 0 A_SpawnItemEx("GibbedGenerator",Random(10,-10),Random(10,-10),Random(20,60),0,0,0,0,128,0)	
	TNT1 AAA 0 A_CustomMissile("BigRedBloodCloud", random(10,80), 0, random(0,360), 2, random(0,360))
    INAP IIIII 2 A_CustomMissile("Kaboom", random(10,60), random(30,-30), random(0,360), 2, random(0,360))
    TNT1 AAAA 0 A_SpawnItemEx("GibbedGenerator",Random(10,-10),Random(10,-10),Random(20,60),0,0,0,0,128,0)
	TNT1 AAAAAA 0 A_CustomMissile("BigRedBloodCloud", random(10,80), 0, random(0,360), 2, random(0,360))
	TNT1 AAAAAAAA 0 A_CustomMissile("SmokeFX3", random(10,60), random(30,-30), random(0,360), 2, random(0,360))	
	INAP J 5 A_KillMaster
	Stop
	}
}

ACTOR InsanitySentientFireSpawner : RedParticleSpawner
{
  States
  {
  Spawn:
    TNT1 A 0
	TNT1 A 0 A_PlaySound("monster/ambientfire2")
	TNT1 A 0 A_JumpIf(CallAcs("LCAEffectCheck"),"Toaster")
    TNT1 AA 0 A_SpawnItemEx("InsanitySpiderFire",random(50,70),random(50,70),74,0,0,random(-4,-6),0,128,0)
	TNT1 AA 0 A_SpawnItemEx("InsanitySpiderFire",random(-50,-70),random(-50,-70),74,0,0,random(-4,-6),0,128,0)
	TNT1 AA 0 A_SpawnItemEx("InsanitySpiderFire",random(50,70),random(-50,-70),74,0,0,random(-4,-6),0,128,0)
	TNT1 AA 0 A_SpawnItemEx("InsanitySpiderFire",random(-50,-70),random(50,70),74,0,0,random(-4,-6),0,128,0)
    TNT1 A 1
    Stop
  }
}

ACTOR InsanitySpiderFire : SentientFire
{
Scale 0.6
States
{
Spawn:
	2HD2 ABCDEFGHIJKL 1 Bright A_FadeOut
	Stop
	}
}

ACTOR InsanePhyteGhostA : InsaneSpiderGhostA
{
Scale 1.1
States
{
Spawn:
    INAP A 2 A_FadeOut(0.18)
    Loop
    }
}

ACTOR InsanePhyteGhostB : InsanePhyteGhostA
{   
States
{
Spawn:
    INAP B 2 A_FadeOut(0.18)
    Loop
    }
}