"use strict";
this.name        = "Dictators_Conditions";
this.author      = "phkb";
this.copyright   = "2016 phkb";
this.description = "Condition script for ships and equipment.";
this.licence     = "CC BY-NC-SA 3.0";

//-------------------------------------------------------------------------------------------------------------
this.allowSpawnShip = function(shipKey) {
	if (worldScripts["dictators.js"]._shipSpawnOverride === true) return true;
	if (system.government !== 3) return false;
	switch (shipKey) {
		case "rev_guard":
		case "enforcer":
		case "enforcer_ambience":
			if (worldScripts["dictators.js"]._settings.policeShipReplace == false) return false;
			if (system.info.economy >= 4) return true;
			break;
		case "prison_ship":
			if (system.info.economy >= 4) return true;
			break;
		case "quaestor":
		case "censor":
		case "censor_ambience":
			if (worldScripts["dictators.js"]._settings.policeShipReplace == false) return false;
			if (system.info.economy < 4) return true;
			break;
		case "astrofactory":
		case "tanker_1":
		case "tanker_2":
		case "tanker_3":
		case "tanker_4":
		case "tanker_5":
		case "tanker_6":
		case "freighter_1":
		case "freighter_2":
		case "freighter_3":
		case "freighter_4":
		case "freighter_5":
		case "freighter_6":
		case "merchantman_1":
		case "merchantman_2":
		case "merchantman_3":
		case "merchantman_4":
		case "merchantman_5":
		case "merchantman_6":
			return true;
	}
	return false;
}
