"use strict";
this.name = "GalCopBBMissions_Conditions";
this.author = "phkb";
this.copyright = "2017 phkb";
this.description = "Condition script for equipment.";
this.license = "CC BY-NC-SA 4.0";

//-------------------------------------------------------------------------------------------------------------
this.allowAwardEquipment = function (equipment, ship, context) {
    if (context === "scripted") return true;
    if (equipment === "EQ_GCM_COMMS_RELAY_SWITCH_RECHARGE" && worldScripts.GalCopBB_DataCache._usageCount > 0) return true;
    return false;
}

//-------------------------------------------------------------------------------------------------------------
this.updateEquipmentPrice = function (equipment, price) {
    var newprice = price;
    if (equipment === "EQ_GCM_COMMS_RELAY_SWITCH_RECHARGE") {
        newprice = worldScripts.GalCopBB_DataCache._usageCount * price;
    }
    return newprice;
}