actor ShrinkerAmmo : Ammo 19335
{
  inventory.pickupmessage "$D3D_SHRINKAMMO"
  inventory.amount 10
  inventory.maxamount 50
  inventory.icon "TNT1A0"
  ammo.backpackamount 10
  ammo.backpackmaxamount 100
  scale 0.5
  +INVENTORY.IGNORESKILL
  states
  {
  Spawn:
    SRKP B -1 bright
    stop
  }
}

actor "Shrinker" : DefaultDukeWeapon 19336
{
  Weapon.SelectionOrder 17
  Weapon.AmmoUse 1
  Weapon.AmmoGive 5
  Weapon.AmmoType "ShrinkerAmmo"
  Obituary "%o was squashed by %k."
  Inventory.Pickupmessage "$D3D_SHRINK"
  Inventory.PickupSound "misc/backpack"
  weapon.upsound "chaingun/select"
  weapon.kickback 0
  scale 0.55
  decal bulletchip
  +NOALERT
  Tag " "
  States
  {
  Unmorph:
    TNT1 A 0 A_JumpIfHealthLower(1,38)
    TNT1 A 0 A_PlaySound("shrinker/transformloop",5,1,1)
    SRKT AABBCCBBAABBCCBBAA 1
    SRKT BBCCBBAABBCCBBAA 1
    TNT1 A 0 A_StopSound(5)
    TNT1 A 0 A_PlaySound("shrinker/transformend", 1)
    Stop
    TNT1 A 1
    Stop
  RReady2:
    SHKR AB 2 A_WeaponReady
    TNT1 A 0 A_JumpIfInventory("TossPipeBomb",1,"TossPipeBomb")
    TNT1 A 0 A_JumpIfInventory("TossTripBomb",1,"TossTripBomb")
    SHKR CD 2 A_WeaponReady
    TNT1 A 0 A_JumpIfInventory("TossPipeBomb",1,"TossPipeBomb")
    TNT1 A 0 A_JumpIfInventory("TossTripBomb",1,"TossTripBomb")
    SHKR EF 2 A_WeaponReady
    TNT1 A 0 A_JumpIfInventory("TossPipeBomb",1,"TossPipeBomb")
    TNT1 A 0 A_JumpIfInventory("TossTripBomb",1,"TossTripBomb")
    SHKR GH 2 A_WeaponReady
    TNT1 A 0 A_JumpIfInventory("TossPipeBomb",1,"TossPipeBomb")
    TNT1 A 0 A_JumpIfInventory("TossTripBomb",1,"TossTripBomb")
    SHKR IJ 2 A_WeaponReady
    TNT1 A 0 A_JumpIfInventory("TossPipeBomb",1,"TossPipeBomb")
    TNT1 A 0 A_JumpIfInventory("TossTripBomb",1,"TossTripBomb")
    SHKR JJ 2 A_WeaponReady
    TNT1 A 0 A_JumpIfInventory("TossPipeBomb",1,"TossPipeBomb")
    TNT1 A 0 A_JumpIfInventory("TossTripBomb",1,"TossTripBomb")
    SHKR JI 2 A_WeaponReady
    TNT1 A 0 A_JumpIfInventory("TossPipeBomb",1,"TossPipeBomb")
    TNT1 A 0 A_JumpIfInventory("TossTripBomb",1,"TossTripBomb")
    SHKR HG 2 A_WeaponReady
    TNT1 A 0 A_JumpIfInventory("TossPipeBomb",1,"TossPipeBomb")
    TNT1 A 0 A_JumpIfInventory("TossTripBomb",1,"TossTripBomb")
    SHKR FE 2 A_WeaponReady
    TNT1 A 0 A_JumpIfInventory("TossPipeBomb",1,"TossPipeBomb")
    TNT1 A 0 A_JumpIfInventory("TossTripBomb",1,"TossTripBomb")
    SHKR DC 2 A_WeaponReady
    TNT1 A 0 A_JumpIfInventory("TossPipeBomb",1,"TossPipeBomb")
    TNT1 A 0 A_JumpIfInventory("TossTripBomb",1,"TossTripBomb")
    SHKR BA 2 A_WeaponReady
    TNT1 A 0 A_JumpIfInventory("TossPipeBomb",1,"TossPipeBomb")
    TNT1 A 0 A_JumpIfInventory("TossTripBomb",1,"TossTripBomb")
    SHKR A 2 A_WeaponReady
    goto RReady
  NoAmmo:
    SHKR J 5 A_WeaponReady(WRF_NOFIRE)
    SHKR J 5 A_WeaponReady
    TNT1 A 0 A_JumpIfInventory("ShrinkerAmmo",1,"RReady")
    loop
  Deselect:
    SHKR A 0 A_StopSound(5)
    goto Super::Deselect
  Select:
    SHKR A 0
    goto Super::Select
  Fire:
    TNT1 A 0
    TNT1 A 0 A_JumpIfInventory("ShrinkerAmmo", 1, 2)
    SHKR J 10 A_PlaySound("DRYFIRE", 1)
    Goto NoAmmo
    SRKF A 0 A_GunFlash
    SRKF A 1 bright offset(0, 34) A_PlayWeaponSound("shrinker/shoot")
    SRKF B 1 bright offset(-2, 31) A_FireCustomMissile("MonsterAlert",0,0,0)
    SRKF C 1 bright offset(1, 32)
    SRKF A 1 bright offset(2, 27)
    SRKF B 1 bright offset(3, 31)
    SRKF C 1 bright offset(-2, 33)
    SRKF A 1 bright offset(-1, 31)
    SRKF B 1 bright offset(2, 27)
    SRKF C 1 bright offset(1, 35)
    TNT1 A 0 A_ZoomFactorD3D("d3d_rshrinker",0.99)
    SRKF A 0 A_FireCustomMissile("ShrinkerMorph",1,1,5,0)
    SRKF A 1 bright offset(-2, 31) A_FireCustomMissile("ShrinkerAttack",1,1,5,0)
    TNT1 A 0 A_ZoomFactor(1.0)
    SRKF B 1 bright offset(4, 33)
    SRKF C 1 bright offset(2, 24)
    SRKF A 1 bright offset(0, 33)
    SRKF B 1 bright offset(5, 27)
    SRKF C 1 bright offset(0, 31)
    TNT1 A 0 A_TakeInventory("Waiting",10)
    Goto RReady
  AltFire:
    TNT1 A 0
    TNT1 A 0 A_JumpIfInventory("ShrinkerAmmo", 7, 2)
    SHKR J 0 A_PlaySound("DRYFIRE", 1)
    Goto NoTarget+1
    SRKF A 1 offset(0, 34)
    SRKF B 1 offset(-2, 31)
    SRKF C 1 offset(1, 32)
    SRKF A 1 offset(2, 27)
    SRKF B 1 offset(3, 31)
    SRKF C 1 offset(-2, 33)
  AltHold:
    TNT1 A 0
    TNT1 A 0 A_JumpIfInventory("ShrinkerAmmo", 7, 2)
    SHKR J 0 A_PlaySound("DRYFIRE", 1)
    Goto NoTarget+1
    SRKF A 1 bright offset(-1, 31)
    SRKF B 1 bright offset(2, 27)
    SRKF C 1 bright offset(1, 35) A_TakeInventory("Waiting",10)
    TNT1 A 0 A_CheckActorUnmorph("PigCop", 700.0, "NoTarget")
    TNT1 A 0 A_ZoomFactorD3D("d3d_rshrinker",0.99)
    TNT1 A 0 A_GunFlash
    SRKF A 1 bright offset(-2, 31) A_PlayWeaponSound("shrinker/shoot")
    TNT1 A 0 A_Overlay (-4, "Unmorph")
    TNT1 A 0 A_OverlayFlags(-4,PSPF_ALPHA,true)
    TNT1 A 0 A_OverlayOffset(-4,0,0)
    TNT1 A 0 A_ZoomFactor(1.0)
    SRKF B 1 bright offset(4, 33) A_FireCustomMissile("MonsterAlert",0,0,0)
    SRKF C 1 bright offset(2, 24)
    TNT1 A 0 A_JumpIfInventory("ShrinkerAmmo", 1, 3)
    TNT1 A 0 A_ForceReFire(false,true)
    TNT1 A 0 A_Jump(256,2)
    TNT1 A 0 A_ForceReFire
    SRKF A 1 bright offset(0, 33)
    SRKF B 1 bright offset(5, 27)
    SRKF C 1 bright offset(0, 31)
    SRKF A 1 bright offset(0, 33)
    SRKF B 1 bright offset(5, 27)
    SRKF C 1 bright offset(0, 31)
    TNT1 A 0 A_JumpIfInventory("ShrinkerAmmo", 1, 3)
    TNT1 A 0 A_ForceReFire(false,true)
    TNT1 A 0 A_Jump(256,2)
    TNT1 A 0 A_ForceReFire
    SRKF A 1 bright offset(0, 33)
    SRKF B 1 bright offset(5, 27)
    SRKF C 1 bright offset(0, 31)
    SRKF A 1 bright offset(0, 33)
    SRKF B 1 bright offset(5, 27)
    SRKF C 1 bright offset(0, 31)
    SRKF A 1 bright offset(0, 33)
    SRKF B 1 bright offset(5, 27)
    SRKF C 1 bright offset(0, 31)
    TNT1 A 0 A_JumpIfInventory("ShrinkerAmmo", 1, 3)
    TNT1 A 0 A_ForceReFire(false,true)
    TNT1 A 0 A_Jump(256,2)
    TNT1 A 0 A_ForceReFire
    SRKF A 1 offset(0, 33)
    SRKF B 1 offset(5, 27)
    SRKF C 1 offset(0, 31)
    SRKF A 1 offset(0, 33)
    SRKF B 1 offset(5, 27)
    SRKF C 1 offset(0, 31)
    TNT1 A 0 A_JumpIfInventory("ShrinkerAmmo", 1, 3)
    TNT1 A 0 A_ForceReFire(false,true)
    TNT1 A 0 A_Jump(256,2)
    TNT1 A 0 A_ForceReFire
    SRKF A 1 offset(0, 33)
    SRKF B 1 offset(5, 27)
    SRKF C 1 offset(0, 31)
    SRKF A 1 offset(0, 33)
    SRKF B 1 offset(5, 27)
    SRKF C 1 offset(0, 31)
    SRKF A 1 offset(0, 33)
    SRKF B 1 offset(5, 27)
    SRKF C 1 offset(0, 31)
    TNT1 A 0 A_JumpIfInventory("ShrinkerAmmo", 1, 3)
    TNT1 A 0 A_ForceReFire(false,true)
    TNT1 A 0 A_Jump(256,2)
    TNT1 A 0 A_ForceReFire
    TNT1 A 0
    Goto RReady
  NoTarget:
    TNT1 A 0 A_PlaySound("shrinker/beep",11)
    TNT1 A 0 A_JumpIfInventory("ShrinkerAmmo", 7, 5)
    TNT1 A 0 A_JumpIfInventory("ShrinkerAmmo", 1, 2)
    TNT1 A 0 A_Jump(256,2)
    TNT1 A 0 A_ForceReFire(true,false)
    TNT1 A 0 A_Jump(256,2)
    TNT1 A 0 A_ForceReFire
    SRKF A 1 bright offset(0, 33)
    SRKF B 1 bright offset(5, 27)
    SRKF C 1 bright offset(0, 31)
    SRKF A 1 bright offset(0, 33)
    SRKF B 1 bright offset(5, 27)
    SRKF C 1 bright offset(0, 31)
    TNT1 A 0 A_JumpIfInventory("ShrinkerAmmo", 7, 5)
    TNT1 A 0 A_JumpIfInventory("ShrinkerAmmo", 1, 2)
    TNT1 A 0 A_Jump(256,2)
    TNT1 A 0 A_ForceReFire(true,false)
    TNT1 A 0 A_Jump(256,2)
    TNT1 A 0 A_ForceReFire
    SRKF A 1 bright offset(0, 33)
    SRKF B 1 bright offset(5, 27)
    SRKF C 1 bright offset(0, 31)
    SRKF A 1 bright offset(0, 33)
    SRKF B 1 bright offset(5, 27)
    SRKF C 1 bright offset(0, 31)
    SRKF A 1 bright offset(0, 33)
    SRKF B 1 bright offset(5, 27)
    SRKF C 1 bright offset(0, 31)
    TNT1 A 0 A_JumpIfInventory("ShrinkerAmmo", 7, 5)
    TNT1 A 0 A_JumpIfInventory("ShrinkerAmmo", 1, 2)
    TNT1 A 0 A_Jump(256,2)
    TNT1 A 0 A_ForceReFire(true,false)
    TNT1 A 0 A_Jump(256,2)
    TNT1 A 0 A_ForceReFire
    SRKF A 1 offset(0, 33)
    SRKF B 1 offset(5, 27)
    SRKF C 1 offset(0, 31)
    SRKF A 1 offset(0, 33)
    SRKF B 1 offset(5, 27)
    SRKF C 1 offset(0, 31)
    TNT1 A 0 A_JumpIfInventory("ShrinkerAmmo", 7, 5)
    TNT1 A 0 A_JumpIfInventory("ShrinkerAmmo", 1, 2)
    TNT1 A 0 A_Jump(256,2)
    TNT1 A 0 A_ForceReFire(true,false)
    TNT1 A 0 A_Jump(256,2)
    TNT1 A 0 A_ForceReFire
    SRKF A 1 offset(0, 33)
    SRKF B 1 offset(5, 27)
    SRKF C 1 offset(0, 31)
    SRKF A 1 offset(0, 33)
    SRKF B 1 offset(5, 27)
    SRKF C 1 offset(0, 31)
    SRKF A 1 offset(0, 33)
    SRKF B 1 offset(5, 27)
    SRKF C 1 offset(0, 31)
    TNT1 A 0 A_JumpIfInventory("ShrinkerAmmo", 7, 5)
    TNT1 A 0 A_JumpIfInventory("ShrinkerAmmo", 1, 2)
    TNT1 A 0 A_Jump(256,2)
    TNT1 A 0 A_ForceReFire(true,false)
    TNT1 A 0 A_Jump(256,2)
    TNT1 A 0 A_ForceReFire
    TNT1 A 0
    Goto RReady
  Flash:
    TNT1 AAAAAAAAAAAAAAA 1 A_FireCustomMissile("MuzzleFlashShrinker",0,0,random[RIDFX](-2,2))
    stop
  AltFlash:
    TNT1 AAAAAA 1 A_FireCustomMissile("MuzzleFlashShrinker",0,0,random[RIDFX](-2,2))
    stop
  Spawn:
    SRKP A -1
    Stop
  }
}

Actor ShrinkerMorphFX
{
  Scale 0.75
  Renderstyle Add
  Alpha 0.875
  +NOINTERACTION
  +CLIENTSIDEONLY
  +THRUGHOST
  States
  {
  Spawn:
    D3D2 AABBCCDD 1 Bright
    TNT1 A 0 A_SetTranslucent(alpha - 0.075)
    D3D2 EEFF 1 Bright
    TNT1 A 0 A_SetTranslucent(alpha - 0.075)
    D3D2 GGHH 1 Bright
    TNT1 A 0 A_SetTranslucent(alpha - 0.075)
    D3D2 II 1 Bright
    D3D2 IIHHGGFF 1 Bright
    TNT1 A 0 A_SetTranslucent(alpha - 0.075)
    D3D2 EEDD 1 Bright
    TNT1 A 0 A_SetTranslucent(alpha - 0.075)
    D3D2 CCBB 1 Bright
    TNT1 A 0 A_SetTranslucent(alpha - 0.075)
    D3D2 AA 1 Bright
    D3D2 AABBCCDD 1 Bright
    TNT1 A 0 A_SetTranslucent(alpha - 0.075)
    D3D2 EEFF 1 Bright
    TNT1 A 0 A_SetTranslucent(alpha - 0.075)
    D3D2 GGHH 1 Bright
    TNT1 A 0 A_SetTranslucent(alpha - 0.075)
    D3D2 II 1 Bright
    D3D2 IIHHGGFF 1 Bright
    TNT1 A 0 A_SetTranslucent(alpha - 0.075)
    D3D2 EEDD 1 Bright
    TNT1 A 0 A_SetTranslucent(alpha - 0.075)
    D3D2 CCBB 1 Bright
    TNT1 A 0 A_SetTranslucent(alpha - 0.075)
    D3D2 AA 1 Bright
    Stop
  }
}

Actor ShrinkerMorphFXOrigin : ShrinkerMorphFX
{
  Scale 0.5
  States
  {
  Spawn:
    D3D2 A 0
    D3D2 AABBCCBBAABBCCBBAA 1
    D3D2 BBCCBBAABBCCBBAA 1
    TNT1 AAAAAAAAAAAAAAAAAAAAAAA 5
    Stop
  }
}

actor ShrinkerAttack : ZMissileP
{
  Radius 11
  Height 8
  Speed 25
  Damage (1)
  Projectile
  DeathSound "shrinker/hit"
  Obituary "%o was shrunk by %k's shrinker."
  scale 0.6
  decal DukeScorch
  damagetype "Shrinkerhit"
  RenderStyle Add
  +THRUSPECIES
  Species "Dukes"
  +THRUGHOST
  States
  {
  Spawn:
    SRKX AABBCCDD 1 bright NoDelay A_SpawnItem("GreenFlare22",0,0)
    loop
  Death:
    TNT1 A 0 A_CustomMissile ("GreenPlasmaFire", 0, 0, random[RIDFX](0, 360), 2, random[RIDFX](0, 360))
    TNT1 AAAAA 0 A_CustomMissile ("GreenPlasmaParticle", 0, 0, random[RIDFX](0, 360), 2, random[RIDFX](0, 360))
    TNT1 AAAAA 0 A_CustomMissile ("GreenPlasmaParticle", 0, 0, random[RIDFX](0, 360), 2, random[RIDFX](0, 360))
    TNT1 AAAAA 0 A_CustomMissile ("GreenPlasmaParticle", 0, 0, random[RIDFX](0, 360), 2, random[RIDFX](0, 360))
    SRKX EEEE 1 bright A_SpawnItem("LensFlareTorchGreen",0,0)
    SRKX F 4 bright A_Explode(1,20,XF_EXPLICITDAMAGETYPE,0,20,0,0,"none","Shrinker")
    TNT1 A 0 A_CustomMissile ("ShrinkerAttackSmoke", 1, 0, random[RIDFX](0, 360), 2, random[RIDFX](0, 160)) 
    SRKX G 4 bright
    SRKX H 4 bright
    TNT2 AAAA 9 A_CustomMissile ("ShrinkerAttackSmoke", 1, 0, random[RIDFX](0, 360), 2, random[RIDFX](0, 160))
    stop
  }
}

ACTOR ShrinkerMorph : ZMissileMorph
{
  Radius 11
  Height 8
  Speed 25
  MorphProjectile.PlayerClass "ShrunkDukePlayer"
  MorphProjectile.MorphStyle MRF_UNDOBYTOMEOFPOWER
  MorphProjectile.Duration 250
  DeathSound "shrinker/hit"
  scale 0.6
  RenderStyle Add
  damagetype "AlienzShrinker"
  +THRUSPECIES
  Species "Dukes"
  +THRUGHOST
  States
  {
  Spawn:
    TNT1 AAAA 2
    loop
  Death:
    TNT1 AAAA 4
    stop
  }
}

actor AlienShrinkerAttack : ZMissile
{
  Radius 11
  Height 8
  Speed 25
  Damage (1)
  Projectile
  DeathSound "shrinker/hit"
  Obituary "none"
  scale 0.6
  decal DukeScorch
  damagetype "Shrinkerhit"
  RenderStyle Add
  +THRUGHOST
  -THRUSPECIES
  Species "none"
  +RANDOMIZE
  States
  {
  Spawn:
    SRKX AABBCCDD 1 bright NoDelay A_SpawnItem("GreenFlare22",0,0)
    loop
  Death:
    TNT1 A 0 A_CustomMissile ("GreenPlasmaFire", 0, 0, random[RIDFX](0, 360), 2, random[RIDFX](0, 360))
    TNT1 AAAAA 0 A_CustomMissile ("GreenPlasmaParticle", 0, 0, random[RIDFX](0, 360), 2, random[RIDFX](0, 360))
    TNT1 AAAAA 0 A_CustomMissile ("GreenPlasmaParticle", 0, 0, random[RIDFX](0, 360), 2, random[RIDFX](0, 360))
    TNT1 AAAAA 0 A_CustomMissile ("GreenPlasmaParticle", 0, 0, random[RIDFX](0, 360), 2, random[RIDFX](0, 360))
    SRKX EEEE 1 bright A_SpawnItem("LensFlareTorchGreen",0,0)
    SRKX F 4 bright A_Explode(1,20,XF_EXPLICITDAMAGETYPE,0,20,0,0,"none","Shrinker")
    TNT1 A 0 A_CustomMissile ("ShrinkerAttackSmoke", 1, 0, random[RIDFX](0, 360), 2, random[RIDFX](0, 160)) 
    SRKX G 4 bright
    SRKX H 4 bright
    TNT2 AAAA 9 A_CustomMissile ("ShrinkerAttackSmoke", 1, 0, random[RIDFX](0, 360), 2, random[RIDFX](0, 160))
    stop
  }
}

ACTOR AlienMorpherAttack : ShrinkerMorph
{
  -THRUSPECIES
  Species "none"
}

actor ShrinkTime : Inventory
{
  inventory.amount 0
  inventory.maxamount 40
}

ACTOR ShrinkEffect : FreezerEffect
{
  scale 1.0
}

actor EnemyBeingStomped : Inventory
{
  inventory.amount 0
  inventory.maxamount 1
}

actor ShrunkEnemy : ZShrunkEnemy
{
  MONSTER
  -SOLID
  +FORCEXYBILLBOARD
//  +FLOORCLIP
  +FRIGHTENED
  Scale 0.2
  meleerange 10
  species "shrunkenemy"
  damagefactor "Shrinker", 0.0
  damagefactor "AlienzShrinker", 0.0
  damagefactor "Shrinkerhit", 0.0
  health 1
  height 16
  radius 20
  mass 1000
  speed 2
  +NOPAIN
  states
  {
  Spawn:
    TNT1 A 0
    TNT1 A 0 A_ReplaceWithSourceEnemy(0,0)
    "####" "#" 0 A_JumpIfInventory("ShrinkTime",40,"Unshrink")
    "####" "#" 0 A_GiveInventory("ShrinkTime",1)
    "####" "#" 0 A_Look
    TNT1 A 0 A_ReplaceWithSourceEnemy(0,10)
    loop
  Idle:
    "####" "#" 0 A_FaceTarget
    TNT1 A 0 A_ReplaceWithSourceEnemy(0,5)
    TNT1 A 0 A_ReplaceWithSourceEnemy(1,5)
    TNT1 A 0 A_ReplaceWithSourceEnemy(0,5)
    TNT1 A 0 A_ReplaceWithSourceEnemy(1,5)
    TNT1 A 0 A_ReplaceWithSourceEnemy(0,5)
    TNT1 A 0 A_ReplaceWithSourceEnemy(1,5)
    TNT1 A 0 A_ReplaceWithSourceEnemy(0,5)
    TNT1 A 0 A_ReplaceWithSourceEnemy(1,5)
    TNT1 A 0 A_ReplaceWithSourceEnemy(0,5)
    TNT1 A 0 A_ReplaceWithSourceEnemy(1,5)
    "####" "#" 0 A_JumpIfInventory("ShrinkTime",40,"Unshrink")
    "####" "#" 0 A_GiveInventory("ShrinkTime",1)
    loop
  See:
    "####" "#" 0 A_JumpIfInventory("ShrinkTime",40,"Unshrink")
    "####" "#" 0 A_GiveInventory("ShrinkTime",1)
    "####" "#" 0 A_Chase
    TNT1 A 0 A_ReplaceWithSourceEnemy(0,3)
    "####" "#" 0 A_Chase
    TNT1 A 0 A_ReplaceWithSourceEnemy(0,3)
    "####" "#" 0 A_Chase
    TNT1 A 0 A_ReplaceWithSourceEnemy(1,3)
    "####" "#" 0 A_Chase
    TNT1 A 0 A_ReplaceWithSourceEnemy(1,3)
    "####" "#" 0 A_Chase
    TNT1 A 0 A_ReplaceWithSourceEnemy(2,3)
    "####" "#" 0 A_Chase
    TNT1 A 0 A_ReplaceWithSourceEnemy(2,3)
    "####" "#" 0 A_Chase
    TNT1 A 0 A_ReplaceWithSourceEnemy(3,3)
    "####" "#" 0 A_Chase
    TNT1 A 0 A_ReplaceWithSourceEnemy(3,3)
    loop
//  Pain:
//    "####" "#" 0 A_Pain
//    TNT1 A 0 A_ReplaceWithSourceEnemy(0,1)
//    goto See
  Death:
    "####" "#" 0
    "####" "#" 0 A_SpawnItemEx("DukeRedBloodPool")
  XDeath:
    "####" "#" 0 A_XScream
    "####" "#" 0 A_NoBlocking
    "####" "#" 0 A_SpawnDebris("DukeGibs5NF", TRUE, 1.0, 1.0)
    "####" "#" 0 A_SpawnDebris("DukeGibs6", FALSE, 1.0, 1.0)
    TNT1 A 1
    stop
  Unshrink:
    "####" "#" 0 A_JumpIfCondition(2,"Unshrinkb")
    "####" "#" 0 A_SetSizeHeight
    "####" "#" 0 A_ChangeFlag("SOLID",1)
    "####" "#" 0 A_PlaySound("shrinker/shrink")
    "####" "#" 0 A_CustomMissile("ShrinkEffect",32,0,0)
    goto Unshrink2
  Unshrinkb:
    "####" "#" 0 A_SetSizeHeight
    "####" "#" 0 A_ChangeFlag("SOLID",1)
    "####" "#" 0 ThrustThingZ(0,5,0,1)
    "####" "#" 0 A_ChangeFlag("NOGRAVITY",1)
    "####" "#" 0 A_PlaySound("shrinker/shrink")
    "####" "#" 0 A_CustomMissile("ShrinkEffect",32,0,0)
    goto Unshrink2
  Unshrink2:
    "####" "#" 0 A_JumpIfCondition(3,"Unshrink2b")
    "####" "#" 0 {A_SetScale(ScaleX + 0.04, ScaleY + 0.04); A_SpawnItemEx("ShrunkBlur",0,0,0,0,0,0,angle,SXF_TRANSFERSPRITEFRAME|SXF_TRANSFERSCALE|SXF_TRANSFERTRANSLATION|SXF_NOCHECKPOSITION|SXF_ABSOLUTEANGLE);}
    TNT1 A 0 A_ReplaceWithSourceEnemy(0,2)
    "####" "#" 0 A_JumpIfCondition(1,"Unshrink2")
    "####" "#" 0 A_Unshrink
    "####" "#" 0 A_Remove(AAPTR_DEFAULT)
    stop
  Unshrink2b:
    "####" "#" 0 {A_SetScale(ScaleX + 0.04, ScaleY + 0.04); A_SpawnItemEx("ShrunkBlur",0,0,0,0,0,0,angle,SXF_TRANSFERSPRITEFRAME|SXF_TRANSFERSCALE|SXF_TRANSFERTRANSLATION|SXF_NOCHECKPOSITION|SXF_ABSOLUTEANGLE);}
    TNT1 A 0 A_ReplaceWithSourceEnemy(0,2)
    "####" "#" 0 A_JumpIfCondition(1,"Unshrink2b")
    "####" "#" 0 A_CheckCeiling(3)
    "####" "#" 0 A_Unshrink
    "####" "#" 0 A_Remove(AAPTR_DEFAULT)
    stop
    "####" "#" 0 A_Unshrink(true)
    "####" "#" 0 A_Remove(AAPTR_DEFAULT)
    TNT1 A 1
    stop
  DeathPossess:
    "####" "#" 0
    "####" "#" 0 A_Die
    TNT1 A 1
    Stop
  }
}

actor ShrunkEnemyb : ShrunkEnemy
{
  bloodcolor "AA D1 5C"
  states
  {
  Death:
    "####" "#" 0
    "####" "#" 0 A_SpawnItemEx("DukeGreenBloodPool")
  XDeath:
    "####" "#" 0 A_XScream
    "####" "#" 0 A_NoBlocking
    "####" "#" 0 A_SpawnDebris("AlienDukeGibs5NF", TRUE, 1.0, 1.0)
    "####" "#" 0 A_SpawnDebris("AlienDukeGibs6", FALSE, 1.0, 1.0)
    TNT1 A 1
    stop
  }
}

actor ShrunkBlur
{
  +NOBLOCKMAP
  +NOGRAVITY
  +NOINTERACTION
  +CLIENTSIDEONLY
  RenderStyle Translucent
  Alpha 0.6
  States
  {
  Spawn:
    "####" "#" 6
    "####" "#" 3 A_SetTranslucent(0.4)
    Stop
  }
}