/*

==PEARL LASER==
A high output form, the Pearl Laser takes cells to
power its rapid fire whirling blasts. This form
also only has one extra attack in its chain: A two
handed energy storm, causing explosions at the focal
point and scattering out plasma from the blast.

Once the cells are depleted, this form can still 
attack with a crushing power palm, providing high
damage and knockback.

The Pearl Laser earned its name from its distinct
coloration.
*/

actor PearlLaser : weapon
{
	Weapon.SelectionOrder 600
	Weapon.AmmoUse 1
	Weapon.AmmoType "Cell"
	+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 "Pearl Laser"
	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 ("PearlLaserSelect",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/PearlLaserUp",CHAN_WEAPON)
		TSW5 ABCD 2 bright a_weaponready (WRF_ALLOWRELOAD)
		TSW5 EFGH 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")
		TNT1 A 0 a_stopsound (6)
		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:
		PRLI A 1 a_weaponready (WRF_ALLOWRELOAD)
		loop
	Fire:
		TNT1 A 0
		TNT1 A 0 a_takeinventory ("PearlLaserSelect",99)
		TNT1 A 0 a_jumpifinventory ("Cell",1,"LaserStart")
		TNT1 A 0 a_stopsound (6)
		PRNF ABC 2
		TNT1 A 0 a_playsound ("TechMonk/PalmStrike",0)
		PRNF D 2
		PRNF E 2 A_FireCustomMissile ("PowerPalm",0,0)
		PRNF FG 2 
		TNT1 A 0 a_refire
		PRNF HI 2 a_weaponready (WRF_ALLOWRELOAD)
		goto realready
	LaserStart:
		PRLA AB 2
		PRLA C 1
		TNT1 A 0 A_FireCustomMissile ("PowerPalm",0,0)
		PRLA DE 2
	LaserLoop:
		TNT1 A 0
		TNT1 A 0 a_playsound ("TechMonk/PearlLaserDoubleShot",CHAN_WEAPON)
		TNT1 A 0 a_firebullets (0,0,1,0,"flickpuff",FBF_NOFLASH)
		PRLA F 1 bright A_FireCustomMissile("PearlLaserShot",0,1,0,0)
		PRLA G 1 bright
		PRLA H 1 bright
		TNT1 A 0 a_refire ("LaserCheck")
	LaserFinish:
		PRLA IJKL 2
		PRLA L 2
		TNT1 A 0 a_giveinventory ("TechCombo1",1)
		PRLA MNOP 2 a_weaponready (WRF_ALLOWRELOAD)
		TNT1 A 0 a_playsound ("TechMonk/ComboAlert",0)
		PRLA QRS 2 bright a_weaponready (WRF_ALLOWRELOAD)
		PRLA TUTUTUTUTU 1 a_weaponready (WRF_ALLOWRELOAD)
		TNT1 A 0 a_takeinventory ("TechCombo1",99)
		PRLA WXYZ 2 a_weaponready (WRF_ALLOWRELOAD)
		goto realready
	LaserCheck:
		TNT1 A 0 
		TNT1 A 0 a_takeinventory ("TechCombo1",99)
		TNT1 A 0 a_takeinventory ("TechCombo2",99)
		TNT1 A 0 a_jumpifinventory ("Cell",1,"LaserLoop")
		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)
		PRLI A 5 a_weaponready (WRF_NOPRIMARY|WRF_ALLOWRELOAD)
		goto realready	
		
	Altfire:
		TNT1 A 0 
		TNT1 A 0 a_takeinventory ("PearlLaserSelect",99)
		TNT1 A 0 a_jumpifinventory ("TechCombo1",1,"FinalLaser")
		TNT1 A 0 a_takeinventory ("TechCombo1",99)
		TNT1 A 0 a_jumpifinventory ("HandBeamAug",1,"AugShot")
		TNT1 A 0 a_stopsound (6)
		PLSF 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")
		PLSF D 1 bright A_FireCustomMissile("HandBeamShot",0,0,0,-3)
		PLSF EF 1
		PLSF GGHHIII 1 a_weaponready (WRF_ALLOWRELOAD)
		PRLI A 1 a_weaponready (WRF_ALLOWRELOAD)
		TNT1 A 0 a_refire ("combomiss")
		goto realready
	AugShot:
		PLZ1 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")
		PLZ1 D 1 bright A_FireCustomMissile("AugBeamShot",0,0,0,-3)
		PLSF EF 1
		PLSF GGHHIII 1 a_weaponready (WRF_ALLOWRELOAD)
		PRLI A 1 a_weaponready (WRF_ALLOWRELOAD)
		TNT1 A 0 a_refire ("combomiss")
		goto realready
	ComboMiss:
		PRLI 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
		
	FinalLaser:
		TNT1 A 0
		TNT1 A 0 a_playsound ("TechMonk/LaserStormPowerUp",0)
		PRC2 ABCDEFGHI 2
		TNT1 A 0 a_takeinventory ("TechCombo2",99)
		PRC2 JK 2
		TNT1 A 0 A_FireCustomMissile ("PowerPalm",0,0,-4)
		TNT1 A 0 A_FireCustomMissile ("PowerPalm",0,0,4)
		PRC2 LMM 2
		TNT1 A 0 a_playsound ("TechMonk/LaserStormLoop",6,1,1)		
	FinalLaserLoop:
		TNT1 A 0 A_Quake(2, 3, 0, 10, "Silence")
		TNT1 AAA 0 a_firecustommissile ("LaserTrailer",0,0,random(-20,20),random(-15,15))
		TNT1 A 0 a_takeinventory ("cell",2)
		PRC2 N 2 bright A_FireBullets (0,0,1,75,"LaserSpark",FBF_NORANDOM)
		TNT1 A 0 a_firecustommissile ("LaserTrailer",0,0,random(-25,35),random(-25,25))
		TNT1 A 0 a_takeinventory ("cell",2)
		PRC2 O 2 bright 
		TNT1 AAA 0 A_Quake(2, 3, 0, 10, "Silence")	
		TNT1 A 0 a_firecustommissile ("LaserTrailer",0,0,random(-15,25),random(-10,25))
		TNT1 A 0 a_takeinventory ("cell",2)
		PRC2 P 2 bright  A_FireBullets (0,0,1,75,"LaserSpark",FBF_NORANDOM)
		TNT1 AAA 0 a_firecustommissile ("LaserTrailer",0,0,random(-30,30),random(-15,15))
		TNT1 A 0 a_takeinventory ("cell",2)
		PRC2 Q 2 bright 
		TNT1 AAA 0 a_firecustommissile ("LaserTrailer",0,0,random(-13,23),random(-18,18))
		TNT1 A 0 a_refire ("FinalLaserCheck")
	FinalLaserEnd:
		TNT1 A 0 
		TNT1 A 0 a_stopsound (6)
		TNT1 A 0 a_playsound ("TechMonk/LaserStormEnd",0)
		PRC3 ABCDEFGH 2 a_weaponready (WRF_ALLOWRELOAD)
		TNT1 A 0 a_stopsound (6)
		TNT1 A 2 a_weaponready (WRF_ALLOWRELOAD)
		PRC3 IJKLMNOPQRSTUVWXYZ 2 a_weaponready (WRF_ALLOWRELOAD)
		goto realready
	FinalLaserCheck:
		TNT1 A 0 
		TNT1 A 0 a_takeinventory ("TechCombo1",99)
		TNT1 A 0 a_takeinventory ("TechCombo2",99)
		TNT1 A 0 a_jumpifinventory ("Cell",8,"FinalLaserLoop")
		PRC2 Q 1
		goto FinalLaserEnd

	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")
		PRLI A 30 a_weaponready 
		goto realready
	KameBombFail:
		TNT1 A 0 
		TNT1 A 0 a_playsound ("TechMonk/Error",0)
		PRLI A 8 
		PRLI 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")
		PLSF A 1 
		KEB5 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)
		KEB5 CC 1 bright 
		TNT1 A 0 a_giveinventory ("KameFired",1)
		KEB5 DD 1
		PLSF E 3 
		PLSF F 2 a_weaponready (WRF_NOFIRE|WRF_ALLOWRELOAD)
		PLSF GG 1 a_weaponready (WRF_ALLOWRELOAD)
		PLSF HHIII 1 a_weaponready (WRF_ALLOWRELOAD)
		PRLI 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:
		KEB5 EFG 1
		KEB5 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)
		KEB5 J 2 a_giveinventory ("KameDet",1)
		TNT1 A 0 a_takeinventory ("KameFired",99)
		KEB5 KLMNO 2 a_weaponready
		PRLI A 1 a_weaponready
		goto realready


	//Striker Beam stuff
	StrikerCharge:
		PRLI 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/PearlLaserUp",CHAN_WEAPON)
		TSW5 ABCD 2 bright a_weaponready (WRF_ALLOWRELOAD)
		TSW5 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 PearlLaserShot
{
	Radius 13
	Height 8
	Speed 55
	Damage 6
	Decal CANESDecal
	Projectile
	species "Player"
	+thruspecies
	+RANDOMIZE
	+forcexybillboard
	+bright
	SeeSound ""
	DeathSound ""
	Obituary "%o was de-rezzed by %k's pearl laser"
	States
	{
	Spawn:
		PLS1 A 2
		PLS1 B random (1,2)
		TNT1 A 0 a_jump (150, "FlightLoop2", "FlightLoop3", "FlightLoop4")
	FlightLoop:
		PLS1 CDEF 1
		loop
	FlightLoop2:
		PLS1 DEEFC 1
		loop
	FlightLoop3:
		PLS1 EFCCD 1
		loop
	FlightLoop4:
		PLS1 FFCDE 1
		loop
	Death:
		PLZM H 0
		PLS1 GHIJK 2 bright
		stop
	}
}




actor LaserSpark
{
	+ALWAYSPUFF
	+MTHRUSPECIES
	+PUFFGETSOWNER
	+FORCEXYBILLBOARD
	+NOGRAVITY
	+NOBLOCKMAP
	+PUFFONACTORS
	+FORCERADIUSDMG
	Renderstyle "Translucent"
	alpha 0.40
	scale 1.25
	Obituary "%o was de-rezzed by %k's pearl laser"
	states
	{
	Spawn:
		TNT1 A 1
		TNT1 A 0 a_explode (40,120,0,0,80)
		TNT1 A 0 
		TNT1 A 0 a_playsound ("TechMonk/LaserStormShot")
		TNT1 AAAAAAAA 0 a_spawnitemex ("PearlLaserParticle",random(-8,8),random(-8,8),random(-10,10),random(-120,120)/25.0,random(-130,130)/22.0,random(-110,110)/27.0,0,160)
		TNT1 A 0 A_SpawnItemEx("PearlLaserScatterShot", 0, 0, 0, 30, 0, 0, -30, SXF_TRANSFERPOINTERS|SXF_NOCHECKPOSITION)
		TNT1 A 0 A_SpawnItemEx("PearlLaserScatterShot", 0, 0, 0, 30, 0, 0, -90, SXF_TRANSFERPOINTERS|SXF_NOCHECKPOSITION)
		TNT1 A 0 A_SpawnItemEx("PearlLaserScatterShot", 0, 0, 0, 30, 0, 0, -150, SXF_TRANSFERPOINTERS|SXF_NOCHECKPOSITION)
		TNT1 A 0 A_SpawnItemEx("PearlLaserScatterShot", 0, 0, 0, 30, 0, 0, -180, SXF_TRANSFERPOINTERS|SXF_NOCHECKPOSITION)
		TNT1 A 0 A_SpawnItemEx("PearlLaserScatterShot", 0, 0, 0, 30, 0, 0, -240, SXF_TRANSFERPOINTERS|SXF_NOCHECKPOSITION)
		TNT1 A 0 A_SpawnItemEx("PearlLaserScatterShot", 0, 0, 0, 30, 0, 0, -300, SXF_TRANSFERPOINTERS|SXF_NOCHECKPOSITION)
		PLS1 GHIJK 2 bright
		stop
	}
}

actor PearlLaserScatterShot : PearlLaserShot
{
	Radius 13
	Height 8
	Speed 35
	Damage 4
	Decal BulletChip
	Projectile
	species "Player"
	+thruspecies
	+RANDOMIZE
	+bright
	+thruactors
	+Hexenbounce
	bouncecount 2
	SeeSound ""
	DeathSound ""
	Obituary "%o was de-rezzed by %k's pearl laser"
	Scale 0.50
	States
	{
	Spawn:
		PLS1 A 2
		PLS1 B random (1,2)
		TNT1 A 0 a_changeflag ("Thruactors",0)
		TNT1 A 0 a_jump (150, "FlightLoop2", "FlightLoop3", "FlightLoop4")
	FlightLoop:
		PLS1 CDEF 1
		TNT1 A 0 a_countdown
		loop
	FlightLoop2:
		PLS1 DEEFC 1
		TNT1 A 0 a_countdown
		loop
	FlightLoop3:
		PLS1 EFCCD 1
		TNT1 A 0 a_countdown
		loop
	FlightLoop4:
		PLS1 FFCDE 1
		TNT1 A 0 a_countdown
		loop
	Death:
		PLZM H 0
		TNT1 A 0 a_setscale (0.50,0.50)
		PLS1 GH 2 bright
		stop
	Xdeath:
		PLS1 GHIJK 2 bright
		stop
	}
}


actor LaserTrailer 
{
	+NOINTERACTION
	+NOCLIP
    +BRIGHT
	Speed 15
	+clientsideonly
	+forcexybillboard
	Radius 1
	Height 1
	Renderstyle Add
	Alpha 0.90
	Scale 0.25
	reactiontime 90
	States
	{
	Spawn:
		PLS1 A 1
		PLS1 B random (1,2)
		TNT1 A 0 a_jump (150, "FlightLoop2", "FlightLoop3", "FlightLoop4")
	FlightLoop:
		TNT1 A 0
		TNT1 A 0 a_spawnitemex ("LaserTrailerFX")
		PLS1 C 1 a_scalevelocity (1.80)
		TNT1 A 0 a_spawnitemex ("LaserTrailerFX")
		PLS1 D 1 a_scalevelocity (1.80)
		TNT1 A 0 a_spawnitemex ("LaserTrailerFX")
		PLS1 E 1 a_scalevelocity (1.80)
		TNT1 A 0 a_spawnitemex ("LaserTrailerFX")
		PLS1 F 1 a_scalevelocity (1.90)
		TNT1 A 0 a_countdown
		loop
	FlightLoop2:
		TNT1 A 0
		TNT1 A 0 a_spawnitemex ("LaserTrailerFX")
		PLS1 D 1 a_scalevelocity (1.80)
		TNT1 A 0 a_spawnitemex ("LaserTrailerFX")
		PLS1 E 1 a_scalevelocity (1.80)
		TNT1 A 0 a_spawnitemex ("LaserTrailerFX")
		PLS1 E 1 a_scalevelocity (1.80)
		TNT1 A 0 a_spawnitemex ("LaserTrailerFX")
		PLS1 F 1 a_scalevelocity (1.80)
		TNT1 A 0 a_spawnitemex ("LaserTrailerFX")
		PLS1 C 1 a_scalevelocity (1.90)
		TNT1 A 0 a_countdown
		loop
	FlightLoop3:
		TNT1 A 0
		TNT1 A 0 a_spawnitemex ("LaserTrailerFX")
		PLS1 E 1 a_scalevelocity (1.80)
		TNT1 A 0 a_spawnitemex ("LaserTrailerFX")
		PLS1 F 1 a_scalevelocity (1.80)
		TNT1 A 0 a_spawnitemex ("LaserTrailerFX")
		PLS1 C 1 a_scalevelocity (1.80)
		TNT1 A 0 a_spawnitemex ("LaserTrailerFX")
		PLS1 C 1 a_scalevelocity (1.80)
		TNT1 A 0 a_spawnitemex ("LaserTrailerFX")
		PLS1 D 1 a_scalevelocity (1.90)
		TNT1 A 0 a_countdown
		loop
	FlightLoop4:
		TNT1 A 0
		TNT1 A 0 a_spawnitemex ("LaserTrailerFX")
		PLS1 F 1 a_scalevelocity (1.80)
		TNT1 A 0 a_spawnitemex ("LaserTrailerFX")
		PLS1 F 1 a_scalevelocity (1.80)
		TNT1 A 0 a_spawnitemex ("LaserTrailerFX")
		PLS1 C 1 a_scalevelocity (1.80)
		TNT1 A 0 a_spawnitemex ("LaserTrailerFX")
		PLS1 D 1 a_scalevelocity (1.80)
		TNT1 A 0 a_spawnitemex ("LaserTrailerFX")
		PLS1 E 1 a_scalevelocity (1.90)
		TNT1 A 0 a_countdown
		loop
	Death:
		PLZM H 0
		PLS1 GHIJK 2 bright
		stop
	}
}



actor PearlLaserParticle
{
	+NOINTERACTION
	+NOCLIP
    +BRIGHT
	+forcexybillboard
	+clientsideonly
	Radius 1
	Height 1
	Renderstyle Add
	Alpha 0.60
	Scale 1
	reactiontime 3
	States
	{
	Spawn:
		PLSQ A random (3,6)
	ShrinkLoop:
		PLSQ A 2
		PLSQ A 1 A_SetScale (scalex * frandom(0.90,0.95))
		PLSQ A 3
		TNT1 A 0 a_countdown
		loop
	Death:
		TNT1 A 1
		stop
	}
}


actor LaserTrailerFX : PearlLaserParticle
{
	scale 0.25
	states
	{
	spawn:
		PLS1 CDEF 1
		goto death
	death:
		TNT1 A 1
		stop
	}
}


actor PowerPalm : fastprojectile
{
	Projectile
	speed 64
	damage (55)
	obituary "%o was no match for %k's kung fu."
	+BLOODSPLATTER
	+thruspecies
	+dontblast
	+dontreflect
	species "player"
	height 8
	radius 8
	mass 2000
	projectilekickback 1000
	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/PalmStrikeHit", CHAN_AUTO)
		TNT1 A 0 radius_quake (1,4,0,8,0)
		STBE BC 2
		stop
	}
}

//Tokens
Actor PearlLaserSelect : Powerup
{
  Powerup.Duration 60
}

