diff --git a/code/__DEFINES/uplink.dm b/code/__DEFINES/uplink.dm index d8cda44e591..fcc2118348c 100644 --- a/code/__DEFINES/uplink.dm +++ b/code/__DEFINES/uplink.dm @@ -12,3 +12,7 @@ /// Progression gets turned into a user-friendly form. This is just an abstract equation that makes progression not too large. #define DISPLAY_PROGRESSION(time) round(time/60, 0.01) +/// Traitor discount size categories +#define TRAITOR_DISCOUNT_BIG "big_discount" +#define TRAITOR_DISCOUNT_AVERAGE "average_discount" +#define TRAITOR_DISCOUNT_SMALL "small_discount" diff --git a/code/modules/uplink/uplink_items.dm b/code/modules/uplink/uplink_items.dm index f74b5877509..4d344efa16e 100644 --- a/code/modules/uplink/uplink_items.dm +++ b/code/modules/uplink/uplink_items.dm @@ -1,6 +1,3 @@ -#define TRAITOR_DISCOUNT_BIG "big_discount" -#define TRAITOR_DISCOUNT_AVERAGE "average_discount" -#define TRAITOR_DISCOUNT_SMALL "small_discount" // TODO: Work into reworked uplinks. /// Selects a set number of unique items from the uplink, and deducts a percentage discount from them @@ -93,7 +90,11 @@ TRAITOR_DISCOUNT_BIG = 1, ) - switch(pick_weight(discount_types)) + return get_discount_value(pick_weight(discount_types)) + +/// Receives a traitor discount type value, returns the amount by which we will reduce the price +/datum/uplink_item/proc/get_discount_value(discount_type) + switch(discount_type) if(TRAITOR_DISCOUNT_BIG) return 0.75 if(TRAITOR_DISCOUNT_AVERAGE) @@ -156,7 +157,3 @@ /// Code that enables the ability to have limited stock that is shared by different items /datum/shared_uplink_stock - -#undef TRAITOR_DISCOUNT_BIG -#undef TRAITOR_DISCOUNT_AVERAGE -#undef TRAITOR_DISCOUNT_SMALL diff --git a/code/modules/uplink/uplink_items/dangerous.dm b/code/modules/uplink/uplink_items/dangerous.dm index 9624139a639..4f295904bfb 100644 --- a/code/modules/uplink/uplink_items/dangerous.dm +++ b/code/modules/uplink/uplink_items/dangerous.dm @@ -79,8 +79,14 @@ cost = 16 purchasable_from = ~UPLINK_CLOWN_OPS -/datum/uplink_item/dangerous/doublesword/get_discount() - return pick(4;0.8,2;0.65,1;0.5) +/datum/uplink_item/dangerous/doublesword/get_discount_value(discount_type) + switch(discount_type) + if(TRAITOR_DISCOUNT_BIG) + return 0.5 + if(TRAITOR_DISCOUNT_AVERAGE) + return 0.35 + else + return 0.2 /datum/uplink_item/dangerous/guardian name = "Holoparasites"