ACTOR SSTCacolantern : Cacolantern replaces Cacolantern
{
damagefactor "RedPaint", 0.3
damagefactor "OrangePaint", 0.3
damagefactor "YellowPaint", 0.3
damagefactor "GreenPaint", 0.3
damagefactor "BluePaint", 0.3
damagefactor "PurplePaint", 0.3
damagefactor "WhitePaint", 0.3
damagefactor "BlackPaint", 0.3
  PainChance "ShotgunWeak", 20

  SpawnID 159
  Health 800
  SeeSound "Cacolantern/sight"
  Obituary "%o was burned by a cacolantern." // "%o was smitten by a cacolantern."
  HitObituary "$OB_CACOLANTERN_MELEE" // "%o got too close to a cacolantern."
bloodtype "PumpkinBlood"
BloodColor "EB 6F 0F"
	PainChance 80
  +MISSILEMORE
	+FORCEXYBILLBOARD
  States
  {

    Crush:
	TNT1 A 0 A_SpawnItemEx ("Gibs", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION|SXF_USEBLOODCOLOR|SXF_CLIENTSIDE)
	TNT1 AAAAAAAA 0 A_SpawnItemEx ("SuperDuperClientsideBloodSpotSpawner", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION|SXF_USEBLOODCOLOR|SXF_CLIENTSIDE)
    TNT1 AAAAAAAA 1 A_SpawnItemEx ("Bloodsquirt3", 0,0,0, 0,0,0, random(-180,180), SXF_USEBLOODCOLOR|SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
    TNT1 A -1
    Stop
  Spawn:
    HED2 A 10 A_Look
    Loop
  See:
    HED2 A 3 A_Chase
    Loop
  Pain:
    HED2 E 3
    HED2 E 3 A_Pain
    HED2 F 6
    Goto See
  Missile:
	HECT G 0 A_JumpIfCloser(176, "Flame")
  Fissile:
    HED2 BC 5 A_FaceTarget
    HED2 D 5 Bright A_BasicAttack (8, "None", "CacolanternBall", 32)
    Goto See
  Flame:
    HED2 A 0 A_JumpIf(waterlevel == 3, "Fissile")
    HED2 BC 2 A_FaceTarget
    HED2 DDD 1 Bright A_CustomMissile("CacoLanternFire", random(21,23), 0, random(-20,0))
    HED2 D 0 A_FaceTarget
    HED2 DDD 1 Bright A_CustomMissile("CacoLanternFire", random(21,23), 0, random(0,10))
    HED2 D 0 A_FaceTarget
    HED2 DDD 1 Bright A_CustomMissile("CacoLanternFire", random(21,23), 0, random(-10,0))
    HED2 D 0 A_FaceTarget
    HED2 DDD 1 Bright A_CustomMissile("CacoLanternFire", random(21,23), 0, random(0,20))
    HED2 D 0 A_FaceTarget
    HED2 CB 2 Bright
	Goto See
  Death.Plasma:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 10,0,0)
	NULL O 0 A_SpawnItemEx ("PlasmaDeathFX", 0,0,0, momx,momy,momz, 0, SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_ABSOLUTEMOMENTUM)
	goto Death
 Death:
   HED2 G 4 A_SetSolid
   HED2 G 4 //A_SetShootable
   HED2 H 8 A_Scream
 Falling:
   HED2 H 1
    HED2 H 0 A_JumpIf(waterlevel == 3, "Crash")
    HED2 H 0 A_JumpIf(waterlevel == 2, "Crash")
    //HED2 H 0 A_JumpIf(waterlevel == 1, "Crash")
   Loop
 Crash:
   HED2 I 4 A_PlaySound ("cacodemon/splat")
   HED2 J 4
   HED2 K 2 A_NoBlocking
   HED2 K 1 A_UnsetSolid
   HED2 K 1 A_UnSetShootable
   HED2 L 1 A_SetFloorClip
   HED2 M 5
   HED2 N 6
   HED2 O 7
   HED2 P 8
   HED2 Q -1
   stop
 Raise:
   HED2 L 8 A_UnSetFloorClip
   HED2 KJIHG 8
   goto See
  Pain.GreenPaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 0,0,0)
	Goto See
  Pain.BluePaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 1,0,0)
	Goto See
  Pain.RedPaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 2,0,0)
	Goto See
  Pain.OrangePaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 3,0,0)
	Goto See
  Pain.PurplePaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 4,0,0)
	Goto See
  Pain.WhitePaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 5,0,0)
	Goto See
  Pain.YellowPaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 6,0,0)
	Goto See
  Pain.BlackPaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 7,0,0)
	Goto See
  }
}

ACTOR SSTCacolanternBall : CacolanternBall replaces CacolanternBall
{
  SpawnID 219
  Radius 6
  Height 8
  Speed 20
  Damage 5
  Projectile
  +RANDOMIZE
	+FORCEXYBILLBOARD
  RenderStyle Add
  SeeSound "caco/attack"
  DeathSound "caco/shotx"
  damagetype "plasma"
  States
  {
  Spawn:
    BAL8 A 1 bright
	NULL AA 0 A_SpawnItemEx ("CacodemonBallTrail1", 0, random(-4,4), random(-4,4), velx/random(3,5), vely/random(3,5), velz/random(3,5), 0, SXF_ABSOLUTEVELOCITY|SXF_NOCHECKPOSITION|SXF_CLIENTSIDE) 
	NULL AA 0 A_SpawnItemEx ("CacoBallCrackleSpawner", 0, random(-1,1), random(-1,1), 0, 0, 0, 0, 160) 
    BAL8 A 1 bright
	NULL AA 0 A_SpawnItemEx ("CacodemonBallTrail2", 0, random(-4,4), random(-4,4), velx/random(3,5), vely/random(3,5), velz/random(3,5), 0, SXF_ABSOLUTEVELOCITY|SXF_NOCHECKPOSITION|SXF_CLIENTSIDE) 
	NULL AA 0 A_SpawnItemEx ("CacoBallCrackleSpawner", 0, random(-1,1), random(-1,1), 0, 0, 0, 0, 160) 
    BAL8 A 1 bright
	NULL AA 0 A_SpawnItemEx ("CacodemonBallTrail3", 0, random(-4,4), random(-4,4), velx/random(3,5), vely/random(3,5), velz/random(3,5), 0, SXF_ABSOLUTEVELOCITY|SXF_NOCHECKPOSITION|SXF_CLIENTSIDE) 
	NULL AA 0 A_SpawnItemEx ("CacoBallCrackleSpawner", 0, random(-1,1), random(-1,1), 0, 0, 0, 0, 160) 
    BAL8 A 1 bright
	NULL AA 0 A_SpawnItemEx ("CacodemonBallTrail4", 0, random(-4,4), random(-4,4), velx/random(3,5), vely/random(3,5), velz/random(3,5), 0, SXF_ABSOLUTEVELOCITY|SXF_NOCHECKPOSITION|SXF_CLIENTSIDE) 
	NULL AA 0 A_SpawnItemEx ("CacoBallCrackleSpawner", 0, random(-1,1), random(-1,1), 0, 0, 0, 0, 160) 
    BAL8 B 1 bright
	NULL AA 0 A_SpawnItemEx ("CacodemonBallTrail1", 0, random(-4,4), random(-4,4), velx/random(3,5), vely/random(3,5), velz/random(3,5), 0, SXF_ABSOLUTEVELOCITY|SXF_NOCHECKPOSITION|SXF_CLIENTSIDE) 
	NULL AA 0 A_SpawnItemEx ("CacoBallCrackleSpawner", 0, random(-1,1), random(-1,1), 0, 0, 0, 0, 160) 
    BAL8 B 1 bright
	NULL AA 0 A_SpawnItemEx ("CacodemonBallTrail2", 0, random(-4,4), random(-4,4), velx/random(3,5), vely/random(3,5), velz/random(3,5), 0, SXF_ABSOLUTEVELOCITY|SXF_NOCHECKPOSITION|SXF_CLIENTSIDE) 
	NULL AA 0 A_SpawnItemEx ("CacoBallCrackleSpawner", 0, random(-1,1), random(-1,1), 0, 0, 0, 0, 160) 
    BAL8 B 1 bright
	NULL AA 0 A_SpawnItemEx ("CacodemonBallTrail3", 0, random(-4,4), random(-4,4), velx/random(3,5), vely/random(3,5), velz/random(3,5), 0, SXF_ABSOLUTEVELOCITY|SXF_NOCHECKPOSITION|SXF_CLIENTSIDE) 
	NULL AA 0 A_SpawnItemEx ("CacoBallCrackleSpawner", 0, random(-1,1), random(-1,1), 0, 0, 0, 0, 160) 
    BAL8 B 1 bright
	NULL AA 0 A_SpawnItemEx ("CacodemonBallTrail4", 0, random(-4,4), random(-4,4), velx/random(3,5), vely/random(3,5), velz/random(3,5), 0, SXF_ABSOLUTEVELOCITY|SXF_NOCHECKPOSITION|SXF_CLIENTSIDE) 
	NULL AA 0 A_SpawnItemEx ("CacoBallCrackleSpawner", 0, random(-1,1), random(-1,1), 0, 0, 0, 0, 160) 
    loop
  Death:
	NULL A 0 A_SpawnItemEx ("BlueParticleShroom", 0,0,0, 0,0,0, 0, 160) 
    BAL8 CDE 6 Bright
    Stop
  }
}

actor CacoLanternFire
{
    PROJECTILE
	SeeSound "vile/firecrkl"
    Radius 16
    Height 16
    Speed 12
    Damage 2
    RenderStyle Add
    Obituary "%o was flame-broiled by a Cacolantern."
    DamageType "Fire"
	//+RIPPER
	+FORCEXYBILLBOARD
	+BLOODLESSIMPACT
	+STRIFEDAMAGE
   RENDERSTYLE ADD
   ALPHA 0.9
   Scale 0.5//.33
    States
    {
    Spawn:
      FIR3 A 0
	  FIR3 A 0 ThrustThingZ(0, random(0,3), 0, 0)
      FIR3 I 1 Bright
    BAL1 A 0 A_JumpIf(waterlevel > 1, "WaterDeath")
      FIR3 A 0 A_SetTranslucent(0.01, 1)
      FIR3 AA 1 Bright A_FadeIn(0.05)
    BAL1 A 0 A_JumpIf(waterlevel > 1, "WaterDeath")
      FIR3 BB 1 Bright A_FadeIn(0.05)
    BAL1 A 0 A_JumpIf(waterlevel > 1, "WaterDeath")
      FIR3 CC 1 Bright A_FadeIn(0.05)
    BAL1 A 0 A_JumpIf(waterlevel > 1, "WaterDeath")
      FIR3 DD 1 Bright A_FadeIn(0.05)
    BAL1 A 0 A_JumpIf(waterlevel > 1, "WaterDeath")
      FIR3 EE 1 Bright A_FadeIn(0.05)
    BAL1 A 0 A_JumpIf(waterlevel > 1, "WaterDeath")
      FIR3 FF 1 Bright A_FadeIn(0.05)
    BAL1 A 0 A_JumpIf(waterlevel > 1, "WaterDeath")
      FIR3 GG 1 Bright A_FadeIn(0.05)
    BAL1 A 0 A_JumpIf(waterlevel > 1, "WaterDeath")
      FIR3 HH 1 Bright A_FadeIn(0.05)
    BAL1 A 0 A_JumpIf(waterlevel > 1, "WaterDeath")
      FIR3 II 1 Bright A_FadeIn(0.05)
      Stop
  WaterDeath:
  	TNT1 AAAAA 0 A_SpawnItemEx ("UnderwaterSteam", 0,0,random(0,40), random(-1,1),random(-3,3),random(0,2), 0, 160, 64)  
	TNT1 A 0 A_Playsound("flesh/fry",CHAN_5)
    TNT1 A 0
	Stop
    Death:
        NULL A 1 Bright
        Stop
    }
}