//////////////////////////////////////////////////////////////
///														   ///
///			Freezebot		   							   ///
///		 			(actually just a floating bd marine)   ///
//////////////////////////////////////////////////////////////

ACTOR FreezerBall : FastProjectile
{
	Radius 4
	Height 8
	Speed 52
	Damage 0
	Projectile
	DamageType "Freeze"
	RenderStyle Add
	//Translation "0:255=%[0,0,0]:[0,1,1]"
	Alpha 0.95
	+NODAMAGETHRUST
	+FORCEXYBILLBOARD
	+FORCERADIUSDMG
	+BOUNCEONFLOORS
	+BOUNCEONWALLS
	+BOUNCEONCEILINGS
	BounceType Grenade
	BounceFactor 1
	WallBounceFactor 1
	BounceCount 2
	DeathSound "weapons/cryobowhit"
	//MissileHeight 8
	Decal "IceScorch"
	States
	{
	Spawn:
		FRPJ ABC 1 Bright A_SpawnItemEx("FreezerTrailSparksSmall", random(5,-5), random(5,-5), random(5,-5), 0, 0, 0, 0, 128, 0) 
		TNT1 A 0 A_CustomMissile("BlueFlareSpawn",0,0,0,0)
		TNT1 A 0 A_CustomMissile ("Icetracer", 0, 0, random (0, 360), 2, random (0, 360))
		Loop
	Death:
		BXPL A 0 Bright A_StopSound(CHAN_BODY)
		BXPL A 0 Bright A_ChangeFlag("ICEDAMAGE", 1)
		BXPL A 0 Bright A_ChangeFlag("NODAMAGETHRUST", 0)
		BXPL A 0 Bright A_Explode(25*random(3,4),180, 0)  
		BXPL A 0 Bright A_Explode(random(20,25), 315, 0) 
		BXPL AAAAAAAAAAA 0 Bright A_SpawnItemEx("CryoSmoke", 0, 0, 0, random(10, 30)*0.1, 0, random(0, 10)*0.1, random(1,360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		BXPL AAAAA 0 Bright A_SpawnItemEx("CryoSmoke3", 0, 0, 0, random(10, 30)*0.04, 0, random(0, 10)*0.04, random(1,360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION,64)
		BXPL AAAAAAA 0 Bright A_SpawnItemEx("FreezerTrailSparksSmall", random(5,-5), random(5,-5), random(5,-5), random(10, 30)*0.04, 0, random(0, 10)*0.04, random(1,360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION,64)
		BXPL AAAAAAA 0 Bright A_SpawnItemEx("CryoSmoke2", 0, 0, 0, random(10, 30)*0.04, 0, random(0, 10)*0.04, random(1,360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION,64)
		BXPL ABCDEFGH 1 Bright
		BXPL IJKLLM 1 Bright A_FadeOut(0.1)
		Stop
	}
}

ACTOR SmallFreezerBall : FreezerBall
{
	Scale 0.5
	States
	{
	Spawn:
		FRPJ ABC 1 Bright A_SpawnItemEx("FreezerTrailSparksSmall", random(5,-5), random(5,-5), random(5,-5), 0, 0, 0, 0, 128, 0) 
		TNT1 A 0 A_CustomMissile("BlueFlareSpawn",0,0,0,0)
		TNT1 A 0 A_CustomMissile ("Icetracer", 0, 0, random (0, 360), 2, random (0, 360))
		FRPJ ABC 1 Bright A_SpawnItemEx("FreezerTrailSparksSmall", random(5,-5), random(5,-5), random(5,-5), 0, 0, 0, 0, 128, 0) 
		TNT1 A 0 A_CustomMissile("BlueFlareSpawn",0,0,0,0)
		TNT1 A 0 A_CustomMissile ("Icetracer", 0, 0, random (0, 360), 2, random (0, 360))
		FRPJ ABC 1 Bright A_SpawnItemEx("FreezerTrailSparksSmall", random(5,-5), random(5,-5), random(5,-5), 0, 0, 0, 0, 128, 0) 
		TNT1 A 0 A_CustomMissile("BlueFlareSpawn",0,0,0,0)
		TNT1 A 0 A_CustomMissile ("Icetracer", 0, 0, random (0, 360), 2, random (0, 360))
		FRPJ ABC 1 Bright A_SpawnItemEx("FreezerTrailSparksSmall", random(5,-5), random(5,-5), random(5,-5), 0, 0, 0, 0, 128, 0) 
		TNT1 A 0 A_CustomMissile("BlueFlareSpawn",0,0,0,0)
		TNT1 A 0 A_CustomMissile ("Icetracer", 0, 0, random (0, 360), 2, random (0, 360))
	Goto Death
	
	Death:		
		BXPL A 0 Bright A_StopSound(CHAN_BODY)
		BXPL A 0 Bright A_ChangeFlag("ICEDAMAGE", 1)
		BXPL A 0 Bright A_ChangeFlag("NODAMAGETHRUST", 0)
		//BXPL A 0 Bright A_Explode(5*random(2,3),10, 0)   
		BXPL AAAAAAAAAAA 0 Bright A_SpawnItemEx("CryoSmoke", 0, 0, 0, random(10, 30)*0.1, 0, random(0, 10)*0.1, random(1,360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		BXPL AAAAA 0 Bright A_SpawnItemEx("CryoSmoke3", 0, 0, 0, random(10, 30)*0.04, 0, random(0, 10)*0.04, random(1,360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION,64)
		BXPL AAAAAAA 0 Bright A_SpawnItemEx("FreezerTrailSparksSmall", random(5,-5), random(5,-5), random(5,-5), random(10, 30)*0.04, 0, random(0, 10)*0.04, random(1,360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION,64)
		BXPL AAAAAAA 0 Bright A_SpawnItemEx("CryoSmoke2", 0, 0, 0, random(10, 30)*0.04, 0, random(0, 10)*0.04, random(1,360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION,64)
		BXPL ABCDEFGH 1 Bright
		BXPL IJKLLM 1 Bright A_FadeOut(0.1)
	Stop
	
	}
}


ACTOR CryoSmoke
{
    Radius 2
    Height 2
    +NOINTERACTION
    +FORCEXYBILLBOARD
    RenderStyle Shaded
    StencilColor "A0 FF FF"
    Alpha 0.8
    Scale 0.85
    States
    {
    Spawn:
		SMKO A 0
        SMK2 A 2 A_FadeOut (0.05)
        Wait
    }
}

Actor CryoSmoke2 : CryoSmoke { StencilColor "DD DD DD" Scale 0.7 Alpha 0.5 VSpeed 2.5
	States {
	Spawn:
		TNT1 A 0
		SMK2 A 6 A_FadeOut(0.04)
		Wait
	}
}

Actor CryoSmoke3 : CryoSmoke { StencilColor "AA FF FF" Scale 0.7 Alpha 0.4 VSpeed 2.25
	States {
	Spawn:
		TNT1 A 0
		TNT1 A 0 A_PlaySound("Weapons/FreezerRecharge")
		SMK2 A 6 A_FadeOut(0.04)
		Wait
	}
}

Actor MiniCryoSmoke1 : CryoSmoke { StencilColor "AA FF FF" Scale 0.7 Alpha 0.4 VSpeed 2.25
	Scale 0.25
	States {
	Spawn:
		TNT1 A 0
		TNT1 A 0 A_PlaySound("Weapons/FreezerRecharge")
		SMK2 A 6 A_FadeOut(0.04)
		Wait
	}
}

Actor IceTracer
{
  Height 0
  Radius 0
  Mass 0
  +Missile
  +NoBlockMap
 // -NoGravity
  +LowGravity
  +DontSplash
  +DoomBounce
  +FORCEXYBILLBOARD
  BounceFactor 0.2
  Gravity 0.1
  RenderStyle Add
  StencilColor "A0 FF FF"
  Scale 1
  //Speed 2
  Speed 0
  -DOOMBOUNCE
  RenderStyle Add
  Alpha 1
  States
  {
  Spawn:
  Death:
    SHEX AABBCCDDEE 1 Bright A_FadeOut(0.04)
    Stop
  }
}

ACTOR CryoShot : FastProjectile
{
	Radius 4
	Height 8
	Speed 125
	Damage 10
	Damagetype "Freeze"
	Projectile
	RenderStyle Add
	Alpha 0.9
	+FORCERADIUSDMG
	+NODAMAGETHRUST
	+NoExtremeDeath
	DeathSound "weapons/cryobowhit"
	MissileType "CryoTrail"
	MissileHeight 8
	Decal "IceScorch"
	States
	{
	Spawn:
		BSHT A 0 Bright A_SpawnItemEx("FreezerTrailSparksSmall", random(3,-3), 0, random(3,-3), 0, 0, 0, 0, 128, 0) 
		BSHT A 1 Bright A_SpawnItem("PlasmaFlare",0,0)
		TNT1 A 0 A_CustomMissile("BlueFlareSpawn",0,0,0,0)
		Loop
	Death:	

		BXPL A 0 Bright A_StopSound(CHAN_BODY)
		BXPL A 0 Bright A_ChangeFlag("ICEDAMAGE", 1)
		BXPL A 0 Bright A_ChangeFlag("NODAMAGETHRUST", 0)
		//BXPL A 0 Bright A_Explode(7, 8, 0) 
		//BXPL A 0 Bright A_Explode(14, 16, 0)
		BXPL AAA 0 Bright A_SpawnItemEx("MiniCryoSmoke1", 0, 0, 0, random(10, 30)*0.1, 0, random(0, 10)*0.1, random(1,360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		BXPL AA 0 Bright A_SpawnItemEx("FreezerTrailSparksSmall", random(5,-5), 0, random(5,-5), random(10, 30)*0.04, 0, random(0, 10)*0.04, random(1,360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION,64)
		BXPL A 0 Bright A_SpawnItemEx("MiniCryoSmoke1", 0, 0, 0, random(10, 30)*0.04, 0, random(0, 10)*0.04, random(1,360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION,64)
		BXPL ABCDEFGH 1 Bright
		BXPL IJKLLM 1 Bright A_FadeOut(0.1)
		Stop
	}
}

ACTOR CryoTrail
{
	+NOINTERACTION
	Radius 4
	Height 8
	Renderstyle Add
	Alpha 0.5
	States
	{
	Spawn:
		BSHT AABBCDEFG 1 Bright
		Stop
	}
}


ACTOR FreezerTrailSparksSmall
{ 
    RenderStyle Add
    Scale 0.008
    Alpha 0.95
    +NOINTERACTION
    +NOGRAVITY
    +CLIENTSIDEONLY
    States
    {
    Spawn:
	YA36 B 0 NoDelay A_JumpIf(ScaleX <= 0, "NULL")
	YA36 B 0 A_SetScale(ScaleX-0.00075)
    YA36 B 3 bright A_ChangeVelocity (frandom(-0.8, 0.8), frandom(-0.8, 0.8), frandom(-0.8, 0.8), 0)
    YA36 B 1 bright A_FadeOut(0.05)
    Loop
    }
}

ACTOR Freezebot : Actor
{
	Game Doom
	Health 1000000
	Radius 16
	Height 32
	Mass 50
	Speed 5
	DeathHeight 4
	VSpeed 2
	FloatSpeed 3
	BurnHeight 0
	/*
	PainChance 255
	PainChance "Kick", 255
	damagefactor "GibRemoving", 0.0 damagefactor "HangingHook", 0
	PainChance "Avoid", 255
	damagefactor "Fire", 0 damagefactor "sAW", 4.0 damagefactor "Cut", 4.0
	*/
	Monster
	Species "Marines"
    +NOBLOOD
	damagefactor "Blood", 0.0 damagefactor "BlueBlood", 0.0 damagefactor "GreenBlood", 0.0
    damagefactor "Fatality", 5.0 damagefactor "PussyGrab", 50.0
	damagefactor "TeleportRemover", 0.0
	DamageFactor "CauseSplash", 0.0 DamageFactor "CauseObjectsToSplashSlime", 0.0 DamageFactor "CauseObjectsToSplashNukage", 0.0
	DamageFactor "CauseObjectsToSplashBlood", 0.0 DamageFactor "CauseObjectsToSplashLava", 0.0
	RenderStyle Normal
    bloodcolor none
	+FLOAT +NOGRAVITY +DONTFALL -NOICEDEATH +FLOATBOB
	+FORCEXYBILLBOARD
	
	-SHOOTABLE
	+INVULNERABLE
	+NODAMAGE
	-NORADIUSDMG
	+QUICKTORETALIATE
    +FIXMAPTHINGPOS 
	+LOOKALLAROUND
    +PUSHABLE
	+SLIDESONWALLS
	+CANNOTPUSH
	-COUNTKILL
	+DONTSPLASH
	+FIXMAPTHINGPOS
	+NORADIUSDMG
	+USESPECIAL
	+MTHRUSPECIES
	+THRUSPECIES
	+NOTAUTOAIMED
	+NOBLOCKMONST
 
	Activation THINGSPEC_Activate
	
	damagefactor "ExplosiveImpact", 3.0
	damagefactor "Shrapnel", 3.0
	damagefactor "Explosives", 3.0
	DeathSound "Explosion"
	Tag "Freezebot"
    Scale 0.8
	AttackSound "none"
	//MaxStepHeight 52
	//MaxDropOffHeight 52
	ActiveSound "none"
	damagefactor "Cut", 0.1
	damagefactor "FriendBullet", 0.0
    damagefactor "Blood", 0.0    damagefactor "GreenBlood", 0.0    damagefactor "BlueBlood", 0.0    damagefactor "Taunt", 0.0    damagefactor "KillMe", 0.0
    damagefactor "Blood", 0.0 damagefactor "BlueBlood", 0.0 damagefactor "GreenBlood", 0.0
    damagefactor "Shrapnel", 0.0
	damagefactor "SpawnMarine", 0.0
	DropItem "AmmoCell"
	//damagefactor "HelperMarineFatallity", 0.0
	SeeSound "None"
	Obituary "%o has been frozen down by a FreezeBot."
	Mass 50
	States
	{
	
	Active:
		FZB1 A 0
		TNT1 A 0 A_PlaySound("BEEEP", 2)
		FZB1 A 3
		TNT1 A 0 A_SpawnItemEx ("BlueFlareMedium", 0, 0, -5)
		TNT1 AAAA 0 A_SpawnItemEx("MiniCryoSmoke1", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.3, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		TNT1 AAAA 0 A_SpawnItemEx("FreezerTrailSparksSmall", 0, 0, -5, random(10, 30)*0.1, 0, random(0, 10)*0.1, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		FZB1 B 3
		FZB1 C 3
		FZB1 D 3
		FZB1 A 3
		TNT1 A 0 A_SpawnItemEx ("BlueFlareMedium", 0, 0, -5)
		TNT1 AAAA 0 A_SpawnItemEx("MiniCryoSmoke1", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.3, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		TNT1 AAAA 0 A_SpawnItemEx("FreezerTrailSparksSmall", 0, 0, -5, random(10, 30)*0.1, 0, random(0, 10)*0.1, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		FZB1 B 3
		TNT1 A 0 A_SpawnItemEx ("FreezebotAmmo")
		Stop
	
	Spawn:
		FZB1 A 0
		FZB1 A 0 A_PlaySound("FRZIDLE", 6,0.2,1)
		TNT1 A 0 A_GiveInventory("TargetIsAMarine")
		FZB1 A 2 BRIGHT A_Look
		TNT1 A 0 A_SpawnItemEx ("BlueFlareMedium", 0, 0, -5)
		//FZB1 A 0 A_ChangeVelocity(0 ,0 ,5)
		TNT1 AAAA 0 A_SpawnItemEx("MiniCryoSmoke1", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.3, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		TNT1 AAAA 0 A_SpawnItemEx("FreezerTrailSparksSmall", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*3, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		
		Goto See
		
	ForgetTarget:
		TNT1 A 0 A_ClearTarget
		Goto See
	
	See:
		TNT1 A 0 A_SpawnItemEx ("BlueFlareMedium", 0, 0, -5)
		TNT1 AAAA 0 A_SpawnItemEx("MiniCryoSmoke1", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.3, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		TNT1 AAAA 0 A_SpawnItemEx("FreezerTrailSparksSmall", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.3, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		TNT1 A 0 A_ChangeFlag("NODROPOFF", 0)	
		TNT1 A 0 A_ChangeFLag("FRIENDLY", 1)
		TNT1 A 0 A_JumpIfInTargetInventory("TargetIsAMarine", 1, "FollowPLayer")//
		TNT1 A 0 A_ChangeFlag("MISSILEMORE", 1)
		TNT1 A 0 A_ChangeFlag("MISSILEEVENMORE", 1)
		TNT1 A 0 A_Recoil(-1)
		TNT1 A 0 A_JumpIfInTargetInventory("TargetIsAMarine", 1, "FollowPLayer")//
		FZB1 AA 1 A_Chase
		TNT1 A 0 A_SpawnItemEx ("BlueFlareMedium", 0, 0, -5)
		TNT1 AAAA 0 A_SpawnItemEx("MiniCryoSmoke1", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.2, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		TNT1 AAAA 0 A_SpawnItemEx("FreezerTrailSparksSmall", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.2, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		TNT1 A 0 A_ChangeFlag("FASTER", 0)
		TNT1 A 0 A_Recoil(-1)
		TNT1 A 0 A_JumpIfInTargetInventory("TargetIsAMarine", 1, "FollowPLayer")//
		FZB1 BB 1 A_Chase
		TNT1 A 0 A_Recoil(-1)
		TNT1 A 0 A_JumpIfInTargetInventory("TargetIsAMarine", 1, "FollowPLayer")//
		FZB1 BB 1 A_Chase
		TNT1 A 0 A_SpawnItemEx ("BlueFlareMedium", 0, 0, -5)
		TNT1 AAAA 0 A_SpawnItemEx("MiniCryoSmoke1", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.2, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		TNT1 AAAA 0 A_SpawnItemEx("FreezerTrailSparksSmall", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.2, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		TNT1 A 0 A_ChangeFLag("FRIENDLY", 0)
		TNT1 A 0 A_Recoil(-1)
		TNT1 A 0 A_JumpIfInTargetInventory("TargetIsAMarine", 1, "FollowPLayer")//
		FZB1 CC 1 A_Chase
		TNT1 A 0 A_ChangeFLag("FRIENDLY", 1)
		TNT1 A 0 A_Recoil(-1)
		TNT1 A 0 A_JumpIfInTargetInventory("TargetIsAMarine", 1, "FollowPLayer")//
		FZB1 CC 1 A_Chase
		TNT1 A 0 A_SpawnItemEx ("BlueFlareMedium", 0, 0, -5)
		TNT1 AAAA 0 A_SpawnItemEx("MiniCryoSmoke1", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.3, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		TNT1 AAAA 0 A_SpawnItemEx("FreezerTrailSparksSmall", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.3, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		TNT1 A 0 A_Recoil(-1)
		TNT1 A 0 A_JumpIfInTargetInventory("TargetIsAMarine", 1, "FollowPLayer")//
		FZB1 DD 1 A_Chase
		TNT1 A 0 A_Recoil(-1)
		TNT1 A 0 A_JumpIfInTargetInventory("TargetIsAMarine", 1, "FollowPLayer")//
		FZB1 DD 1 A_Chase
		TNT1 A 0 A_SpawnItemEx ("BlueFlareMedium", 0, 0, -5)
		TNT1 AAAA 0 A_SpawnItemEx("MiniCryoSmoke1", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.3, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		TNT1 AAAA 0 A_SpawnItemEx("FreezerTrailSparksSmall", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.3, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		TNT1 A 0 A_Recoil(-1)
		TNT1 A 0 A_CheckSight("ForgetTarget")
		TNT1 A 0 A_JumpIfInTargetInventory("TargetIsAMarine", 1, "FollowPLayer")//
		TNT1 A 0 A_CheckSight("FollowPLayer")
		TNT1 A 0 A_ChangeFLag("FRIENDLY", 0)
		TNT1 A 0 A_ChangeFlag("SHOOTABLE", 0)
		
		FZB1 AA 1 A_Chase
		TNT1 A 0 A_Recoil(-1)
		TNT1 A 0 A_JumpIfCloser(200, "Waits")
		TNT1 A 0 A_CheckSight("CheckIfPlayerSee")
		TNT1 A 0 A_SpawnItemEx ("BlueFlareMedium", 0, 0, -5)
		TNT1 AAAA 0 A_SpawnItemEx("MiniCryoSmoke1", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.1, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		TNT1 AAAA 0 A_SpawnItemEx("FreezerTrailSparksSmall", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.1, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		
		FZB1 BB 1 A_Chase
		TNT1 A 0 A_Recoil(-1)
		TNT1 A 0 A_JumpIfInTargetInventory("IsPlayer", 1, "FollowPlayer")
		TNT1 A 0 A_JumpIfCloser(200, "Waits")
		TNT1 A 0 A_CheckSight("CheckIfPlayerSee")
		TNT1 A 0 A_SpawnItemEx ("BlueFlareMedium", 0, 0, -5)
		TNT1 AAAA 0 A_SpawnItemEx("MiniCryoSmoke1", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.3, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		TNT1 AAAA 0 A_SpawnItemEx("FreezerTrailSparksSmall", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.2, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		
		FZB1 CC 1 A_Chase
		TNT1 A 0 A_Recoil(-1)
		TNT1 A 0 A_JumpIfInTargetInventory("IsPlayer", 1, "FollowPlayer")
		TNT1 A 0 A_JumpIfCloser(200, "Waits")
		TNT1 A 0 A_CheckSight("CheckIfPlayerSee")
		TNT1 A 0 A_SpawnItemEx ("BlueFlareMedium", 0, 0, -5)
		TNT1 AAAA 0 A_SpawnItemEx("MiniCryoSmoke1", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.3, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		TNT1 AAAA 0 A_SpawnItemEx("FreezerTrailSparksSmall", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.3, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		
		FZB1 DD 1 A_Chase
		TNT1 A 0 A_Recoil(-1)
		
		TNT1 A 0 A_JumpIfInTargetInventory("IsPlayer", 1, "FollowPlayer")
		TNT1 A 0 A_JumpIfCloser(200, "Waits")
		TNT1 A 0 A_CheckSight("CheckIfPlayerSee")
		TNT1 A 0 A_SpawnItemEx ("BlueFlareMedium", 0, 0, -5)
		TNT1 AAAA 0 A_SpawnItemEx("MiniCryoSmoke1", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.1, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		TNT1 AAAA 0 A_SpawnItemEx("FreezerTrailSparksSmall", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.3, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		
		
		TNT1 A 0 A_JumpIfCloser(200, "Waits")
		TNT1 A 0 A_JumpIfInTargetInventory("IsPlayer", 1, "FollowPlayer")
		Goto See
	
	BecomeEnemy23:
		FZB1 A 1
		TNT1 A 0 A_ClearTarget
		TNT1 A 0 A_ChangeFlag("SHOOTABLE", 0)
		TNT1 A 0 A_ChangeFLag("FRIENDLY", 0)
		Goto FollowPlayer	
	
	FollowPlayer:
		TNT1 A 0 A_SpawnItemEx ("BlueFlareMedium", 0, 0, -5)
		TNT1 A 0 A_SpawnItemEx("MiniCryoSmoke1", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.3, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		TNT1 A 0 A_SpawnItemEx("FreezerTrailSparksSmall", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.3, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		
	    TNT1 A 0 A_ChangeFlag("FRIENDLY", 0)
		//TNT1 A 0 A_ChangeFlag("FASTER", 1)
		TNT1 A 0 A_ChangeFlag("SHOOTABLE", 0)
	    TNT1 A 0 A_JumpIfCloser(100, "Waits")
		TNT1 A 0 A_ChangeFlag("MISSILEMORE", 0)
		TNT1 A 0 A_ChangeFlag("MISSILEEVENMORE", 0)
		FZB1 A 1 A_Chase
		TNT1 A 0 A_Recoil(-1)
		TNT1 A 0 A_Recoil(-1)
		FZB1 AA 1 A_Chase
		TNT1 A 0 A_Recoil(-1)
		FZB1 BB 1 A_Chase
		TNT1 A 0 A_Recoil(-1)
		FZB1 BB 1 A_Chase
		TNT1 AAAA 0 A_SpawnItemEx("MiniCryoSmoke1", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.2, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		TNT1 AAAA 0 A_SpawnItemEx("FreezerTrailSparksSmall", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.2, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		TNT1 A 0 A_Recoil(-1)
		FZB1 CC 1 A_Chase
		TNT1 A 0 A_Recoil(-1)
		FZB1 CC 1 A_Chase
		TNT1 A 0 A_Recoil(-1)
		FZB1 DD 1 A_Chase
		TNT1 A 0 A_Recoil(-1)
		FZB1 DD 1 A_Chase
		TNT1 A 0 A_Recoil(-1)
		TNT1 A 0 A_SpawnItemEx ("BlueFlareMedium", 0, 0, -5)
		TNT1 AAAA 0 A_SpawnItemEx("MiniCryoSmoke1", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.3, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		TNT1 AAAA 0 A_SpawnItemEx("FreezerTrailSparksSmall", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.3, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		
		FZB1 AA 1 A_Chase
		TNT1 A 0 A_Recoil(-1)
		FZB1 BB 1 A_Chase
		TNT1 A 0 A_Recoil(-1)
		FZB1 BB 1 A_Chase
		TNT1 A 0 A_Recoil(-1)
		FZB1 CC 1 A_Chase
		TNT1 A 0 A_CheckSight("CheckIfPlayerSee")
		TNT1 AAAA 0 A_SpawnItemEx("MiniCryoSmoke1", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.2, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		TNT1 AAAA 0 A_SpawnItemEx("FreezerTrailSparksSmall", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.2, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		TNT1 A 0 A_Recoil(-1)
		FZB1 CC 1 A_Chase
		TNT1 A 0 A_Recoil(-1)
		FZB1 DD 1 A_Chase
		TNT1 A 0 A_Recoil(-1)
		FZB1 DD 1 A_Chase
		TNT1 A 0 A_Recoil(-1)
		TNT1 A 0 A_SpawnItemEx ("BlueFlareMedium", 0, 0, -5)
		TNT1 AAAA 0 A_SpawnItemEx("MiniCryoSmoke1", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.3, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		TNT1 AAAA 0 A_SpawnItemEx("FreezerTrailSparksSmall", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.3, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		
		TNT1 A 0 A_ChangeFlag("FRIENDLY", 1)
		TNT1 A 0 A_JumpIfTargetInLOS("See")
		TNT1 A 0 A_ChangeFlag("FRIENDLY", 0)
		
		
		TNT1 A 0 A_CheckSight("CheckIfPlayerSee")
		Loop
	
	CheckRangeToWait:
		TNT1 A 0
		TNT1 A 0 A_JumpIfCloser(100, "Waits")
		Goto FollowPLayer
	
	CheckIfPlayerSee:
		TNT1 A 0
		FZB1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_FastChase
		TNT1 A 0 A_ChangeFlag("SHOOTABLE", 0)
		TNT1 A 0 A_ChangeFLag("FRIENDLY", 0)
		////TNT1 A 0 Thing_Hate(94, 0, 0)
		TNT1 A 0 A_JumpIfCloser(600, 2)
		Goto Pathfind
		TNT1 AAA 0
		Goto FollowPlayer
	
	
	
	Pathfind:
		TNT1 A 0
		TNT1 A 0 A_ChangeFLag("FRIENDLY", 0)
		TNT1 A 0 A_JumpIFInTargetInventory("IsPLayer", 1, 1)
		Goto FollowPLayer
		//TNT1 A 1 A_Chase("", "")
		TNT1 A 0 A_ChangeFlag("SHOOTABLE", 0)
		TNT1 A 0 A_ChangeFlag("NOBLOCKMAP", 1)
		TNT1 A 0 A_ChangeFlag("NOCLIP", 1)
		TNT1 A 0 A_ChangeFlag("SOLID", 0)
		TNT1 A 0 A_Noblocking
		TNT1 A 0 A_SpawnItemEx ("FreezebotPathfinder",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
		Stop
	
	
	
	Waits:
		TNT1 A 0 A_SpawnItemEx ("BlueFlareMedium", 0, 0, -5)
		TNT1 AAAA 0 A_SpawnItemEx("MiniCryoSmoke1", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.2, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		TNT1 AAAA 0 A_SpawnItemEx("FreezerTrailSparksSmall", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.3, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		
		FZB1 B 1
		TNT1 A 0 A_JumpIfInTargetInventory("IsPlayer", 1, 2)
		TNT1 A 0 A_ClearTarget
		Goto See
		TNT1 A 0 A_ChangeFlag("FRIENDLY", 0)
		TNT1 A 0 A_ChangeFlag("MISSILEMORE", 1)
		TNT1 A 0 A_ChangeFlag("MISSILEEVENMORE", 1)
		TNT1 A 0 A_ChangeFlag("SHOOTABLE", 0)
		TNT1 A 0 A_ChangeFlag("SOLID", 0)
		TNT1 A 0 A_JumpIfInTargetInventory("TargetIsAMarine", 1, "BecomeEnemy23")
		TNT1 A 0 A_Jump(32, "Waits2")
		TNT1 A 0 A_Jump(32, "Waits3")
		
		FZB1 A 8 A_Stop 
		TNT1 A 0 A_SpawnItemEx ("BlueFlareMedium", 0, 0, -5)
		TNT1 AAAA 0 A_SpawnItemEx("MiniCryoSmoke1", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.2, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		TNT1 AAAA 0 A_SpawnItemEx("FreezerTrailSparksSmall", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.2, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		
		FZB1 B 8 A_Stop
		TNT1 AAAA 0 A_SpawnItemEx("MiniCryoSmoke1", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.2, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		TNT1 AAAA 0 A_SpawnItemEx("FreezerTrailSparksSmall", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.2, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		TNT1 A 0 A_Stop
		TNT1 A 0 A_CheckSight("FollowPlayer")
		TNT1 A 0 A_ChangeFLag("FRIENDLY", 1)
		TNT1 A 0 A_ClearTarget
		
		TNT1 A 0 A_ChangeFlag("SHOOTABLE", 0)
		FZB1 C 8 A_Look
		TNT1 AAAA 0 A_SpawnItemEx("MiniCryoSmoke1", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.2, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		TNT1 AAAA 0 A_SpawnItemEx("FreezerTrailSparksSmall", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.2, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		TNT1 A 0 A_ChangeFLag("FRIENDLY", 0)
		TNT1 A 0 A_ChangeFlag("SHOOTABLE", 0)
		FZB1 D 7 A_LookEx(0, 0, 0, 0, 0, "FollowPlayer")
		TNT1 AAAA 0 A_SpawnItemEx("MiniCryoSmoke1", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.2, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		TNT1 AAAA 0 A_SpawnItemEx("FreezerTrailSparksSmall", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.2, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		TNT1 A 0 A_CheckSIght("FollowPlayer")
		TNT1 A 0 A_ChangeFlag("SHOOTABLE", 0)
		TNT1 A 0 A_JumpIfCloser(120, "Waits")
		Goto FollowPlayer
	
	Waits2:
		TNT1 A 0 A_SetAngle(random(90, -90) + angle)
		FZB1 D 8 A_Stop
		TNT1 AAAA 0 A_SpawnItemEx("MiniCryoSmoke1", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.2, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		TNT1 AAAA 0 A_SpawnItemEx("FreezerTrailSparksSmall", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.2, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		TNT1 A 0 A_PlaySound("BEPBEP", 2)
		FZB1 C 8 A_Stop
		TNT1 AAAA 0 A_SpawnItemEx("MiniCryoSmoke1", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.2, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		TNT1 AAAA 0 A_SpawnItemEx("FreezerTrailSparksSmall", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.2, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		TNT1 A 0 A_CheckSight("FollowPlayer")
		TNT1 A 0 A_ChangeFLag("FRIENDLY", 1)
		TNT1 A 0 A_ClearTarget
		
		TNT1 A 0 A_ChangeFlag("SHOOTABLE", 0)
		FZB1 D 0 A_Look
		TNT1 A 0 A_ChangeFLag("FRIENDLY", 0)
		TNT1 A 0 A_ChangeFlag("SHOOTABLE", 0)
		TNT1 AAAA 0 A_SpawnItemEx("MiniCryoSmoke1", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.2, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		TNT1 AAAA 0 A_SpawnItemEx("FreezerTrailSparksSmall", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.2, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		FZB1 D 1 A_LookEx(0, 0, 0, 0, 0, "FollowPlayer")
		TNT1 A 0 A_CheckSIght("FollowPlayer")
		TNT1 A 0 A_ChangeFlag("SHOOTABLE", 0)
		TNT1 A 0 A_JumpIfCloser(200, "Waits")
		Goto FollowPLayer
	
	Waits3:
		TNT1 A 0
		TNT1 AAA 0
		TNT1 A 0 A_SetAngle(random(90, -90) + angle)
		FZB1 D 8 A_Stop
		TNT1 AAAA 0 A_SpawnItemEx("MiniCryoSmoke1", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.2, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		TNT1 AAAA 0 A_SpawnItemEx("FreezerTrailSparksSmall", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.2, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		TNT1 A 0 A_PlaySound("BEPBEP", 2)
		FZB1 C 8 A_Stop
		TNT1 AAAA 0 A_SpawnItemEx("MiniCryoSmoke1", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.2, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		TNT1 AAAA 0 A_SpawnItemEx("FreezerTrailSparksSmall", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.2, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		TNT1 A 0 A_CheckSight("FollowPlayer")
		TNT1 A 0 A_ChangeFLag("FRIENDLY", 1)
		TNT1 A 0 A_ClearTarget
		
		TNT1 A 0 A_ChangeFlag("SHOOTABLE", 0)
		FZB1 D 0 A_Look
		TNT1 A 0 A_ChangeFLag("FRIENDLY", 0)
		TNT1 A 0 A_ChangeFlag("SHOOTABLE", 0)
		FZB1 D 1 A_LookEx(0, 0, 0, 0, 0, "FollowPlayer")
		TNT1 AAAA 0 A_SpawnItemEx("MiniCryoSmoke1", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.2, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		TNT1 AAAA 0 A_SpawnItemEx("FreezerTrailSparksSmall", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.2, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		TNT1 A 0 A_CheckSIght("FollowPlayer")
		TNT1 A 0 A_ChangeFlag("SHOOTABLE", 0)
		TNT1 A 0 A_JumpIfCloser(200, "Waits")
		Goto FollowPLayer
	
	Missile:
		TNT1 A 0 A_ChangeFlag("NODROPOFF", 1)
		TNT1 A 0 A_SpawnItem("KillMeSmall")
		//TNT1 A 0 A_JumpIfInTargetInventory("TargetIsACyberdemon", 1, "CheckRetreat")
		//TNT1 A 0 A_JumpIfInTargetInventory("TargetIsAMastermind", 1, "CheckRetreat")
		//TNT1 A 0 A_JumpIfInTargetInventory("TargetIsABaronOfHell", 1, "CheckRetreat")
		//TNT1 A 0 A_JumpIfInTargetInventory("TargetIsAMancubus", 1, "CheckRetreat")
		TNT1 A 0 A_JumpIfInTargetInventory("TargetIsAMarine", 1, "FollowPLayer")//
		TNT1 A 0 A_JumpIfInTargetInventory("IsPlayer", 1, "CheckRangeToWait")
		TNT1 A 0 A_ChangeFlag("SHOOTABLE", 0)
		//TNT1 A 0 A_ChangeFlag("SOLID", 0)
		//TNT1 A 0 A_JumpIfCloser(60, "MeleeAttack")
		//TNT1 A 0 A_JumpIfCloser(200, "Retreat")
		TNT1 A 0 A_PlaySound("BEP", 2)
		FZB1 A 0 BRIGHT A_SpawnItem ("BlueFlare", 0, 24)
		TNT1 A 0 A_ChangeFlag("NOPAIN", 1)
		FZB1 A 4 BRIGHT A_FaceTarget
		FR1D A 0 A_Giveinventory("HasFreezerWeapon",1)
		FZB1 E 4 BRIGHT A_SpawnItem ("BlueFlare", 0, 24)
		TNT1 A 0 A_Playsound ("FRZFIRE2")
        TNT1 A 0 A_CustomMissile ("CryoShot", 17, 0, 0, 0) 
		TNT1 A 0 A_CustomMissile ("IceTracer", 17, 0, 0, 0) 
		FZB1 FF 2 BRIGHT A_SpawnItem ("BlueFlareMEdium", 0, 24)
		FZB1 AA 2 BRIGHT A_SpawnItem ("BlueFlareMEdium", 0, 24)
		TNT1 AAAA 0 A_SpawnItemEx("MiniCryoSmoke1", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.2, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		TNT1 AAAA 0 A_SpawnItemEx("FreezerTrailSparksSmall", 0, 0, -5, random(10, 30)*0.1, 0, random(0, -10)*0.2, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		FR1D A 0 A_Takeinventory("HasFreezerWeapon",1)
		TNT1 A 0 A_JumpIfInventory("MaxLostSoulRange", 10, "See")
		TNT1 A 0 A_giveInventory("MaxLostSoulRange", 1)
		Goto See
			
	
	Pain:
        TNT1 AAA 0 A_CustomMissile ("SoulTrails", 12, 0, random (0, 360), 2, random (0, 160))
		FZB1 A 3 BRIGHT
        TNT1 A 0 A_Jump (128, 3)
        Goto Avoid
        TNT1 AAA 0
        TNT1 AAA 0 A_CustomMissile ("SoulTrails", 12, 0, random (0, 360), 2, random (0, 160))
		FZB1 A 1 BRIGHT A_Pain
		Goto FollowPlayer

	Avoid:
         NULL A 0 A_FaceTarget
         FZB1 A 6 A_FastChase
       //FZB1 AA 0 A_CustomMissile ("SoulTrails", 24, 0, random (0, 360), 2, random (0, 160))
		FZB1 A 0 BRIGHT A_SpawnItem ("BlueFlareMedium", 0, 24)

         NULL A 0 A_FaceTarget
         FZB1 A 6 BRIGHT A_FastChase
       //FZB1 AA 0 A_CustomMissile ("SoulTrails", 24, 0, random (0, 360), 2, random (0, 160))
		FZB1 A 0 BRIGHT A_SpawnItem ("BlueFlareMedium", 0, 24)

         NULL A 0 A_FaceTarget
         FZB1 A 6 BRIGHT A_FastChase
       //FZB1 AA 0 A_CustomMissile ("SoulTrails", 24, 0, random (0, 360), 2, random (0, 160))
		FZB1 A 0 BRIGHT A_SpawnItem ("BlueFlareMedium", 0, 24)

         NULL A 0 A_FaceTarget
         FZB1 A 6 BRIGHT A_FastChase
       //FZB1 AA 0 A_CustomMissile ("SoulTrails", 24, 0, random (0, 360), 2, random (0, 160))
		FZB1 A 0 BRIGHT A_SpawnItem ("BlueFlareMedium", 0, 24)

		Goto Missile

	Death:
		FZB1 A 4 BRIGHT A_NoBlocking
		TNT1 AAAA 0 A_CustomMissile ("XJunk1", 0, 0, random (0, 360), 2, random (0, 360))
		TNT1 AAAA 0 A_CustomMissile ("XJunk2", 0, 0, random (0, 360), 2, random (0, 360))
        TNT1 AAA 0 A_CustomMissile ("CoolAndNewFlameTrailsLong", 12, 0, random (0, 360), 2, random (0, 160))
		FZB1 A 0 BRIGHT A_Scream
	    EXPL AA 0 A_SpawnItem("ExplosionParticleSpawner")
	    TNT1 A 0 A_SpawnItemEx ("ExplosionFlareSpawner",0,0,32,0,0,0,0,SXF_NOCHECKPOSITION,0)
	    EXPL AAAAA 0 A_CustomMissile ("FireBallExplosionFlamesMedium", 32, 0, random (0, 360), 2, random (0, 360))
		TNT1 AAAA 0 A_CustomMissile ("PlasmaSmoke", 32, 0, random (0, 360), 2, random (0, 360))
       TNT1 AAA 0 A_CustomMissile ("XJunk3", 42, 0, random (0, 360), 2, random (0, 160))
       TNT1 A 0 A_CustomMissile ("XJunk5", 42, 0, random (0, 360), 2, random (0, 160))
       TNT1 AA 0 A_CustomMissile ("XJunk4", 42, 0, random (0, 360), 2, random (0, 160))
		TNT1 A 0
        FZB1 HI 0
		Stop
	}
}

ACTOR FreezebotPathfinder
{
	Radius 32
	Height 56
	Speed 20
	Health 4000
	PainChance 255
	MaxTargetRange 150
	Monster
	damagefactor "SpawnMarine", 8000.0
	MaxDropOffHeight 1200
	MaxStepHeight 1200
	-COUNTKILL
	+NOTARGET
	+THRUACTORS
	+MISSILEMORE
	+MISSILEEVENMORE
	+FASTER
    +DONTSPLASH
	-SHOOTABLE
	-FRIENDLY
	+NOCLIP
	+LOOKALLAROUND
	+NOINFIGHTING
	States
	{
	Spawn:
	Pain:
    See:
		TNT1 A 0 A_ChangeFlag("FRIENDLY", 0)
		TNT1 A 0 A_ChangeFlag("NOCLIP", 1)
		//TNT1 A 0 Thing_ChangeTID(0,98)
		//TNT1 A 0 Thing_Hate(98, 0, 0)
		TNT1 A 0
		TNT1 A 0 A_GiveInventory("TargetIsAMarine", 1)
		TNT1 AAAAA 1 A_Chase
		//TNT1 A 0 Thing_Hate(98, 0, 0)
		TNT1 A 0
		TNT1 A 0 A_GiveInventory("TargetIsAMarine", 1)
		TNT1 A 1 A_FaceTarget
		Loop

	Missile:
	    TNT1 A 0
		TNT1 A 0 A_ChangeFlag("NOCLIP", 0)
	    TNT1 A 0 A_Recoil(-4)
		TNT1 A 1
		TNT1 A 0 A_JumpIf(momx == 0, "CheckAgain")
	SpawnMarine:	
		TNT1 A 0 A_Scream
		TNT1 A 0 A_NoBlocking
		TNT1 A 0 A_SpawnItem("CryoSmoke")
		TNT1 A 0 A_SpawnItemEx("Freezebot",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
		Stop
	CheckAgain:
		TNT1 A 0
		TNT1 A 0 A_JumpIF(momy == 0, "See")
		Goto SpawnMarine
	}
}


