"use strict";
this.name = "IR_fuel_waste.js";
this.author = "Ramirez";
this.copyright = "August 2010";
this.description = "Iron Raven fuel waste script";
this.version = "2.0";

//-------------------------------------------------------------------------------------------------------------
this.shipWasScooped = function (whom) {
	if (whom == player.ship) {
		if (missionVariables.IR_SDF_quest != "CONTAMINATED") {
			worldScripts["IR-mfd.js"].$updateMFD("IR_fuel_sample_warning");
			missionVariables.IR_SDF_quest = "CONTAMINATED";
			
			if (system.shipsWithRole("IR-krait") != 0) {
				var krait = system.shipsWithRole("IR-krait")[0];
				var playerDistance = krait.position.distanceTo(player.ship);
				if (playerDistance > 25000) { // if Krait is out of scanner range
					var playerDirection = player.ship.position.subtract(krait.position).direction();
					krait.position = player.ship.position.subtract(playerDirection.multiply(25000));
					//log('krait moved towards player')
					krait.reactToAIMessage("ATTACK_PLAYER");
				} else
					//log('in range')
					krait.reactToAIMessage("ATTACK_PLAYER");
				return;
			}
		}
	}
}