Files
Jacquerel 9fb7c20daa Cargo can buy more presents at Christmas time (#94251)
## About The Pull Request

Last Christmas we had and resolved this bug #88595 where via the
mechanic of buying random trash, Cargo could roll on the roulette to try
and get random Christmas presents and open them for random items.
This was removed because it's not supposed to work that way and was a
way of exploiting Christmas cheer for personal gain, which is grinchsome
behaviour.

That said, being able to order Christmas presents is also kind of
soulful, so this PR brings that mechanic back but on purpose this time.

During the Christmas season _only_, Cargo can spend 3000 credits of
their budget to order a "Surplus Christmas Gifts" crate which contains
4-6 presents _with pre-assigned recipients_.
In a similar system to addressed mail, only the person written on the
gift tag can open the present, so unless you're sufficiently scroogeous
to collect a huge pile of presents on the cargo room floor in hopes of
getting a couple with your name on (in my testing these contained raw
unbaked croissant dough, and a piece of paper from a space ruin) you
should mostly be using this to deliver generalised holiday cheer to the
crew rather than just yourself.



This PR also contains (maybe as more lines than the actual feature) a
refactor changing a bunch of boolean vars on `/datum/supply_pack` into
bitflags, because I needed to add one more and it seemed silly to have
so many booleans.

## Why It's Good For The Game

It allows those with the yuletide spirit to deliver some christmas cheer
to their fellow man, isn't that the season's reason?

## Changelog

🆑
add: When the game considers it to be Christmas, Cargo can order
additional Christmas gifts pre-addressed to random crew members.
/🆑
2025-12-12 02:10:31 +11:00

85 lines
3.0 KiB
Plaintext

/obj/machinery/computer/order_console/bitrunning
name = "bitrunning supplies order console"
desc = "NexaCache(tm)! Dubiously authentic gear for the digital daredevil."
icon = 'icons/obj/machines/bitrunning.dmi'
icon_state = "vendor"
icon_keyboard = null
icon_screen = null
circuit = /obj/item/circuitboard/computer/order_console/bitrunning
cooldown_time = 10 SECONDS
cargo_cost_multiplier = 0.65
express_cost_multiplier = 1
purchase_tooltip = @{"Your purchases will arrive at cargo,
and hopefully get delivered by them.
35% cheaper than express delivery."}
express_tooltip = @{"Sends your purchases instantly."}
credit_type = MONEY_BITRUNNING_SYMBOL
order_categories = list(
CATEGORY_BITRUNNING_FLAIR,
CATEGORY_BITRUNNING_TECH,
CATEGORY_BEPIS,
)
blackbox_key = "bitrunning"
announcement_line = "A bitrunner has ordered equipment which will arrive on the cargo shuttle! Please make sure it gets to them as soon as possible!"
/obj/machinery/computer/order_console/bitrunning/subtract_points(final_cost, obj/item/card/id/card)
if(final_cost <= card.registered_account.bitrunning_points)
card.registered_account.bitrunning_points -= final_cost
return TRUE
return FALSE
/obj/machinery/computer/order_console/bitrunning/order_groceries(mob/living/purchaser, obj/item/card/id/card, list/groceries)
var/list/things_to_order = list()
for(var/datum/orderable_item/item as anything in groceries)
things_to_order[item.purchase_path] = groceries[item]
var/datum/supply_pack/bitrunning/pack = new(
purchaser = purchaser, \
cost = get_total_cost(), \
contains = things_to_order,
)
var/datum/supply_order/new_order = new(
pack = pack,
orderer = purchaser,
orderer_rank = "Bitrunning Vendor",
orderer_ckey = purchaser.ckey,
reason = "",
paying_account = card.registered_account,
department_destination = null,
coupon = null,
charge_on_purchase = FALSE,
manifest_can_fail = FALSE,
cost_type = credit_type,
can_be_cancelled = FALSE,
)
say("Thank you for your purchase! It will arrive on the next cargo shuttle!")
aas_config_announce(/datum/aas_config_entry/order_console, list(), src, list(radio_channel), capitalize(blackbox_key))
SSshuttle.shopping_list += new_order
/obj/machinery/computer/order_console/bitrunning/retrieve_points(obj/item/card/id/id_card)
return round(id_card.registered_account.bitrunning_points)
/obj/machinery/computer/order_console/bitrunning/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
. = ..()
if(!.)
flick("vendor_off", src)
/obj/machinery/computer/order_console/bitrunning/update_icon_state()
icon_state = "[initial(icon_state)][powered() ? null : "_off"]"
return ..()
/datum/supply_pack/bitrunning
name = "bitrunning order"
order_flags = ORDER_INVISIBLE
crate_name = "bitrunning delivery crate"
access = list(ACCESS_BIT_DEN)
test_ignored = TRUE
/datum/supply_pack/bitrunning/New(purchaser, cost, list/contains)
. = ..()
name = "[purchaser]'s Bitrunning Order"
src.cost = cost
src.contains = contains