ACTOR IcicleBowCounter : Inventory
{
	Inventory.MaxAmount 1
}

Actor IcicleBow : Weapon 
{
	Weapon.AmmoType "Shell"
	Weapon.AmmoType2 "Shell"
	Weapon.AmmoGive 8
	Weapon.AmmoUse 1
	Weapon.AmmoUse2 2
	Weapon.SlotNumber 3
	Inventory.PickupMessage "You got the Icicle Bow!"
	Obituary "%o was shattered by %k's Icicle Bow."
	+WEAPON.NOAUTOFIRE
	Tag "Icicle Bow"
	States
	{
	Spawn:
		WBOW A -1
		Stop
	Deselect:
		BOWG A 1 Bright A_Lower
		Loop
	Select:
		BOWG A 1 Bright A_Raise
		Loop
	Ready:
		BOWG AAABBBCCCDDDBBB 1 Bright A_WeaponReady
    	Loop
	Fire:
		BOWG A 0 Bright A_GunFlash
		BOWG A 0 Bright A_Recoil(4.0)
		BOWG A 0 Bright A_PlaySound("weapons/cryobowshot")
		BOWG A 0 Bright A_PlaySound("weapons/cryobowfire", CHAN_WEAPON)
		BOWF A 0 Bright A_FireCustomMissile("IcicleBowShard1",0,1)
		BOWF A 0 Bright A_FireCustomMissile("IcicleBowShard2",2,0)
		BOWF A 0 Bright A_FireCustomMissile("IcicleBowShard2",-2,0)
		BOWF A 0 Bright A_FireCustomMissile("IcicleBowShard3",0,0)
		BOWF A 0 Bright A_FireCustomMissile("IcicleBowShard3",4,0)
		BOWF A 0 Bright A_FireCustomMissile("IcicleBowShard3",-4,0)
		BOWF A 0 Bright A_FireCustomMissile("IcicleBowShard4",2,0)
		BOWF A 0 Bright A_FireCustomMissile("IcicleBowShard4",-2,0)
		BOWF A 0 Bright A_FireCustomMissile("IcicleBowShard4",6,0)
		BOWF A 0 Bright A_FireCustomMissile("IcicleBowShard4",-6,0)
		BOWF ABCD 2 Bright
		BOWF E 8
		BOWF E 2 A_PlaySound("weapons/cryobowreload")
		BOWF E 2 Offset(0,31) 
		BOWF F 2 Offset(0,32)
		BOWF F 2 Offset(0,30)
		BOWF G 2 Offset(0,31)
		BOWF HI 1 Offset(0,32)
		BOWG CDB 3 Bright Offset(0,32)
		BOWG A 0 A_ReFire
		Goto Ready
	Altfire:
		BOWG A 0 Bright A_GunFlash
		BOWG A 0 Bright A_Recoil(4.0)
		BOWG A 0 Bright A_PlaySound("weapons/cryobowshot")
		BOWG A 0 Bright A_PlaySound("weapons/cryobowfire", CHAN_WEAPON)
		BOWF A 2 Bright A_FireCustomMissile("CryoShot",0,1)
		BOWF BCD 2 Bright
		BOWF E 8
		BOWF E 2 A_PlaySound("weapons/cryobowreload")
		BOWF E 2 Offset(0,31) 
		BOWF F 2 Offset(0,32)
		BOWF F 2 Offset(0,30)
		BOWF G 2 Offset(0,31)
		BOWF HI 1 Offset(0,32)
		BOWG CDB 3 Bright Offset(0,32)
		BOWG A 0 A_ReFire
		Goto Ready
	Flash:
		TNT1 A 2 Bright A_Light1
		TNT1 A 2 Bright A_Light2
		TNT1 A 1 Bright A_Light1
		Goto LightDone
	}
}
Actor IcicleBowShard1
{
  Speed 50
  Radius 3
  Height 6
  Damage (9) //I mean, of course.
  +THRUSPECIES
  Species "Player"
  DamageType Ice
  Projectile
  DeathSound "FrostFang/Hit1"
  Scale 0.75
  RenderStyle Translucent
  Alpha 0.8
  States
  {
  Spawn:
    ICSD AAABBBCCC 1 Bright A_SpawnItemEx("FrostFangFog", -(MomX/1.4), -(MomY/1.4), (MomZ/1.4*-1), (MomX/1.4), (MomY/1.4), (MomZ/1.4), -Angle, 138)
    Loop
  Death:
    ICSD DEFGH 5 Bright
    Stop
  }
}
Actor IcicleBowShard2 : IcicleBowShard1 { Speed 45 }
Actor IcicleBowShard3 : IcicleBowShard1 { Speed 40 }
Actor IcicleBowShard4 : IcicleBowShard1 { Speed 35 }
Actor IcicleBowShard5 : IcicleBowShard1 { Speed 30 }
Actor IcicleBowShard6 : IcicleBowShard1 { Speed 25 }
Actor FrostFangFog
{
  Radius 1
  Height 1
  +NoGravity
  +NoClip
  RenderStyle Add
  Alpha 0.2
  XScale 0.4
  YScale 0.2
  States
  {
  Spawn:
    FFFG A 4 A_FadeOut(0.1)
    Loop
  }
}
ACTOR CryoShot : FastProjectile
{
	Radius 4
	Height 8
	Speed 100
	Damage 0
	Projectile
	RenderStyle Add
	Alpha 0.9
	+FORCERADIUSDMG
	+NODAMAGETHRUST
	DeathSound "weapons/cryobowhit"
	MissileType "CryoTrail"
	MissileHeight 8
	Decal "PlasmaScorchLower"
	States
	{
	Spawn:
		BSHT A 0 Bright
		BSHT A 0 Bright A_PlaySound("weapons/cryobowflyby", CHAN_BODY, 1.0, 1)
		BSHT A 1 Bright
		Loop
	Death:		
		BXPL A 0 Bright A_StopSound(CHAN_BODY)
		BXPL A 0 Bright A_Explode(9, 128, 0, 0, 128) // Break frozen things, 9 damage because of course it is)
		BXPL A 0 Bright A_ChangeFlag("ICEDAMAGE", 1)
		BXPL A 0 Bright A_ChangeFlag("NODAMAGETHRUST", 0)
		BXPL A 0 Bright A_Explode(18, 18, 0, 0, 18) // Simulated impact damage, 9 * 2 damage.
		BXPL A 0 Bright A_Explode(81, 144, 0) // Freezy radius damage, hits for 9 * 5 damage and 9 * 16 radius.
		//BXPL AAAAAAAA 0 Bright A_SpawnItemEx("CryoSmoke", 0, 0, 0, random(10, 30)*0.1, 0, random(0, 10)*0.1, random(1,360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		//BXPL AAAA 0 Bright A_SpawnItemEx("CryoSmoke2", 0, 0, 0, random(10, 30)*0.04, 0, random(0, 10)*0.04, random(1,360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION,64)
		BXPL ABCDEFGH 1 Bright
		BXPL IJKLLM 1 Bright A_FadeOut(0.1)
		Stop
	}
}

ACTOR CryoTrail
{
	+NOINTERACTION
	Radius 4
	Height 8
	Renderstyle Add
	Alpha 0.5
	States
	{
	Spawn:
		BSHT AABBCDEFG 1 Bright
		Stop
	}
}
/*
ACTOR CryoSmoke
{
    Radius 2
    Height 2
    +NOINTERACTION
    +FORCEXYBILLBOARD
    RenderStyle Shaded
    StencilColor "A0 A0 A0"
    Alpha 1.0
    Scale 0.4
    States
    {
    Spawn:
		SMOK A 0
        SMOK A 2 A_FadeOut (0.05)
        Wait
    }
}
Actor CryoSmoke2 : CryoSmoke
{
	StencilColor "DD DD DD"
	Scale 0.7
	Alpha 0.5
	VSpeed 2.5
	States
	{
	Spawn:
		TNT1 A 0
		SMOK A 6 A_FadeOut(0.04)
		Wait
	}
}
*/