/*

==MOON BEAM==
A high speed form, the moon beam converts common bullets
into rapid fire energy pulses. Ammo is only used if the 
pulses come into contact with living targets, otherwise
the energy is recalled shortly after being fired, preventing
waste. As a downside it means the initial attack of the moon
beam has a very short range. The second level of the beam
provides a proper long range attack, though the fire rate
and efficiency suffer for it, being only a burst fire attack
that expends ammo regardless of a hit or not. The Moon Beam's
finisher is a devastating storm of energy pulses, overwhelming
most targets with sheer volume of fire alone. This attack 
is extremely costly though, so it should be used with care.

If the user runs out of ammo, a technique known as
"Stone Hands" can be used, providing a rapid fire melee
attack.

Known as the "Sea Snake Ball" elsewhere for the constant
slithering beam.
*/

actor MoonBeam : weapon
{
	Weapon.SelectionOrder 400
	Weapon.AmmoUse 1
	Weapon.AmmoType "Clip"
	+WEAPON.AMMO_OPTIONAL
	Inventory.RestrictedTo "TechMonk"
	weapon.bobstyle smooth
	weapon.bobrangex 0.1
	weapon.bobrangey 0.3
	weapon.bobspeed 2
	+INVENTORY.UNTOSSABLE
	+noautofire
	+NOAUTOAIM
	Tag "Moon Beam"
	states
	{
	select:
		TNT1 A 0
	draw:
		TNT1 A 0
		HBID AAAAAAAA 0 a_raise
		TNT1 A 1 a_raise
		loop
	Ready:
		TNT1 A 0
		TNT1 A 0
		TNT1 A 0 a_giveinventory ("MoonBeamSelect",1)
		TNT1 A 0 a_takeinventory ("ArtiPainTimer",9999)
		TNT1 A 0 a_giveinventory ("ArtiPainTimer",40)
		TSWI IJKL 2 a_weaponready (WRF_ALLOWRELOAD)
		TNT1 A 0 a_playsound ("TechMonk/WeaponChange",CHAN_WEAPON)
		TSWI MNOPQRS 1 bright a_weaponready (WRF_ALLOWRELOAD)
		TSWI TUV 2 bright a_weaponready (WRF_ALLOWRELOAD)
		TNT1 A 0 a_playsound ("TechMonk/MoonBeamUp",CHAN_WEAPON)
		TSW3 ABCD 2 bright a_weaponready (WRF_ALLOWRELOAD)
		TSW3 EFG 2 a_weaponready (WRF_ALLOWRELOAD)
		goto realready
	deselect:
		TNT1 A 0
		TNT1 A 0 a_takeinventory ("HandBeamSelect",99)
		TNT1 A 0 a_takeinventory ("WaveBallSelect",99)
		TNT1 A 0 a_takeinventory ("MoonBeamSelect",99)
		TNT1 A 0 a_takeinventory ("ClashBallSelect",99)
		TNT1 A 0 a_takeinventory ("PearlLaserSelect",99)
		TNT1 A 0 a_jumpifhealthlower (1, "deadlower")
		TSWI ABCD 1
		TNT1 A 0 a_playsound ("TechMonk/WeaponDown",0)		
		TNT1 A 0 a_takeinventory ("TechCombo1",99)
		TNT1 A 0 a_takeinventory ("TechCombo2",99)
		TNT1 A 0 a_takeinventory ("TechCombo3",99)
		TNT1 A 0 a_takeinventory ("ArtiPainTimer",9999)
		TNT1 A 0 a_giveinventory ("ArtiPainTimer",40)
		TSWI EFGH 2
	holster:
		TNT1 A 0
		TWSI H 1 a_lower
		TNT1 A 0 a_takeinventory ("secretaction", 99)
		HBID AA 0 a_lower
		loop
	DeadLower:
		TNT1 A 0
		TNT1 A 0
		TNT1 AAAAAAAAAAAAA 0 a_lower
		TNT1 A 1 a_lower
		wait
	RealReady:
		MBID A 1 a_weaponready (WRF_ALLOWRELOAD)
		loop
	Fire:
		TNT1 A 0
		TNT1 A 0 a_takeinventory ("MoonBeamSelect",99)
		TNT1 A 0 a_jumpifinventory ("TechCombo2",1,"Level3Check")
		TNT1 A 0 a_jumpifinventory ("Clip",1,"Level1Start")
		MBPF A 1
		MBNF A 1
		MBNF C 1
		TNT1 A 0 a_playsound ("TechMonk/StoneHand",0)
		MBNF D 1
		MBNF E 1
		TNT1 A 0 a_firecustommissile ("StoneHandStrike")
		MBNF FF 1 
		TNT1 A 0 a_playsound ("TechMonk/StoneHand",0)
		MBNF D 1
		MBNF E 1
		TNT1 A 0 a_firecustommissile ("StoneHandStrike")
		MBNF FF 1 
		TNT1 A 0 a_playsound ("TechMonk/StoneHand",0)
		MBNF D 1
		MBNF E 1
		TNT1 A 0 a_firecustommissile ("StoneHandStrike")
		MBNF FF 1
		MBNF G 1 a_weaponready (WRF_ALLOWRELOAD)
		MBNF HIJKLMN 2 a_weaponready (WRF_ALLOWRELOAD)
		goto realready
	
	Level1Start:
		TNT1 A 0
		TNT1 A 0 a_giveinventory ("TechCombo1",99)
		MBPF ABB 1
		TNT1 A 0 a_playsound ("TechMonk/MoonBeamWoosh",0)
		MBPF C 1
		MBPF D 2
	Level1shot:
		TNT1 A 0
		TNT1 A 0 a_playsound ("Techmonk/MoonBeamShot",0)
		TNT1 A 0 a_firebullets (0,0,1,0,"flickpuff",FBF_NOFLASH)
		MBPF E 1 bright A_firecustommissile ("Moonwhip",0,0,-4)
		MBPF F 1 bright A_firecustommissile ("Moonwhip",0,0,-4)
		MBPF G 1 bright A_firecustommissile ("Moonwhip",0,0,-4)
		TNT1 A 0 a_refire ("Level1AmmoCheck")
		Goto Level1End
	Level1AmmoCheck:
		TNT1 A 0 
		TNT1 A 0 a_jumpifinventory ("Clip",1,"Level1Shot")
		TNT1 A 0 a_playsound ("TechMonk/Error",0)
		TNT1 A 0 a_takeinventory ("TechCombo1",99)
		TNT1 A 0 a_takeinventory ("TechCombo2",99)
		TNT1 A 0 a_takeinventory ("TechCombo3",99)
		MBID A 5 a_weaponready (WRF_NOPRIMARY|WRF_ALLOWRELOAD)
		goto realready
	Level1End:
		TNT1 A 0
		TNT1 A 0 a_giveinventory ("TechCombo1",1)
		MBPF GH 2 a_weaponready (WRF_ALLOWRELOAD) 
		TNT1 A 0 a_playsound ("TechMonk/ComboAlert",0)
		MBPF IJK 2 bright a_weaponready (WRF_ALLOWRELOAD) 
		MBPF LMN 2 a_weaponready (WRF_ALLOWRELOAD) 
		MBPF OPQR 2 a_weaponready (WRF_ALLOWRELOAD)
		TNT1 A 0 a_takeinventory ("TechCombo1",99)
		TNT1 A 0 a_takeinventory ("TechCombo2",99)
		TNT1 A 0 a_takeinventory ("TechCombo3",99)
		MBID A 1
		goto realready
	
	Altfire:
		TNT1 A 0 
		TNT1 A 0 a_takeinventory ("MoonBeamSelect",99)
		TNT1 A 0 a_jumpifinventory ("TechCombo1",1,"Level2Check")
		TNT1 A 0 a_takeinventory ("TechCombo1",99)
		TNT1 A 0 a_takeinventory ("TechCombo2",99)
		TNT1 A 0 a_takeinventory ("TechCombo3",99)
		TNT1 A 0 a_jumpifinventory ("HandBeamAug",1,"AugShot")
		MBSF BBC 1 Bright
		TNT1 A 0 a_playsound ("TechMonk/HandBeam",CHAN_WEAPON)
		TNT1 A 0 a_firebullets (0,0,1,0,"flickpuff",FBF_NOFLASH)
		TNT1 A 0 a_firecustommissile ("PalmJab")
		MBSF D 1 bright A_FireCustomMissile("HandBeamShot",0,0,0,-3)
		MBSF EF 1
		MBSF GGHHIII 1 a_weaponready (WRF_ALLOWRELOAD)
		MBID A 1 a_weaponready (WRF_ALLOWRELOAD)
		TNT1 A 0 a_refire ("combomiss")
		goto realready
	AugShot:
		MBS1 BBC 1 Bright
		TNT1 A 0 a_playsound ("TechMonk/AugBeam",0)
		TNT1 A 0 a_firebullets (0,0,1,0,"flickpuff",FBF_NOFLASH)
		TNT1 A 0 a_firecustommissile ("PalmJab")
		MBS1 D 1 bright A_FireCustomMissile("AugBeamShot",0,0,0,-3)
		MBSF EF 1
		MBSF GGHHIII 1 a_weaponready (WRF_ALLOWRELOAD)
		MBID A 1 a_weaponready (WRF_ALLOWRELOAD)
		TNT1 A 0 a_refire ("combomiss")
		goto realready
		
	ComboMiss:
		MBID A 1 a_weaponready (WRF_NOFIRE)
		TNT1 A 0 a_takeinventory ("TechCombo1",99)
		TNT1 A 0 a_takeinventory ("TechCombo2",99)
		TNT1 A 0 a_takeinventory ("TechCombo3",99)
		TNT1 A 0 a_jumpifinventory ("StrikerModule",1,"StrikerCharge")
		TNT1 A 0 a_refire ("ComboMiss")
		goto realready
	
	Level2Check:
		TNT1 A 0 
		TNT1 A 0 a_takeinventory ("TechCombo1",99)
		TNT1 A 0 a_jumpifinventory ("Clip",1,"Level2Shot")
		TNT1 A 0 a_playsound ("TechMonk/Error",0)
		TNT1 A 0 a_takeinventory ("TechCombo1",99)
		TNT1 A 0 a_takeinventory ("TechCombo2",99)
		TNT1 A 0 a_takeinventory ("TechCombo3",99)
		MBID A 5 a_weaponready (WRF_NOPRIMARY|WRF_ALLOWRELOAD)
		goto realready	
	Level2Shot:
		MBC1 AABC 1
		TNT1 A 0 a_playsound ("TechMonk/MoonBeamWoosh",0)
		MBC1 D 1
		MBC1 E 2
	Level2FirstShot:
		TNT1 A 0
		TNT1 A 0 a_playsound ("Techmonk/MoonBeamShot",0)
		TNT1 A 0 a_firebullets (0,0,1,0,"flickpuff",FBF_NOFLASH)
		TNT1 A 0 a_firebullets (0,0,-1,6,"MoonbeamPuff",0)
		
		//TNT1 A 0 A_firecustommissile ("MoonBeamShot",0,0,4)
		TNT1 A 0 a_takeinventory ("Clip",1)
		MBC1 F 1 bright
		TNT1 A 0 a_jumpifinventory ("clip",1,"Level2SecondShot")
		TNT1 A 0 a_playsound ("TechMonk/Error",0)
		MBC1 K 5
		MBCF ABCDE 2
		TNT1 A 0 a_takeinventory ("TechCombo1",99)
		TNT1 A 0 a_takeinventory ("TechCombo2",99)
		MBC1 RSTUVWX 2
		MBID A 1
		goto realready
	Level2SecondShot:
		TNT1 A 0
		TNT1 A 0 a_firebullets (0,0,1,0,"flickpuff",FBF_NOFLASH)
		TNT1 A 0 a_firebullets (0,0,-1,6,"MoonbeamPuff",0)
		//TNT1 A 0 A_firecustommissile ("MoonBeamShot",0,0,4)
		TNT1 A 0 a_takeinventory ("Clip",1)
		MBC1 G 1 bright
		TNT1 A 0 a_jumpifinventory ("clip",1,"Level2ThirdShot")
		TNT1 A 0 a_takeinventory ("TechCombo1",99)
		TNT1 A 0 a_playsound ("TechMonk/Error",0)
		MBC1 K 5
		MBCF ABCDE 2
		TNT1 A 0 a_takeinventory ("TechCombo1",99)
		TNT1 A 0 a_takeinventory ("TechCombo2",99)
		MBC1 RSTUVWX 2
		MBID A 1
		goto realready
		
	Level2ThirdShot:
		TNT1 A 0
		TNT1 A 0 a_firebullets (0,0,1,0,"flickpuff",FBF_NOFLASH)
		TNT1 A 0 a_firebullets (0,0,-1,6,"MoonbeamPuff",0)
		//TNT1 A 0 A_firecustommissile ("MoonBeamShot",0,0,4)
		TNT1 A 0 a_playsound ("Techmonk/MoonBeamShot",0)
		TNT1 A 0 a_takeinventory ("Clip",1)
		MBC1 HH 1 bright
		TNT1 A 0 a_playsound ("Techmonk/MoonBeamShotLevel2",0)
		MBC1 IJJK 2
		TNT1 A 0 a_giveinventory ("TechCombo2",1)
		MBC1 K 2 a_weaponready (WRF_ALLOWRELOAD)
		TNT1 A 0 a_refire ("Level2LoopCheck")
		goto Level2End
	Level2LoopCheck:
		TNT1 A 0 
		MBC1 K 2
		TNT1 A 0 a_jumpifinventory ("Clip",1,"Level2FirstShot")
		TNT1 A 0 a_takeinventory ("TechCombo1",99)
		TNT1 A 0 a_takeinventory ("TechCombo2",99)
		TNT1 A 0 a_playsound ("TechMonk/Error",0)
		MBCF ABCDE 2
		TNT1 A 0 a_takeinventory ("TechCombo1",99)
		TNT1 A 0 a_takeinventory ("TechCombo2",99)
		MBC1 RSTUVWX 2
		MBID A 1
		goto realready

	Level2End:
		TNT1 A 0 a_giveinventory ("TechCombo2",1)
		MBC1 L 2 a_weaponready (WRF_ALLOWRELOAD)
		TNT1 A 0 a_playsound ("TechMonk/ComboAlert",0)
		MBC1 MNO 2 bright a_weaponready (WRF_ALLOWRELOAD)
		MBC1 PQ 2 a_weaponready (WRF_ALLOWRELOAD)
		MBC1 RSTU 2 a_weaponready (WRF_ALLOWRELOAD) 
		TNT1 A 0 a_takeinventory ("TechCombo2",99)
		MBC1 VWX 2 a_weaponready (WRF_ALLOWRELOAD) 
		MBID A 1 a_weaponready (WRF_ALLOWRELOAD) 
		goto realready

	Level3Check:
		TNT1 A 0 
		TNT1 A 0 a_takeinventory ("TechCombo2",99)
		TNT1 A 0 a_jumpifinventory ("Clip",1,"Level3Shot")
		TNT1 A 0 a_playsound ("TechMonk/Error",0)
		TNT1 A 0 a_takeinventory ("TechCombo1",99)
		TNT1 A 0 a_takeinventory ("TechCombo2",99)
		TNT1 A 0 a_takeinventory ("TechCombo3",99)
		MBID A 5 a_weaponready (WRF_NOPRIMARY|WRF_ALLOWRELOAD)
		goto realready	
	Level3Shot:
		MBC2 ABDEFG 2
		TNT1 A 0 A_Quake(3, 22, 0, 10, "Silence")	
		TNT1 A 0 a_playsound ("TechMonk/MoonBeamPowerUp",CHAN_WEAPON)
		MBC2 H 2 
		MBC2 HIHIHIHIHI 1
		TNT1 A 0 a_stopsound (CHAN_WEAPON)
		TNT1 A 0 a_playsound ("TechMonk/MoonBeamBigWoosh",0)
		MBC2 JJ 1
		MBC2 KLL 1
	Level3Loop:
		TNT1 A 0 a_firebullets (0,0,1,0,"flickpuff",FBF_NOFLASH)
		TNT1 A 0 A_firecustommissile ("scattermoonbeamshot",Frandom(3, -3),0,-4,0,0,Frandom(2, -2))
		TNT1 A 0 A_Quake(2, 6, 0, 10, "Silence")	
		TNT1 A 0 a_takeinventory ("Clip",1)
		TNT1 A 0 A_playsound ("Techmonk/MoonBeamShotLevel3",0)
		TNT1 A 0 a_firebullets (0,0,1,0,"flickpuff",FBF_NOFLASH)
		MBC2 M 1 bright A_firecustommissile ("scattermoonbeamshot",Frandom(2, -2),0,-4,0,0,Frandom(1, -1))
		TNT1 A 0 a_jumpifinventory ("Clip",1,"Level3Shot2")
		Goto Level3End
	Level3Shot2:
		TNT1 A 0
		TNT1 A 0 a_takeinventory ("Clip",1)		
		TNT1 A 0 a_firebullets (0,0,1,0,"flickpuff",FBF_NOFLASH)
		MBC2 N 1 bright A_firecustommissile ("scattermoonbeamshot",Frandom(2, -2),0,-4,0,0,Frandom(3, -3))
		TNT1 A 0 a_jumpifinventory ("Clip",1,"Level3Shot3")
		Goto Level3End
	Level3Shot3:
		TNT1 A 0
		TNT1 A 0 a_takeinventory ("Clip",1)		
		TNT1 A 0 a_firebullets (0,0,1,0,"flickpuff",FBF_NOFLASH)
		TNT1 A 0 A_firecustommissile ("scattermoonbeamshot",Frandom(1, -1),0,-4,0,0,Frandom(2, -2))
		TNT1 A 0 A_firecustommissile ("scattermoonbeamshot",Frandom(3, -4),0,-4,0,0,Frandom(1, -3))
		MBC2 OO 1 bright 
		TNT1 A 0 a_refire ("Level3LoopCheck")
		Goto Level3End
	
	Level3LoopCheck:
		TNT1 A 0
		TNT1 A 0 a_jumpifinventory ("Clip",1,"Level3Loop")
		Goto Level3End
	Level3End:
		TNT1 A 0
		MBC2 PQRSTTTUUVVVV 1
		MBC2 V 3
		MBC2 VUVUVUVUVUVUVUVUV 1
		MBC2 V 3
		MBC2 WXYZ 2
		MBC3 A 1
		goto realready
		
	Reload:
		TNT1 A 0 
		TNT1 A 0 a_takeinventory ("TechCombo1",99)
		TNT1 A 0 a_takeinventory ("TechCombo2",99)
		TNT1 A 0 a_takeinventory ("TechCombo3",99)
		TNT1 A 0 a_jumpifinventory ("KameBombModule",1,"KameBombShot")
		MBID A 30 a_weaponready 
		goto realready
	KameBombFail:
		TNT1 A 0 
		TNT1 A 0 a_playsound ("TechMonk/Error",0)
		MBID A 8 
		MBID A 30 a_weaponready 
		goto realready
	KameBombShot:
		TNT1 A 0
		TNT1 A 0 a_jumpifinventory ("KameFired",1, "Detonate")
		TNT1 A 0 a_jumpifinventory ("KameCoolDown",1,"KameBombFail")
		MBSF A 1 
		KEB3 AAB 1 bright
		TNT1 A 0 a_playsound ("TechMonk/KameBomb",0)
		TNT1 A 0 ACS_NamedExecuteAlways("KameBombCharge", 0, 0, 0, 0)
		TNT1 A 0 A_FireCustomMissile("KameBomb",0,0)
		KEB3 CC 1 bright 
		TNT1 A 0 a_giveinventory ("KameFired",1)
		KEB3 DD 1
		MBSF E 3 
		MBSF F 2 a_weaponready (WRF_NOFIRE|WRF_ALLOWRELOAD)
		MBSF GG 1 a_weaponready (WRF_ALLOWRELOAD)
		MBSF HHIII 1 a_weaponready (WRF_ALLOWRELOAD)
		MBID A 1 a_weaponready (WRF_ALLOWRELOAD)
		TNT1 A 0 a_takeinventory ("TechCombo1",99)
		TNT1 A 0 a_takeinventory ("TechCombo2",99)
		TNT1 A 0 a_takeinventory ("TechCombo3",99)
		goto realready
	Detonate:
		KEB3 EFG 1
		KEB3 HI 2 
		TNT1 A 0 a_takeinventory ("TechCombo1",99)
		TNT1 A 0 a_takeinventory ("TechCombo2",99)
		TNT1 A 0 a_takeinventory ("TechCombo3",99)
		TNT1 A 0 a_playsound ("TechMonk/KameTrigger",0)
		KEB3 J 2 a_giveinventory ("KameDet",1)
		TNT1 A 0 a_takeinventory ("KameFired",99)
		KEB3 KLMNO 2 a_weaponready
		MBID A 1 a_weaponready
		goto realready

	//Striker Beam stuff
	StrikerCharge:
		MBID A 1 
		TNT1 A 0 a_giveinventory ("StrikerPrep",1)
		TNT1 A 0 a_jumpifinventory ("StrikerPrep", 8, "StrikerChargeStart")
		TNT1 A 0 a_refire ("StrikerCharge")
		TNT1 A 0 a_takeinventory ("StrikerPrep",99)
		goto realready
	StrikerChargeStart:	
		SPOW A 2
		TNT1 A 0 a_takeinventory ("StrikerPrep",99)
		TNT1 A 0 a_playsound ("TechMonk/StrikerCharge",0)
		SPOW B 2
		SPOW CDE 2
		SPOW E 3 
		TNT1 A 0 a_playsound ("TechMonk/StrikerChargeLoop",CHAN_WEAPON,1,1)
	ChargeLoop:
		SPOW F 2 bright a_giveinventory ("StrikerCharge",8)
		SPOW G 2 bright a_giveinventory ("StrikerCharge",8)
		SPOW H 2 bright a_giveinventory ("StrikerCharge",8)
		SPOW I 2 bright a_giveinventory ("StrikerCharge",8)
		TNT1 A 0 a_jumpifinventory ("StrikerCharge",300,"ChargeFinish")
		TNT1 A 0 a_refire ("chargeloop")
	ChargeCancel:
		TNT1 A 0
		TNT1 A 0 a_stopsound (CHAN_WEAPON)
		TNT1 A 0 a_takeinventory ("StrikerCharge",9999)
		TSWI IJKL 2 a_weaponready (WRF_ALLOWRELOAD)
		TSWI MNOPQRS 1 bright a_weaponready (WRF_ALLOWRELOAD)
		TSWI TUV 2 bright a_weaponready (WRF_ALLOWRELOAD)
		TNT1 A 0 a_playsound ("TechMonk/MoonBeamUp",CHAN_WEAPON)
		TSW3 ABCD 2 bright a_weaponready (WRF_ALLOWRELOAD)
		TSW3 EFG 2 a_weaponready (WRF_ALLOWRELOAD)
		goto realready
	ChargeFinish:	
		TNT1 A 0
		TNT1 A 0 a_stopsound (CHAN_WEAPON)
		TNT1 A 0 a_playsound ("TechMonk/StrikerChargeFinish",0)
		SPOW JKLM 2 bright
		TNT1 A 0 a_playsound ("TechMonk/StrikerPowerUp",CHAN_WEAPON)
		SPOW NOPQRST 2 bright
		SPOW UVWX 2 bright
		TNT1 A 0 a_playsound ("TechMonk/StrikerPowerUpFinish",CHAN_WEAPON)
		SPOW YZ 2 bright
		SPO1 ABC 2 bright
		TNT1 A 0 a_giveinventory ("StrikerBeam",1)
		TNT1 A 0 a_selectweapon ("StrikerBeam")
		goto StrikerChange
	StrikerChange:
		TNT1 A 0
		STRI A 0 a_lower
		TNT1 A 0 a_takeinventory ("secretaction", 99)
		HBID AAAAAAAAAAA 0 a_lower
		loop

	}
}

actor MoonWhip
{
	Radius 10
	Height 3
	Speed 50
	Damage (5*random(2,3))
	decal CANESDecal
	Projectile
	species "Player"
	+thruspecies
	+bright
	+PAINLESS
	+hittracer
	scale 0.80
	Obituary "%o was blinded by %k's Moon Beam"
	States
	{
	Spawn:
		MBSH A 1
		MBSH A 1 a_jump (45,"PainfulShot")
		MBSH A 3
		MBSH A 1 a_stop
		goto death
	PainfulShot:
		TNT1 A 0
		TNT1 A 0 a_changeflag ("Painless",0)
		MBSH A 4
		MBSH A 1 a_stop
		goto death

	death:
		TNT1 A 0
		TNT1 A 0 a_stop
		MBSH B 1 a_stop
		TNT1 A 0 a_setscale (1.2,1.2)
		MBSH FGH 1 
		stop
	Crash:
	Xdeath:
		TNT1 A 0
		TNT1 A 0 a_setscale (1.8,1.8)
		TNT1 A 0 a_playsound ("TechMonk/MoonBeamHit",0)
		TNT1 A 0 A_JumpIf(CallACS("CombinedArms_IsTracerAlive")==false,"Noammotake")
		TNT1 A 0 a_takefromtarget ("Clip",1)
		MBSH BCDE 1
		stop
	NoAmmoTake:
		MBSH BCDE 1
		stop
	}
}


ACTOR MoonBeamPuff : BulletPuff
{
	+NOBLOCKMAP
	+NOGRAVITY
	+ALLOWPARTICLES
	+bloodlessimpact
	+RANDOMIZE
	+thruspecies
	+MTHRUSPECIES
	+PUFFONACTORS
	+forcexybillboard
	+bright
	species "player"
	RenderStyle add
	Alpha 0.90
	scale 0.80
	VSpeed 0
	Mass 5
	decal CANESDecal
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 2
		// Intentional fall-through
	crash:
		TNT1 A 0
		TNT1 A 0 a_stop
		TNT1 A 0 A_PlaySound("TechMonk/StoneHandHit", CHAN_VOICE)
		MBSH B 1 a_stop
		TNT1 A 0 A_PlaySound("TechMonk/MeleeMiss", CHAN_VOICE)
		TNT1 A 0 a_setscale (1.2,1.2)
		MBSH FGH 1 
		stop
	Xdeath:
		TNT1 A 0
		TNT1 A 0 a_setscale (1.8,1.8)
		TNT1 A 0 a_playsound ("TechMonk/MoonBeamHit",0)
		MBSH BCDE 1
		stop
	}
}


actor MoonBeamShot : MoonWhip
{
	Radius 10
	Height 4
	Speed 70
	Damage (6*random(2,3))
	Decal SmallCANESDecal
	Projectile
	species "Player"
	+thruspecies
	+bright
	-painless
	scale 0.80
	States
	{
	Spawn:
		MBSH A 1
		loop
	Xdeath:
		TNT1 A 0
		TNT1 A 0 a_setscale (1.5,1.5)
		TNT1 A 0 a_playsound ("TechMonk/MoonBeamHit",0)
		MBSH BCDE 2
		stop
	}
}

actor ScatterMoonBeamShot : MoonBeamShot
{
	Speed 50
	States
	{
	Spawn:
		MBSH A 1
		loop
	Xdeath:
		TNT1 A 0
		TNT1 A 0 a_setscale (1.5,1.5)
		TNT1 A 0 a_playsound ("TechMonk/MoonBeamHit",0)
		MBSH BCDE 2
		stop
	}
}



actor StoneHandStrike : fastprojectile
{
	Projectile
	speed 64
	damage (15)
	obituary "%o was no match for %k's kung fu."
	+BLOODSPLATTER
	+thruspecies
	+dontblast
	+dontreflect
	+bright
	scale 0.10
	species "player"
	height 8
	radius 8
	mass 2000
	states
	{
	Spawn:
		TNT1 A 1
		stop
	Death:
		TNT1 A 0
		TNT1 A 1
		TNT1 A 0 A_PlaySound("TechMonk/MeleeMiss", CHAN_AUTO)
		TNT1 A 0 A_SpawnDebris("WWStyleBulletSpark")
		TNT1 A 0 radius_quake (1,2,0,8,0)
		TNT1 A 5 
		stop
	Xdeath:
		TNT1 A 0
		TNT1 A 1
		TNT1 A 0 A_PlaySound("TechMonk/StoneHandHit", CHAN_AUTO)
		TNT1 A 0 radius_quake (1,4,0,8,0)
		STBE B 1
		STBE B 1 a_setscale (0.30,2)
		STBE B 1 a_setscale (0.80,1)
		STBE B 1 a_setscale (1.60,1.40)
		STBE B 2 a_setscale (0.80,1)
		stop
	}
}

//Tokens
Actor UseMoonAmmo : inventory
{inventory.maxamount 2}

Actor MoonBeamSelect : Powerup
{
  Powerup.Duration 60
}

