@name FailCake FishTank
@outputs [E Bas]:entity Water WaterP
@persist GTABLE:gtable Flood
@trigger all
@model models/hunter/blocks/cube05x1x05.mdl

if(first() | duped()){
runOnTick(1)
    
E = entity()
E:setAlpha(1)   
 
GTABLE = gTable("fishtank",0)
GTABLE:clear()
Water = 0
Flood = 0
propSpawnEffect(0)

holoCreate(1)
holoModel(1,"cube")
holoScaleUnits(1,vec(25,1,25))
holoPos(1,E:toWorld(vec(0,24,0)))
holoParent(1,E)

holoCreate(2)
holoModel(2,"cube")
holoScaleUnits(2,vec(25,1,25))
holoPos(2,E:toWorld(vec(0,-24,0)))
holoParent(2,E)

holoCreate(3)
holoModel(3,"cube")
holoScaleUnits(3,vec(48,1,25))
holoAng(3,ang(0,90,0))
holoPos(3,E:toWorld(vec(12,0,0)))
holoParent(3,E)

holoCreate(4)
holoModel(4,"cube")
holoScaleUnits(4,vec(48,1,25))
holoAng(4,ang(0,90,0))
holoPos(4,E:toWorld(vec(-12,0,0)))
holoParent(4,E)

holoCreate(5)
holoModel(5,"cube")
holoScaleUnits(5,vec(47,24,1))
holoAng(5,ang(0,90,0))
holoPos(5,E:toWorld(vec(0,0,-12)))
holoParent(5,E)
holoMaterial(5,"models/props_wasteland/dirtwall001a")

holoCreate(7)
holoModel(7,"cube")
holoScaleUnits(7,vec(48,25,1))
holoAng(7,ang(0,90,0))
holoColor(7,vec(0,178,255))
holoPos(7,E:toWorld(vec(0,0,-12)))
holoParent(7,E)
#holoMaterial(7,"models/shadertest/predator")

holoCreate(8)
holoModel(8,"hqcylinder")
holoScaleUnits(8,vec(1,1,2))
holoAng(8,ang(0,90,0))
holoColor(8,vec(0,178,255))
holoPos(8,E:toWorld(vec(0,0,-13)))
holoParent(8,E)
holoAlpha(8,0)
holoAlpha(7,0)

holoMaterial(4,"models/props_combine/health_charger_glass")
holoMaterial(3,"models/props_combine/health_charger_glass")
holoMaterial(2,"models/props_combine/health_charger_glass")
holoMaterial(1,"models/props_combine/health_charger_glass")

Bas = propSpawn("models/hunter/plates/plate05x1.mdl",holoEntity(5):pos(),holoEntity(5):angles(),1)
Bas:setAlpha(0)

GTABLE["fishtank",entity] = Bas
GTABLE["fishtankCol",entity] = E
GTABLE["fish",number] = 0
}

if(GTABLE["FILL",number] == 1){
Water+=0.3
holoAlpha(7,50)
WaterP = Water/20*100

if(Water <= 24){  
holoScaleUnits(7,vec(47,24,Water))
holoPos(7,E:toWorld(vec(0,0,Water/2 - 12+0.3))) 
}

if(Water >= 24 & GTABLE["FILL",number] == 1){
holoAlpha(8,50)
Flood+=1
holoScaleUnits(8,vec(Flood,Flood,2))
}

}
if(Water >= 20){
if(GTABLE["fish",number] > 0){
    
}    
}

setName("FailCake FishTank
Water = " + round(WaterP) + "%
Fish = " + GTABLE["fish",number])
