@name Icy Gaze
@inputs 
@outputs  C Count I
@persist Tog E:entity On A:array C Count E1:entity
@trigger all
entity():setAlpha(10)
interval(20)
Gaze="Icy Gaze: "
Hyper=Gaze+"Hyper Frost"
Melt=Gaze+"Hyper Meltdown"
State=Gaze+"Active State: "
Cleared=Gaze+"Entity Cleared"

if(entity():owner():name()!="Captain Maim"){selfDestruct()}

Self=entity():owner()
Aim=Self:aimEntity()
if(first()){On=1 C=0}
if(Self:keyUse()&Aim&Aim!=E){
    E=Aim 
    A=Aim:getConstraints()
    A:pushEntity(Aim)
        Count=A:count()
    print("Target Entity is: "+E:id())
    print("Target has: "+Count+" entities other constrained to it")
    if(Tog){print(Hyper)}
    if(!Tog){print(Melt)}
    
    }
runOnChat(1)
Chat=owner():lastSaid()
Command=Chat:find("ICY")
if(chatClk()&Command){
    Freeze=Chat:find("hf")
    Unfreeze=Chat:find("uf")
    Release=Chat:find("clear")
    Stop=Chat:find("stop")
}
if(Freeze){Tog=1 print(Hyper)}
if(Unfreeze){Tog=0 print(Melt)}
if(Stop){On=!On print(State+On)}
if(Release){E=entity(0) print(Cleared)}
if(On&C<Count){
    if(C!=0){E1=A:entity(C)}else{E1=E}
    I=E1:id()
    E1:propFreeze(Tog)
    C++
}else{C=0}
