//UACbot Decorate by Virute/Ben2k9
//some edits by Aenima

actor UACBot 22088
{
//$Category Monsters
  obituary "%o was cut down by a UAC Bot."
  health 2000
  radius 40
  height 110
  mass 3000
  speed 16
  painchance 0
  seesound "uacbsee"
  activesound "uacbact"
  DeathSound "world/barrelx"
  MONSTER
  //+NOBLOOD
  //+BOSS
  Bloodtype "BarrelPuff"
   +NOBLOODDECALS
  +FLOORCLIP
  +NORADIUSDMG
  +DONTMORPH
  +MISSILEMORE
  +FRIENDLY
  +standstill
  +lookallaround
  +dontdrain
damagefactor "RedPaint", 0
damagefactor "OrangePaint", 0
damagefactor "YellowPaint", 0
damagefactor "GreenPaint", 0
damagefactor "BluePaint", 0
damagefactor "PurplePaint", 0
damagefactor "WhitePaint", 0
damagefactor "BlackPaint", 0
  states
  {
  Spawn:
    UACB G 10 A_Look
    loop
  See:
    UACB A 3 A_Hoof
    UACB A 3 A_Chase
    UACB B 3 A_Metal
    UACB BCC 3 A_Chase
    UACB D 3 A_Hoof
    UACB D 3 A_Chase
    UACB E 3 A_Metal
    UACB EFF 3 A_Chase
    Goto Spawn
  Missile:
    UACB G 0 A_jump(136,"rockit")
  Minigun:
    TNT1 A 0 A_StopSoundEx("soundslot7")
    UACB A 1 A_FaceTarget
    TNT1 A 0 A_PlaySoundEx("weapons/minigunspin1", "soundslot7")
    UACB A 20 A_FaceTarget
    TNT1 A 0 A_PlaySoundEx("weapons/minigunspin3", "soundslot7",1)
    UACB A 2 A_FaceTarget
  Missile2:
	
    TNT1 A 0 A_PlaySoundEx("weapons/minigun", "Weapon")
    NULL A 0 A_SpawnItemEx ("MinigunEcho", 0,0,0, 0,0,0, 0, 160)
    //UACB G 2 bright A_CustomMissile ("TracerChain2", 55, random(-2,2), random(-4,4), CMF_OFFSETPITCH, random(-4,4))
	TNT1 A 0 A_CustomMissile ("TracerRound", 55, 0, random(-20,20)*0.1, CMF_OFFSETPITCH, random(-20,20)*0.1)
    UACB G 2 bright A_CustomBulletAttack(2, 2, 1, 3, "SSTBulletPuff1") //A_PosAttack 
    UACB G 0 bright A_CustomMissile ("BulletCasingSpawner", 55, 0, 0, 0, 0)

    TNT1 A 0 A_PlaySoundEx("weapons/minigun", "Weapon")
    NULL A 0 A_SpawnItemEx ("MinigunEcho", 0,0,0, 0,0,0, 0, 160)
    TNT1 A 0 A_CustomMissile ("TracerRound", 55, 0, random(-20,20)*0.1, CMF_OFFSETPITCH, random(-20,20)*0.1)
    UACB G 2 bright A_CustomBulletAttack(2, 2, 1, 3, "SSTBulletPuff1") //A_PosAttack 
    UACB G 0 bright A_CustomMissile ("BulletCasingSpawner", 55, 0, 0, 0, 0)
	
	UACB H 0 A_Jump(3,"MissileEnd")
    UACB H 0 A_MonsterRefire(10,"MissileEnd")
	Loop
  MissileEnd:
    TNT1 A 0 A_StopSoundEx("soundslot7")
    TNT1 A 0 A_PlaySoundEx("weapons/minigunspin2", "soundslot7")
    UACB A 6 A_FaceTarget
	Goto See
  RockIt:
    UACB G 6 A_facetarget
    UACB H 0 A_playsound("grenpop",CHAN_AUTO)
    UACB IJ 3 A_facetarget
    UACB K 0 A_playsound("grenfire")
    UACB K 6 bright A_custommissile("UACbotrocket",106,0,0)
    UACB G 6 A_facetarget
    UACB H 0 A_playsound("grenpop",CHAN_AUTO)
    UACB IJ 3 A_facetarget
    UACB K 0 A_playsound("grenfire")
    UACB K 6 bright A_custommissile("UACbotrocket",106,0,0)
    UACB JIG 3 A_facetarget
    goto see  
  Death:
    TNT1 A 0 A_StopSoundEx("soundslot7")
    UACD K 0 bright
	NULL A 0 A_SpawnItemEx ("PowEffectSpawner", random(-32,32), random(-32,32), 16, 0, 0, 0, 0, 160) 
    NULL A 0 A_SpawnItemEx ("RocketEcho", 0,0,0, 0,0,0, 0, 160)
	UACD K 4 bright A_Scream
    UACD L 4 bright 
    UACD MN 4 bright
    UACD O 4 A_NoBlocking
    UACD PQR 4
    UACD S 30
    NULL A 0 A_SpawnItemEx ("BarrelEcho", 0,0,0, 0,0,0, 0, 160)
    BEXP C 0 BRIGHT A_SpawnItemEx ("BarrelExplosion1", 0,0,0, 0,0,random(1,8), 0, 160) 
    BEXP C 0 BRIGHT A_SpawnItemEx ("BarrelExplosion2", 0,0,0, 0,0,random(1,4), 0, 160) 
    BEXP C 0 BRIGHT A_SpawnItemEx ("BarrelExplosion3", 0,0,0, 0,0,0, 0, 160) 
    BEXP C 0 BRIGHT A_SpawnItemEx ("BarrelEffectSpawner2", 0,0,2, 0,0,0, 0, 160) 
	UACD T 4 bright A_Scream 
	UACD UVW 4 bright
	UACD XYZAB 2
    UACD C -1 //A_BossDeath
  }
}


actor UACbotrocket : SSTRevenantTracer
{
  RENDERSTYLE TRANSLUCENT
  alpha 1.0
  scale 0.66
  Speed 30
  damage 20
  States
  {
  Spawn:
	FBXP A 0
    BMIS A 0 A_PlaySoundEx ("rocket/screech", soundslot6, 0)
  	NULL A 0 A_SpawnItemEx ("RocketSource", 0,0,0, 0,0,0, 0, 160)
  BoostedLoop:
    BMIS A 1 bright
	NULL A 0 A_CustomMissile("RocketSmokeTrail1", random(0,4), 0, 0, 2, momz*2)//A_SpawnItemEx ("RocketSmokeTrail1", 0, random(0,4), 0, 2, 0, 0, 0, SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_TRANSFERPITCH) //A_CustomMissile("RocketSmokeTrail1", 0, 0, 0, 2, pitch)
    BMIS A 1 bright
	NULL A 0 A_CustomMissile("RocketSmokeTrail1", 0, random(0,4), 0, 2, momz*2)//A_SpawnItemEx ("RocketSmokeTrail1", 0, 0, random(0,4), 2, 0, 0, 0, SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_TRANSFERPITCH) 
    BMIS A 1 bright
	NULL A 0 A_CustomMissile("RocketSmokeTrail1", random(-4,0), 0, 0, 2, momz*2)//A_SpawnItemEx ("RocketSmokeTrail1", 0, random(-4,0), 0, 2, 0, 0, 0, SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_TRANSFERPITCH) 
    BMIS A 1 bright
	NULL A 0 A_CustomMissile("RocketSmokeTrail1", 0, random(-4,0), 0, 2, momz*2)//A_SpawnItemEx ("RocketSmokeTrail1", 0, 0, random(-4,0), 2, 0, 0, 0, SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_TRANSFERPITCH) 
	
	TNT1 A 0 A_SetAngle(angle+random(-5,5))
	TNT1 A 0 A_SetPitch(pitch+random(-5,5))
	TNT1 A 0 A_ChangeVelocity(cos(pitch) * 30, 0, (-sin(pitch) * 30)+velz, CVF_RELATIVE|CVF_REPLACE)
    // THANKS TDRR for help with my maths!
	TNT1 A 0 A_CountDown
	loop
	
	
  Death:
	FBXP AA 0 A_StopsoundEx(soundslot6)
    FBXP A 1 bright A_Explode(100,128)
    NULL A 0 A_SpawnItemEx ("RocketEcho", 0,0,0, 0,0,0, 0, 160)
	NULL A 0 A_SpawnItemEx ("PowEffectSpawner", 0, 0, 0, 0, 0, 0, 0, 160) 
    FBXP A 5 bright
    FBXP B 4 bright
    FBXP C 2 bright
    stop
  }
}