
// No pod should be damaged by a poison cloud...
actor BlastPod : Pod replaces Pod { DamageFactor "Poison", 0 }

actor IcePod : BlastPod 20009
{
	//$Category Obstacles
	//$Title Pod (Ice Variant)
	DamageType Ice
	DamageFactor "Fire", 15.0
   DamageFactor "Ice", 15.0 // counter-intuitive, but this way the shards cause chain reactions ;)
   States
   {
   Spawn:
      IPOD A 10
      Loop
   Pain:
      IPOD B 14 A_PodPain("IcePodGoo")
      Goto Spawn
   Death:
      IPOD C 5 BRIGHT A_RemovePod
      IPOD D 5 BRIGHT A_Scream
      IPOD E 0 BRIGHT A_SpawnItemEx("IcePodShard", 8, 0, 32, 14, 0, -0.3,   0 )
      IPOD E 0 BRIGHT A_SpawnItemEx("IcePodShard", 8, 0, 32, 14, 0, -0.3,  30 )
      IPOD E 0 BRIGHT A_SpawnItemEx("IcePodShard", 8, 0, 32, 14, 0, -0.3,  60 )
      IPOD E 0 BRIGHT A_SpawnItemEx("IcePodShard", 8, 0, 32, 14, 0, -0.3,  90 )
      IPOD E 0 BRIGHT A_SpawnItemEx("IcePodShard", 8, 0, 32, 14, 0, -0.3, 120 )
      IPOD E 0 BRIGHT A_SpawnItemEx("IcePodShard", 8, 0, 32, 14, 0, -0.3, 150 )
      IPOD E 0 BRIGHT A_SpawnItemEx("IcePodShard", 8, 0, 32, 14, 0, -0.3, 180 )
      IPOD E 0 BRIGHT A_SpawnItemEx("IcePodShard", 8, 0, 32, 14, 0, -0.3, 210 )
      IPOD E 0 BRIGHT A_SpawnItemEx("IcePodShard", 8, 0, 32, 14, 0, -0.3, 240 )
      IPOD E 0 BRIGHT A_SpawnItemEx("IcePodShard", 8, 0, 32, 14, 0, -0.3, 270 )
      IPOD E 0 BRIGHT A_SpawnItemEx("IcePodShard", 8, 0, 32, 14, 0, -0.3, 300 )
      IPOD E 0 BRIGHT A_SpawnItemEx("IcePodShard", 8, 0, 32, 14, 0, -0.3, 330 )
      IPOD E 5 BRIGHT A_Explode
      IPOD F 10 BRIGHT
      Stop
   Grow:
      IPDG ABCDEFGHIJ 3
      Goto Spawn
   }
}

ACTOR IcePodGoo : PodGoo
{
   Speed 3
   States
   {
   Spawn:
      IPDG AB 8
      Loop
   Death:
      IPDG B 10
      Stop
   }
}

ACTOR IcePodShard : IceGuyFX2
{
   SeeSound "FrostImp/Shards"
   DeathSound "misc/icehit"
   States
   {
   Spawn:
      IMSD ABC 5 Bright
      Loop
   Death:
      IMSD DEFGH 4 Bright
      Stop
   }
}

actor FirePod : BlastPod 20010
{
	//$Category Obstacles
	//$Title Pod (Fire Variant)
   DamageFactor Fire, 0.0
   Obituary "$OB_LAVA"
   +NEVERTARGET
   States
   {
   Spawn:
      FPOD A 10
      Loop
   Pain:
      FPOD B 14 A_PodPain("FirePodGoo")
      Goto Spawn
   Death:
      FPOD C 5 BRIGHT A_RemovePod
      FPOD D 5 BRIGHT A_Scream
      FPOD AAAAAAAAAAAA 0 A_PodPain("FirePodGoo")
      FPOD E 5 BRIGHT A_SpawnItemEx("FirePodExplosion", 0, 0, 0, 0, 0, 0, 0, SXF_TRANSFERPOINTERS)
      FPOD F 10 BRIGHT
      Stop
   Grow:
      FPDG ABCDEFGHI 3
      Goto Spawn
   }
}

ACTOR FirePodGoo : PodGoo
{
	DamageType "Fire"
	+DONTSPLASH
	+NODAMAGETHRUST
	var int user_count;
	States
	{
	Spawn:
		FPDG AB 8
		Loop
	Death:
		TNT1 A 0 A_PlaySound("SFX/FireStart", CHAN_7)
		TNT1 A 0 A_PlaySound("SFX/FireLoop1", CHAN_6, 1.0, TRUE)
	Explode:
		TNT1 A 0 A_Explode(32, 32)
		TNT1 AAAAA 1 Light("FireSpawnerSmall") A_GiveInventory("HPSpawnSmallFire")
		TNT1 A 0 A_SetUserVar("user_count", user_count + 1)
		TNT1 A 0 A_JumpIf(user_count < 34, "Explode")
		TNT1 A 0 A_PlaySound("SFX/FireDie", CHAN_6)
		Stop
	}
}

// Important note: this does _not_ have DamageType Fire, and this is _not_
// an oversight! This is the blast from the explosion, and it does blast damage.
// Making it deal fire damage would prevent chain reactions, which would be a
// crying shame. A SHAME! DO YOU HEAR ME? A SHAME!
ACTOR FirePodExplosion
{
   PROJECTILE
   radius 2
   height 4
   speed 0
   States
   {
   Spawn:
      TNT1 AA 0 A_Explode
      Stop
   }
}

actor PoisonPod : BlastPod 20020
{
	//$Category Obstacles
	//$Title Pod (Poison Variant)
	DeathSound "PoisonPod/Puff"
	States
	{
	Spawn:
		TPOD A 10
		Loop
	Pain:
		TPOD B 14 A_PodPain("PoisonPodGoo") 
		Goto Spawn
	Death:
		TPOD C 5 BRIGHT A_RemovePod
		TPOD D 5 BRIGHT A_Scream
		TPOD E 5 BRIGHT A_Explode
		TPOD A 0 A_SpawnItemEx("PoisonCloud", 0, 0, 28, 0, 0, 0, 0, SXF_TRANSFERPOINTERS)
		TPOD F 10 BRIGHT
		Stop
	Grow:
		TPDG ABCDEFGHI 3
		Goto Spawn
   }
}

ACTOR PoisonPodGoo : PodGoo
{
	Speed 3
	States
	{
	Spawn:
		TPDG AB 8
		Loop
	Death:
		TPDG B 10
		Stop
	}
}

Actor PoisonPodGas
{
   Projectile
   +Ripper
   +BloodlessImpact
   DamageType "Poison"
   Damage 1
   Speed 0
   Alpha 0.8
   SeeSound ""
   DeathSound ""
   States
   {
   Spawn:
      VPGS ABC 5
   Idle:
      VPGS DEFG 5 A_FadeOut(0.02)
      Loop
   }
}

Actor PoisonPodSmallGas : PoisonPodGas
{
   Speed 2
   Scale 0.5
   Radius 10
   Height 20
}


ACTOR FirePodGenerator : PodGenerator 21001
{
	//$Category Obstacles
	//$Title Pod Generator (Fire Variant)
	//$Sprite FPDGH0
   States
   {
   Spawn:
      TNT1 A 35 A_MakePod("FirePod")
      Loop
   }
}

ACTOR PoisonPodGenerator : PodGenerator 21002
{
	//$Category Obstacles
	//$Title Pod Generator (Poison Variant)
	//$Sprite TPDGH0
   States
   {
   Spawn:
      TNT1 A 35 A_MakePod("PoisonPod")
      Loop
     }
}

ACTOR IcePodGenerator : PodGenerator 21003
{
	//$Category Obstacles
	//$Title Pod Generator (Ice Variant)
	//$Sprite IPDGH0
   States
   {
   Spawn:
      TNT1 A 35 A_MakePod("IcePod")
      Loop
   }
}

ACTOR RandomPodGenerator : PodGenerator 21000
{
	//$Category Obstacles
	//$Title Pod Generator (Random Variant)
	//$Sprite PPODO0
   States
   {
   Spawn:
       TNT1 A 35 A_Jump(256, "StandardGen", "FireGen", "IceGen", "PoisonGen")
       Loop
   StandardGen:
      TNT1 A 35 A_MakePod("BlastPod")
      Goto Spawn
   FireGen:
      TNT1 A 35 A_MakePod("FirePod")
      Goto Spawn
   IceGen:
      TNT1 A 35 A_MakePod("IcePod")
      Goto Spawn
   PoisonGen:
      TNT1 A 35 A_MakePod("PoisonPod")
      Goto Spawn
   }
}

ACTOR VolcanoPurpleFX : BishopFX
{
  DeathSound ""
}

ACTOR VolcanoPurple : Volcano 12457
{
  States
  {
  Spawn:
    VLCP A 350
    VLCP A 35 A_VolcanoSet
    VLCP BCDBCD 3
    VLCP E 10
    VLCP EEEEEEEEEEEE 0 A_CustomMissile("VolcanoPurpleFX",16,0,random(90,270),6,random(0,20))
    VLCP EEEEEEEEEEEE 0 A_CustomMissile("VolcanoPurpleFX",16,0,random(0,359),6,random(0,90))
    VLCP E 0 A_PlaySound("BishopMissileExplode")
    Goto Spawn+1
  }

}

actor FirePodExplosionOnly //Tormentor667
{
   DamageFactor Fire, 0.0
   States
   {
   Spawn:
      TNT1 D 5 BRIGHT A_Playsound("pyro/explosion", 0, 1.0)
      TNT1 AAAAAAAAAAAA 0 A_SpawnItemEx("FirePodGoo", 0, 0, 0, random(0, 3), random(0, 3), random(0, 3), random(0,359))
      TNT1 EEEEEE 1 BRIGHT A_SpawnItemEx("FirePodExplosion", 0, 0, 0, 0, 0, 0, 0, SXF_TRANSFERPOINTERS)
      Stop
   Stop
   }
}