@name SpiderBoat 3 E2
@inputs W S M1 M2 Alt Shift Space Reload Vec:vector
@inputs AdvPod:wirelink VecThrust:wirelink Velocity
@outputs Thrust Local W S M1 M2 Reload Space Shift Alt Mass Mul Vector:vector MPH
@outputs Boat:entity
@persist Boat:entity Mass
@trigger 
@model models//props_combine/headcrabcannister01a_skybox.mdl
if(duped()){reset()}
W=AdvPod["W",number]
S=AdvPod["S",number]
M1=AdvPod["Mouse1",number]
M2=AdvPod["Mouse2",number]
Reload=AdvPod["R",number]
Space=AdvPod["Space",number]
Shift=AdvPod["Shift",number]
Alt=AdvPod["Alt",number]


interval(30)
if(first()|duped()){
    #entity():setAlpha(0)
    #AdvPod:entity():setAlpha(0)
    
    E=entity():getConstraints()
    E:pushEntity(entity())
    for(C=1,E:count()){
        Mass+=E[C,entity]:mass()
        if(E[C,entity]:type()=="prop_vehicle_airboat"){
            Boat=E[C,entity]
        }
        if(E[C,entity]:type():find("thruster")){
            E[C,entity]:setMass(12)
        }
    }
} 

Velocity=Boat:vel():length()
Num1=Vec:x()
Num2=Vec:y()
Num3=Vec:z()

Off=1 #Diagnostic full shutdown 0 is off 1 is on


#M=599 
#Mass=M
M=Mass
M1=Reload
#Global = ((M * 600) / (183.6375*!M2))*!Reload
#Global = ((M * 600) / (50*!M2))*!Reload
Global = ((M * 600) / (75))*!Reload
Slow=Alt*0.1+Alt==0
#Fast=Shift*2.6+Shift==0
Fast=Shift*2.6+!Shift
Jump=-1*Space+!Space
Vel=(797.9*Slow*Fast)-Velocity
#Thrust=((40*(Vel/30)*(M/50)*(W-S)))
#Thrust=((40*(Vel/30)*(M/183.6375)*(W-S)))
Thrust=(40*(Vel/30)*(M/183.6375)*(W-S))*Off
Local=(Jump* -((M * 600) /183.6375)*!M2)*Off
Mul=Global
Vector=vec(0,0,-1)
VecThrust["Mul",number]=Global*Off
VecThrust["Vector",vector]=Vector
