/// decorate/world.txt by Kaapeli47

/// World ///

DamageType Falling
{
	Factor 5.0 // Good luck surviving with Strife-style fall damage!
	ReplaceFactor
}

ACTOR BarrelSpawnActor : CustomInventory replaces ExplosiveBarrel
{
	Tag "Barrel Spawner"
	//$Category Obstacles
	//$Sprite BAR1A0
	+NOBLOCKMAP
	+NOGRAVITY
	States
	{
	Spawn:
	  TNT1 A 0
	  TNT1 A 1 A_SpawnItemEx("BarrelSpawner")
	  TNT1 A -1
	  Stop
	}
}

ACTOR BarrelSpawner : RandomSpawner
{
	DropItem "IDMExplosiveBarrel"
	DropItem "IDMFireBarrel"
	DropItem "IDMIceBarrel"
	DropItem "IDMOilBarrel"
}

ACTOR IDMExplosiveBarrel : ExplosiveBarrel // replaces ExplosiveBarrel
{
  Health 20
  Radius 10
  Height 42
  Mass 10
  +SOLID
  +SHOOTABLE
  +ACTIVATEMCROSS
  +DONTGIB
  -NOBLOOD
  +NOICEDEATH
  -OLDRADIUSDMG
  +EXTREMEDEATH
  DeathSound "world/barrelx"
  Obituary "%o was blown up to smithereens by %k."
  SelfObituary "%o blew %hself up to smithereens."
  BloodColor "Green"
  Tag "Explosive Barrel"
  States
  {
  Spawn:
    BAR1 AB 6 A_SetTranslucent(1.0)
    Loop
  Death:
  XDeath:
    BEXP A 5 Bright
    BEXP B 5 Bright A_Scream
    BEXP CCCCC 1 Bright A_Explode(random(50,150),160,1,0,160)
	TNT1 A 0 A_SpawnItemEx("IDMBarrelExplosion",random(-32,32),random(-32,32),random(0,20),0,0,4,0,SXF_ABSOLUTEPOSITION|SXF_TRANSFERPOINTERS)
    BEXP DDDDD 1 Bright A_Explode(random(100,300),192,1,0,192)
	TNT1 A 0 A_SetTranslucent(0.5)
	TNT1 A 0 A_SpawnItemEx("IDMBarrelExplosion",random(-32,32),random(-32,32),random(0,20),0,0,4,0,SXF_ABSOLUTEPOSITION|SXF_TRANSFERPOINTERS)
    BEXP EEEEE 1 Bright A_Explode(random(25,75),160,1,0,160)
	TNT1 A 0 A_SpawnItemEx("IDMBarrelExplosion",random(-32,32),random(-32,32),random(0,20),0,0,4,0,SXF_ABSOLUTEPOSITION|SXF_TRANSFERPOINTERS)
    BEXP EEE 1 Bright A_Explode(random(25,75),160,1,0,160)
    TNT1 A 1050 Bright A_BarrelDestroy
    TNT1 A 5 A_Respawn
    Wait
  }
}

ACTOR IDMFireBarrel : IDMExplosiveBarrel
{
  Tag "Fire Barrel"
  BloodColor "Orange"
  States
  {
  Spawn:
    BAR2 AB 6 A_SetTranslucent(1.0)
    Loop
  Death:
  XDeath:
    BEX2 A 5 Bright
    BEX2 B 5 Bright A_Scream
	BEX2 C 5 Bright
	TNT1 AAAAAAAAAA 0 A_SpawnItemEx("IDMFireBarrelMushroom",0,0,16,random(10,30),0,random(5,25),random(0,359),SXF_TRANSFERPOINTERS)
    BEX2 DDDDD 1 Bright A_SpawnItemEx("IDMFireBarrelMushroom",0,0,16,random(10,30),0,random(5,25),random(0,359),SXF_TRANSFERPOINTERS)
	TNT1 A 0 A_SetTranslucent(0.5)
	BEX2 E 8 Bright
    TNT1 A 1050 Bright A_BarrelDestroy
    TNT1 A 5 A_Respawn
    Wait
  }
}

ACTOR IDMFireBarrelMushroom
{
	Damage 30
	DeathSound "weapons/mushlx"
	SeeSound "fatso/attack"
	Obituary "%o was blown up to smithereens by %k."
	SelfObituary "%o blew %hself up to smithereens."
	Radius 6
	Height 8
	Speed 25
	Projectile 
	+RANDOMIZE
    +SKYEXPLODE
	+EXTREMEDEATH
	-NOGRAVITY
    -NOTELEPORT
	RenderStyle Add
	Alpha 0.9
	Gravity 0.5
	States
	{
	Spawn:
      MANF AB 4 Bright
      Loop
	XDeath:
	Death:
      MISL B 0 A_Scream
	  TNT1 A 0 A_SetScale(1.75)
      MISL B 6 Bright A_Explode(256,256)
      MISL C 5 Bright
	  MISL D 4 Bright
	  Stop
	}
}

ACTOR IDMIceBarrel : IDMExplosiveBarrel
{
  Tag "Ice Barrel"
  BloodColor "Light Slate Blue"
  States
  {
  Spawn:
    BAR3 AB 6 A_SetTranslucent(1.0)
    Loop
  Death:
  XDeath:
    BEX3 A 5 Bright
    BEX3 B 5 Bright A_Scream
	BEX3 C 5 Bright
	TNT1 A 0 A_SetTranslucent(0.5)
	TNT1 A 0 A_Playsound("weapons/freezeshot",CHAN_BODY)
	TNT1 A 0 A_Playsound("weapons/freezeshot",CHAN_5)
	TNT1 AAAAAAAAAA 0 A_SpawnItemEx("IDMIceBarrelBall",0,0,16,random(20,40),0,random(-2,5),random(0,359),SXF_TRANSFERPOINTERS)
	TNT1 AAAAAAAAAA 0 A_SpawnItemEx("IDMIceBarrelBall2",0,0,16,random(20,40),0,random(-2,5),random(0,359),SXF_TRANSFERPOINTERS)
    BEX3 D 2 Bright
	TNT1 A 0 A_Playsound("weapons/freezeshot",CHAN_BODY)
	TNT1 A 0 A_Playsound("weapons/freezeshot",CHAN_5)
	TNT1 AAAAAAAAAA 0 A_SpawnItemEx("IDMIceBarrelBall",0,0,16,random(20,40),0,random(-2,5),random(0,359),SXF_TRANSFERPOINTERS)
	TNT1 AAAAAAAAAA 0 A_SpawnItemEx("IDMIceBarrelBall2",0,0,16,random(20,40),0,random(-2,5),random(0,359),SXF_TRANSFERPOINTERS)
    BEX3 D 3 Bright
	BEX3 E 8 Bright
    TNT1 A 1050 Bright A_BarrelDestroy
    TNT1 A 5 A_Respawn
    Wait
  }
}

ACTOR IDMIceBarrelBall : FastProjectile
{
  Radius 13
  Height 8
  Speed 80
  Damage (25*random(1,4))
  Projectile
  ProjectileKickBack 25
  RenderStyle Add
  Alpha 0.75
  SeeSound "weapons/freezeshot"
  DeathSound "weapons/freezehit"
  Obituary "%o got frozen solid by %k."
  DamageType Ice
  Decal FreezeBlastMelt
  +RANDOMIZE
  +SKYEXPLODE
  -NOTELEPORT
  States
  {
  Spawn:
    FBLS A 1 bright A_SpawnItem("FreezeBallTrail")
    loop
  Death:
	TNT1 AAAAA 0 A_SpawnItemEx("IDMIceBarrelBallShard",0,0,0,frandom(5,20),0,frandom(0,10),frandom(0,360),SXF_TRANSFERPOINTERS)
    FBLS BCDE 4 bright
    stop
  }
}

ACTOR IDMIceBarrelBall2 : IDMIceBarrelBall
{
  States
  {
  Death:
	TNT1 AAAAAAAAAA 0 A_SpawnItemEx("IDMIceBarrelBallShard",0,0,0,frandom(5,20),0,frandom(0,10),frandom(0,360),SXF_TRANSFERPOINTERS)
	TNT1 AAA 0 A_CustomMissile("IDMIceBarrelSpikeBall",0,0,frandom(120,240),CMF_AIMDIRECTION|CMF_TRACKOWNER,frandom(-5,5))
    FBLS BCDE 4 bright
    stop
  }
}

ACTOR IDMIceBarrelBallShard
{
  Radius 6
  Height 4
  Speed 25
  Damage (20*random(1,4))
  DamageType Ice
  Projectile
  ProjectileKickback 10
  Gravity 0.5
  RenderStyle Add
  Alpha 0.75
  Obituary "%o got frozen solid by %k."
  Decal BulletChip
  +RANDOMIZE
  +SKYEXPLODE
  -NOGRAVITY
  -NOTELEPORT
  States
  {
  Spawn:
    FRT2 NOP 3 Bright
    Loop
  Death:
	TNT1 A 0 A_ChangeFlag(NOGRAVITY,1)
    FRT2 Q 7 Bright A_Playsound("weapons/freezehit",CHAN_VOICE,0.5,0)
    FRT2 R 7 Bright
	Stop
  }
}

ACTOR IDMIceBarrelSpikeBall : IDMIceBarrelBall
{
  Radius 10
  Height 6
  Speed 30
  Damage (20*random(1,4))
  States
  {
  Spawn:
	FRT2 ABC 2 Bright A_SpawnItem("FreezeSpikeBallTrail")
	Loop
  Death:
	TNT1 AAAAAAAAAA 0 A_SpawnItemEx("IDMIceBarrelBallShard",0,0,0,frandom(5,20),0,frandom(0,10),frandom(0,360),SXF_TRANSFERPOINTERS)
	FRT2 DEFGH 2 Bright
	Stop
  }
}

ACTOR IDMOilBarrel : IDMExplosiveBarrel
{
  Tag "Oil Barrel"
  BloodColor "Black"
  States
  {
  Spawn:
    BAR4 A 6 A_SetTranslucent(1.0)
    Loop
  Death:
  XDeath:
    BEX4 A 5 Bright
    BEX4 A 5 Bright A_Scream
	BEX4 B 5 Bright
	TNT1 A 0 A_SetTranslucent(0.5)
	TNT1 AAAAA 0 A_SpawnItemEx("OilPyroSpawner",0,0,10,15,0,random(5,15),random(0,359),SXF_TRANSFERPOINTERS)
    BEX4 CCCCCDDD 1 Bright A_SpawnItemEx("OilPyroSpawner",0,0,16,15,0,random(-5,15),random(0,359),SXF_TRANSFERPOINTERS)
	BEX4 D 5 Bright
    TNT1 A 1050 Bright A_BarrelDestroy
    TNT1 A 5 A_Respawn
    Wait
  }
}

ACTOR OilPyroSpawner
{
  Radius 1
  Height 1
  Damage (0)
  Projectile
  Speed 15
  +Ripper
  +BloodlessImpact
  -NOTELEPORT
  -NOGRAVITY
  States
  {
  Spawn:
    TNT1 A 0
    TNT1 AAAAA 5 Bright A_CustomMissile("OilPyroBoom", 0, 0, 0, CMF_TRACKOWNER)
    Stop
  }
}

Actor OilPyroBoom
{
  Radius 0
  Height 1
  Damage (0)
  Projectile
  RenderStyle Add
  DamageType "Rocket"
  Alpha 0.95
  Scale 0.67
  SeeSound "PyroCannon/Explosion"
  Obituary "%o was blown up to smithereens by %k."
  SelfObituary "%o blew %hself up to smithereens."
  +EXTREMEDEATH
  -NOTELEPORT
  States
  {
  Spawn:
    PYXP AB 2 Bright
    PYXP C 2 Bright A_Explode(192,128)
    PYXP DEFGHIJKLMNOPQRST 2 Bright
    Stop
  }
}

ACTOR IDMBulletPuff : BulletPuff
{
  +NOBLOCKMAP
  +NOGRAVITY
  +ALLOWPARTICLES
  +RANDOMIZE
  +PUFFONACTORS
  +SKYEXPLODE
  +CLIENTSIDEONLY
  AttackSound "misc/ricochet"
  Seesound "misc/bullethit"
  RenderStyle Translucent
  DamageType "Bullet"
  Alpha 0.7
  VSpeed 0
  States
  {
  Spawn:
  See:
	TNT1 A 0
	TNT1 A 0 A_Jump(256,"See1","See2","See3","See4")
  See1:
    PUFF A 3 Bright
    PUFF BCD 2
	Stop
  See2:
    BPUF A 3 Bright
    BPUF BCD 2
	Stop
  See3:
    PUFY A 3 Bright
    PUFY BCD 2
	Stop
  See4:
    FPUF A 3 Bright
    FPUF BCD 2
	Stop
  XDeath:
	TNT1 A 1
	Stop
  }
}

ACTOR IDMShotPuff : IDMBulletPuff
{
  AttackSound "misc/shotricochet"
  Seesound "misc/shothit"
  Scale 0.8
}

ACTOR FistHitPuff : IDMBulletPuff
{
  +PUFFONACTORS
  SeeSound "weapons/punch"
  ActiveSound "silent"
  AttackSound "weapons/pwall"
  DamageType "Punch"
  States
  {
  Spawn:
	PUFF CD 3
    Stop
  }
}

ACTOR IDMExplosion
{
  +NOBLOCKMAP
  +NOGRAVITY
  +ALLOWPARTICLES
  +RANDOMIZE
  +PUFFONACTORS
  +SKYEXPLODE
  +PUFFGETSOWNER
  +EXTREMEDEATH
  DamageType "Rocket"
  Alpha 0.8
  Renderstyle Add
  Obituary "%o joined %k's big fireball sendoff."
  States
  {
  Spawn:
	TNT1 A 0
	TNT1 A 0 A_Playsound("weapons/rocklx",CHAN_VOICE,1.0)
	TNT1 A 0 A_SetScale(1.75)
	MISL B 8 Bright A_Explode(256,256,0,0,192)
	MISL C 6 Bright
	MISL D 4 Bright
	Stop
  }
}

ACTOR IDMBarrelExplosion : IDMExplosion
{
  Obituary "%o was blown up to smithereens by %k."
  SelfObituary "%o blew %hself up to smithereens."
  States
  {
  Spawn:
	TNT1 A 0
	TNT1 A 0 A_Playsound("weapons/rocklx",CHAN_VOICE,1.0)
	TNT1 A 0 A_SetScale(1.75)
	MISL B 8 Bright A_Explode(256,256,1,0,192)
	MISL C 6 Bright
	MISL D 4 Bright
	Stop
  }
}

ACTOR ExtremePuff : IDMBulletPuff
{
	Seesound "misc/crit"
	+EXTREMEDEATH
	DamageType "Extreme"
}

ACTOR ExtremeShotPuff : IDMShotPuff
{
	Seesound "misc/shotcrit"
	+EXTREMEDEATH
	DamageType "Extreme"
}

ACTOR IDMSuperPuff : IDMBulletPuff
{
	+EXTREMEDEATH
	DamageType "Extreme"
}

ACTOR IDMSuperShotPuff : IDMShotPuff
{
	+EXTREMEDEATH
	DamageType "Extreme"
}

ACTOR ChainsawPuff : IDMBulletPuff
{
	Seesound "weapons/chainsawhit"
	Damagetype "Saw"
}

ACTOR PiercePuff : IDMBulletPuff
{
	+PIERCEARMOR
}

/// Teleport & spawn effects

ACTOR IDMTeleportFog : TeleportFog replaces TeleportFog
{
  +NOBLOCKMAP
  +NOTELEPORT
  +NOGRAVITY
  +CLIENTSIDEONLY
  RenderStyle Add
  States
  {
  Spawn:
    TFOG ABCDEFGHIJ 4 Bright
    Stop
  }
}

ACTOR IDMItemFog : ItemFog replaces ItemFog
{
  +NOBLOCKMAP
  +NOGRAVITY
  +CLIENTSIDEONLY
  States
  {
  Spawn:
    IFOG ABCDE 5 Bright
    Stop
  }
}

ACTOR BloodSplatter2 : BloodSplatter
{
  Mass 5
  States
  {
  Spawn:
    BLUD C 8 A_Jump(128,1)
	BLUD BA 8
    Stop
  Death:
    BLUD A 6
    Stop
  }
}

ACTOR BloodSplatter3 : BloodSplatter
{
  Mass 5
  States
  {
  Spawn:
	BLUD BA 6
    Stop
  Death:
    BLUD A 6
    Stop
  }
}