"use strict";
this.name = "coyoteAsp230";
this.author = "Captain Okti";
this.copyright = "(C) 2011 Oktay Sarioglu";
this.licence = "Creative Commons Attribution - Non-Commercial - Share Alike 3.0";
this.description = "Script for coyoteAsp230.";

this.shipSpawned = function () {
	//this.ship.reportAIMessages = true;
	this.damage = 0;
}

this.checkPlayer = function () {
	if (this.ship.position.distanceTo(player.ship.position) < 25000) {
		this.ship.target = player.ship;
		this.ship.reactToAIMessage("TARGET_FOUND");
	}
}

this.shipTakingDamage = function (amount, whom, type) {
	if (whom !== null) {
		if (whom.primaryRole == "coyotecuervo" || whom.primaryRole == "coyotesahana2") {
			this.damage += amount;
			//log(this.name,this.damage);
			if (this.damage >= 30); {
				this.ship.explode();
			}
		}
	}
}