actor "Freezer Rifle" : Weapon
{
  Game Doom
  SpawnID 30
  Weapon.PreferredSkin "GrenadeLauncher-Marine"
  Weapon.SelectionOrder 110
  Weapon.AmmoUse 2
  Weapon.AmmoGive 40
  Weapon.AmmoType "NewCell"
  Inventory.PickupMessage "You got the Freeze rifle!"
  Obituary "%o couldn't handle k's chilled weaponry."
  Weapon.Upsound "weapons/freezeup"
  +INVENTORY.UNDROPPABLE
  States
  {
  Ready:
    FRSG A 1 A_WeaponReady
    Loop
  Deselect:
    FRSG A 1 A_Lower
    Loop
  Select:
    FRSG A 1 A_Raise
	Loop
  Fire:
    FRSG A 0 A_GunFlash
    TNT1 A 0 A_PlaySound("weapons/iceshot",6,5)
	FRSG A 2 A_FireCustomMissile("FreezeBlast",0.0)
    FRSG A 1 Offset(0,40)
	FRSG A 1 Offset(0,48)
	FRSG A 1 Offset(0,44)
	FRSG A 1 Offset(0,40)
	FRSG A 1 Offset(0,37)
	FRSG A 1 Offset(0,35)
	TNT1 A 0 A_PlaySound("weapons/chill",6,5)
	FRSF B 2 A_Refire
    Goto Ready
  Flash:
    FRSF A 3 Bright A_Light1
	Goto LightDone
    FRSF B 3 Bright A_Light1
    Goto LightDone
  Spawn:
    FRAS A -1
    Stop
  }
}

actor FreezeBlast
{
  Radius 13
  Height 8
  Speed 55
  Damage 12
  Projectile
  Species "Player"
  +RANDOMIZE
  +THRUSPECIES
  RenderStyle Add
  Alpha 0.75
  scale 0.9
  SeeSound "weapons/iceshot"
  DeathSound "weapons/icehit"
  Obituary "%o got frozen solid by %k."
  DamageType "Ice"
  States
  {
  Spawn:
    FBLS A 6 bright A_SpawnItem("FreezeBlastTrail")
    loop
  Death:
    TNT1 AAA 0 A_CustomMissile("Kaboom6", 0, 0, random(0,360), 2, random(0,360))
	FBLS BCDE 4 bright
    stop
  }
}

actor FreezeBlastTrail
{
  Radius 13
  Height 8
  Speed 20
  Damage 0
  Projectile
  +RANDOMIZE
  RenderStyle Add
  Alpha 0.75
  SeeSound "weapons/iceshot"
  DeathSound "weapons/icehit"
  Obituary "%o got frozen solid by %k."
  States
  {
  Spawn:
    TNT1 A 0
    TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(304) == 1, "Toaster")
  Fade:
    FRTR ABC 6 bright A_FadeOut(0.2)
    Loop
  Toaster:
    FRTR ABC 6 bright
    Stop
  Death:
    FRTR ABC 4 bright
    Stop
  }
}