"use strict";
this.name = "Deep Horizon - Navigation Buoy"
this.author	= "Blake Deakins - a.k.a. Cmd. Cheyd";
this.description = "Allow navigation beacons to automatically reposition themselves if bumped out of position.";
this.version = "1.0.2";
this.copyright = "Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License";


this.shipSpawned = function()
{
	//this.ship.reportAIMessages = true;
	this.position = this.ship.position;
}
this.checkPosition = function()
{
	if(this.position.distanceTo(this.ship.position) > 50)
	{
		this.ship.savedCoordinates = this.position;
		this.ship.reactToAIMessage("POSITION_CHANGED");
		log(this.name,this.position);
		log(this.name,this.ship.position);
	}
}
this.positionMe = function()
{
	this.ship.position = this.position;
}
this.checkDistance = function()
{
	if(this.ship.position.distanceTo(this.position) > 10000)
	{
		this.ship.reactToAIMessage("FAR_AWAY");
	}
}