ACTOR ImpFish: Imp
{
+FLOAT
+NOGRAVITY
Height 56
Speed 4
States
{
Spawn:
		IUSA B 1 A_Look
		Goto Spawn
	See:
	    
		TNT1 A 0 ThrustThingZ(0,-2,0,1)
		IUSA AA 2 A_Chase
		
		TNT1 A 0 A_JumpIf(waterlevel < 1, "JumpOutOfWater")
		TNT1 A 0 A_Recoil(-1)
		IUSA AA 2 A_Chase
		TNT1 A 0 A_JumpIf(waterlevel < 1, "JumpOutOfWater")
		TNT1 A 0 A_Recoil(-1)
		
		IUSA BB 2 A_Chase
		TNT1 A 0 A_JumpIf(waterlevel < 1, "JumpOutOfWater")
		TNT1 A 0 A_Recoil(-1)
		IUSA BB 2 A_Chase
		TNT1 A 0 A_JumpIf(waterlevel < 1, "JumpOutOfWater")
		TNT1 A 0 A_Recoil(-1)
		
		TNT1 A 0 ThrustThingZ(0,-2,0,1)
		IUSA CC 2 A_Chase
		TNT1 A 0 A_JumpIf(waterlevel < 1, "JumpOutOfWater")
		TNT1 A 0 A_Recoil(-1)
		IUSA CC 2 A_Chase
		TNT1 A 0 A_JumpIf(waterlevel < 1, "JumpOutOfWater")
		TNT1 A 0 A_Recoil(-1)
		
		IUSA DD 2 A_Chase
		TNT1 A 0 A_JumpIf(waterlevel < 1, "JumpOutOfWater")
		TNT1 A 0 A_Recoil(-1)
		IUSA DD 2 A_Chase
		TNT1 A 0 A_JumpIf(waterlevel < 1, "JumpOutOfWater")
		TNT1 A 0 A_Recoil(-1)
		TNT1 A 0 A_JumpIf(waterlevel == 1, "JumpOutOfWater")
		Loop
		
	See2:
		IUSA AA 2 A_Chase
		TNT1 A 0 A_JumpIf(waterlevel < 1, "JumpOutOfWater")
		TNT1 A 0 A_Recoil(-1)
		IUSA AA 2 A_Chase
		TNT1 A 0 A_JumpIf(waterlevel < 1, "JumpOutOfWater")
		TNT1 A 0 A_Recoil(-1)
		
		IUSA BB 2 A_Chase
		TNT1 A 0 A_JumpIf(waterlevel < 1, "JumpOutOfWater")
		TNT1 A 0 A_Recoil(-1)
		IUSA BB 2 A_Chase
		TNT1 A 0 A_JumpIf(waterlevel < 1, "JumpOutOfWater")
		TNT1 A 0 A_Recoil(-1)
		
		IUSA CC 2 A_Chase
		TNT1 A 0 A_JumpIf(waterlevel < 1, "JumpOutOfWater")
		TNT1 A 0 A_Recoil(-1)
		IUSA CC 2 A_Chase
		TNT1 A 0 A_JumpIf(waterlevel < 1, "JumpOutOfWater")
		TNT1 A 0 A_Recoil(-1)
		
		IUSA DD 2 A_Chase
		TNT1 A 0 A_JumpIf(waterlevel < 1, "JumpOutOfWater")
		TNT1 A 0 A_Recoil(-1)
		IUSA DD 2 A_Chase
		TNT1 A 0 A_JumpIf(waterlevel < 1, "JumpOutOfWater")
		TNT1 A 0 A_Recoil(-1)
		Loop	
	
	JumpOutOfWater:
	TNT1 A 0
	TNT1 A 0 A_ChangeFlag("SHOOTABLE", 0)
	TROO A 1 A_Facetarget
	TNT1 A 0 A_Recoil(-6)
	TNT1 A 0 ThrustThingZ(0,50,0,1)
	TROO A 4
	TNT1 A 0 A_NoBlocking
	TNT1 A 0 A_SpawnItem("Imp")
	Stop

	Melee:
        IUSA A 4 A_FaceTarget
		TNT1 A 0 A_JumpIf(waterlevel < 1, "JumpOutOfWater")
        TNT1 A 0 A_FaceTarget
        TNT1 A 0 A_Recoil (-6)
		IUSA B 6
		TNT1 A 0 A_JumpIf(waterlevel < 1, "JumpOutOfWater")
        TNT1 A 0 A_FaceTarget
        IUSA E 6 
		TNT1 AA 0 A_CustomMissile("ImpAttack",10,0,0,0)
        TNT1 A 0
		TNT1 A 0 A_JumpIf(waterlevel < 1, "JumpOutOfWater")
        IUSA B 6
        Goto See

	Missile:
        TNT1 A 0 A_JumpIfCloser(150, "Melee")
		
		IUSA A 4 A_FaceTarget
        TNT1 A 0 A_JumpIfCloser(170, "Melee")
		TNT1 A 0 A_Playsound ("IMPCHARG")
        TNT1 A 0 A_CustomMissile ("BUBULZ", 35, 30, random (0, 40), 2, random (0, 160))
        TNT1 A 0 A_CustomMissile ("ImBallGettingReady", 35, 30, random (0, 140), 2, random (0, 160))
		IUSA A 2 A_FaceTarget
		
		        TNT1 A 0 A_CustomMissile ("BUBULZ", 25, 30, random (0, 40), 2, random (0, 160))
        TNT1 A 0 A_CustomMissile ("ImBallGettingReady", 25, 30, random (0, 140), 2, random (0, 160))
		IUSA A 2 A_FaceTarget
		        TNT1 A 0 A_CustomMissile ("BUBULZ", 25, 30, random (0, 40), 2, random (0, 160))
        TNT1 A 0 A_CustomMissile ("ImBallGettingReady", 25, 30, random (0, 140), 2, random (0, 160))
		IUSA A 2 A_FaceTarget
		        TNT1 A 0 A_CustomMissile ("BUBULZ", 25, 30, random (0, 40), 2, random (0, 160))
        TNT1 A 0 A_CustomMissile ("ImBallGettingReady", 25, 30, random (0, 140), 2, random (0, 160))
		IUSA A 2 A_FaceTarget
		        TNT1 A 0 A_CustomMissile ("BUBULZ", 25, 30, random (0, 40), 2, random (0, 160))
        TNT1 A 0 A_CustomMissile ("ImBallGettingReady", 25, 30, random (0, 140), 2, random (0, 160))
		IUSA A 2 A_FaceTarget
		TNT1 A 0 A_CustomMissile ("BUBULZ", 25, 30, random (0, 40), 2, random (0, 160))
        TNT1 A 0 A_CustomMissile ("ImBallGettingReady", 25, 30, random (0, 140), 2, random (0, 160))

		IUSA B 2 A_FaceTarget
		IUSA E 6 A_CustomMissile("FireBall_", 34, 0, 0, 0) 
		TNT1 A 0 A_JumpIf(waterlevel < 1, "JumpOutOfWater")
		IUSA B 4
		Goto See

		
		
	Death.ExplosiveImpact:
	XDeath:
		TNT1 A 0
		TNT1 A 0 A_CustomMissile ("XDeath1", 32, 0, random (0, 360), 2, random (0, 160))
		TNT1 A 0 A_CustomMissile ("XDeath2", 32, 0, random (0, 360), 2, random (0, 160))
		TNT1 A 0 A_ChangeFlag("NOBLOCKMONST", 1)
		TNT1 A 0 A_ChangeFlag("NOGRAVITY", 0)
		TNT1 A 0 A_ChangeFlag("FLOAT", 0)
		TNT1 AAAA 0 A_CustomMissile ("Brains1", 50, 0, random (0, 360), 2, random (0, 160))
		TNT1 A 0 A_CustomMissile ("Brains3", 50, 0, random (0, 360), 2, random (0, 160))
		TNT1 A 0 A_CustomMissile ("Brains6", 50, 0, random (0, 360), 2, random (0, 160))
		TNT1 A 0 A_CustomMissile ("Brains7", 50, 0, random (0, 360), 2, random (0, 160))
		TNT1 AAAA 0 A_CustomMissile ("SmallBrainPieceFast", random (45, 55), random (5, -5), random (170, 190), 2, random (-10, 10))
		TNT1 AAAA 0 A_CustomMissile ("SmallBrainPiece", 50, 0, random (0, 360), 2, random (0, 160))
		TNT1 AA 0 A_CustomMissile ("SuperWallRedBlood", 46, 0, random (170, 190), 2, random (0, 40))
        TNT1 AAAAAAA 0 A_CustomMissile ("BrainBlood", 50, 0, random (0, 360), 2, random (0, 160))
	    TNT1 AAAAAA 0 bright A_CustomMissile ("SuperGoreSpawner", 5, 0, random (0, 360), 2, random (0, 360))
	TNT1 A 0 A_CustomMissile ("XDeathImpArm", 35, 0, random (0, 360), 2, random (0, 160))
	TNT1 A 0 A_CustomMissile ("XDeath3", 40, 0, random (0, 360), 2, random (0, 160))
	TNT1 A 0 A_CustomMissile ("XDeathImpLeg", 32, 0, random (0, 360), 2, random (0, 160))
    TNT1 AA 0 A_CustomMissile ("XDeath1", 40, 0, random (0, 360), 2, random (0, 160))
	Goto FloatXDEath
	
	FloatXDeath:
	    ID17 C 5 A_CheckFloor ("Dead.ExplosiveImpact")
		TNT1 A 0 A_CustomMissile ("Underblood3", 32, 0, random (0, 360), 2, random (0, 160))
		BLUD C 0 ThrustThingZ (0,7,1,0)
		ID17 DEF 5 A_CheckFloor ("Dead.ExplosiveImpact")
		TNT1 A 0 A_CustomMissile ("Underblood3", 32, 0, random (0, 360), 2, random (0, 160))
	    BLUD C 0 ThrustThingZ (0,7,1,0)
	Loop
		
		Dead.ExplosiveImpact:
		TNT1 A 0 A_SpawnItem ("ThisImpGotFuckedHard")
		Stop
	
   Pain:
		TROO C 2
		TROO C 2 A_Pain
		Goto See	
  Death:
  Death.Cut:
  Death.Minigun:
  Death.Shotgun:
  TNT1 A 0 A_NOBlocking
  TNT1 A 0 A_Scream
  TNT1 A 0 A_ChangeFlag("NOGRAVITY", 0)
  TNT1 A 0 A_ChangeFlag("FLOAT", 0)
  TROO VW 4
  Goto Sink
  
  Sink:
  TROO X 4 A_CheckFloor ("Deadz")
  TNT1 A 0 ThrustThingZ (0,7,1,0)
  TROO X 4 A_CheckFloor ("Deadz")
  TNT1 A 0 ThrustThingZ (0,7,1,0)
  TNT1 A 0 A_CustomMissile ("Underblood1", 32, 0, random (0, 360), 2, random (0, 160))
  Loop
  
  Deadz:
  TROO YYYYYYY 8 A_CustomMissile ("Underblood1", 32, 0, random (0, 360), 2, random (0, 160))
  TROO Y -1
  Loop
  
}
}