ACTOR RasputinFrostShell : FastProjectile
{
   Obituary "%o received a ''Froststorm'' grenade in da face, thanks to %k's ''Rasputin''."
   Radius 10
   Height 14
   Speed 100
   Damage 150
   Scale 0.9
   PROJECTILE
   +RANDOMIZE
   +THRUGHOST
   +EXPLODEONWATER
   +DONTBLAST
   MissileType "100MMTrailSpawner"
   Scale 0.8
   States
   {
   Spawn:
      RASC A 0
      RASC A 0 ThrustThingZ(0,30,0,1)
      RASC A 0 A_PlaySound("Weapons/PushkaLoop",5,1.0)
   Maocopter:
      RASC A 0 ThrustThingZ(0,random(-4,-6),0,1)
      RASC A 1 Bright
	  Loop
  Death:
    TNT1 A 0 A_PlaySound("Rasputin/Hit",5)
    TNT1 A 0 A_SpawnItemEx("FrozenOrbProjectile",0,0,10,0,0,0,0,SXF_TRANSFERPOINTERS,0)
    stop
   }
}

ACTOR IcestormShard
{
  Radius 6
  Height 9
  Damage 15
  Projectile
  +DONTSPLASH
  +EXPLODEONWATER
  -NOGRAVITY
  Gravity 0.6
  Renderstyle Add
  DamageType Ice
  DeathSound "Icestorm/Hit"
  //ProjectileKickBack 80
  Obituary "%o was rained upon %k's icestorm ball."
  Scale 1.0
  States
  {
  Spawn:
  ICEB A 0
  ICPR AAABBBCCC 1 Bright A_SpawnItemEx("IcestormShardTrail",random(2,-2),0,random(2,-2))
  Loop
  Death:
  TNT1 A 0 A_SpawnItemEx("FrozenShardExploder",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS) //to shatter the frozen enemies
  ICPR DEFGH 2 Bright
  Stop
  }
}

ACTOR IcestormShardTrail
{
  +NOGRAVITY
  +NOINTERACTION
  Renderstyle Add
  +CLIENTSIDEONLY
  Scale 0.8
  States
  {
  Spawn:
  ICPR AABBCC 1 Bright A_FadeOut(0.15)
  Stop
  }
}

//Tomed Spell

actor FrozenOrbProjectile
{
  Radius 10
  Height 14
  Speed 0
  Damage 10
  Projectile
  +DONTSPLASH
  +EXPLODEONWATER
  +RIPPER
  +BLOODLESSIMPACT
  Renderstyle Add
  DamageType Ice
  DeathSound ""
  //ProjectileKickBack 0
  Obituary "%o was frozen by %k's oversized frost ball of doom."
  Scale 1.0
  ReactionTime 11
  var int user_count;
  States
  {
  Spawn:
    SBLL AA 0 A_PlaySound("FrozenOrb/Fly",5,0.9,1)
  Looplet:
    TNT1 A 0 A_Countdown
    TNT1 A 0 A_AlertMonsters //it's pretty damn loud and visible, you know
	SBLL AAA 0 A_SpawnItemEx("FrozenOrbShard",random(12,-12),random(12,-12),random(12,-12),frandom(9.0,8.0),frandom(8.0,9.0),frandom(0.5,-0.5),random(0,359))
    SBLL A 1 Bright
	SBLL AAA 0 A_SpawnItemEx("FrozenOrbShard",random(12,-12),random(12,-12),random(12,-12),frandom(9.0,8.0),frandom(8.0,9.0),frandom(0.5,-0.5),random(0,359))
    SBLL B 1 Bright
	SBLL AAA 0 A_SpawnItemEx("FrozenOrbShard",random(12,-12),random(12,-12),random(12,-12),frandom(9.0,8.0),frandom(8.0,9.0),frandom(0.5,-0.5),random(0,359))
    SBLL C 1 Bright
    TNT1 A 0 A_AlertMonsters
	SBLL AAA 0 A_SpawnItemEx("FrozenOrbShard",random(12,-12),random(12,-12),random(12,-12),frandom(9.0,8.0),frandom(8.0,9.0),frandom(0.5,-0.5),random(0,359))
    SBLL D 1 Bright
	SBLL AAA 0 A_SpawnItemEx("FrozenOrbShard",random(12,-12),random(12,-12),random(12,-12),frandom(9.0,8.0),frandom(8.0,9.0),frandom(0.5,-0.5),random(0,359))
    SBLL E 1 Bright
	SBLL AAA 0 A_SpawnItemEx("FrozenOrbShard",random(12,-12),random(12,-12),random(12,-12),frandom(9.0,8.0),frandom(8.0,9.0),frandom(0.5,-0.5),random(0,359))
    SBLL F 1 Bright
	TNT1 A 0 A_AlertMonsters
	SBLL AAA 0 A_SpawnItemEx("FrozenOrbShard",random(12,-12),random(12,-12),random(12,-12),frandom(9.0,8.0),frandom(8.0,9.0),frandom(0.5,-0.5),random(0,359))
    SBLL G 1 Bright
	SBLL AAA 0 A_SpawnItemEx("FrozenOrbShard",random(12,-12),random(12,-12),random(12,-12),frandom(9.0,8.0),frandom(8.0,9.0),frandom(0.5,-0.5),random(0,359))
    SBLL H 1 Bright
	SBLL AAA 0 A_SpawnItemEx("FrozenOrbShard",random(12,-12),random(12,-12),random(12,-12),frandom(9.0,8.0),frandom(8.0,9.0),frandom(0.5,-0.5),random(0,359))
    SBLL I 1 Bright
	Loop
  Death:
	//TNT1 A 0 A_SetUserVar("User_Count", 25)
    TNT1 A 0 A_PlaySound("Icestorm/Launch",5,0.9)
    TNT1 A 0 A_Quake (4, 25, 0, 256, none)
    TNT1 A 0 A_Quake (3, 25, 0, 384, none)
	TNT1 A 0 A_AlertMonsters
  Looplet2:
	//TNT1 A 0 A_JumpIf(User_Count <= 0,"TheEnd")
	TNT1 AAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("IcestormShard",random(4,-4),random(4,-4),random(4,-4),frandom(6.0,12.0),frandom(6.0,12.0),frandom(8.0,16.0),random(0,359),SXF_TRANSFERPOINTERS)
	TNT1 AAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("IcestormShard",random(4,-4),random(4,-4),random(4,-4),frandom(6.0,12.0),frandom(6.0,12.0),frandom(8.0,16.0),random(0,359),SXF_TRANSFERPOINTERS)
	TNT1 AAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("IcestormShard",random(4,-4),random(4,-4),random(4,-4),frandom(6.0,12.0),frandom(6.0,12.0),frandom(8.0,16.0),random(0,359),SXF_TRANSFERPOINTERS)
	TNT1 AAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("IcestormShard",random(4,-4),random(4,-4),random(4,-4),frandom(6.0,12.0),frandom(6.0,12.0),frandom(8.0,16.0),random(0,359),SXF_TRANSFERPOINTERS)
	//TNT1 A 0 A_SetUserVar("User_Count", User_Count - 1)
	//Loop
  TheEnd:
	TNT1 A 0 A_SpawnItemEx("FrozenOrbShardNova",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS)
    stop
  }
}

ACTOR FrozenOrbShardNova
{
   +NOGRAVITY
   +NOINTERACTION
   ReactionTime 91
   States
   {
   Spawn:
   TNT1 A 0
   Looplet:
   TNT1 A 0 A_Countdown
   TNT1 A 0 A_SpawnItemEx("FrozenOrbShardNoGrav",0,0,0,frandom(9.0,10.0),0,0,0,SXF_TRANSFERPOINTERS)
   TNT1 A 0 A_SetAngle(Angle+4)
   Loop
   Death:
   Stop
   }
}

ACTOR FrozenOrbProjectileFade1
{
   Radius 14
   Height 16
   Speed 6
   Damage 0
   Projectile
   +NOGRAVITY
   +RIPPER
   +BLOODLESSIMPACT
   +CLIENTSIDEONLY
   Renderstyle Add
   Scale 1.2
   Alpha 0.9
   ReactionTime 24
   States
   {
   Spawn:
   SBLL AA 0 A_Countdown
   SBLL ABCDEFGI 1
   Loop
   Death:
   Stop
   }
}

ACTOR FrozenOrbProjectileFade2 : FrozenOrbProjectileFade1
{
   Scale 1.5
   Alpha 0.8
}

ACTOR FrozenOrbShard
{
  Radius 6
  Height 9
  Damage 10
  Projectile
  +DONTSPLASH
  +EXPLODEONWATER
  -NOGRAVITY
  Gravity 0.1
  Renderstyle Add
  DamageType Ice
  DeathSound "Icestorm/Hit"
  //ProjectileKickBack 80
  Obituary "%o was shredded'n'frozen by %k's frozen orb shards."
  Scale 1.1
  States
  {
  Spawn:
  SHRD AA 0 ThrustThingZ(0,frandom(8.0,10.0),0,1)
  Looplet:
  SHRD A 0 A_Weave (2, 0, 1.5, 0.0)
  SHRD A 1 Bright A_SpawnItemEx("FrozenOrbShardTrail",random(2,-2),0,random(2,-2))
  SHRD A 0 A_Weave (2, 0, 1.5, 0.0)
  SHRD B 1 Bright A_SpawnItemEx("FrozenOrbShardTrail",random(2,-2),0,random(2,-2))
  SHRD A 0 A_Weave (2, 0, 1.5, 0.0)
  SHRD C 1 Bright A_SpawnItemEx("FrozenOrbShardTrail",random(2,-2),0,random(2,-2))
  Loop
  Death:
  TNT1 A 0 A_PlaySound("FrozenOrb/Hit",5,0.6)
  TNT1 A 0 A_SpawnItemEx("FrozenShardExploder",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS) //to shatter the frozen enemies
  ICPR DEFGH 2 Bright
  Stop
  }
}

ACTOR FrozenShardExploder
{
  +NOINTERACTION
  +NOGRAVITY
  +FORCERADIUSDMG
  States
  {
  Spawn:
  TNT1 AA 0 A_Explode(1,16,0,0,16)
  Stop
  }
}

ACTOR FrozenOrbShardNoGrav : FrozenOrbShard
{
  +NOGRAVITY
  States
  {
  Spawn:
  SHRD A 0
  SHRD A 0 A_Weave (2, 0, 1.5, 0.0)
  SHRD A 1 Bright A_SpawnItemEx("FrozenOrbShardTrail",random(2,-2),0,random(2,-2))
  SHRD A 0 A_Weave (2, 0, 1.5, 0.0)
  SHRD B 1 Bright A_SpawnItemEx("FrozenOrbShardTrail",random(2,-2),0,random(2,-2))
  SHRD A 0 A_Weave (2, 0, 1.5, 0.0)
  SHRD C 1 Bright A_SpawnItemEx("FrozenOrbShardTrail",random(2,-2),0,random(2,-2))
  Loop
  }
}

ACTOR FrozenOrbShardTrail
{
  +NOGRAVITY
  +CLIENTSIDEONLY
  +NOINTERACTION
  Renderstyle Add
  Scale 1.3
  States
  {
  Spawn:
  SHRD DEFGH 2 Bright A_FadeOut(0.15)
  Stop
  }
}
