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.
/🆑
This commit is contained in:
Jacquerel
2025-12-11 15:10:31 +00:00
committed by GitHub
parent 9c430648c6
commit 9fb7c20daa
29 changed files with 190 additions and 119 deletions
@@ -192,7 +192,7 @@ GLOBAL_LIST_INIT(blacklisted_cargo_types, typecacheof(list(
if(spawning_order.paying_account) //Someone paid out of pocket
paying_for_this = spawning_order.paying_account
// note this is before we increment, so this is the GOODY_FREE_SHIPPING_MAX + 1th goody to ship. also note we only increment off this step if they successfully pay the fee, so there's no way around it
if(spawning_order.pack.goody)
if(spawning_order.pack.order_flags & ORDER_GOODY)
var/list/current_buyer_orders = goodies_by_buyer[spawning_order.paying_account]
if(LAZYLEN(current_buyer_orders) == GOODY_FREE_SHIPPING_MAX)
price = round(price + CRATE_TAX)
@@ -212,7 +212,7 @@ GLOBAL_LIST_INIT(blacklisted_cargo_types, typecacheof(list(
pack_cost = spawning_order.pack.get_cost()
if(spawning_order.paying_account)
paying_for_this = spawning_order.paying_account
if(spawning_order.pack.goody)
if(spawning_order.pack.order_flags & ORDER_GOODY)
LAZYADD(goodies_by_buyer[spawning_order.paying_account], spawning_order)
var/receiver_message = "Cargo order #[spawning_order.id] has shipped."
if(spawning_order.charge_on_purchase)
@@ -223,7 +223,7 @@ GLOBAL_LIST_INIT(blacklisted_cargo_types, typecacheof(list(
cargo.adjust_money(price - pack_cost) //Cargo gets the handling fee
value += pack_cost
if(!spawning_order.pack.goody) //we handle goody crates below
if(!(spawning_order.pack.order_flags & ORDER_GOODY)) //we handle goody crates below
var/obj/structure/closet/crate = spawning_order.generate(pick_n_take(empty_turfs))
crate.name += " - #[spawning_order.id]"
@@ -231,7 +231,7 @@ GLOBAL_LIST_INIT(blacklisted_cargo_types, typecacheof(list(
var/from_whom = paying_for_this?.account_holder || "nobody (department order)"
investigate_log("Order #[spawning_order.id] ([spawning_order.pack.name], placed by [key_name(spawning_order.orderer_ckey)]), paid by [from_whom] has shipped.", INVESTIGATE_CARGO)
if(spawning_order.pack.dangerous)
if(spawning_order.pack.order_flags & ORDER_DANGEROUS)
message_admins("\A [spawning_order.pack.name] ordered by [ADMIN_LOOKUPFLW(spawning_order.orderer_ckey)], paid by [from_whom] has shipped.")
purchases++