diff --git a/code/datums/components/uplink.dm b/code/datums/components/uplink.dm index cec757486abc..e7fe90891cf1 100644 --- a/code/datums/components/uplink.dm +++ b/code/datums/components/uplink.dm @@ -253,6 +253,7 @@ data["current_stock"] = remaining_stock data["shop_locked"] = uplink_handler.shop_locked data["purchased_items"] = length(uplink_handler.purchase_log?.purchase_log) + data["locked_entries"] = uplink_handler.locked_entries //monkestation edit return data /datum/component/uplink/ui_static_data(mob/user) diff --git a/code/modules/antagonists/traitor/uplink_handler.dm b/code/modules/antagonists/traitor/uplink_handler.dm index 30c209a517c7..40b5d97c0cff 100644 --- a/code/modules/antagonists/traitor/uplink_handler.dm +++ b/code/modules/antagonists/traitor/uplink_handler.dm @@ -70,13 +70,18 @@ return FALSE return TRUE -/datum/uplink_handler/proc/can_purchase_item(mob/user, datum/uplink_item/to_purchase) +/datum/uplink_handler/proc/can_purchase_item(mob/user, datum/uplink_item/to_purchase, ignore_locked = FALSE) //monkestation edit: adds ignore_locked if(debug_mode) return TRUE if(shop_locked) return FALSE +//monkestation edit start + if(!(ignore_locked) && (to_purchase.type in locked_entries)) + return FALSE +//monkestation edit end + if(to_purchase.lock_other_purchases) // Can't purchase an uplink item that locks other purchases if you've already purchased something if(length(purchase_log.purchase_log) > 0) @@ -93,7 +98,7 @@ return TRUE /datum/uplink_handler/proc/purchase_item(mob/user, datum/uplink_item/to_purchase, atom/movable/source) - if(!can_purchase_item(user, to_purchase)) + if(!can_purchase_item(user, to_purchase) || !to_purchase.unique_checks(user, src, source)) //monkestation edit: adds the unique_checks() check return if(to_purchase.limited_stock != -1 && !(to_purchase.stock_key in item_stock)) diff --git a/code/modules/uplink/uplink_items/bundle.dm b/code/modules/uplink/uplink_items/bundle.dm index 2ce0de0f5733..708d255ea8a1 100644 --- a/code/modules/uplink/uplink_items/bundle.dm +++ b/code/modules/uplink/uplink_items/bundle.dm @@ -17,19 +17,26 @@ /datum/uplink_item/bundles_tc/random/purchase(mob/user, datum/uplink_handler/handler, atom/movable/source) var/list/possible_items = list() + var/ignore_locked = check_ignore_locked(handler) //monkestation edit for(var/datum/uplink_item/item_path as anything in SStraitor.uplink_items_by_type) var/datum/uplink_item/uplink_item = SStraitor.uplink_items_by_type[item_path] if(src == uplink_item || !uplink_item.item) continue - if(!handler.can_purchase_item(user, uplink_item)) + if(!handler.can_purchase_item(user, uplink_item, ignore_locked)) //monkestation edit: adds ignore_locked continue possible_items += uplink_item +//monkestation edit start, this is the less snowflakey more janky way to handle this + var/debug_mode = handler.debug_mode + if(ignore_locked) + handler.debug_mode = TRUE +//monkestation edit end if(possible_items.len) var/datum/uplink_item/uplink_item = pick(possible_items) log_uplink("[key_name(user)] purchased a random uplink item from [handler.owner]'s uplink with [handler.telecrystals] telecrystals remaining") SSblackbox.record_feedback("tally", "traitor_random_uplink_items_gotten", 1, initial(uplink_item.name)) handler.purchase_item(user, uplink_item) + handler.debug_mode = debug_mode //monkestation edit /datum/uplink_item/bundles_tc/telecrystal name = "1 Raw Telecrystal" @@ -80,24 +87,25 @@ name = "Syndicate Surplus Crate" desc = "A dusty crate from the back of the Syndicate warehouse delivered directly to you via Supply Pod. \ If the rumors are true, it will fill it's contents based on your current reputation. Get on that grind. \ - Contents are sorted to always be worth 30 TC. The Syndicate will only provide one surplus item per agent." + Contents are sorted to always be worth 40 TC. The Syndicate will only provide one surplus item per agent." item = /obj/structure/closet/crate // will be replaced in purchase() cost = 20 purchasable_from = ~(UPLINK_NUKE_OPS | UPLINK_CLOWN_OPS) stock_key = UPLINK_SHARED_STOCK_SURPLUS /// Value of items inside the crate in TC - var/crate_tc_value = 30 + var/crate_tc_value = 40 //monkestation edit: from 30 to 40 /// crate that will be used for the surplus crate var/crate_type = /obj/structure/closet/crate /// generates items that can go inside crates, edit this proc to change what items could go inside your specialized crate -/datum/uplink_item/bundles_tc/surplus/proc/generate_possible_items(mob/user, datum/uplink_handler/handler) +/// monkestation edit: set unrestricted to TRUE if you want to pick from all uplink items +/datum/uplink_item/bundles_tc/surplus/proc/generate_possible_items(mob/user, datum/uplink_handler/handler, unrestricted = FALSE) //monkestation edit: adds unrestricted var/list/possible_items = list() for(var/datum/uplink_item/item_path as anything in SStraitor.uplink_items_by_type) var/datum/uplink_item/uplink_item = SStraitor.uplink_items_by_type[item_path] if(src == uplink_item || !uplink_item.item) continue - if(!handler.check_if_restricted(uplink_item)) + if(!unrestricted && !handler.check_if_restricted(uplink_item)) //monkestation edit: adds the unrestricted check continue if(!uplink_item.surplus) continue @@ -130,6 +138,13 @@ CRASH("crate_type is not a crate") var/list/possible_items = generate_possible_items(user, handler) +//monkestation edit start + if(!possible_items || !length(possible_items)) + handler.telecrystals += cost + to_chat(user, span_warning("You get the feeling something went wrong and that you should inform syndicate command")) + qdel(surplus_crate) + CRASH("surplus crate failed to generate possible items") +//monkestation edit end fill_crate(surplus_crate, possible_items) podspawn(list( @@ -143,13 +158,13 @@ name = "United Surplus Crate" desc = "A shiny and large crate to be delivered directly to you via Supply Pod. It has an advanced locking mechanism with an anti-tampering protocol. \ It is recommended that you only attempt to open it by having another agent purchase a Surplus Crate Key. Unite and fight. \ - Rumored to contain a valuable assortment of items based on your current reputation, but you never know. Contents are sorted to always be worth 80 TC. \ + Rumored to contain a valuable assortment of items based on your current reputation, but you never know. Contents are sorted to always be worth 100 TC. \ The Syndicate will only provide one surplus item per agent." cost = 20 item = /obj/structure/closet/crate/syndicrate progression_minimum = 30 MINUTES stock_key = UPLINK_SHARED_STOCK_SURPLUS - crate_tc_value = 80 + crate_tc_value = 100 //monkestation edit: from 80 to 100 crate_type = /obj/structure/closet/crate/syndicrate /// edited version of fill crate for super surplus to ensure it can only be unlocked with the syndicrate key diff --git a/code/modules/uplink/uplink_items/dangerous.dm b/code/modules/uplink/uplink_items/dangerous.dm index 0c14c302b5ef..0086c6e40940 100644 --- a/code/modules/uplink/uplink_items/dangerous.dm +++ b/code/modules/uplink/uplink_items/dangerous.dm @@ -12,7 +12,7 @@ darts effective at incapacitating a target." item = /obj/item/gun/ballistic/automatic/pistol/toy/riot cost = 2 - surplus = 10 + surplus = 50 //monkestation edit: from 10 to 50 purchasable_from = ~UPLINK_NUKE_OPS /datum/uplink_item/dangerous/pistol @@ -86,7 +86,7 @@ progression_minimum = 30 MINUTES item = /obj/item/guardiancreator/tech/choose/traitor cost = 18 - surplus = 0 + surplus = 40 //monkestation edit: from 0 to 40 purchasable_from = ~(UPLINK_NUKE_OPS | UPLINK_CLOWN_OPS) restricted = TRUE diff --git a/code/modules/uplink/uplink_items/device_tools.dm b/code/modules/uplink/uplink_items/device_tools.dm index b5012ab4f885..aff270bd80fa 100644 --- a/code/modules/uplink/uplink_items/device_tools.dm +++ b/code/modules/uplink/uplink_items/device_tools.dm @@ -69,7 +69,7 @@ name = "Briefcase Launchpad" desc = "A briefcase containing a launchpad, a device able to teleport items and people to and from targets up to eight tiles away from the briefcase. \ Also includes a remote control, disguised as an ordinary folder. Touch the briefcase with the remote to link it." - surplus = 0 + surplus = 30 //monkestation edit: from 0 to 30 item = /obj/item/storage/briefcase/launchpad cost = 6 @@ -245,7 +245,7 @@ progression_minimum = 30 MINUTES item = /obj/item/sbeacondrop cost = 10 - surplus = 0 // not while there isnt one on any station + surplus = 50 // not while there isnt one on any station, monkestation edit: from 0 to 50, we have them purchasable_from = ~(UPLINK_NUKE_OPS | UPLINK_CLOWN_OPS) /datum/uplink_item/device_tools/powersink diff --git a/code/modules/uplink/uplink_items/explosive.dm b/code/modules/uplink/uplink_items/explosive.dm index 27145ccf004d..095b2e4cea65 100644 --- a/code/modules/uplink/uplink_items/explosive.dm +++ b/code/modules/uplink/uplink_items/explosive.dm @@ -67,7 +67,7 @@ progression_minimum = 30 MINUTES item = /obj/item/pizzabox/bomb cost = 6 - surplus = 8 + surplus = 30 //monkestation edit: from 8 to 30 /datum/uplink_item/explosives/syndicate_minibomb name = "Syndicate Minibomb" diff --git a/code/modules/uplink/uplink_items/job.dm b/code/modules/uplink/uplink_items/job.dm index b754ed2ff94f..01c745231aa8 100644 --- a/code/modules/uplink/uplink_items/job.dm +++ b/code/modules/uplink/uplink_items/job.dm @@ -23,7 +23,7 @@ limited_stock = 1 item = /obj/item/devices/bureaucratic_error_remote restricted_roles = list(JOB_HEAD_OF_PERSONNEL, JOB_QUARTERMASTER) - surplus = 5 + surplus = 40 //monkestation edit: from 5 to 40 /datum/uplink_item/role_restricted/clumsinessinjector //clown ops can buy this too, but it's in the pointless badassery section for them name = "Clumsiness Injector" @@ -57,7 +57,7 @@ item = /obj/item/firing_pin/clown/ultra restricted_roles = list(JOB_CLOWN) illegal_tech = FALSE - surplus = 25 + surplus = 0 //monkestation edit: from 25 to 0 /datum/uplink_item/role_restricted/clownsuperpin name = "Super Ultra Hilarious Firing Pin" @@ -66,7 +66,7 @@ item = /obj/item/firing_pin/clown/ultra/selfdestruct restricted_roles = list(JOB_CLOWN) illegal_tech = FALSE - surplus = 25 + surplus = 0 //monkestation edit: from 25 to 0 /datum/uplink_item/role_restricted/syndimmi name = "Syndicate Brand MMI" @@ -99,7 +99,7 @@ The acid only affects carbon-based creatures." item = /obj/item/storage/box/syndie_kit/ez_clean cost = 6 - surplus = 20 + surplus = 40 //monkestation edit: from 20 to 40 restricted_roles = list(JOB_JANITOR) /datum/uplink_item/role_restricted/reverse_bear_trap @@ -238,7 +238,7 @@ item = /obj/item/sbeacondrop/clownbomb cost = 15 restricted_roles = list(JOB_CLOWN) - surplus = 10 + surplus = 50 //monkestation edit: from 10 to 50 /datum/uplink_item/role_restricted/clown_bomb/New() . = ..() diff --git a/code/modules/uplink/uplink_items/nukeops.dm b/code/modules/uplink/uplink_items/nukeops.dm index 70ca0377e8ce..85362d74506a 100644 --- a/code/modules/uplink/uplink_items/nukeops.dm +++ b/code/modules/uplink/uplink_items/nukeops.dm @@ -70,7 +70,7 @@ and returning to you even if you miss. WARNING: DO NOT ATTEMPT TO STAND ON SHIELD WHILE DEPLOYED, EVEN IF WEARING ANTI-SLIP SHOES." item = /obj/item/shield/energy/bananium cost = 16 - surplus = 0 + surplus = 40 //monkestation edit: from 0 to 40 purchasable_from = UPLINK_CLOWN_OPS /datum/uplink_item/dangerous/clownsword @@ -79,7 +79,7 @@ impact, or just stepping on it. Beware friendly fire, as even anti-slip shoes will not protect against it." item = /obj/item/melee/energy/sword/bananium cost = 3 - surplus = 0 + surplus = 100 //monkestation edit: from 0 to 100(its funny) purchasable_from = UPLINK_CLOWN_OPS /datum/uplink_item/dangerous/clownoppin @@ -122,7 +122,7 @@ against other attacks. Pair with an Energy Sword for a killer combination." item = /obj/item/shield/energy cost = 16 - surplus = 20 + surplus = 40 //monkestation edit: from 20 to 40 purchasable_from = UPLINK_NUKE_OPS /datum/uplink_item/dangerous/machinegun @@ -131,7 +131,7 @@ This deadly weapon has a massive 50-round magazine of devastating 7.12x82mm ammunition." item = /obj/item/gun/ballistic/automatic/l6_saw cost = 18 - surplus = 0 + surplus = 10 //monkestation edit: from 0 to 10 purchasable_from = UPLINK_NUKE_OPS /datum/uplink_item/dangerous/carbine @@ -172,7 +172,7 @@ desc = "A fully-loaded Donksoft bullpup submachine gun that fires riot grade darts with a 20-round magazine." item = /obj/item/gun/ballistic/automatic/c20r/toy cost = 5 - surplus = 0 + surplus = 70 //monkestation edit: from 0 to 70 purchasable_from = UPLINK_CLOWN_OPS /datum/uplink_item/dangerous/foammachinegun @@ -181,7 +181,7 @@ riot grade darts, that can briefly incapacitate someone in just one volley." item = /obj/item/gun/ballistic/automatic/l6_saw/toy cost = 10 - surplus = 0 + surplus = 70 //monkestation edit: from 0 to 70 purchasable_from = UPLINK_CLOWN_OPS /datum/uplink_item/stealthy_weapons/cqc @@ -190,7 +190,7 @@ item = /obj/item/book/granter/martial/cqc purchasable_from = UPLINK_NUKE_OPS | UPLINK_CLOWN_OPS cost = 13 - surplus = 0 + surplus = 60 //monkestation edit: from 0 to 60 /datum/uplink_item/ammo/pistol_nukeop name = "10mm Handgun Magazine" @@ -440,7 +440,7 @@ a few seconds after the banana is eaten." item = /obj/item/food/grown/banana/bombanana cost = 4 //it is a bit cheaper than a minibomb because you have to take off your helmet to eat it, which is how you arm it - surplus = 0 + surplus = 60 //monkestation edit: from 0 to 60 purchasable_from = UPLINK_CLOWN_OPS /datum/uplink_item/explosives/clown_bomb_clownops @@ -485,7 +485,7 @@ item = /obj/item/storage/belt/grenade/full purchasable_from = UPLINK_NUKE_OPS cost = 22 - surplus = 0 + surplus = 70 //monkestation edit: from 0 to 70 /datum/uplink_item/explosives/syndicate_detonator name = "Syndicate Detonator" @@ -503,7 +503,7 @@ remain attached to the face of all targets for one minute, preventing the use of breath masks and other such devices." item = /obj/item/grenade/chem_grenade/teargas/moustache cost = 3 - surplus = 0 + surplus = 80 //monkestation edit: from 0 to 80 purchasable_from = UPLINK_CLOWN_OPS /datum/uplink_item/explosives/viscerators @@ -522,7 +522,7 @@ purchasable_from = UPLINK_CLOWN_OPS limited_stock = 1 cost = 12 //This is effectively the clown ops version of the grenadier belt where you should on average get 8 explosives if you use a weapon with exactly 10 force. - surplus = 0 + surplus = 60 //monkestation edit: from 0 to 60 //Support and Mechs /datum/uplink_category/support @@ -615,7 +615,7 @@ squeak significantly louder." item = /obj/item/clothing/shoes/clown_shoes/banana_shoes/combat cost = 6 - surplus = 0 + surplus = 100 //monkestation edit: from 0 to 100 HONK purchasable_from = UPLINK_CLOWN_OPS /datum/uplink_item/stealthy_tools/syndigaloshes/nuke @@ -717,7 +717,7 @@ desc = "This implant will help you get back up on your feet faster after being stunned. Comes with an autosurgeon." item = /obj/item/autosurgeon/syndicate/anti_stun cost = 12 - surplus = 0 + surplus = 40 //monkestation edit: from 0 to 40 purchasable_from = UPLINK_NUKE_OPS /datum/uplink_item/implants/microbomb @@ -743,7 +743,7 @@ desc = "This implant will attempt to revive and heal you if you lose consciousness. Comes with an autosurgeon." item = /obj/item/autosurgeon/syndicate/reviver cost = 8 - surplus = 0 + surplus = 30 //monkestation edit: from 0 to 30 purchasable_from = UPLINK_NUKE_OPS /datum/uplink_item/implants/thermals @@ -751,7 +751,7 @@ desc = "These cybernetic eyes will give you thermal vision. Comes with a free autosurgeon." item = /obj/item/autosurgeon/syndicate/thermal_eyes cost = 8 - surplus = 0 + surplus = 40 //monkestation edit: from 0 to 40 purchasable_from = UPLINK_NUKE_OPS /datum/uplink_item/implants/xray @@ -759,7 +759,7 @@ desc = "These cybernetic eyes will give you X-ray vision. Comes with an autosurgeon." item = /obj/item/autosurgeon/syndicate/xray_eyes cost = 10 - surplus = 0 + surplus = 30 //monkestation edit: from 0 to 30 purchasable_from = UPLINK_NUKE_OPS /datum/uplink_item/implants/deathrattle diff --git a/code/modules/uplink/uplink_items/species.dm b/code/modules/uplink/uplink_items/species.dm index aa9c727d6e8b..fa42da23dc9b 100644 --- a/code/modules/uplink/uplink_items/species.dm +++ b/code/modules/uplink/uplink_items/species.dm @@ -13,6 +13,6 @@ cost = 2 item = /obj/item/flashlight/lantern/syndicate restricted_species = list(SPECIES_MOTH) - surplus = 0 + surplus = 80 //monkestation edit: from 0 to 80 diff --git a/code/modules/uplink/uplink_items/stealthy.dm b/code/modules/uplink/uplink_items/stealthy.dm index 491f8e8e99d6..005384c3f762 100644 --- a/code/modules/uplink/uplink_items/stealthy.dm +++ b/code/modules/uplink/uplink_items/stealthy.dm @@ -67,7 +67,7 @@ item = /obj/item/storage/box/syndie_kit/origami_bundle progression_minimum = 10 MINUTES cost = 4 - surplus = 0 + surplus = 50 //monkestation edit: from 0 to 50 purchasable_from = ~UPLINK_NUKE_OPS //clown ops intentionally left in, because that seems like some s-tier shenanigans. @@ -78,7 +78,7 @@ item = /obj/item/book/granter/martial/carp progression_minimum = 30 MINUTES cost = 13 - surplus = 0 + surplus = 30 //monkestation edit: from 0 to 30 purchasable_from = ~(UPLINK_NUKE_OPS | UPLINK_CLOWN_OPS) /datum/uplink_item/stealthy_weapons/crossbow diff --git a/monkestation/code/modules/antagonists/traitor/uplink_handler.dm b/monkestation/code/modules/antagonists/traitor/uplink_handler.dm new file mode 100644 index 000000000000..4848d52468e5 --- /dev/null +++ b/monkestation/code/modules/antagonists/traitor/uplink_handler.dm @@ -0,0 +1,8 @@ +/datum/uplink_handler + /// Extra stuff that cannot be purchased by an uplink, regardless of flag. + var/list/locked_entries = list() + +///Add items to our locked_entries +/datum/uplink_handler/proc/add_locked_entries(list/items_to_add) + for(var/datum/uplink_item/item as anything in items_to_add) + locked_entries |= item diff --git a/monkestation/code/modules/antagonists/uplink_items/bundles.dm b/monkestation/code/modules/antagonists/uplink_items/bundles.dm deleted file mode 100644 index bccbba83f232..000000000000 --- a/monkestation/code/modules/antagonists/uplink_items/bundles.dm +++ /dev/null @@ -1,31 +0,0 @@ -/datum/uplink_item/bundles_tc/surplus/lootbox - name = "Syndicate Lootbox Crate" - desc = "A dusty crate from the back of the Syndicate warehouse. Rumored to contain a valuable assortment of items, \ - With their all new kit, codenamed 'scam' the syndicate attempted to extract the energy of the die of fate to \ - make a loot-box style system but failed, so instead just fake their randomness using ook's evil twin brother to sniff out the items to shove in it. \ - Item price not guaranteed. Can contain normally unobtainable items." - lock_other_purchases = TRUE - -/datum/uplink_item/bundles_tc/surplus/lootbox/purchase(mob/user, datum/uplink_handler/handler, atom/movable/source) - crate_tc_value = rand(1,20) // randomise how much it costs, from 5 to 100 TC - crate_tc_value *= 5 - if(crate_tc_value == 5) //horrible luck, welcome to gambling - crate_tc_value *= 0 - to_chat(user, span_warning("You feel an overwhelming sense of pride and accomplishment.")) - if(crate_tc_value == 100) // Jackpot, how lucky - crate_tc_value *= 2 - print_command_report("Congratulations to [user] for being the [rand(2, 9)]th lucky winner of the syndicate lottery! \ - Dread Admiral Sabertooth has authorised the beaming of your special equipment immediately! Happy hunting operative.", - "Syndicate Gambling Division High Command", TRUE) - var/obj/structure/closet/crate/surplus_crate = new crate_type() - if(!istype(surplus_crate)) - CRASH("crate_type is not a crate") - var/list/possible_items = generate_possible_items(user, handler) - - fill_crate(surplus_crate, possible_items) - - podspawn(list( // unlike other chests, lets give them the chest with STYLE - "target" = get_turf(user), - "style" = STYLE_SYNDICATE, - "spawn" = surplus_crate, - )) diff --git a/monkestation/code/modules/antagonists/uplink_items/species.dm b/monkestation/code/modules/antagonists/uplink_items/species.dm deleted file mode 100644 index d39476f11b82..000000000000 --- a/monkestation/code/modules/antagonists/uplink_items/species.dm +++ /dev/null @@ -1,15 +0,0 @@ -//Species Specific Items - -/datum/uplink_item/race_restricted/monkey_barrel - name = "Angry Monkey Barrel" - desc = "Expert Syndicate Scientists put pissed a couple monkeys off and put them in a barrel. It isn't that complicated, but it's very effective" - cost = 7 - item = /obj/item/grenade/monkey_barrel - restricted_species = list(SPECIES_SIMIAN) - -/datum/uplink_item/race_restricted/monkey_ball - name = "Monkey Ball" - desc = "Stolen experimental MonkeTech designed to bring a monkey's speed to dangerous levels." - cost = 12 - item = /obj/vehicle/ridden/monkey_ball - restricted_species = list(SPECIES_SIMIAN) diff --git a/monkestation/code/modules/uplink/uplink_items.dm b/monkestation/code/modules/uplink/uplink_items.dm new file mode 100644 index 000000000000..406f4c571d06 --- /dev/null +++ b/monkestation/code/modules/uplink/uplink_items.dm @@ -0,0 +1,3 @@ +///Override for any unique checks for specific items, by default returns TRUE +/datum/uplink_item/proc/unique_checks(mob/user, datum/uplink_handler/handler, atom/movable/source) + return TRUE diff --git a/monkestation/code/modules/uplink/uplink_items/bundles.dm b/monkestation/code/modules/uplink/uplink_items/bundles.dm new file mode 100644 index 000000000000..4b5b73d01e44 --- /dev/null +++ b/monkestation/code/modules/uplink/uplink_items/bundles.dm @@ -0,0 +1,52 @@ +/datum/uplink_item/bundles_tc/surplus/lootbox + name = "Syndicate Lootbox Crate" + desc = "A dusty crate from the back of the Syndicate warehouse. Rumored to contain a valuable assortment of items, \ + With their all new kit, codenamed 'scam' the syndicate attempted to extract the energy of the die of fate to \ + make a loot-box style system but failed, so instead just fake their randomness using ook's evil twin brother to sniff out the items to shove in it. \ + Item price not guaranteed. Can contain normally unobtainable items. Purchasing this will prevent you from purchasing any non-random item. \ + Cannot be purchased if you have already bought another item." + +/datum/uplink_item/bundles_tc/surplus/lootbox/unique_checks(mob/user, datum/uplink_handler/handler, atom/movable/source) + //we dont acually have the var that makes this get checked so do it manually + if(length(handler.purchase_log.purchase_log) > 0) + return FALSE + return TRUE + +/datum/uplink_item/bundles_tc/surplus/lootbox/spawn_item(spawn_path, mob/user, datum/uplink_handler/handler, atom/movable/source) + crate_tc_value = rand(1,20) * 5 // randomise how much in TC it gives, from 5 to 100 TC + if(crate_tc_value == 5) //horrible luck, welcome to gambling + crate_tc_value = 0 + to_chat(user, span_warning("You feel an overwhelming sense of pride and accomplishment.")) + if(crate_tc_value == 100) // Jackpot, how lucky + crate_tc_value *= 2 + print_command_report("Congratulations to [user] for being the [rand(2, 9)]th lucky winner of the syndicate lottery! \ + Dread Admiral Sabertooth has authorised the beaming of your special equipment immediately! Happy hunting operative.", + "Syndicate Gambling Division High Command", TRUE) + if(ishuman(user) && !(locate(/obj/item/implant/weapons_auth) in user)) //jackpot winners dont have to find firing pins for any guns they get + var/obj/item/implant/weapons_auth/auth = new + auth.implant(user) + to_chat(user, span_notice("You feel as though the syndicate have given you the ability to use weapons beyond your normal access level.")) + var/obj/structure/closet/crate/surplus_crate = new crate_type() + if(!istype(surplus_crate)) + CRASH("crate_type is not a crate") + + var/list/possible_items = generate_possible_items(user, handler, TRUE) + if(!possible_items || !length(possible_items)) + handler.telecrystals += cost + to_chat(user, span_warning("You get the feeling something went wrong and that you should inform syndicate command.")) + qdel(surplus_crate) + CRASH("lootbox crate failed to generate possible items") + + fill_crate(surplus_crate, possible_items) + + podspawn(list( // unlike other chests, lets give them the chest with STYLE + "target" = get_turf(user), + "style" = STYLE_SYNDICATE, + "spawn" = surplus_crate, + )) + handler.add_locked_entries(subtypesof(/datum/uplink_item) - /datum/uplink_item/bundles_tc/random) + +//pain +///Check if we should ignore handler locked_entries or not +/datum/uplink_item/bundles_tc/random/proc/check_ignore_locked(datum/uplink_handler/handler) + return (length(handler.locked_entries) == (length(subtypesof(/datum/uplink_item)) - 1)) && !(src.type in handler.locked_entries) diff --git a/monkestation/code/modules/uplink/uplink_items/device_tools.dm b/monkestation/code/modules/uplink/uplink_items/device_tools.dm new file mode 100644 index 000000000000..3ccfc94cb441 --- /dev/null +++ b/monkestation/code/modules/uplink/uplink_items/device_tools.dm @@ -0,0 +1,5 @@ +/datum/uplink_item/device_tools/tram_remote + surplus = 40 + +/datum/uplink_item/device_tools/rad_laser + surplus = 40 diff --git a/monkestation/code/modules/uplink/uplink_items/explosive.dm b/monkestation/code/modules/uplink/uplink_items/explosive.dm new file mode 100644 index 000000000000..493b311b441f --- /dev/null +++ b/monkestation/code/modules/uplink/uplink_items/explosive.dm @@ -0,0 +1,2 @@ +/datum/uplink_item/explosives/soap_clusterbang + surplus = 60 diff --git a/monkestation/code/modules/uplink/uplink_items/job.dm b/monkestation/code/modules/uplink/uplink_items/job.dm index bfbb6c547e37..216d4cb5987d 100644 --- a/monkestation/code/modules/uplink/uplink_items/job.dm +++ b/monkestation/code/modules/uplink/uplink_items/job.dm @@ -5,3 +5,9 @@ cost = 1 item = /obj/item/storage/book/bible/mini restricted_roles = list(JOB_CHAPLAIN, JOB_CLOWN) + +/datum/uplink_item/role_restricted/reverse_bear_trap + surplus = 60 + +/datum/uplink_item/role_restricted/modified_syringe_gun + surplus = 50 diff --git a/monkestation/code/modules/antagonists/uplink_items/misc.dm b/monkestation/code/modules/uplink/uplink_items/misc.dm similarity index 100% rename from monkestation/code/modules/antagonists/uplink_items/misc.dm rename to monkestation/code/modules/uplink/uplink_items/misc.dm diff --git a/monkestation/code/modules/uplink/uplink_items/nukeops.dm b/monkestation/code/modules/uplink/uplink_items/nukeops.dm new file mode 100644 index 000000000000..8a918b7ad0b5 --- /dev/null +++ b/monkestation/code/modules/uplink/uplink_items/nukeops.dm @@ -0,0 +1,20 @@ +/datum/uplink_item/stealthy_weapons/romerol_kit + surplus = 10 //very rare from lootboxes + +/datum/uplink_item/dangerous/clownoppin + surplus = 80 + +/datum/uplink_item/dangerous/clownopsuperpin + surplus = 80 + +/datum/uplink_item/bundles_tc/cyber_implants + surplus = 30 + +/datum/uplink_item/bundles_tc/medical + surplus = 40 + +/datum/uplink_item/support/gygax + surplus = 40 + +/datum/uplink_item/support/honker + surplus = 60 diff --git a/monkestation/code/modules/uplink/uplink_items/species.dm b/monkestation/code/modules/uplink/uplink_items/species.dm index 29a4623f1664..db1ee12eac86 100644 --- a/monkestation/code/modules/uplink/uplink_items/species.dm +++ b/monkestation/code/modules/uplink/uplink_items/species.dm @@ -8,3 +8,18 @@ cost = 4 restricted_species = list(SPECIES_MOTH) surplus = 0 + +/datum/uplink_item/race_restricted/monkey_barrel + name = "Angry Monkey Barrel" + desc = "Expert Syndicate Scientists put pissed a couple monkeys off and put them in a barrel. It isn't that complicated, but it's very effective" + cost = 7 + item = /obj/item/grenade/monkey_barrel + restricted_species = list(SPECIES_SIMIAN) + +/datum/uplink_item/race_restricted/monkey_ball + name = "Monkey Ball" + desc = "Stolen experimental MonkeTech designed to bring a monkey's speed to dangerous levels." + cost = 12 + item = /obj/vehicle/ridden/monkey_ball + restricted_species = list(SPECIES_SIMIAN) + diff --git a/monkestation/code/modules/antagonists/uplink_items/weapons.dm b/monkestation/code/modules/uplink/uplink_items/weapons.dm similarity index 100% rename from monkestation/code/modules/antagonists/uplink_items/weapons.dm rename to monkestation/code/modules/uplink/uplink_items/weapons.dm diff --git a/tgstation.dme b/tgstation.dme index d3bc1729f965..5c1f240219ec 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -5689,12 +5689,9 @@ #include "monkestation\code\modules\antagonists\slasher\slasher_outfit\slasher_footwear.dm" #include "monkestation\code\modules\antagonists\slasher\slasher_outfit\slasher_headgear.dm" #include "monkestation\code\modules\antagonists\slasher\slasher_outfit\slasher_middlewear.dm" +#include "monkestation\code\modules\antagonists\traitor\uplink_handler.dm" #include "monkestation\code\modules\antagonists\traitor\objectives\tide_bug_department.dm" #include "monkestation\code\modules\antagonists\traitor\objectives\final_objective\become_wizard.dm" -#include "monkestation\code\modules\antagonists\uplink_items\bundles.dm" -#include "monkestation\code\modules\antagonists\uplink_items\misc.dm" -#include "monkestation\code\modules\antagonists\uplink_items\species.dm" -#include "monkestation\code\modules\antagonists\uplink_items\weapons.dm" #include "monkestation\code\modules\antagonists\wizard\equipment\artefact.dm" #include "monkestation\code\modules\antagonists\wizard\equipment\spellbook_entries\defensive.dm" #include "monkestation\code\modules\antagonists\wizard\equipment\spellbook_entries\mobility.dm" @@ -6359,9 +6356,16 @@ #include "monkestation\code\modules\twitch_bits\events\random_item.dm" #include "monkestation\code\modules\twitch_bits\events\rod.dm" #include "monkestation\code\modules\twitch_bits\events\skinny.dm" +#include "monkestation\code\modules\uplink\uplink_items.dm" #include "monkestation\code\modules\uplink\uplink_items\badass.dm" +#include "monkestation\code\modules\uplink\uplink_items\bundles.dm" +#include "monkestation\code\modules\uplink\uplink_items\device_tools.dm" +#include "monkestation\code\modules\uplink\uplink_items\explosive.dm" #include "monkestation\code\modules\uplink\uplink_items\job.dm" +#include "monkestation\code\modules\uplink\uplink_items\misc.dm" +#include "monkestation\code\modules\uplink\uplink_items\nukeops.dm" #include "monkestation\code\modules\uplink\uplink_items\species.dm" +#include "monkestation\code\modules\uplink\uplink_items\weapons.dm" #include "monkestation\code\modules\vehicles\monkey_ball.dm" #include "monkestation\code\modules\vehicles\mecha\mecha_actions.dm" #include "monkestation\code\modules\vehicles\mecha\equipment\tools\other_tools.dm" diff --git a/tgui/packages/tgui/interfaces/AntagInfoMalf.tsx b/tgui/packages/tgui/interfaces/AntagInfoMalf.tsx index f2d53da2bb12..6292753cf0ad 100644 --- a/tgui/packages/tgui/interfaces/AntagInfoMalf.tsx +++ b/tgui/packages/tgui/interfaces/AntagInfoMalf.tsx @@ -195,6 +195,7 @@ export const AntagInfoMalf = (props, context) => { cost: `${item.cost} PT`, desc: item.desc, disabled: processingTime < item.cost, + is_locked: null, }); } } diff --git a/tgui/packages/tgui/interfaces/Uplink/GenericUplink.tsx b/tgui/packages/tgui/interfaces/Uplink/GenericUplink.tsx index 3ea3e3abcd3a..7ae85a5157c4 100644 --- a/tgui/packages/tgui/interfaces/Uplink/GenericUplink.tsx +++ b/tgui/packages/tgui/interfaces/Uplink/GenericUplink.tsx @@ -1,6 +1,6 @@ import { BooleanLike } from 'common/react'; import { useLocalState, useSharedState } from '../../backend'; -import { Box, Button, Input, Section, Tabs, NoticeBox, Stack } from '../../components'; +import { Box, Button, Input, Section, Tabs, NoticeBox, Stack, Dimmer } from '../../components'; import type { InfernoNode } from 'inferno'; type GenericUplinkProps = { @@ -95,6 +95,7 @@ export type Item = { cost: InfernoNode | string; desc: InfernoNode | string; disabled: BooleanLike; + is_locked: BooleanLike; extraData?: ItemData; }; @@ -111,17 +112,32 @@ const ItemList = (props: ItemListProps, context: any) => { {items.map((item, index) => ( -
handleBuy(item)} - /> - }> - {compactMode ? null : item.desc} +
+
handleBuy(item)} + /> + }> + {compactMode ? null : item.desc} +
+ {(item.is_locked && ( + + + ENTRY LOCKED + + + )) || + null}
))} diff --git a/tgui/packages/tgui/interfaces/Uplink/index.tsx b/tgui/packages/tgui/interfaces/Uplink/index.tsx index 24cbb734d885..fe2aa6b0d08b 100644 --- a/tgui/packages/tgui/interfaces/Uplink/index.tsx +++ b/tgui/packages/tgui/interfaces/Uplink/index.tsx @@ -59,6 +59,7 @@ type UplinkData = { maximum_potential_objectives: number; purchased_items: number; shop_locked: BooleanLike; + locked_entries: string[]; }; type UplinkState = { @@ -176,6 +177,7 @@ export class Uplink extends Component<{}, UplinkState> { lockable, purchased_items, shop_locked, + locked_entries, } = data; const { allItems, allCategories, currentTab } = this.state as UplinkState; @@ -199,6 +201,7 @@ export class Uplink extends Component<{}, UplinkState> { stock = null; } const canBuy = telecrystals >= item.cost && (stock === null || stock > 0); + const locked = locked_entries.includes(item.id); items.push({ id: item.id, name: item.name, @@ -231,7 +234,11 @@ export class Uplink extends Component<{}, UplinkState> { )} ), - disabled: !canBuy || (item.lock_other_purchases && purchased_items > 0), + disabled: + !canBuy || + (item.lock_other_purchases && purchased_items > 0) || + locked, + is_locked: locked, extraData: { ref: item.ref, },