
@name TAAANK! v6 Ammut
@inputs Pod:wirelink Cam:wirelink 
@outputs 
@persist TT E:entity RunOnce
@trigger 
@model models/hunter/blocks/cube4x6x2.mdl
interval(1)
if(first()){    
    E = entity()
    
    E:propFreeze(0)
    entity():setAlpha(0)
    holoCreate(1)
    holoModel(1,"models/bots/boss_bot/boss_tank.mdl")
    holoPos(1,E:toWorld(vec(0,0,-25)))
    holoAng(1,E:toWorld(ang(0,90,0)))
    holoParent(1,entity())  

    holoCreate(2)
    holoModel(2,"models/bots/boss_bot/tank_track.mdl")
    holoPos(2,E:toWorld(vec(-200,0,-25)))
    holoAng(2,E:toWorld(ang(0,90,0)))
    holoParent(2,1)
    
    holoAnim(1,2)  
    holoCreate(3)
    holoModel(3,"models/bots/boss_bot/tank_track.mdl")
    holoPos(3,E:toWorld(vec(-90,0,-25)))
    holoAng(3,E:toWorld(ang(0,90,0)))
    holoParent(3,1)
}




Ang = Pod["Entity",entity]:driver():eyeAngles()

W = Pod["W",number]
A = Pod["A",number]
S = Pod["S",number]
D = Pod["D",number]
Space = Pod["Space",number]
Shift = Pod["Shift",number]

Cam["Angle",angle] = E:angles() + ang(0,90,0)

Cam["Position",vector] = E:pos()+vec(0,-500,100):rotate(E:angles())

Cam["Activated",number] = Pod["Active",number]

ACTIVE = Pod["Active",number]

if(!ACTIVE){

    if(RunOnce==0){
        #holoAnim(1,1)
        RunOnce = 1
    }
}

if(ACTIVE){

    if(RunOnce==1){
        #holoAnim(1,2)
        RunOnce = 0
    }
}

if(W-S){

    applyForce(E:right()*(W-S)*E:mass()*-20)
}
else{    holoAnim(2,1)
holoAnim(3,1)}

if(A){
 Yaw = E:angles():yaw()
Pitch = E:angles():pitch()
Roll = E:angles():roll()
E:setAng(ang(Pitch,Yaw + 5,Roll))
}

if(D){
 Yaw = E:angles():yaw()
Pitch = E:angles():pitch()
Roll = E:angles():roll()
E:setAng(ang(Pitch,Yaw - 5,Roll))
}

