"use strict";
this.name = "stealth_mine";
this.author = "Thargoid";
this.copyright = "Creative Commons: attribution, non-commercial, sharealike with clauses - see readme.txt";
this.description = "Script for space mine";
this.version = "1.06";

this.activate = function () {
	this.ship.scannerDisplayColor1 = "yellowColor";
	this.ship.scannerDisplayColor2 = "redColor";
	this.ship.displayName = expandMissionText("stealth_mine_active");
}

this.deactivate = function () {
	this.ship.scannerDisplayColor1 = "whiteColor";
	this.ship.scannerDisplayColor2 = "whiteColor";
	this.ship.displayName = expandMissionText("stealth_mine_inactive");
}	

this.shipDied = function(whom, why) {
	if (!whom) return;
	var stns = system.shipsWithRole("stealth_base");
	// when the player starts destroying mines, consider it an act of aggression
	if (stns && stns.length > 0) {
		stns[0].target = whom;
		stns[0].alertCondition = 3;
	}
}