Actor BarrelSpawner : RandomSpawner replaces ExplosiveBarrel
{
dropitem "ChasmBarrelNormal",255, 10
dropitem "ChasmBarrelToxic",255, 10
}

ACTOR ChasmBarrel
{
  Health 75
  Radius 20
  Height 42
  +SOLID
  +SHOOTABLE
  +ACTIVATEMCROSS
  +DONTGIB
  +NOICEDEATH
  +OLDRADIUSDMG
  +PUSHABLE
  +NOBLOODDECALS
  DeathSound "Barrel/Exp"
  Obituary "%o exploded."
  BloodType "ArmorBlood", "ArmorBlood"
  States
  {
  Spawn:
    TNT1 A 0 NoDelay
    BARX A 5
    Loop
  Death:
  BARX A random(8,16) BRIGHT
  TNT1 A 0 Radius_Quake(2, 4, 0, 10, 0)
  TNT1 AAAAAAAAAA 0 A_CustomMissile("ExplosionFlare", random(1,8), random(18,-18), random (0, 360), 2, random (0, 160))
  TNT1 AAAAAAAAAA 0 A_SpawnParticle ("Orange", SPF_FULLBRIGHT | SPF_RELATIVE, random(30,60), random(2,5), frandom(0,360), 0,0,0, frandom(0.2,12.0),frandom(-0.2,0.2),frandom(-6.0,6.0), 0,0,-0.1, 0.98, -1)
  TNT1 AAAA 0 A_CustomMissile("ExplosionFX", random(1,40), random(15,-15), random (0, 360), 2, random (0, 160))
  TNT1 AAAA 0 A_CustomMissile("ExplosionFX", random(1,40), random(15,-15), random (0, 360), 2, random (0, 160))
  TNT1 A 0 A_CustomMissile("ExplosionSparkSpawner", random(1,8), random(15,-15), random (0, 360), 2, random (0, 160))
  TNT1 AAAAAA 0 A_CustomMissile("ExplosionSmokeSpawner", random(1,11), random(15,-15), random (0, 360), 2, random (0, 160))
  TNT1 AAAAAA 0 A_CustomMissile("ExplosionSmokeSpawner", random(1,-11), random(15,-15), random (0, 360), 2, random (0, 160))
  TNT1 AAA 0 A_CustomMissile("BigExplosionSmokeSpawner", random(1,-12), random(15,-15), random (0, 360), 2, random (0, 160))
  TNT1 AAA 0 A_CustomMissile("BigExplosionSmokeSpawner", random(1,12), random(1,-1), random (0, 360), 2, random (0, 160))
  TNT1 A 0 BRIGHT A_Scream
  TNT1 A 0 BRIGHT A_Explode
  TNT1 A 1050 Bright A_BarrelDestroy
  TNT1 A 5 A_Respawn
  Wait
  }
}

//Barrels
ACTOR ChasmBarrelNormal 
{
  Health 75
  Radius 10
  Height 42
  +SOLID
  +SHOOTABLE
  +ACTIVATEMCROSS
  +DONTGIB
  +NOICEDEATH
  +OLDRADIUSDMG
  +PUSHABLE
  +NOBLOODDECALS
  DeathSound "Barrel/Exp"
  Obituary "%o exploded."
  BloodType "ArmorBlood", "ArmorBlood"
  States
  {
  Spawn:
    TNT1 A 0 NoDelay
    BAR3 A 1
    Loop
  Death: //LOAD BARREL EXPLODE MD3
  BAR3 A Random(8,18) BRIGHT
  BAR4 A 1 A_Spawnitem ("Explosion2")
  TNT1 A 0 A_Scream
  TNT1 AAAAAAAAAA 0 A_CustomMissile("ExplosionFlare", random(1,8), random(18,-18), random (0, 360), 2, random (0, 160))
  TNT1 AAAAAAAAAA 0 A_SpawnParticle ("Orange", SPF_FULLBRIGHT | SPF_RELATIVE, random(30,60), random(2,5), frandom(0,360), 0,0,0, frandom(0.2,12.0),frandom(-0.2,0.2),frandom(-6.0,6.0), 0,0,-0.1, 0.98, -1)
  TNT1 AAAA 0 A_CustomMissile("ExplosionFX", random(1,40), random(15,-15), random (0, 360), 2, random (0, 160))
  TNT1 AAAA 0 A_CustomMissile("ExplosionFX", random(1,40), random(15,-15), random (0, 360), 2, random (0, 160))
  TNT1 A 0 A_CustomMissile("ExplosionSparkSpawner", random(1,8), random(15,-15), random (0, 360), 2, random (0, 160))
  TNT1 AAAAAA 0 A_CustomMissile("ExplosionSmokeSpawner", random(1,11), random(15,-15), random (0, 360), 2, random (0, 160))
  TNT1 AAAAAA 0 A_CustomMissile("ExplosionSmokeSpawner", random(1,-11), random(15,-15), random (0, 360), 2, random (0, 160))
  TNT1 AAA 0 A_CustomMissile("BigExplosionSmokeSpawner", random(1,-12), random(15,-15), random (0, 360), 2, random (0, 160))
  TNT1 AAA 0 A_CustomMissile("BigExplosionSmokeSpawner", random(1,12), random(1,-1), random (0, 360), 2, random (0, 160))
  TNT1 A 0 A_Explode
  TNT1 A 0 Radius_Quake(2, 4, 0, 10, 0)
  BAR4 CEFGHIJKLMNOP 1 BRIGHT
  BAR4 QR 1 A_SetTranslucent(0.8)
  BAR4 ST 1 A_SetTranslucent(0.6)
  BAR4 UV 1 A_SetTranslucent(0.4)
  BAR4 WX 1 A_SetTranslucent(0.2)
  BAR4 YZ 1 A_SetTranslucent(0.0)
  TNT1 A 1050 Bright A_BarrelDestroy
  //TNT1 A 5 A_Respawn
  Wait
  }
}

ACTOR ChasmBarrelToxic
{
  Health 75
  Radius 10
  Height 42
  +SOLID
  +SHOOTABLE
  +ACTIVATEMCROSS
  +DONTGIB
  +NOICEDEATH
  +OLDRADIUSDMG
  +PUSHABLE
  +BRIGHT
  +NOBLOODDECALS
  DeathSound "Barrel/ToxicExp"
  Obituary "%o exploded."
  BloodType "ArmorBlood", "ArmorBlood"
  States
  {
  Spawn:
    TNT1 A 0 NoDelay
    BAR0 ABCDEFGHIJKLMNOPQRSTUVWXYZ 1
    Loop
    
    
  Death: //LOAD BARREL EXPLODE MD3
  BAR0 A Random(8,18) BRIGHT
  BAR1 A 1 A_Spawnitem ("Explosion1Toxic")
  TNT1 A 0 A_Scream
  TNT1 AAAAAAAAAA 0 A_SpawnParticle ("Green", SPF_FULLBRIGHT | SPF_RELATIVE, random(30,60), random(2,5), frandom(0,360), 0,0,0, frandom(0.2,12.0),frandom(-0.2,0.2),frandom(-6.0,6.0), 0,0,-0.1, 0.98, -1)
  TNT1 AAAAAA 0 A_CustomMissile("ExplosionSmokeSpawner", random(1,11), random(15,-15), random (0, 360), 2, random (0, 160))
  TNT1 AAAAAA 0 A_CustomMissile("ExplosionSmokeSpawner", random(1,-11), random(15,-15), random (0, 360), 2, random (0, 160))
  TNT1 AAA 0 A_CustomMissile("BigExplosionSmokeSpawner", random(1,-12), random(15,-15), random (0, 360), 2, random (0, 160))
  TNT1 AAA 0 A_CustomMissile("BigExplosionSmokeSpawner", random(1,12), random(1,-1), random (0, 360), 2, random (0, 160))
  TNT1 A 0 A_CustomMissile("ToxicBarrelCloud", 1, 0, 0) 
  TNT1 A 0 A_CustomMissile("ToxicBarrelCloud", 1, 0, 45) 
  TNT1 A 0 A_CustomMissile("ToxicBarrelCloud", 1, 0, 90) 
  TNT1 A 0 A_CustomMissile("ToxicBarrelCloud", 1, 0, 135) 
  TNT1 A 0 A_CustomMissile("ToxicBarrelCloud", 1, 0, 180) 
  TNT1 A 0 A_CustomMissile("ToxicBarrelCloud", 1, 0, 225) 
  TNT1 A 0 A_CustomMissile("ToxicBarrelCloud", 1, 0, 270) 
  TNT1 A 0 A_CustomMissile("ToxicBarrelCloud", 1, 0, 315) 
  TNT1 A 0 Radius_Quake(2, 4, 0, 10, 0)
  TNT1 A 0 A_Explode(56,78)
  BAR1 B 1 A_Spawnitem ("ChasmBarrelMelt")
  BAR1 CEFGHIJKLMNOP 1 BRIGHT   
  BAR1 QR 1 A_SetTranslucent(0.8)
  BAR1 ST 1 A_SetTranslucent(0.6)
  BAR1 UV 1 A_SetTranslucent(0.4)
  BAR1 WX 1 A_SetTranslucent(0.2)
  BAR1 YZ 1 A_SetTranslucent(0.0)
  TNT1 A 1050 Bright A_BarrelDestroy
  //TNT1 A 5 A_Respawn
  Wait
  }
}

Actor ChasmBarrelMelt
{

    +BRIGHT
	States
	{
      
	Spawn:
        BAR2 ABCD 4
        goto Melt        
    Melt: 
        BAR2 DDDDDDDDDDDDDDDDDDDDDDD 5
        BAR2 D 3 A_SetTranslucent(0.9)
        BAR2 D 3 A_SetTranslucent(0.8)
        BAR2 D 3 A_SetTranslucent(0.7)
        BAR2 D 3 A_SetTranslucent(0.6)
        BAR2 D 3 A_SetTranslucent(0.5)
        BAR2 D 3 A_SetTranslucent(0.4)
        BAR2 D 3 A_SetTranslucent(0.3)
        BAR2 D 3 A_SetTranslucent(0.2)
        BAR2 D 3 A_SetTranslucent(0.1)
        BAR2 D 1 A_SetTranslucent(0.0)
        Stop     
	}
}

ACTOR ChasmBarrelFire Replaces BurningBarrel
{
  Health 75
  Radius 10
  Height 42
  +SOLID
  +SHOOTABLE
  +ACTIVATEMCROSS
  +DONTGIB
  +NOICEDEATH
  +OLDRADIUSDMG
  +PUSHABLE
  +BRIGHT
  DeathSound "Barrel/Exp"
  Obituary "%o exploded."
  BloodType "ArmorBlood", "ArmorBlood"
  States
  {
  Spawn:
    TNT1 A 0 NoDelay
    BAR5 ABCDEFGHIJK 1
    Loop
    
    
  Death: //LOAD BARREL EXPLODE MD3
  BAR5 A Random(8,18) BRIGHT
  BAR6 A 1 A_Spawnitem ("Explosion3")
  TNT1 A 0 A_Explode(56,128)
  TNT1 A 0 A_Scream
  TNT1 A 0 Radius_Quake(2, 4, 0, 10, 0)
  BAR6 CEFGHIJKLMNOP 1 BRIGHT
  BAR6 QR 1 A_SetTranslucent(0.8)
  BAR6 ST 1 A_SetTranslucent(0.6)
  BAR6 UV 1 A_SetTranslucent(0.4)
  BAR6 WX 1 A_SetTranslucent(0.2)
  BAR6 YZ 1 A_SetTranslucent(0.0)
  TNT1 A 1050 Bright A_BarrelDestroy
  //TNT1 A 5 A_Respawn
  Wait
  }
}



//ToxicBarrel FX
actor ToxicBarrelCloud
{ 
    Radius 36
    Height 12
    Speed 1
    +STRIFEDAMAGE 
    +RIPPER 
	+NOCLIP
	+DONTSPLASH
    PROJECTILE 
    RENDERSTYLE Add
    ALPHA 0.95
	Scale 1
    States 
    { 
    Spawn: 
	    TNT1 A 0
		TNT1 A 0 A_SpawnItem("ToxicCloudDmg")
		PSBG BCDE 6
		TNT1 A 0 A_SpawnItem("ToxicCloudDmg")
        PSBG FGHI 6
		TNT1 A 0 A_SpawnItem("ToxicCloudDmg")
		PSBG FGHI 6
		TNT1 A 0 A_SpawnItem("ToxicCloudDmg")
		PSBG FGHI 6
		TNT1 A 0 A_SpawnItem("ToxicCloudDmg")
		PSBG FGHI 6
		TNT1 A 0 A_SpawnItem("ToxicCloudDmg")
		PSBG FGHI 6
		TNT1 A 0 A_SpawnItem("ToxicCloudDmg")
		PSBG FGHI 6
		TNT1 A 0 A_SpawnItem("ToxicCloudDmg")
        Goto Death 
    Death: 
        PSBG FFGGHHHIII 3 A_FadeOut(0.1)
        Stop 
    } 
}

actor ToxicCloudDmg
{
  Radius 76
  Height 32
  Speed 0
  damagetype "Poison"
  Damage 1
  PoisonDamage 4, 4, 0
  Projectile
  +DONTSPLASH
  States
  {
  Spawn:
    TNT1 A 1
    TNT1 A 1 A_Explode(5, 76)
    stop
  }
}
   


//FX
Actor Explosion1
{
	Radius 0
	Height 0
    +BRIGHT
	States
	{
        Spawn:
		EX00 A 1 A_SetTranslucent(0.9) 
        EX00 B 1 A_SetTranslucent(0.9) 
        EX00 C 1 A_SetTranslucent(0.8) 
        EX00 D 1 A_SetTranslucent(0.8) 
        EX00 E 1 A_SetTranslucent(0.7) 
        EX00 F 1 A_SetTranslucent(0.7) 
        EX00 G 1 A_SetTranslucent(0.6) 
        EX00 H 1 A_SetTranslucent(0.6) 
        EX00 I 1 A_SetTranslucent(0.5) 
        
        EX01 A 1 A_SetTranslucent(0.5) 
        EX01 B 1 A_SetTranslucent(0.4) 
        EX01 C 1 A_SetTranslucent(0.4) 
        EX01 D 1 A_SetTranslucent(0.3) 
        EX01 E 1 A_SetTranslucent(0.3) 
        EX01 F 1 A_SetTranslucent(0.2)
        TNT1 A 1
        Stop
	}
}

Actor Explosion1Toxic
{
	Radius 0
	Height 0
    +BRIGHT
	States
	{
        Spawn:
		EX02 A 1 A_SetTranslucent(0.9) 
        EX02 B 1 A_SetTranslucent(0.9) 
        EX02 C 1 A_SetTranslucent(0.8) 
        EX02 D 1 A_SetTranslucent(0.8) 
        EX02 E 1 A_SetTranslucent(0.7) 
        EX02 F 1 A_SetTranslucent(0.7) 
        EX02 G 1 A_SetTranslucent(0.6) 
        EX02 H 1 A_SetTranslucent(0.6) 
        EX02 I 1 A_SetTranslucent(0.5) 
        
        EX03 A 1 A_SetTranslucent(0.5) 
        EX03 B 1 A_SetTranslucent(0.4) 
        EX03 C 1 A_SetTranslucent(0.4) 
        EX03 D 1 A_SetTranslucent(0.3) 
        EX03 E 1 A_SetTranslucent(0.3) 
        EX03 F 1 A_SetTranslucent(0.2)
        TNT1 A 1
        Stop
	}
}
////////////////////////////////////////////
////////////////////////////////////////////

////////////////////////////////////////////
////////////////////////////////////////////
Actor Explosion2
{
	Radius 0
	Height 0
    +BRIGHT
	States
	{
        Spawn:
		EX04 A 1 A_SetTranslucent(0.9) 
        EX04 B 1 A_SetTranslucent(0.9) 
        EX04 C 1 A_SetTranslucent(0.8) 
        EX04 D 1 A_SetTranslucent(0.8) 
        EX04 E 1 A_SetTranslucent(0.7) 
        EX04 F 1 A_SetTranslucent(0.7) 
        EX04 G 1 A_SetTranslucent(0.6) 
        EX04 H 1 A_SetTranslucent(0.6) 
        EX04 I 1 A_SetTranslucent(0.5) 
        
        EX05 A 1 A_SetTranslucent(0.5) 
        EX05 B 1 A_SetTranslucent(0.4) 
        EX05 C 1 A_SetTranslucent(0.4) 
        EX05 D 1 A_SetTranslucent(0.3) 
        EX05 E 1 A_SetTranslucent(0.3) 
        EX05 F 1 A_SetTranslucent(0.2)
        TNT1 A 1
        Stop
	}
}


Actor Explosion2Toxic
{
	Radius 0
	Height 0
    +BRIGHT
	States
	{
        Spawn:
		EX06 A 1 A_SetTranslucent(0.9) 
        EX06 B 1 A_SetTranslucent(0.9) 
        EX06 C 1 A_SetTranslucent(0.8) 
        EX06 D 1 A_SetTranslucent(0.8) 
        EX06 E 1 A_SetTranslucent(0.7) 
        EX06 F 1 A_SetTranslucent(0.7) 
        EX06 G 1 A_SetTranslucent(0.6) 
        EX06 H 1 A_SetTranslucent(0.6) 
        EX06 I 1 A_SetTranslucent(0.5) 
        
        EX07 A 1 A_SetTranslucent(0.5) 
        EX07 B 1 A_SetTranslucent(0.4) 
        EX07 C 1 A_SetTranslucent(0.4) 
        EX07 D 1 A_SetTranslucent(0.3) 
        EX07 E 1 A_SetTranslucent(0.3) 
        EX07 F 1 A_SetTranslucent(0.2)
        TNT1 A 1
        Stop
	}
}

////////////////////////////////////////////
////////////////////////////////////////////
Actor Explosion3
{
	Radius 0
	Height 0
    +BRIGHT
	States
	{
        Spawn:
		EX08 A 1 A_SetTranslucent(0.9)
        EX08 B 1 A_SetTranslucent(0.9) 
        EX08 C 1 A_SetTranslucent(0.9) 
        
        EX08 D 1 A_SetTranslucent(0.8)
        EX08 E 1 A_SetTranslucent(0.8) 
        EX08 F 1 A_SetTranslucent(0.8)
        
        EX08 G 1 A_SetTranslucent(0.7)
        EX08 H 1 A_SetTranslucent(0.7) 
        EX08 I 1 A_SetTranslucent(0.7)
        
        EX08 J 1 A_SetTranslucent(0.6)
        EX08 K 1 A_SetTranslucent(0.6) 
        EX08 L 1 A_SetTranslucent(0.6)
        
        EX09 A 1 A_SetTranslucent(0.5)
        EX09 B 1 A_SetTranslucent(0.5) 
        EX09 C 1 A_SetTranslucent(0.5) 
    
        EX09 D 1 A_SetTranslucent(0.4)
        EX09 E 1 A_SetTranslucent(0.4) 
        EX09 F 1 A_SetTranslucent(0.4)
        
        EX09 G 1 A_SetTranslucent(0.3)
        EX09 H 1 A_SetTranslucent(0.3)
        
        EX09 I 1 A_SetTranslucent(0.7)
        EX09 J 1 A_SetTranslucent(0.2)

        TNT1 A 1
        Stop
	}
}

////////////////////////////////////////////
////////////////////////////////////////////
Actor Explosion3Toxic
{
	Radius 0
	Height 0
    +BRIGHT
	States
	{
        Spawn:
		EX10 A 1 A_SetTranslucent(0.9)
        EX10 B 1 A_SetTranslucent(0.9) 
        EX10 C 1 A_SetTranslucent(0.9) 
        
        EX10 D 1 A_SetTranslucent(0.8)
        EX10 E 1 A_SetTranslucent(0.8) 
        EX10 F 1 A_SetTranslucent(0.8)
    
        EX10 G 1 A_SetTranslucent(0.7)
        EX10 H 1 A_SetTranslucent(0.7) 
        EX10 I 1 A_SetTranslucent(0.7)
        
        EX10 J 1 A_SetTranslucent(0.6)
        EX10 K 1 A_SetTranslucent(0.6) 
        EX10 L 1 A_SetTranslucent(0.6)
        
        EX11 A 1 A_SetTranslucent(0.5)
        EX11 B 1 A_SetTranslucent(0.5) 
        EX11 C 1 A_SetTranslucent(0.5) 
    
        EX11 D 1 A_SetTranslucent(0.4)
        EX11 E 1 A_SetTranslucent(0.4) 
        EX11 F 1 A_SetTranslucent(0.4)
        
        EX11 G 1 A_SetTranslucent(0.3)
        EX11 H 1 A_SetTranslucent(0.3)
        
        EX11 I 1 A_SetTranslucent(0.2)
        EX11 J 1 A_SetTranslucent(0.2)

        TNT1 A 1
        Stop
	}
}


