/*

==ICE BEAM==
The default attachment of the Blastmaster Mk.2, the ice beam
releases a highly focused beam of sub-zero energy, tearing
into soft targets while simultaneously freezing them. This
focusing is extremely taxing on the main weapon platform,
generating heat at a high rate, though as heat builds,
the ice beam module overclocks, increasing output and making
the beam more damaging.

Once firing stops, there's a brief pause before the generator
begins to replenish, providing effectively infinite ammo.

==VENT ATTACKS==
One of the key features of the Blastmaster Mk.2 is the 
ability to take accumulated and weaponize it. At tier 1
the heat is converted into a flamethrower, simple, but 
time has proven not much can withstand fire when applied
in large quantities. Tier 2 condenses the heat into dense
plasma bullets, the vent attack becoming a rapid fire
machine gun attack. While not as hot as the flames, they 
travel further. Finally, at tier 3, all of the built up 
heat is compressed into a single explosive plasma grenade, 
thankfully the heat shielding provided by the main platform 
will protect the user from being roasted by the explosion
if used in close range.

If the heat reaches critical levels without any venting,
the weapon locks up, and any attached modules cannot be
used until the weapon resets. Thankfully in the event
of a lockdown, the venter can still be used to blast
out extra hot flames similar to the tier 1 flamer.

==SUPER VENTER==
The Blastmaster Mk.2 can be equipped with this device to
augment the venting attacks. Tier 1's flamer scatters out 
extra flames, tier 2's machine gun bullets travel at a 
much higher velocity, and tier 3's grenades explode with
more force. The emergency flamer becomes a devastating 
firestorm, and after releasing the trigger, if there's
enough overheat available, a follow up plasma grenade
attack will be launched!


Sorry for that big block of lore text, but I didn't
have anywhere else fitting I can put all this.
*/

ACTOR BMIcebeam : Weapon
{
	Weapon.SelectionOrder 60
	Weapon.AmmoUse 1
	Weapon.AmmoType "Icecharge"
	Weapon.SlotNumber 2
	weapon.bobstyle alpha
	weapon.bobrangex 0.2
	weapon.bobrangey 0.2
	weapon.bobspeed 2
	Inventory.PickupMessage "You got the ice beam module!"
	Obituary "%o was frozen."
	Inventory.RestrictedTo "Blastmaster"
	+WEAPON.AMMO_OPTIONAL
	+WEAPON.ALT_AMMO_OPTIONAL
	+cheatnotweapon
	+undroppable
	+NOAUTOAIM
	Tag "Ice beam"
	states
	{
	Select:
		TNT1 A 0
        TNT1 AAAAAAAAAAAAAAAAAAAA 0 A_Raise
        TNT1 A 1 A_Raise
		goto ready
	Ready:
		BMST A 2
		TNT1 A 0 a_playsound ("BMicebeam/raise",6)
		ICBE ACDFGHIJ 1 a_weaponready (WRF_NOBOB | WRF_NOFIRE)
		ICBE LMNOPQRS 1 a_weaponready (WRF_NOBOB)
		goto realready 
	Deselect:
		TNT1 A 0
		TNT1 A 0 a_stopsound (6)
		TNT1 A 0 a_jumpifhealthlower (1, "deadlower")
		TNT1 A 0 a_takeinventory ("secretaction", 99)
		TNT1 A 0 a_playsound ("BMicebeam/lower", 0)
		TNT1 A 0
		ICBE RPMKIGEDB 1
		BMST A 5
	holster:
        TNT1 AAAAAAAAAAAAAAAAAAAA 0 A_lower
        TNT1 A 1 A_lower
		loop
	deadlower:
		TNT1 A 0
		TNT1 A 0
		TNT1 A 0 a_stopsound (6)
		TNT1 AAAAAAAAAAAAA 0 a_lower
		TNT1 A 1 a_lower
		wait	
	Realready:
		TNT1 A 0
		TNT1 A 0 a_jumpifinventory ("BMoverheat",1,"lockdown")
		WSDL A 0 a_jumpifinventory ("secretaction", 1, "PastBlaster")
		ICBE T 1 a_weaponready
		WSDL A 0 a_jumpifinventory ("secretaction", 1, "PastBlaster")
		TNT1 A 0 a_jumpifinventory ("BMoverheat",1,"lockdown")
		loop
	lockdown:
		TNT1 A 0
		TNT1 A 0 a_stopsound (6)
		ICBE T 3 a_weaponready (WRF_NOPRIMARY)
		TNT1 A 0 a_firecustommissile ("SmasherSmokeSpawner",0,0,0,0,0,0)
		ICBE T 3 a_weaponready (WRF_NOPRIMARY)
		TNT1 A 0 a_jumpifinventory ("BMoverheat",1,"lockdown")
		goto VentFinish
	Fire:
		TNT1 A 0
		TNT1 A 0 a_jumpifinventory ("BMoverheat",1,"lockdown")
		TNT1 A 0 a_jumpifinventory ("IceCharge",1,"ActuallyShoot")
		TNT1 A 0 a_playsound ("BlastMaster/DryFire",0)
		ICBE T 30 a_weaponready (WRF_NOPRIMARY)
		goto RealReady
	ActuallyShoot:
		TNT1 A 0 a_playsound ("BMicebeam/Fire",0)

	//Lv 1 Ice Beam------------------------------------------------------------------
	IceBeamStartLv1:
		TNT1 A 0
		TNT1 A 0 a_playsound ("BMIceBeam/Level1",6,1,1)
	IceBeamLoopLv1:
		TNT1 A 0
	//giving tokens for being fired
		TNT1 A 0 a_giveinventory ("BlastMasterFired",1)
	//heat checks
		TNT1 A 0 a_jumpifinventory ("BMheat",156,"IceBeamStartLv3")
		TNT1 A 0 a_jumpifinventory ("BMheat",91,"IceBeamStartLv2")
		TNT1 A 0 a_jumpifinventory ("BMoverheat",1,"IceBeamEndLv1")
	//maybe jump to the other muzzleflash, otherwise shoot this bastard
		TNT1 A 0 a_jump (80, "AltIceBeamFlashLv1")
		BMIB A 1 bright 
		TNT1 A 0 A_FireBullets (0,0, -1, 0, "IceBeamImpactLv1", FBF_NOFLASH)
		TNT1 A 0 a_firecustommissile ("IceSmokeSpawner",0,0,0,0,0,0)
		TNT1 A 0 a_gunflash ("PainCheckLv1",GFF_NOEXTCHANGE)
		TNT1 A 0 a_giveinventory ("BMheat",2)
		TNT1 A 0
		TNT1 A 0 A_RailAttack (2, 0, 1, none, none, RGF_SILENT | RGF_NOPIERCING | RGF_FULLBRIGHT, 0, "IceBeamTip", 0, 0, 0, 6, 6, 1, "IceBeamCoreLv1", 1)
		BMIB B 1 bright
		TNT1 A 0 a_refire ("AmmoCheckLv1")
		Goto IceBeamEndLv1
	AltIceBeamFlashLv1:	
		BMIB A 1 bright		
		TNT1 A 0 A_FireBullets (0,0, -1, 0, "IceBeamImpactLv1", FBF_NOFLASH)
		TNT1 A 0 a_firecustommissile ("IceSmokeSpawner",0,0,0,0,0,0)
		TNT1 A 0 a_giveinventory ("BMheat",2)
		TNT1 A 0 a_gunflash ("PainCheckLv1",GFF_NOEXTCHANGE)
		TNT1 A 0 A_RailAttack (2, 0, 1, None, None, RGF_SILENT | RGF_NOPIERCING | RGF_FULLBRIGHT, 0, "IceBeamTip", 0, 0, 0, 6, 6, 1, "IceBeamCoreLv1", 1)
		BMIB C 1 bright
		ICBE T 1 a_refire ("AmmoCheckLv1")
		goto IceBeamEndLv1
	
	AmmoCheckLv1:
		TNT1 A 0
		TNT1 A 0 a_jumpifinventory ("IceCharge",1,"IceBeamLoopLv1")
		TNT1 A 0 a_playsound ("BlastMaster/DryFire",0)
		goto IceBeamEndLv1
	
	IceBeamEndLv1:
		TNT1 A 0 A_FireBullets (0,0, -1, 0, "IceBeamImpactLv1", FBF_NOFLASH)
		TNT1 A 0 a_gunflash ("PainCheckLv1",GFF_NOEXTCHANGE)
		BMIB D 1 A_RailAttack (2, 0, 1, none, none, RGF_SILENT | RGF_NOPIERCING | RGF_FULLBRIGHT, 0, "IceBeamTip", 0, 0, 0, 6, 6, 1, "IceBeamFinisherLv1", 1)
		TNT1 A 0 a_playsound ("BMicebeam/End",6,1,0)
		TNT1 A 0 a_jumpifinventory ("BMoverheat",1,"lockdown")
		BMIB DEE 2
		BMIB FFGGHHIJKLMN 1 a_weaponready
		goto realready

	//This is how I make the beam flinch stuff
	//So it doesn't just perma stunlock dudes
	PainCheckLv1:
		TNT1 A 0
		TNT1 A 1 a_jump (70,"PainShot")
		stop
	PainShot:
		TNT1 A 0
		TNT1 A 1 a_firebullets (0,0,-1,0,"IceBeamPain",FBF_NOFLASH)
		stop
		
	//Lv 2 Ice Beam------------------------------------------------------------------
	IceBeamStartLv2:
		TNT1 A 0
		TNT1 A 0 a_playsound ("BMIceBeam/Level2",6,1,1)
	IceBeamLoopLv2:
		TNT1 A 0
	//giving tokens for being fired
		TNT1 A 0 a_giveinventory ("BlastMasterFired",1)
	//heat checks
		TNT1 A 0 a_jumpifinventory ("BMheat",156,"IceBeamStartLv3")
		TNT1 A 0 a_jumpifinventory ("BMoverheat",1,"IceBeamEndLv2")
	//maybe jump to the other muzzleflash, otherwise shoot this bastard
	IceBeamLv2:	
		TNT1 A 0
		TNT1 A 0 A_Quake(1, 2, 0, 32)
		TNT1 A 0 a_jump (80, "AltIceBeamFlashLv2")
		BMIB A 1 bright 
		TNT1 A 0 A_FireBullets (0,0, -1, 0, "IceBeamImpactLv2", FBF_NOFLASH)
		TNT1 A 0 a_gunflash ("PainCheckLv2",GFF_NOEXTCHANGE)
		TNT1 A 0 a_firecustommissile ("IceSmokeSpawner",0,0,0,0,0,0)
		TNT1 A 0 a_giveinventory ("BMheat",2)
		TNT1 A 0 A_RailAttack (5, 0, 1, none, none, RGF_SILENT | RGF_NOPIERCING | RGF_FULLBRIGHT, 0, "IceBeamTip", 0, 0, 0, 6, 6, 1, "IceBeamCoreLv2", 1)
		BMIB B 1 bright
		TNT1 A 0 a_refire ("AmmoCheckLv2")
		Goto IceBeamEndLv2
	AltIceBeamFlashLv2:	
		BMIB A 1 bright		
		TNT1 A 0 A_FireBullets (0,0, -1, 0, "IceBeamImpactLv2", FBF_NOFLASH)
		TNT1 A 0 a_gunflash ("PainCheckLv2",GFF_NOEXTCHANGE)
		TNT1 A 0 a_firecustommissile ("IceSmokeSpawner",0,0,0,0,0,0)
		TNT1 A 0 a_giveinventory ("BMheat",2)
		TNT1 A 0 A_RailAttack (5, 0, 1, None, None, RGF_SILENT | RGF_NOPIERCING | RGF_FULLBRIGHT, 0, "IceBeamTip", 0, 0, 0, 6, 6, 1, "IceBeamCoreLv2", 1)
		BMIB C 1 bright
		ICBE T 1 a_refire ("AmmoCheckLv2")
		goto IceBeamEndLv2
	
	AmmoCheckLv2:
		TNT1 A 0
		TNT1 A 0 a_jumpifinventory ("IceCharge",1,"IceBeamLoopLv2")
		TNT1 A 0 a_playsound ("BlastMaster/DryFire",0)
		goto IceBeamEndLv2
	
	IceBeamEndLv2:
		TNT1 A 0 A_FireBullets (0,0, -1, 0, "IceBeamImpactLv2", FBF_NOFLASH)
		TNT1 A 0 a_gunflash ("PainCheckLv2",GFF_NOEXTCHANGE)
		BMIB D 1 A_RailAttack (5, 0, 1, none, none, RGF_SILENT | RGF_NOPIERCING | RGF_FULLBRIGHT, 0, "IceBeamTip", 0, 0, 0, 6, 6, 1, "IceBeamFinisherLv2", 1)
		TNT1 A 0 a_playsound ("BMicebeam/End",6,1,0)
		TNT1 A 0 a_jumpifinventory ("BMoverheat",1,"lockdown")
		BMIB DEE 2
		BMIB FFGGHHIJKLMN 1 a_weaponready
		goto realready
	
	//Same thing as above, it just stings 
	//a little more!
	PainCheckLv2:
		TNT1 A 0
		TNT1 A 1 a_jump (95,"PainShot")
		stop


	//Lv 3 Ice Beam------------------------------------------------------------------
	IceBeamStartLv3:
		TNT1 A 0
		TNT1 A 0 a_playsound ("BMIceBeam/Level3",6,1,1)
	IceBeamLoopLv3:
		TNT1 A 0
	//giving tokens for being fired
		TNT1 A 0 a_giveinventory ("BlastMasterFired",1)
	//heat checks
		TNT1 A 0 a_jumpifinventory ("BMoverheat",1,"IceBeamEndLv3")
	//maybe jump to the other muzzleflash, otherwise shoot this bastard
	IceBeamLv3:	
		TNT1 A 0
		TNT1 A 0 A_Quake(2, 2, 0, 32)
		TNT1 A 0 a_jump (80, "AltIceBeamFlashLv3")
		BMIB A 1 bright 
		TNT1 A 0 A_FireBullets (0,0, -1, 0, "IceBeamImpactLv3", FBF_NOFLASH)
		TNT1 A 0 a_gunflash ("PainCheckLv3",GFF_NOEXTCHANGE)
		TNT1 A 0 a_firecustommissile ("IceSmokeSpawner",0,0,0,0,0,0)
		TNT1 A 0 a_giveinventory ("BMheat",3)
		TNT1 A 0 A_RailAttack (9, 0, 1, none, none, RGF_SILENT | RGF_NOPIERCING | RGF_FULLBRIGHT, 0, "IceBeamTip", 0, 0, 0, 6, 6, 1, "IceBeamCoreLv3", -2)
		BMIB B 1 bright
		TNT1 A 0 a_refire ("AmmoCheckLv3")
		Goto IceBeamEndLv3
	AltIceBeamFlashLv3:	
		BMIB A 1 bright		
		TNT1 A 0 A_FireBullets (0,0, -1, 0, "IceBeamImpactLv3", FBF_NOFLASH)
		TNT1 A 0 a_gunflash ("PainCheckLv3",GFF_NOEXTCHANGE)
		TNT1 A 0 a_firecustommissile ("IceSmokeSpawner",0,0,0,0,0,0)
		TNT1 A 0 a_giveinventory ("BMheat",2)
		TNT1 A 0 A_RailAttack (9, 0, 1, None, None, RGF_SILENT | RGF_NOPIERCING | RGF_FULLBRIGHT, 0, "IceBeamTip", 0, 0, 0, 6, 6, 1, "IceBeamCoreLv3", -2)
		BMIB C 1 bright
		ICBE T 1 a_refire ("AmmoCheckLv3")
		goto IceBeamEndLv3
	
	AmmoCheckLv3:
		TNT1 A 0
		TNT1 A 0 a_jumpifinventory ("IceCharge",1,"IceBeamLoopLv3")
		TNT1 A 0 a_playsound ("BlastMaster/DryFire",0)
		goto IceBeamEndLv3
	
	IceBeamEndLv3:
		TNT1 A 0 A_FireBullets (0,0, -1, 0, "IceBeamImpactLv3", FBF_NOFLASH)
		TNT1 A 0 a_gunflash ("PainCheckLv3",GFF_NOEXTCHANGE)
		BMIB D 1 A_RailAttack (9, 0, 1, none, none, RGF_SILENT | RGF_NOPIERCING | RGF_FULLBRIGHT, 0, "IceBeamTip", 0, 0, 0, 6, 6, 1, "IceBeamFinisherLv3", -2)
		TNT1 A 0 a_playsound ("BMicebeam/End",6,1,0)
		TNT1 A 0 a_jumpifinventory ("BMoverheat",1,"LockDown")
		BMIB DEE 2
		BMIB FFGGHHIJKLMN 1 a_weaponready
		goto realready
		
	//HOLY SHIT OW WHAT THE FUCK MAN
	PainCheckLv3:
		TNT1 A 0
		TNT1 A 1 a_jump (128,"PainShot")
		stop

		
	
		
	//VENT ATTACKS------------------------------------------------------------------
	Altfire:
		TNT1 A 0
		ICBE T 2 A_weaponready (WRF_NOFIRE)
		TNT1 A 0 a_jumpifinventory ("BMoverheat",1,"OverHeatFire")
		TNT1 A 0 a_jumpifinventory ("BMheat",156,"RedGrenade")
		TNT1 A 0 a_jumpifinventory ("BMheat",91,"YellowMachineGun")
		TNT1 A 0 a_jumpifinventory ("BMheat",1,"BlueFire")
		goto realready

	//Blue Fire (Tier one)----------------------------------------------------------
	BlueFire:
		TNT1 A 0 a_playsound ("BlastMaster/BlueFireStart",0)
		TNT1 A 0 a_playsound ("BlastMaster/BlueFireLoop",6,1,1)
	BlueFireLoop:
		TNT1 A 0 a_gunflash
		TNT1 A 0 a_takeinventory ("BMheat",2)
		TNT1 A 0 a_giveinventory ("BlastMasterFired",1)
		TNT1 A 0 a_giveinventory ("BlastMasterVented",1)
		TNT1 A 0 a_recoil (0.10)
		TNT1 A 0 Bright A_FireCustomMissile ("BlueVentFire",Frandom(-5, 5), 0, random(-1,1), random(-2,-1), 0, Frandom(-2, 2))
		ICBE T 0 A_jumpifinventory ("SuperVenter",1,"SuperBlueFire")
		BMV2 AB 1 bright
		TNT1 A 0 a_jumpifinventory ("BMHeat",1,"BlueFireLoop")
		TNT1 A 0 a_playsound ("BlastMaster/BlueFireEnd",6)
		goto VentFinish
	SuperBlueFire:
		TNT1 A 0
		TNT1 A 0 A_FireCustomMissile ("BlueVentEmber1",Frandom(-5, 5), 0, random(-4,4), random(1,4), 0, Frandom(-5, 5))
		TNT1 A 0 A_FireCustomMissile ("BlueVentEmber2",Frandom(-5, 5), 0, random(-4,4), random(1,4), 0, Frandom(-5, 5))
		TNT1 A 0 Bright A_FireCustomMissile ("BlueVentFire",Frandom(-9, 9), 0, random(-3,3), random(-2,-1), 0, Frandom(-4, 4))
		TNT1 A 0 a_playsound ("BlastMaster/PowerFire",0)
		BMV2 AB 1 bright
		TNT1 A 0 a_jumpifinventory ("BMHeat",1,"BlueFireLoop")
		TNT1 A 0 a_playsound ("BlastMaster/BlueFireEnd",6)
		goto VentFinish

	//Yellow Machine Gun (Tier two)--------------------------------------------------
	YellowMachineGun:
		TNT1 A 0 a_gunflash
		TNT1 A 0 a_takeinventory ("BMheat",4)
		TNT1 A 0 a_giveinventory ("BlastMasterFired",1)
		TNT1 A 0 a_giveinventory ("BlastMasterVented",1)
		TNT1 A 0 a_playsound ("BlastMaster/YellowShot",6)
		TNT1 A 0 A_Quake(1, 2, 0, 32)
		ICBE T 0 A_jumpifinventory ("SuperVenter",1,"YellowHitScan")
		ESHG B 0 Bright A_FireCustomMissile("YellowVentBullet",Frandom(-2, 2), 0, 0, random(-1,1), 0, Frandom(-2, 2))
		BMV2 CD 1 bright
		ICBE T 1
		TNT1 A 0 a_jumpifinventory ("BMHeat",1,"YellowMachineGun")
		goto VentFinish
	YellowHitScan:
		ESHG B 0 Bright A_FireBullets (3.5, 2.0, -1, 9, "YellowCAPuff",FBF_NORANDOM) 
		BMV2 C 1 bright
		TNT1 A 0 a_playsound ("BlastMaster/PowerGun",6)
		BMV2 D 1 bright
		ICBE T 1
		TNT1 A 0 a_jumpifinventory ("BMHeat",1,"YellowMachineGun")
		goto VentFinish

	//Red Grenade (Tier three)--------------------------------------------------------
	RedGrenade:
		TNT1 A 0 a_gunflash
		TNT1 A 0 a_playsound ("BlastMaster/RedGrenade",6)		
		TNT1 A 0 a_takeinventory ("BMheat",999)
		TNT1 A 0 a_giveinventory ("BlastMasterVented",1)
		TNT1 A 0 a_giveinventory ("BlastMasterFired",1)
		TNT1 A 0 A_Quake(2, 6, 0, 32)
		ICBE T 0 A_jumpifinventory ("SuperVenter",1,"SuperGrenade")
		ESHG B 0 Bright A_FireCustomMissile("RedGrenade")
		BMV2 EFGHHIIJJKKLL 1 bright
		ICBE T 3
		goto VentFinish
	SuperGrenade:
		ESHG B 0 Bright A_FireCustomMissile("SuperRedGrenade")
		BMV2 EFGHH 1
		TNT1 A 0 a_playsound ("BlastMaster/PowerGrenade",0)		
		BMV2 IIJJKKLL 1 bright
		ICBE T 3
		goto VentFinish

		
	
	VentFinish:
		ICBE T 3
		BMP2 ABCC 2
		TNT1 A 0 a_takeinventory ("BlastMasterFired",99)
		TNT1 A 0 a_takeinventory ("BlastMasterVented",99)
		TNT1 A 0 a_playsound ("BlastMaster/PumpDown",0)
		BMP2 DEFFG 2 A_FireCustomMissile ("BlastMasterSmoker",0,0,6,6)
		TNT1 A 0 a_playsound ("BlastMaster/PumpUp",0)
		BMP2 CBA 2
		ICBE T 1
		goto realready

	//Super Flamer (Overheat)--------------------------------------------------------
	OverHeatFire:
		TNT1 A 0 a_takeinventory ("BlastMasterFired",99)
		TNT1 A 0 a_takeinventory ("BlastMasterVented",99)
		TNT1 A 0 a_playsound ("BlastMaster/BlueFireStart",0)
		TNT1 A 0 a_playsound ("BlastMaster/RedFireStart",0)
		TNT1 A 0 a_playsound ("BlastMaster/RedFireLoop",6,1,1)
	OverHeatFireLoop:
		TNT1 A 0 a_gunflash
		TNT1 A 0 Bright A_FireCustomMissile ("RedVentFire",Frandom(-5, 5), 0, random(-1,1), random(-2,-1), 0, Frandom(-2, 2))
		TNT1 A 0 a_takeinventory ("BMOverHeat",1)
		TNT1 A 0 a_recoil (0.15)
		ICBE T 0 A_jumpifinventory ("SuperVenter",1,"SuperRedFire")
		BMV2 MN 1 bright
		TNT1 A 0 a_refire ("OverHeatCheck")
		TNT1 A 0 a_playsound ("BlastMaster/RedFireEnd",6)	
		ICBE T 0 A_jumpifinventory ("SuperVenter",1,"RedFinisherCheck")
		ICBE T 6 
		ICBE T 6 a_weaponready (WRF_NOPRIMARY)
		goto LockDown	
	OverHeatCheck:
		TNT1 A 0 a_jumpifinventory ("BMOverHeat",1,"OverHeatFireLoop")
		TNT1 A 0 a_playsound ("BlastMaster/RedFireEnd",6)	
		goto VentFinish

	SuperRedFire:
		TNT1 A 0
		TNT1 A 0 A_FireCustomMissile ("RedVentEmber1",Frandom(-5, 5), 0, random(-4,4), random(1,4), 0, Frandom(-5, 5))
		TNT1 A 0 A_FireCustomMissile ("RedVentEmber2",Frandom(-5, 5), 0, random(-4,4), random(1,4), 0, Frandom(-5, 5))
		TNT1 A 0 Bright A_FireCustomMissile ("RedVentFire",Frandom(-9, 9), 0, random(-3,3), random(-2,-1), 0, Frandom(-4, 4))
		TNT1 A 0 a_playsound ("BlastMaster/PowerFire",0)
		BMV2 MN 1 bright
		TNT1 A 0 a_refire ("OverHeatCheck")
		TNT1 A 0 a_playsound ("BlastMaster/RedFireEnd",6)
		goto RedFinisherCheck
	RedFinisherCheck:
		TNT1 A 0 a_jumpifinventory ("BMOverHeat",60,"SuperFinisher")
		goto LockDown
	SuperFinisher:
		TNT1 A 0 a_gunflash
		TNT1 A 0 a_playsound ("BlastMaster/RedGrenade",6)		
		TNT1 A 0 a_takeinventory ("BMOverHeat",60)
		ICBE T 0 A_jumpifinventory ("SuperVenter",1,"SuperGrenade")
		ESHG B 0 Bright A_FireCustomMissile("RedGrenade")
		BMV2 EFGHHIIJJKKLL 1 bright
		ICBE T 6
		goto LockDown

		
		
	Flash:
		TNT1 A 2 Bright A_Light(3)
		TNT1 A 2 Bright A_Light2
		TNT1 A 2 Bright A_Light1
		Goto LightDone
		
	PastBlaster:
		TNT1 A 0 a_gunflash
		TNT1 A 0 a_playsound ("cyber/hoof",0)
		TNT1 A 0 a_giveinventory ("BlastMasterFired",1)
		TNT1 A 0 a_giveinventory ("BMheat",50)
		TNT1 A 0 a_takeinventory ("secretaction", 99)
		TNT1 A 0 A_Quake(2, 6, 0, 32)
		ESHG B 0 Bright a_firecustommissile ("OldBarrelBomb")
		BMV2 EFGHHIIJJKKLL 1 bright
		ICBE T 3
		TNT1 A 0 a_jumpifinventory ("BMoverheat",1,"LockDown")
		BMP2 ABCC 2
		TNT1 A 0 a_playsound ("BlastMaster/PumpDown",0)
		BMP2 DEFFG 2 
		TNT1 A 0 a_playsound ("BlastMaster/PumpUp",0)
		BMP2 CBA 2
		ICBE T 1
		goto RealReady
	}
}

//====================================================================
//====================================================================
//LEVEL ONE ICE BEAM STUFF
//====================================================================
//====================================================================

ACTOR IceBeamCoreLv1
{   
	+NOINTERACTION
	+NOGRAVITY
	+FORCEXYBILLBOARD
	+bright
	RenderStyle Add
	Alpha 0.20
	Scale 0.25
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 a_checkrange (40,"Emit")
		TNT1 A 1
		stop
	Emit:
		2WBS A 1 a_setscale (0.45,0.45) 
		TNT1 A 0 a_fadein (0.75)
		2WBS A 1 a_setscale (0.10,0.10) 
		Stop
	}
}

ACTOR IceBeamFinisherLv1 : IceBeamCoreLv1
{   
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 a_checkrange (40,"Emit")
		TNT1 A 1
		stop
	Emit:
		2WBS A 1 a_setscale (0.55,0.55) 
		TNT1 A 0 a_fadein (0.75)
		2WBS A 1 a_setscale (0.20,0.20) 
		2WBS A 1 a_setscale (0.10,0.10) 
		2WBS A 1 a_setscale (0.05,0.05) 
		Stop
	}
}


ACTOR IceBeamImpactLv1 : CAPuff
{
	+ALWAYSPUFF
	+PUFFONACTORS
	+THRUSPECIES
	+BLOODLESSIMPACT
	+HITTRACER
	+PUFFGETSOWNER
	Scale 0.6
	RenderStyle Add
	Alpha 0.40
	VSpeed 0
	DamageType Ice
	States
	{
	Spawn:
	XDeath:
	Crash:
		TNT1 A 0
		TNT1 A 0 A_SetScale (frandom(0.6,0.9),frandom(0.6,0.9))
		TNT1 A 1 A_spawnitemex("Icesmoke",5,0,0,frandom(-3,3),frandom(-3,3),frandom(-3,3),0,SXF_NOCHECKPOSITION)
		BM1C ABC random(1,2) Bright
		TNT1 A 1 a_checkflag ("ICECORPSE", "ShatterMode",AAPTR_TRACER)
		Stop
	ShatterMode:
		TNT1 A 0
		TNT1 A random (10,18)
		TNT1 A 1 a_spawnitemex ("IceSmasher",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_TRANSFERPOINTERS)
		stop
	}
}

ACTOR IceBeamTip : CAPuff
{
	+ALWAYSPUFF
	+PUFFONACTORS
	+BLOODLESSIMPACT
	+NODAMAGETHRUST
	+THRUSPECIES
	+HITTRACER
	+painless
	+THRUSPECIES
	Species "Player"
	-ALLOWPARTICLES
	DamageType Ice
	States
	{
	Spawn:
	Crash:
	Death:
	XDeath:
		TNT1 A 3
		stop
	}
}

Actor IceBeamPain : CAPuff
{
	+ALWAYSPUFF
	+PUFFONACTORS
	+BLOODLESSIMPACT
	+NODAMAGETHRUST
	+THRUSPECIES
	+HITTRACER
	+Forcepain
	+THRUSPECIES
	Species "Player"
	-ALLOWPARTICLES
	States
	{
	spawn:
		TNT1 A 1
		stop
	Death:
	XDeath:
	Crash:
		TNT1 A 1
		stop
	}
}

Actor IceSmasher
{
	projectile
	+painless
	+THRUSPECIES
	+hexenbounce
	Species "Player"
	states
	{
	spawn:
		TNT1 A 0
		TNT1 A 1 
		goto death
	Death:
		TNT1 A 0
		TNT1 A 1 a_explode (1,40,0,0,40)
		stop
	}
}



//====================================================================
//====================================================================
//LEVEL TWO ICE BEAM STUFF
//====================================================================
//====================================================================

ACTOR IceBeamCoreLv2 : IcebeamCoreLv1
{   
	Scale 0.50
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 a_checkrange (40,"Emit")
		TNT1 A 1
		stop
	Emit:
		2WBS A 1 a_setscale (0.90,0.90)
		TNT1 A 0 a_fadein (0.75)
		2WBS A 1 a_setscale (0.35,0.35) 
		Stop
	}
}


ACTOR IceBeamFinisherLv2 : IceBeamCoreLv1
{   
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 a_checkrange (40,"Emit")
		TNT1 A 1
		stop
	Emit:
		2WBS A 1 a_setscale (1,1) 
		TNT1 A 0 a_fadein (0.75)
		2WBS A 1 a_setscale (0.40,0.40) 
		2WBS A 1 a_setscale (0.20,0.20) 
		2WBS A 1 a_setscale (0.10,0.10) 
		2WBS A 1 a_setscale (0.05,0.05) 
		Stop
	}
}


ACTOR IceBeamImpactLv2 : IceBeamImpactLv1
{
	Scale 1.20
	states
	{
	Spawn:
	XDeath:
	Crash:
		TNT1 A 0
		TNT1 A 0 A_SetScale (frandom(0.90,1.20),frandom(0.90,1.20))
		TNT1 A 1 A_spawnitemex("Icesmoke",5,0,0,frandom(-3,3),frandom(-3,3),frandom(-3,3),0,SXF_NOCHECKPOSITION)
		BM1C ABC random(1,2) Bright
		TNT1 A 1 a_checkflag ("ICECORPSE", "ShatterMode",AAPTR_TRACER)
		stop
	}
}

//====================================================================
//====================================================================
//LEVEL THREE ICE BEAM STUFF
//====================================================================
//====================================================================

ACTOR IceBeamCoreLv3 : IcebeamCoreLv1
{   
	Scale 0.50
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 a_checkrange (40,"Emit")
		TNT1 A 1
		stop
	Emit:
		2WBS A 1 a_setscale (1.50,1.50)
		TNT1 A 0 a_fadein (0.75)
		2WBS A 1 a_setscale (0.75,0.75) 
		Stop
	}
}


ACTOR IceBeamFinisherLv3 : IceBeamCoreLv1
{   
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 a_checkrange (40,"Emit")
		TNT1 A 1
		stop
	Emit:
		2WBS A 1 a_setscale (1.80,1.80 )
		TNT1 A 0 a_fadein (0.75)
		2WBS A 1 a_setscale (0.90,0.90) 
		2WBS A 1 a_setscale (0.40,0.40) 
		2WBS A 1 a_setscale (0.20,0.20) 
		2WBS A 1 a_setscale (0.10,0.10) 
		2WBS A 1 a_setscale (0.05,0.05) 
		Stop
	}
}


ACTOR IceBeamImpactLv3 : IceBeamImpactLv1
{
	Scale 2.10
	States
	{
	Spawn:
	XDeath:
	Crash:
		TNT1 A 0
		TNT1 A 0 A_SetScale (frandom(1.80,2.20),frandom(1.80,2.20))
		TNT1 A 1 A_spawnitemex("Icesmoke",5,0,0,frandom(-3,3),frandom(-3,3),frandom(-3,3),0,SXF_NOCHECKPOSITION)
		BM1C ABC random(1,2) Bright
		TNT1 A 1 a_checkflag ("ICECORPSE", "ShatterMode",AAPTR_TRACER)
		stop
	}
}




//====================================================================
//====================================================================
//ICE SMOKE STUFF
//====================================================================
//====================================================================


ACTOR IceSmokeSpawner
{
	projectile
	RenderStyle Translucent
	speed 20
	-SOLID
	+NOBLOCKMAP
	+NOGRAVITY
	+NOCLIP
	+DONTSPLASH
	+NOTELEPORT
	+clientsideonly
	States
	{
	Spawn:
        TNT1 A 0
        TNT1 A 1 a_scalevelocity (0.60)
        TNT1 A 1 A_SpawnItemEx("SmallIceSmoke",frandom(-0.1,0.1),frandom(-0.1,0.1),frandom(-1.5,-1.5),frandom(0.5,5),frandom(-0.5,0.5),frandom(-0.5,0.5),0,32)
        TNT1 A 1 A_SpawnItemEx("SmallIceSmoke",frandom(-0.1,0.1),frandom(-0.1,0.1),frandom(-1.5,-1.5),frandom(0.5,5),frandom(-0.5,0.5),frandom(-0.5,0.5),0,32)
		Stop
	}
}



actor icesmoke
{
	+NOGRAVITY
	+NOBLOCKMAP
	+NOCLIP
	+BLOODLESSIMPACT
	+FORCEXYBILLBOARD
	+painless
	+thruactors
	+bright
	RenderStyle add
	Speed 5
	scale 0.65
	alpha 0.30
	damage (0)
	states
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 A_SetScale (frandom(0.65,0.80),frandom(0.65,0.80))
		BM2C ABCDE random (3,5)
		goto death
	Death:
		TNT1 A 0
		TNT1 A 1
		Stop	
	}
}


actor SmallIceSmoke : IceSmoke
{
	scale 0.25
	states
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 A_SetScale (frandom(0.25,0.30),frandom(0.25,0.30))
		BM2C ABCDE random (3,5)
		goto death
	}
}



ACTOR icecharge : Ammo
{
	Inventory.PickupMessage "You shouldn't see this!"
	Inventory.Amount 1
	Inventory.MaxAmount 100
	Ammo.BackpackAmount 0
	Ammo.BackpackMaxAmount 10
	Inventory.Icon "CLIPA0"
	States
	{
	Spawn:
		CLIP A -1
		Stop
	}
}

	