actor CrystalEyeBoss : BaseMM8BDMWep_CBM
{
tag "$TAGC_5H"
dropitem "CrystalEyeWepCDropped"
Weapon.AmmoUse2 4
Weapon.AmmoGive2 28
Obituary "$OB_CRYSTALEYE"
weapon.ammotype1 "TotallyNotFakeCrystalsAmmo"
States
{
Spawn:
C_05 H 1
loop
Ready:
CRYA A 0 ACS_ExecuteAlways(998,0,DYE_CRYSTALMAN)
CRYA A 0 A_GiveInventory("SpawningMisfire",1)
goto Ready0
Ready0:
CRYA A 2 A_WeaponReady
CRYA A 0 A_TakeInventory("SpawningMisfire",1)
Goto Ready1
SpawnProtect:
CRYA A 1
Goto Ready0

ReadyCheck:

CRYA H 0 A_JumpIfInventory("CrystalEyeDelay",1,"Ready1a")
CRYA H 0 A_JumpIfInventory("CrystalEyeIsOut",1,"ReadyCheck2")
goto Ready1
ReadyCheck2:
CRYA A 0 A_JumpIfInventory("CrystalEyeCharge",56,"Ready2.d")
CRYA A 0 A_JumpIfInventory("CrystalEyeCharge",42,"Ready2.c")
CRYA A 0 A_JumpIfInventory("CrystalEyeCharge",28,"Ready2.b")
CRYA A 0 A_JumpIfInventory("CrystalEyeCharge",14,"Ready2.a")
goto Ready2

Ready1:
CRYA A 0 A_JumpIfInventory("CrystalEyeDelay",1,"Ready1a")
CRYA A 2 A_WeaponReady
wait
Ready1a:
CRYA A 2 A_WeaponReady(4)
CRYA A 0 A_TakeInventory("CrystalEyeDelay",1)
goto Ready1

Ready2:
CRYA A 2 A_WeaponReady
CRYA A 0 A_JumpIfInventory("CrystalEyeIsOut",1,"Ready2")
goto Ready2End
Ready2.a:
CRYA G 2 A_WeaponReady
CRYA G 0 A_JumpIfInventory("CrystalEyeIsOut",1,1)
goto Ready2End
CRYA A 2 A_WeaponReady
CRYA A 0 A_JumpIfInventory("CrystalEyeIsOut",1,"Ready2.a")
goto Ready2End
Ready2.b:
CRYA H 2 A_WeaponReady
CRYA H 0 A_JumpIfInventory("CrystalEyeIsOut",1,1)
goto Ready2End
CRYA A 2 A_WeaponReady
CRYA A 0 A_JumpIfInventory("CrystalEyeIsOut",1,"Ready2.b")
goto Ready2End
Ready2.c:
CRYA I 2 A_WeaponReady
CRYA I 0 A_JumpIfInventory("CrystalEyeIsOut",1,1)
goto Ready2End
CRYA A 2 A_WeaponReady
CRYA A 0 A_JumpIfInventory("CrystalEyeIsOut",1,"Ready2.c")
goto Ready2End
Ready2.d:
CRYA J 2 A_WeaponReady
CRYA J 0 A_JumpIfInventory("CrystalEyeIsOut",1,1)
goto Ready2End
CRYA A 2 A_WeaponReady
CRYA A 0 A_JumpIfInventory("CrystalEyeIsOut",1,"Ready2.d")
goto Ready2End

Ready2End:
CRYA A 0 A_GiveInventory("CrystalEyeDelay",14)
CRYA A 0 A_TakeInventory("CrystalEyeCharge",999)
goto Ready1a

Deselect:
CRYA AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
CRYA A 1 A_Lower
Loop
Select:
CRYA AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
CRYA A 1 A_Raise
Loop

Fire:
CRYA B 0 A_JumpIfInventory("IsBot",1,"BotFire2")
CRYA B 0 A_JumpIfInventory("SpawningMisfire",1,"SpawnProtect")
CRYA B 0 A_JumpIfInventory("CrystalEyeIsOut",1,"FireDet")
CRYA B 0 A_JumpIfInventory("CrystalEyeDelay",1,"FireDet")
CRYA B 1 A_GiveInventory("CrystalEyeCharge",1)
CRYA B 0 A_Refire("FireH")
goto FireEnd

FireH:
CRYA B 0 A_JumpIfInventory("CrystalEyeCharge",14,"FireH2")
CRYA B 1
CRYA B 0 A_Refire("FireH.a")
goto FireEnd
FireH.a:
CRYA B 1 A_GiveInventory("CrystalEyeCharge_RC",1)
CRYA B 0 A_Refire("FireH")
goto FireEnd

FireH2:
CRYA B 0 A_PlaySoundEx("wep/CrysCharge1","Body")
FireH2.a:
CRYA B 0 A_JumpIfInventory("CrystalEyeCharge",28,"FireH3")
CRYA B 1
CRYA B 0 A_Refire("FireH2.b")
goto FireEnd
FireH2.b:
CRYA C 1 A_GiveInventory("CrystalEyeCharge_RC",1)
CRYA C 0 A_Refire("FireH2.a")
goto FireEnd

FireH3:
CRYA B 0 A_PlaySoundEx("wep/CrysCharge2","Body")
FireH3.a:
CRYA B 0 A_JumpIfInventory("CrystalEyeCharge",42,"FireH4")
CRYA B 1
CRYA B 0 A_Refire("FireH3.b")
goto FireEnd
FireH3.b:
CRYA D 1 A_GiveInventory("CrystalEyeCharge_RC",1)
CRYA D 0 A_Refire("FireH3.a")
goto FireEnd

FireH4:
CRYA B 0 A_PlaySoundEx("wep/CrysCharge3","Body")
FireH4.a:
CRYA B 0 A_JumpIfInventory("CrystalEyeCharge",56,"FireH5")
CRYA B 1
CRYA B 0 A_Refire("FireH4.b")
goto FireEnd
FireH4.b:
CRYA E 1 A_GiveInventory("CrystalEyeCharge_RC",1)
CRYA E 0 A_Refire("FireH4.a")
goto FireEnd

FireH5:
CRYA B 0 A_PlaySoundEx("wep/CrysCharge4","Body")
FireH5.a:
CRYA B 1
CRYA B 0 A_Refire("FireH5.b")
goto FireEnd
FireH5.b:
CRYA F 1 A_GiveInventory("CrystalEyeCharge_RC",1)
CRYA F 0 A_Refire("FireH5.a")
goto FireEnd

FireEnd:
CRYA B 0 A_PlaySoundEx("weapon/crystalshot","Weapon")
CRYA B 0 A_GiveInventory("CrystalEyeIsOut",1)
CRYA B 0 A_GiveInventory("CrystalmanMain_CI",1)
CRYA B 0 A_JumpIfInventory("CrystalEyeCharge",56,"FireEnd5")
CRYA B 0 A_JumpIfInventory("CrystalEyeCharge",42,"FireEnd4")
CRYA B 0 A_JumpIfInventory("CrystalEyeCharge",28,"FireEnd3")
CRYA B 0 A_JumpIfInventory("CrystalEyeCharge",14,"FireEnd2")
CRYA B 2 OffSet(-6,20)
CRYA B 2 OffSet(-12,8)
CRYA B 2 OffSet(-12,8)
CRYA B 2 OffSet(-9,13)
CRYA B 2 OffSet(-6,18)
CRYA B 2 OffSet(-4,23)
CRYA B 2 OffSet(-2,28)
goto ReadyCheck
FireEnd2:
CRYA B 2 OffSet(-6,20)
CRYA C 2 OffSet(-12,8)
CRYA B 2 OffSet(-12,8)
CRYA C 2 OffSet(-9,13)
CRYA B 2 OffSet(-6,18)
CRYA C 2 OffSet(-4,23)
CRYA B 2 OffSet(-2,28)
goto ReadyCheck
FireEnd3:
CRYA B 2 OffSet(-6,20)
CRYA D 2 OffSet(-12,8)
CRYA B 2 OffSet(-12,8)
CRYA D 2 OffSet(-9,13)
CRYA B 2 OffSet(-6,18)
CRYA D 2 OffSet(-4,23)
CRYA B 2 OffSet(-2,28)
goto ReadyCheck
FireEnd4:
CRYA B 2 OffSet(-6,20)
CRYA E 2 OffSet(-12,8)
CRYA B 2 OffSet(-12,8)
CRYA E 2 OffSet(-9,13)
CRYA B 2 OffSet(-6,18)
CRYA E 2 OffSet(-4,23)
CRYA B 2 OffSet(-2,28)
goto ReadyCheck
FireEnd5:
CRYA B 2 OffSet(-6,20)
CRYA F 2 OffSet(-12,8)
CRYA B 2 OffSet(-12,8)
CRYA F 2 OffSet(-9,13)
CRYA B 2 OffSet(-6,18)
CRYA F 2 OffSet(-4,23)
CRYA B 2 OffSet(-2,28)
goto ReadyCheck

FireDet:
CRYA K 0 A_PlaySoundEx("weapon/crystalshot","Weapon")
CRYA K 0 A_GiveInventory("CrystalEyeDetonate",1)

CRYA K 2 OffSet(-6,20)
CRYA B 2 OffSet(-12,8)
CRYA K 2 OffSet(-12,8)
CRYA B 2 OffSet(-9,13)
CRYA K 2 OffSet(-6,18)
CRYA B 2 OffSet(-4,23)A_GiveInventory("CrystalEyeDelay",14)
CRYA K 2 OffSet(-2,28)

CRYA A 0 A_TakeInventory("CrystalEyeCharge",999)
CRYA A 0 A_TakeInventory("CrystalEyeDetonate",999)
CRYA A 0 A_TakeInventory("CrystalEyeIsOut",999)
Goto Ready1

AltFire:
CRYA B 0 A_PlaySoundEx("weapon/crystalshot","Weapon")
CRYA B 0 A_GiveInventory("CrystalmanAlt_CI",1)
CRYA B 2 OffSet(-6,23)
CRYA B 0 A_JumpIfInventory("CrystalEyeCharge",56,"AltFireE5")
CRYA B 0 A_JumpIfInventory("CrystalEyeCharge",42,"AltFireE4")
CRYA B 0 A_JumpIfInventory("CrystalEyeCharge",28,"AltFireE3")
CRYA B 0 A_JumpIfInventory("CrystalEyeCharge",14,"AltFireE2")
CRYA B 2 OffSet(-12,14)
CRYA B 0 A_JumpIfInventory("CrystalEyeIsOut",1,2)
CRYA B 0 A_TakeInventory("CrystalEyeDelay",2)
CRYA B 2 OffSet(-12,14)
CRYA B 2 OffSet(-10,17)
CRYA B 2 OffSet(-8,20)
CRYA B 2 OffSet(-6,23)
CRYA B 2 OffSet(-4,26)
CRYA B 2 OffSet(-2,29)
goto ReadyCheck
AltFireE2:
CRYA C 2 OffSet(-12,14)
CRYA B 2 OffSet(-12,14)
CRYA C 2 OffSet(-10,17)
CRYA B 2 OffSet(-8,20)
CRYA C 2 OffSet(-6,23)
CRYA B 2 OffSet(-4,26)
CRYA C 2 OffSet(-2,29)
goto ReadyCheck
AltFireE3:
CRYA D 2 OffSet(-12,14)
CRYA B 2 OffSet(-12,14)
CRYA D 2 OffSet(-10,17)
CRYA B 2 OffSet(-8,20)
CRYA D 2 OffSet(-6,23)
CRYA B 2 OffSet(-4,26)
CRYA D 2 OffSet(-2,29)
goto ReadyCheck
AltFireE4:
CRYA E 2 OffSet(-12,14)
CRYA B 2 OffSet(-12,14)
CRYA E 2 OffSet(-10,17)
CRYA B 2 OffSet(-8,20)
CRYA E 2 OffSet(-6,23)
CRYA B 2 OffSet(-4,26)
CRYA E 2 OffSet(-2,29)
goto ReadyCheck
AltFireE5:
CRYA F 2 OffSet(-12,14)
CRYA B 2 OffSet(-12,14)
CRYA F 2 OffSet(-10,17)
CRYA B 2 OffSet(-8,20)
CRYA F 2 OffSet(-6,23)
CRYA B 2 OffSet(-4,26)
CRYA F 2 OffSet(-2,29)
goto ReadyCheck


BotFire:
CRYA B 0 A_Jump(16,"HoldEND")
CRYA B 0 A_TakeInventory("CrystalEyeEndLag",3)
CRYA B 3 A_GiveInventory("CrystalEyeCharge",1)
CRYA B 0 A_Refire
Goto HoldEND
BotFire2:
CRYA B 0 A_Jump(128, "AltFire")
Goto Fire+1
}
}

actor TotallyNotFakeCrystalsAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 28
+INVENTORY.IGNORESKILL
}

actor CrystalEyeDelay : Inventory
{
inventory.amount 1
inventory.maxamount 14
}

actor CrystalEyeIsOut : Powerup
{
Powerup.Duration -22
}

actor CrystalEyeDetonate : OnceC{}

actor CrystalEyeCharge : Inventory
{
inventory.amount 1
inventory.maxamount 56
}

actor CrystalFrameFlag : Inventory
{
inventory.amount 1
inventory.maxamount 3
}
actor CrystalFrameFlag2 :OnceC{}

actor CrystalEyeEndLag : Inventory
{
inventory.amount 1
inventory.maxamount 99
}

actor CrystalEyeCharge_RC : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("PowerRage_ST",1,"PickupR")
TNT1 A 0 A_GiveInventory("CrystalEyeCharge",1)
stop
PickupR:
TNT1 A 0 A_GiveInventory("CrystalEyeCharge",2)
stop
}
}

actor CrystalmanEyeEnd_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_GiveInventory("CrystalEyeDelay",14)
TNT1 A 0 A_TakeInventory("CrystalEyeIsOut",9)
TNT1 A 0 A_TakeInventory("CrystalEyeCharge",999)
stop
}
}

actor CrystalEyeC
{
var int user_D;
Translation "199:199=193:193", "202:202=0:0", "204:204=210:210"
PROJECTILE
damagetype "CrystalM_Eye"
Obituary "$OB_CRYSTALEYEB"
+SKYEXPLODE
BounceSound "weapon/crystalbit"
+BOUNCEONFLOORS
+BOUNCEONWALLS
+BOUNCEONCEILINGS
+ALLOWBOUNCEONACTORS
+CANBOUNCEWATER
+BOUNCEAUTOOFF
//+EXPLODEONWATER
+FORCEXYBILLBOARD
bouncefactor 1.0
wallbouncefactor 1.0
BounceCount 125
Damage (220+user_D*2.5)
ReactionTime 25
Height 16
Radius 16
speed 22//28
Scale 2.5
States
{
Spawn:
//ABCDE Big
//FGHIJ Small
//KLMNO Big white
//PQRST Small white
Y_5H A 0
Y_5H A 0 A_SetUserVar("user_D",ACS_NamedExecuteWithResult("cbm_countinv_acs",57,2))
Y_5H A 0 A_GiveInventory("CrystalEyeCharge",4)
Y_5H AAAA 1 A_JumpIfInTargetInventory("CrystalEyeDetonate",1,"BoomAim")
Y_5H A 0 A_JumpIf(ACS_ExecuteWithResult(C_CHECK_TARGET_OOC)==0,"Death2")
Y_5H LLLL 1 A_JumpIfInTargetInventory("CrystalEyeDetonate",1,"BoomAim")
Y_5H A 0 A_JumpIf(ACS_ExecuteWithResult(C_CHECK_TARGET_OOC)==0,"Death2")
Y_5H CCCC 1 A_JumpIfInTargetInventory("CrystalEyeDetonate",1,"BoomAim")
Y_5H A 0 A_JumpIf(ACS_ExecuteWithResult(C_CHECK_TARGET_OOC)==0,"Death2")
Y_5H NNNN 1 A_JumpIfInTargetInventory("CrystalEyeDetonate",1,"BoomAim")
Y_5H A 0 A_JumpIf(ACS_ExecuteWithResult(C_CHECK_TARGET_OOC)==0,"Death2")
Y_5H DDDD 1 A_JumpIfInTargetInventory("CrystalEyeDetonate",1,"BoomAim")
Y_5H A 0 A_JumpIf(ACS_ExecuteWithResult(C_CHECK_TARGET_OOC)==0,"Death2")
Y_5H KKKK 1 A_JumpIfInTargetInventory("CrystalEyeDetonate",1,"BoomAim")
Y_5H A 0 A_JumpIf(ACS_ExecuteWithResult(C_CHECK_TARGET_OOC)==0,"Death2")
Y_5H AAAA 1 A_JumpIfInTargetInventory("CrystalEyeDetonate",1,"BoomAim")
Y_5H A 0 A_JumpIf(ACS_ExecuteWithResult(C_CHECK_TARGET_OOC)==0,"Death2")
Y_5H A 0 A_CountDown
goto Spawn+3
BoomAim://Aimed
"####" "#" 0 A_Stop
"####" "#" 2 ACS_ExecuteAlways(259,0,1)//Set angle based on player pitch/angle
//TNT1 A 0 A_LogInt(Pitch)

TNT1 A 0 A_SpawnItemEx("CrystalShot2",0,0,0,Cos(pitch)*28,0,-sin(pitch)*28,0,1)
TNT1 A 0 A_SpawnItemEx("CrystalShot2",0,0,0,Cos(pitch+10)*28,0,-sin(pitch+10)*28,0,1)
TNT1 A 0 A_SpawnItemEx("CrystalShot2",0,0,0,Cos(pitch-10)*28,0,-sin(pitch-10)*28,0,1)
TNT1 A 0 A_SpawnItemEx("CrystalShot2",0,0,0,Cos(pitch)*28,7,-sin(pitch)*28,0,1)
TNT1 A 0 A_SpawnItemEx("CrystalShot2",0,0,0,Cos(pitch)*28,-7,-sin(pitch)*28,0,1)

TNT1 A 0 A_JumpIfInTargetInventory("CrystalEyeCharge",28,"BoomAim28")
TNT1 A 0 A_JumpIfInTargetInventory("CrystalEyeCharge",14,"BoomAim14")
goto BoomE

BoomAim14:
TNT1 A 0 A_Jump(128,"BoomAim14.a")
TNT1 A 0 A_SpawnItemEx("CrystalShot2",0,0,0,Cos(pitch+10)*28,7,-sin(pitch+10)*28,0,1)
TNT1 A 0 A_SpawnItemEx("CrystalShot2",0,0,0,Cos(pitch-10)*28,-7,-sin(pitch-10)*28,0,1)
goto BoomE
BoomAim14.a:
TNT1 A 0 A_SpawnItemEx("CrystalShot2",0,0,0,Cos(pitch+10)*28,-7,-sin(pitch+10)*28,0,1)
TNT1 A 0 A_SpawnItemEx("CrystalShot2",0,0,0,Cos(pitch-10)*28,7,-sin(pitch-10)*28,0,1)
goto BoomE

BoomAim28:
TNT1 A 0 A_SpawnItemEx("CrystalShot2",0,0,0,Cos(pitch+10)*28,7,-sin(pitch+10)*28,0,1)
TNT1 A 0 A_SpawnItemEx("CrystalShot2",0,0,0,Cos(pitch-10)*28,7,-sin(pitch-10)*28,0,1)
TNT1 A 0 A_SpawnItemEx("CrystalShot2",0,0,0,Cos(pitch+10)*28,-7,-sin(pitch+10)*28,0,1)
TNT1 A 0 A_SpawnItemEx("CrystalShot2",0,0,0,Cos(pitch-10)*28,-7,-sin(pitch-10)*28,0,1)
TNT1 A 0 A_JumpIfInTargetInventory("CrystalEyeCharge",56,"BoomAim56")
TNT1 A 0 A_JumpIfInTargetInventory("CrystalEyeCharge",42,"BoomAim42")
goto BoomE

BoomAim42:
TNT1 A 0 A_Jump(128,"BoomAim42.a")
TNT1 A 0 A_SpawnItemEx("CrystalShot2",0,0,0,Cos(pitch+5)*28,3.5f,-sin(pitch+5)*28,0,1)
TNT1 A 0 A_SpawnItemEx("CrystalShot2",0,0,0,Cos(pitch-5)*28,-3.5f,-sin(pitch-5)*28,0,1)
goto BoomE
BoomAim42.a:
TNT1 A 0 A_SpawnItemEx("CrystalShot2",0,0,0,Cos(pitch+5)*28,-3.5f,-sin(pitch+5)*28,0,1)
TNT1 A 0 A_SpawnItemEx("CrystalShot2",0,0,0,Cos(pitch-5)*28,3.5f,-sin(pitch-5)*28,0,1)
goto BoomE

BoomAim56:
TNT1 A 0 A_SpawnItemEx("CrystalShot2",0,0,0,Cos(pitch+5)*28,3.5f,-sin(pitch+5)*28,0,1)
TNT1 A 0 A_SpawnItemEx("CrystalShot2",0,0,0,Cos(pitch+5)*28,-3.5f,-sin(pitch+5)*28,0,1)
TNT1 A 0 A_SpawnItemEx("CrystalShot2",0,0,0,Cos(pitch-5)*28,3.5f,-sin(pitch-5)*28,0,1)
TNT1 A 0 A_SpawnItemEx("CrystalShot2",0,0,0,Cos(pitch-5)*28,-3.5f,-sin(pitch-5)*28,0,1)
goto BoomE

Boom0://Classic
TNT1 A 0 A_SpawnItemEx("CrystalShot2",0,0,0,28,0,12,random(40,50),1)
TNT1 A 0 A_SpawnItemEx("CrystalShot2",0,0,0,28,0,12,random(-40,-50),1)
TNT1 A 0 A_SpawnItemEx("CrystalShot2",0,0,0,28,0,-12,random(40,50),1)
TNT1 A 0 A_SpawnItemEx("CrystalShot2",0,0,0,28,0,-12,random(-40,-50),1)
TNT1 A 0 A_SpawnItemEx("CrystalShot2",0,0,0,28,0,12,random(220,230),1)
TNT1 A 0 A_SpawnItemEx("CrystalShot2",0,0,0,28,0,12,random(-220,-230),1)
TNT1 A 0 A_SpawnItemEx("CrystalShot2",0,0,0,28,0,-12,random(220,230),1)
TNT1 A 0 A_SpawnItemEx("CrystalShot2",0,0,0,28,0,-12,random(-220,-230),1)
TNT1 A 0 A_JumpIfInTargetInventory("CrystalEyeCharge",1,1)
goto DeathBoom
TNT1 A 0 A_SpawnItemEx("CrystalShot2",0,0,0,28,0,0,random(-5,5),1)
TNT1 A 0 A_JumpIfInTargetInventory("CrystalEyeCharge",5,1)
goto DeathBoom
TNT1 A 0 A_SpawnItemEx("CrystalShot2",0,0,0,28,0,0,random(175,185),1)
TNT1 A 0 A_JumpIfInTargetInventory("CrystalEyeCharge",10,1)
goto DeathBoom
TNT1 A 0 A_SpawnItemEx("CrystalShot2",0,0,0,28,0,0,random(85,95),1)
TNT1 A 0 A_JumpIfInTargetInventory("CrystalEyeCharge",15,1)
goto DeathBoom
TNT1 A 0 A_SpawnItemEx("CrystalShot2",0,0,0,28,0,0,random(-85,-95),1)
TNT1 A 0 A_JumpIfInTargetInventory("CrystalEyeCharge",20,1)
goto DeathBoom
TNT1 A 0 A_SpawnItemEx("CrystalShot2",0,0,0,28,0,0,random(40,50),1)
TNT1 A 0 A_JumpIfInTargetInventory("CrystalEyeCharge",25,1)
goto DeathBoom
TNT1 A 0 A_SpawnItemEx("CrystalShot2",0,0,0,28,0,0,random(-130,-140),1)
TNT1 A 0 A_JumpIfInTargetInventory("CrystalEyeCharge",30,1)
goto DeathBoom
TNT1 A 0 A_SpawnItemEx("CrystalShot2",0,0,0,28,0,0,random(130,140),1)
TNT1 A 0 A_JumpIfInTargetInventory("CrystalEyeCharge",35,1)
goto DeathBoom
TNT1 A 0 A_SpawnItemEx("CrystalShot2",0,0,0,28,0,0,random(-40,-50),1)
TNT1 A 0 A_JumpIfInTargetInventory("CrystalEyeCharge",40,1)
goto DeathBoom
TNT1 A 0 A_SpawnItemEx("CrystalShot2",0,0,0,random(-5,5),0,28,random(-5,5),1)
TNT1 A 0 A_JumpIfInTargetInventory("CrystalEyeCharge",45,1)
goto DeathBoom
TNT1 A 0 A_SpawnItemEx("CrystalShot2",0,0,0,random(-5,5),0,-28,random(-5,5),1)
TNT1 A 0 //A_JumpIfInTargetInventory("CrystalEyeCharge",50,1)
goto DeathBoom

BoomE:
"####" "#" 0 A_GiveInventory("CrystalEyeDetonate",1)
"####" "#" 1 A_CountDownArg(0)
wait

XDeath:
Crash:
TNT1 A 0 A_JumpIfInventory("CrystalEyeCharge",4,"XDeath0")
goto XDeathBoomBonus
XDeathBoomBonus:
TNT1 A 0 A_Explode(ACS_NamedExecuteWithResult("cbm_countinv_acs",57,2)/4,24,0,0,24)
goto XDeath0
XDeath0:
TNT1 A 0 A_JumpIfInTargetInventory("CrystalEyeCharge",56,"XDeath5")
TNT1 A 0 A_JumpIfInTargetInventory("CrystalEyeCharge",42,"XDeath4")
TNT1 A 0 A_JumpIfInTargetInventory("CrystalEyeCharge",28,"XDeath3")
TNT1 A 0 A_JumpIfInTargetInventory("CrystalEyeCharge",14,"XDeath2")
goto XDeath1
XDeath1:
TNT1 AAAAA 0 A_SpawnItemEx("CrystalEyeC_FX",0,0,0,random(-10,10),random(-10,10),random(5,10),random(0,359),1)
goto XDeathEnd
XDeath2:
TNT1 AAAAAAA 0 A_SpawnItemEx("CrystalEyeC_FX",0,0,0,random(-10,10),random(-10,10),random(5,10),random(0,359),1)
goto XDeathEnd
XDeath3:
TNT1 AAAAAAAAA 0 A_SpawnItemEx("CrystalEyeC_FX",0,0,0,random(-10,10),random(-10,10),random(5,10),random(0,359),1)
goto XDeathEnd
XDeath4:
TNT1 AAAAAAAAAAA 0 A_SpawnItemEx("CrystalEyeC_FX",0,0,0,random(-10,10),random(-10,10),random(5,10),random(0,359),1)
goto XDeathEnd
XDeath5:
TNT1 AAAAAAAAAAAAA 0 A_SpawnItemEx("CrystalEyeC_FX",0,0,0,random(-10,10),random(-10,10),random(5,10),random(0,359),1)
goto XDeathEnd
XDeathEnd:
TNT1 A 0 A_GiveToTarget("CrystalmanEyeEnd_P",1)
TNT1 A 0 A_PlaySound("wep_L/crystalbit",1)
TNT1 A 0 A_PlaySound("wep_L/crystalbit",3)
TNT1 A 1
stop

Death:
TNT1 A 0 A_JumpIfInventory("CrystalEyeDetonate",1,"DeathBoom")
TNT1 A 1 A_GiveToTarget("CrystalmanEyeEnd_P",1)
stop

DeathBoom:
XMFX QQ 1 bright
VMFX IIIJJJKKKDDD 1 bright
stop

Death2:
TNT1 A 1
stop
}
}


actor CrystalEyeCB : CrystalEyeC{translation"202:202=205:205","199:199=74:74","204:204=205:205"}
actor CrystalEyeCR : CrystalEyeC{translation"202:202=171:171","199:199=41:41","204:204=171:171"}
actor CrystalEyeCO : CrystalEyeC{translation"202:202=104:104","199:199=128:128","204:204=104:104"}
actor CrystalEyeCP : CrystalEyeC{translation"202:202=229:229","199:199=232:232","204:204=229:229"}

actor CrystalEyeC_FX
{
-SOLID
+CLIENTSIDEONLY
+THRUACTORS
-NOGRAVITY
+DONTSPLASH
+DONTBLAST
damage (0)
Radius 2
Height 2
scale 2.5
States
{
Spawn:
Y_5H FZFZFZFZFZFZFZFZFZF 1
stop
}
}

actor CrystalShot
{
Translation "199:199=193:193", "202:202=0:0", "204:204=210:210"

PROJECTILE
damagetype "CrystalM_EyeShot"
Obituary "$OB_CRYSTALEYE"
+SKYEXPLODE
BounceSound "weapon/crystalbit"
+BOUNCEONFLOORS
+BOUNCEONWALLS
+BOUNCEONCEILINGS
+ALLOWBOUNCEONACTORS
+CANBOUNCEWATER
+BOUNCEAUTOOFF
+FORCEXYBILLBOARD
bouncefactor 1.0
wallbouncefactor 1.0
BounceCount 4
reactiontime 15
Damage(120)
Height 8
Radius 8
speed 28
Scale 2.5
States
{
Spawn:
//CRYE NOPQRNN 4
//CRYE FGHIJFF 4
Y_5H FQHSJPF 4
Y_5H F 0 A_CountDown
loop
Death:
VMFX IJKD 2 bright
stop
}
}

actor CrystalShotB : CrystalShot{translation"202:202=205:205","199:199=74:74","204:204=205:205"}
actor CrystalShotR : CrystalShot{translation"202:202=171:171","199:199=41:41","204:204=171:171"}
actor CrystalShotO : CrystalShot{translation"202:202=104:104","199:199=128:128","204:204=104:104"}
actor CrystalShotP : CrystalShot{translation"202:202=229:229","199:199=232:232","204:204=229:229"}


actor CrystalShot2 : CrystalShot
{
damagetype "CrystalM_EyeBit"
BounceCount 10
reactiontime 3
Damage(140)
}

actor CrystalM_EyeBitProtect : PowerProtection
{
Powerup.Duration 10
DamageFactor "CrystalM_EyeBit", 0.45
}

actor CrystalmanMain_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("CrystalEyeC",0,0,8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("CrystalEyeCB",0,0,8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("CrystalEyeCR",0,0,8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("CrystalEyeCO",0,0,8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("CrystalEyeCP",0,0,8,0)
goto Done
}
}

actor CrystalmanAlt_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("CrystalShot",0,0,8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("CrystalShotB",0,0,8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("CrystalShotR",0,0,8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("CrystalShotO",0,0,8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("CrystalShotP",0,0,8,0)
goto Done
}
}
