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

95 lines
4.3 KiB
Plaintext

#define RUBBLE_NONE 1
#define RUBBLE_NORMAL 2
#define RUBBLE_WIDE 3
#define RUBBLE_THIN 4
#define POD_SHAPE_NORMAL 1
#define POD_SHAPE_OTHER 2
#define POD_TRANSIT "1"
#define POD_FALLING "2"
#define POD_OPENING "3"
#define POD_LEAVING "4"
#define SUPPLYPOD_X_OFFSET -16
///DO NOT GO ANY LOWER THAN X1.4 the "CARGO_CRATE_VALUE" value if using regular crates, or infinite profit will be possible! This is also unit tested against.
#define CARGO_MINIMUM_COST CARGO_CRATE_VALUE * 1.4
/// The baseline unit for cargo crates. Adjusting this will change the cost of all in-game shuttles, crate export values, bounty rewards, and all supply pack import values, as they use this as their unit of measurement.
#define CARGO_CRATE_VALUE 200
/// The highest amount of orders you can have of one thing at any one time
#define CARGO_MAX_ORDER 50
/// Returned by /obj/docking_port/mobile/supply/proc/get_order_count to signify us going over the order limit
#define OVER_ORDER_LIMIT "GO AWAY"
/// Universal Scanner mode for export scanning.
#define SCAN_EXPORTS 1
/// Universal Scanner mode for using the sales tagger.
#define SCAN_SALES_TAG 2
/// Universal Scanner mode for using the price tagger.
#define SCAN_PRICE_TAG 3
// Defines for use with `export_item_and_contents()`, aka the export code that sells the items.
/// Default export define, these are things that are sold to centcom.
#define EXPORT_MARKET_STATION "supply"
/// Export market for pirates.
#define EXPORT_MARKET_PIRACY "piracy"
///Used by coupons to define that they're cursed
#define COUPON_OMEN "omen"
// Supply pack flags determining ordering properties
/// Order is literally never visible, presumably it's an abstract type or something
#define ORDER_INVISIBLE (1 << 0)
/// Only orderable on emagged consoles
#define ORDER_EMAG_ONLY (1 << 1)
/// Only orderable on consoles with doctored boards
#define ORDER_CONTRABAND (1 << 2)
/// Can only be ordered privately, can use discount coupons, and arrives in a bag instead of a crate
#define ORDER_GOODY (1 << 3)
/// Can only be ordered via the express order console
#define ORDER_POD_ONLY (1 << 4)
/// Can only be ordered if the following flag is also enabled, for conditionally provided options
#define ORDER_SPECIAL (1 << 5)
/// If present then a special order can be ordered
#define ORDER_SPECIAL_ENABLED (1 << 6)
/// Unavailable to departmental order consoles even if it is in an appropriate category
#define ORDER_NOT_DEPARTMENTAL (1 << 7)
/// This will notify admins when it is purchased
#define ORDER_DANGEROUS (1 << 8)
/// This is set when something is created by an admin to make sure its contents is also marked as such
#define ORDER_ADMIN_SPAWNED (1 << 9)
///Discount categories for coupons. This one is for anything that isn't discountable.
#define SUPPLY_PACK_NOT_DISCOUNTABLE null
///Discount category for the standard stuff, mostly goodies.
#define SUPPLY_PACK_STD_DISCOUNTABLE "standard_discount"
///Discount category for stuff that's mostly niche and/or that might be useful.
#define SUPPLY_PACK_UNCOMMON_DISCOUNTABLE "uncommon_discount"
///Discount category for the silly, overpriced, joke content, sometimes useful or plain bad.
#define SUPPLY_PACK_RARE_DISCOUNTABLE "rare_discount"
///Standard export define for not selling the item.
#define EXPORT_NOT_SOLD 0
///Sell the item
#define EXPORT_SOLD 1
///Sell the item, but for the love of god, don't delete it, we're handling it in a fancier way.
#define EXPORT_SOLD_DONT_DELETE 2
//At 320 it's 7.5 minutes, at 1400 it's 12.44 minutes, at 3000 (around gun crates) it's 15.5 minutes, at 8000 (hat crate) 20 minutes, at 9000 (expensive atmos cans) it's 20.58 minutes, and at the 20k crate it's 24.76 minutes.
/// Multiplies the logarithmic value calculating the free crate cooldown
#define DEPARTMENTAL_ORDER_COOLDOWN_COEFFICIENT 60
/// Used for the power of the logarithmic value for the free crate cooldown
#define DEPARTMENTAL_ORDER_COOLDOWN_EXPONENT 2.2
//At 320 it's 475 credits, at 1400 it's 669 credits, at 3000 (around gun crates) its 778, at 8000 (hat crate) it's 925 credits, at 9000 (expensive atmos cans) it's 943 credits, and at the 20k crate it's 1070 credits.
/// Multiplies the logarithmic value calculating the free crate delivery reward
#define DEPARTMENTAL_ORDER_REWARD_COEFFICIENT 120
/// Used for the power of the logarithmic value for the free crate delivery reward
#define DEPARTMENTAL_ORDER_REWARD_EXPONENT 1.5