diff --git a/code/modules/client/preference/loadout/loadout.dm b/code/modules/client/preference/loadout/loadout.dm index 010fc54564c..b42c5d5abf1 100644 --- a/code/modules/client/preference/loadout/loadout.dm +++ b/code/modules/client/preference/loadout/loadout.dm @@ -4,6 +4,7 @@ var/list/gear_datums = list() /datum/loadout_category var/category = "" var/list/gear = list() + var/donor_only = FALSE /datum/loadout_category/New(cat) category = cat @@ -33,6 +34,8 @@ var/list/gear_datums = list() if(!loadout_categories[use_category]) loadout_categories[use_category] = new /datum/loadout_category(use_category) var/datum/loadout_category/LC = loadout_categories[use_category] + if(initial(G.donor_only)) + LC.donor_only = TRUE gear_datums[use_name] = new geartype LC.gear[use_name] = gear_datums[use_name] @@ -54,6 +57,7 @@ var/list/gear_datums = list() var/list/gear_tweaks = list() //List of datums which will alter the item after it has been spawned. var/subtype_path = /datum/gear //for skipping organizational subtypes (optional) var/subtype_cost_overlap = TRUE //if subtypes can take points at the same time + var/donor_only = FALSE // if it's only available to donors /datum/gear/New() ..() @@ -76,4 +80,4 @@ var/list/gear_datums = list() var/item = new gd.path(gd.location) for(var/datum/gear_tweak/gt in gear_tweaks) gt.tweak_item(item, metadata["[gt]"]) - return item \ No newline at end of file + return item diff --git a/code/modules/client/preference/loadout/loadout_donor.dm b/code/modules/client/preference/loadout/loadout_donor.dm new file mode 100644 index 00000000000..acfe24b2c56 --- /dev/null +++ b/code/modules/client/preference/loadout/loadout_donor.dm @@ -0,0 +1,4 @@ +/datum/gear/donor + donor_only = TRUE + sort_category = "Donor" + subtype_path = /datum/gear/donor diff --git a/code/modules/client/preference/preferences.dm b/code/modules/client/preference/preferences.dm index 62b02b51b34..415a6f05d3f 100644 --- a/code/modules/client/preference/preferences.dm +++ b/code/modules/client/preference/preferences.dm @@ -222,7 +222,6 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts max_gear_slots = config.max_loadout_points if(C.donator_level >= DONATOR_LEVEL_ONE) max_gear_slots += 5 - log_to_dd("Added 5 gear slots to [C.ckey], now [max_gear_slots]") var/loaded_preferences_successfully = load_preferences(C) if(loaded_preferences_successfully) @@ -481,6 +480,10 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts var/firstcat = 1 for(var/category in loadout_categories) + var/datum/loadout_category/LC = loadout_categories[category] + if(LC.donor_only) + if(user.client.donator_level < DONATOR_LEVEL_TWO) // level two donators get the donator loadout, so don't show it to anyone with less than that + continue if(firstcat) firstcat = 0 else @@ -1106,6 +1109,10 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts if(TG.display_name in gear) gear -= TG.display_name else + if(TG.donor_only) + if(user.client.donator_level < DONATOR_LEVEL_TWO) // donator items are locked to > tier 2 + //they normally can't even get this far- but just in case of href exploits, we check them here + return var/total_cost = 0 var/list/type_blacklist = list() for(var/gear_name in gear) diff --git a/paradise.dme b/paradise.dme index ad5db876321..194e853807b 100644 --- a/paradise.dme +++ b/paradise.dme @@ -1117,6 +1117,7 @@ #include "code\modules\client\preference\loadout\loadout.dm" #include "code\modules\client\preference\loadout\loadout_accessories.dm" #include "code\modules\client\preference\loadout\loadout_cosmetics.dm" +#include "code\modules\client\preference\loadout\loadout_donor.dm" #include "code\modules\client\preference\loadout\loadout_general.dm" #include "code\modules\client\preference\loadout\loadout_hat.dm" #include "code\modules\client\preference\loadout\loadout_shoes.dm"