"use strict";
this.name = "PFoohaul_cargo";
this.author = "Original by Ark, modified by Thargoid";
this.copyright = "Creative Commons Attribution - Non-Commercial - Share Alike 3.0 license with clauses - see readme.txt.";
this.description = "Code for spawn oohaul cargo";
this.version = "1.10";

//-------------------------------------------------------------------------------------------------------------
this.shipDied = function (whom, why) {
	this.ship.owner.spawn("PFoohaulcargo", 10);
	if (whom.isPlayer) {
		missionVariables.PFoohaul_credits = 0;
		missionVariables.PFoohaul_mis_done = "TRAITOR";
	} else {
		missionVariables.PFoohaul_credits -= 500 // decrement credits with 500 on each death.
		if (--missionVariables.PFoohaul_cargo == 0) missionVariables.PFoohaul_credits = 500  // decrement by one. And when zero set credits to 500.
	}
}