"use strict";
this.name = "coyoteKatikHermit";
this.author = "Okti";
this.copyright = "(C) Okti";
this.licence = "Creative Commons Attribution - Non-Commercial - Share Alike 3.0";
this.description = "Ship script for coyoteAnaconda and python during STAGE_160.";

this.shipSpawned = function () {
	//this.ship.reportAIMessages = true;
	this.ctTimer = new Timer(this, this.checkTemp, 5, 5)
	this.heatLevel = 0;
}

this.shipDied = function (whom, why) {
	missionVariables.Coyote_status = "STAGE_225";
}

this.checkTemp = function () {
	if (this.ship.temperature >= 0.99) {
		this.ship.spawnOne("coyotekatikboss1")
		this.ctTimer.stop();
		this.ship.explode();
	} else if (this.ship.temperature >= 0.80 && this.heatLevel == 0) {
		this.heatLevel += 1;
		this.ship.commsMessage(expandDescription("[COYOTE_S220_04]"), player.ship);
	} else if (this.ship.temperature >= 0.80 && this.heatLevel == 1) {
		this.heatLevel += 1;
		this.ship.commsMessage(expandDescription("[COYOTE_S220_05]"), player.ship);
	} else if (this.ship.temperature >= 0.80 && this.heatLevel == 2) {
		this.heatLevel += 1;
		player.commsMessage(expandDescription("[COYOTE_S220_06]"), 6);

	} else if (this.ship.temperature >= 0.80 && this.heatLevel == 3) {
		this.heatLevel += 1;
		this.ship.commsMessage(expandDescription("[COYOTE_S220_07]"), player.ship);
	} else if (this.ship.temperature >= 0.80 && this.heatLevel == 4) {
		this.heatLevel += 1;
		player.commsMessage(expandDescription("[COYOTE_S220_08]"), 6);
	}
}