"use strict";
this.name = "TCAT_largeWreck";
this.author = "Thargoid";
this.copyright = "Creative Commons: attribution, non-commercial, sharealike with clauses - see readme.txt";
this.description = "Break-up of larger wreckage into small ones";
this.version = "2.0";

//----------------------------------------------------------------------------------------
this.shipDied = function () {
	this.subSmallCount = (Math.ceil(Math.random() * 5) - 2); // between 0 (-1) and 3 pieces of small wreckage spawned from large one
	if (this.subSmallCount > 0) { // if we have a positive amount of small wreckage
		if (this.ship.dataKey.indexOf("_navy")) {
			this.ship.spawn("TCAT_smallWreckage_navy", this.subSmallCount); // spawn the small wreckage
		} else {
			this.ship.spawn("TCAT_smallWreckage", this.subSmallCount); // spawn the small wreckage
		}
	}
	this.fuelCount = (Math.ceil(Math.random() * 10)); // between 1-10 burning fuel entities
	this.ship.spawn("TCAT_burningFuel", this.fuelCount); // spawn the burning fuel
	delete this.shipDied;
}
