Skip to content

Commit

Permalink
Merge pull request #997 from Gboster-0/surplus-crate-round-end-mirror…
Browse files Browse the repository at this point in the history
…-uwu

Makes syndicate lootboxes show properly on the round-end purchase list
  • Loading branch information
wraith-54321 authored Jan 25, 2024
2 parents e224666 + 29009b0 commit a687a15
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion monkestation/code/modules/uplink/uplink_items/bundles.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@

/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! \
Expand All @@ -50,11 +52,14 @@
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()
// quick safety check
if(!istype(surplus_crate))
CRASH("crate_type is not a crate")

var/list/possible_items = generate_possible_items(user, handler, TRUE)
// again safety check, if things fucked up badly we give them back their cost and return
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."))
Expand All @@ -63,13 +68,19 @@

fill_crate(surplus_crate, possible_items)

podspawn(list( // unlike other chests, lets give them the chest with STYLE
// unlike other chests, lets give them the chest with STYLE by droppodding in a STYLIZED pod
podspawn(list(
"target" = get_turf(user),
"style" = STYLE_SYNDICATE,
"spawn" = surplus_crate,
))

// lock everything except random entries, once you start gambling you cannot stop
handler.add_locked_entries(subtypesof(/datum/uplink_item) - /datum/uplink_item/bundles_tc/random)

// return the source, this is so the round-end uplink section shows how many TC the traitor spent on us (20TC) and a radio icon. Instead of 0 TC and a blank one
return source

//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)
Expand Down

0 comments on commit a687a15

Please sign in to comment.