Skip to content

Commit

Permalink
Merge branch 'lootboxes-random' into gib-contractor-bounty
Browse files Browse the repository at this point in the history
  • Loading branch information
wraith-54321 committed Nov 19, 2023
2 parents 62b2776 + 4fe8bb8 commit 09a53fc
Show file tree
Hide file tree
Showing 39 changed files with 524 additions and 158 deletions.
1 change: 1 addition & 0 deletions code/datums/components/uplink.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 7 additions & 2 deletions code/modules/antagonists/traitor/uplink_handler.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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))
Expand Down
29 changes: 22 additions & 7 deletions code/modules/uplink/uplink_items/bundle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions code/modules/uplink/uplink_items/dangerous.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions code/modules/uplink/uplink_items/device_tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion code/modules/uplink/uplink_items/explosive.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 5 additions & 5 deletions code/modules/uplink/uplink_items/job.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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()
. = ..()
Expand Down
32 changes: 16 additions & 16 deletions code/modules/uplink/uplink_items/nukeops.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -743,23 +743,23 @@
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
name = "Thermal Eyes"
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
name = "X-ray Vision Implant"
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
Expand Down
2 changes: 1 addition & 1 deletion code/modules/uplink/uplink_items/species.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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


4 changes: 2 additions & 2 deletions code/modules/uplink/uplink_items/stealthy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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.


Expand All @@ -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
Expand Down
9 changes: 9 additions & 0 deletions html/changelogs/AutoChangeLog-pr-513.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
author: "KittyNoodle"
delete-after: True
changes:
- rscadd: "Nuke ops have been authorized for a new experimental combat implant."
- qol: "Stacking hardlight spears now stores it in only one spell. And it looks really cool."
- qol: "Hardlight spears no longer delete themselves after 10 seconds."
- balance: "Hardlight spears now do much more damage."
- image: "resprited the hardlight spear"
- refactor: "Hardlight spears use projectiles instead of throws now."
Loading

0 comments on commit 09a53fc

Please sign in to comment.