@name Guided Spawn Bomb
@inputs X1 Y1 Z1 Vx Vy Vz Tar X3 Y3 Z3 V1x V1y V1z ID
@outputs X2 Y2 Z2 Boom X3 Y3 Z3 
@persist 
@trigger 

#[
    A new preprocessor command, @autoupdate has been added.
    See the wiki for more info.

    Documentation and examples are available at:
    http://wiki.wiremod.com/wiki/Expression_2
    The community is available at http://www.wiremod.com
]#
interval(20)
Boom=0
if(Tar){
    Speed=0.1
    Mass=66.049378991127
    Z1+=50
    Dist=40
    X2=Speed*(X1-X3)-V1x*Mass+Vx
    Y2=Speed*(Y1-Y3)-V1y*Mass+Vy
    Z2=Speed*(Z1-Z3)-V1z*Mass+Vz
    if(!ID){
        if(((X1-X3)<Dist)&((Y1-Y3)<Dist)&((Z1-Z3)<Dist)){Boom=1}
    }
}
if(!X1&!Y1&!Z1){X2=Y2=Z2=0}
