Skip to content

Commit

Permalink
supply: supply pack datums, some reworks (Citadel-Station-13#6599)
Browse files Browse the repository at this point in the history
tl;dr refactors supplypacks to a new system

- all access locks yanked from crates other than the ones that actually
need to be locked
- preps system for reworks, translates stuff over to a new format
- adds unified subsystem parsing & support for other descriptors for
cargo crate contents other than typepath
  • Loading branch information
silicons authored Jul 31, 2024
1 parent 4fd7e01 commit 5134116
Show file tree
Hide file tree
Showing 197 changed files with 5,627 additions and 5,435 deletions.
56 changes: 34 additions & 22 deletions citadel.dme
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
#include "code\__DEFINES\spells.dm"
#include "code\__DEFINES\stat_tracking.dm"
#include "code\__DEFINES\statpanel.dm"
#include "code\__DEFINES\supply.dm"
#include "code\__DEFINES\targeting.dm"
#include "code\__DEFINES\text.dm"
#include "code\__DEFINES\tgs.config.dm"
Expand Down Expand Up @@ -201,7 +202,8 @@
#include "code\__DEFINES\dcs\signals\signals_mob\signals_mob_organs.dm"
#include "code\__DEFINES\dcs\signals\signals_mob\signals_mob_perspectiive.dm"
#include "code\__DEFINES\dcs\signals\signals_mob\signals_mob_simple.dm"
#include "code\__DEFINES\economy\economy.dm"
#include "code\__DEFINES\economy\category.dm"
#include "code\__DEFINES\economy\currency.dm"
#include "code\__DEFINES\economy\payment.dm"
#include "code\__DEFINES\economy\payscale.dm"
#include "code\__DEFINES\economy\worth.dm"
Expand Down Expand Up @@ -1034,11 +1036,31 @@
#include "code\game\click\reachability.dm"
#include "code\game\click\rig.dm"
#include "code\game\click\telekinesis.dm"
#include "code\game\content\factions\corporations\nanotrasen\nanotrasen-faction.dm"
#include "code\game\content\factions\corporations\nanotrasen\nanotrasen-supply.dm"
#include "code\game\content\factions\corporations\nanotrasen\nanotrasen-supply\animals.dm"
#include "code\game\content\factions\corporations\nanotrasen\nanotrasen-supply\atmospherics.dm"
#include "code\game\content\factions\corporations\nanotrasen\nanotrasen-supply\contraband.dm"
#include "code\game\content\factions\corporations\nanotrasen\nanotrasen-supply\costumes.dm"
#include "code\game\content\factions\corporations\nanotrasen\nanotrasen-supply\engineering.dm"
#include "code\game\content\factions\corporations\nanotrasen\nanotrasen-supply\hospitality.dm"
#include "code\game\content\factions\corporations\nanotrasen\nanotrasen-supply\hydroponics.dm"
#include "code\game\content\factions\corporations\nanotrasen\nanotrasen-supply\materials.dm"
#include "code\game\content\factions\corporations\nanotrasen\nanotrasen-supply\medical.dm"
#include "code\game\content\factions\corporations\nanotrasen\nanotrasen-supply\miscellaneous.dm"
#include "code\game\content\factions\corporations\nanotrasen\nanotrasen-supply\munitions.dm"
#include "code\game\content\enigmas\unsorted\cursedform.dm"
#include "code\game\content\enigmas\unsorted\deadringer.dm"
#include "code\game\content\enigmas\unsorted\telecube.dm"
#include "code\game\content\factions\corporations\corporation.dm"
#include "code\game\content\factions\corporations\nanotrasen\faction.dm"
#include "code\game\content\factions\corporations\nanotrasen\nanotrasen-supply\reagents.dm"
#include "code\game\content\factions\corporations\nanotrasen\nanotrasen-supply\recreation.dm"
#include "code\game\content\factions\corporations\nanotrasen\nanotrasen-supply\robotics.dm"
#include "code\game\content\factions\corporations\nanotrasen\nanotrasen-supply\science.dm"
#include "code\game\content\factions\corporations\nanotrasen\nanotrasen-supply\security.dm"
#include "code\game\content\factions\corporations\nanotrasen\nanotrasen-supply\supplies.dm"
#include "code\game\content\factions\corporations\nanotrasen\nanotrasen-supply\vehicles.dm"
#include "code\game\content\factions\corporations\nanotrasen\nanotrasen-supply\voidsuits.dm"
#include "code\game\content\locations\frontier.dm"
#include "code\game\dna\dna2.dm"
#include "code\game\dna\dna2_domutcheck.dm"
Expand Down Expand Up @@ -1747,8 +1769,9 @@
#include "code\game\objects\items\weapons\melee\melee.dm"
#include "code\game\objects\items\weapons\melee\misc.dm"
#include "code\game\objects\items\weapons\tanks\jetpack.dm"
#include "code\game\objects\items\weapons\tanks\tank.dm"
#include "code\game\objects\items\weapons\tanks\tank_types.dm"
#include "code\game\objects\items\weapons\tanks\tanks.dm"
#include "code\game\objects\items\weapons\tanks\tank_types\shipment.dm"
#include "code\game\objects\random\_random.dm"
#include "code\game\objects\random\books.dm"
#include "code\game\objects\random\guns_and_ammo.dm"
Expand Down Expand Up @@ -2354,24 +2377,6 @@
#include "code\modules\bodysets\synthetic\oss_tajaran.dm"
#include "code\modules\bodysets\synthetic\oss_vulpkanin.dm"
#include "code\modules\busy_space\organizations.dm"
#include "code\modules\cargo\supplypacks\_supplypacks.dm"
#include "code\modules\cargo\supplypacks\atmospherics.dm"
#include "code\modules\cargo\supplypacks\contraband.dm"
#include "code\modules\cargo\supplypacks\costumes.dm"
#include "code\modules\cargo\supplypacks\engineering.dm"
#include "code\modules\cargo\supplypacks\hospitality.dm"
#include "code\modules\cargo\supplypacks\hydroponics.dm"
#include "code\modules\cargo\supplypacks\materials.dm"
#include "code\modules\cargo\supplypacks\medical.dm"
#include "code\modules\cargo\supplypacks\misc.dm"
#include "code\modules\cargo\supplypacks\munitions.dm"
#include "code\modules\cargo\supplypacks\recreation.dm"
#include "code\modules\cargo\supplypacks\robotics.dm"
#include "code\modules\cargo\supplypacks\science.dm"
#include "code\modules\cargo\supplypacks\security.dm"
#include "code\modules\cargo\supplypacks\supply.dm"
#include "code\modules\cargo\supplypacks\vehicles.dm"
#include "code\modules\cargo\supplypacks\voidsuits.dm"
#include "code\modules\catalogue\atoms.dm"
#include "code\modules\catalogue\catalogue_data.dm"
#include "code\modules\catalogue\cataloguer.dm"
Expand Down Expand Up @@ -2476,6 +2481,13 @@
#include "code\modules\clothing\spacesuits\void\void_vr.dm"
#include "code\modules\clothing\spacesuits\void\wizard.dm"
#include "code\modules\clothing\spacesuits\void\zaddat.dm"
#include "code\modules\clothing\spacesuits\void\station\command.dm"
#include "code\modules\clothing\spacesuits\void\station\engineering.dm"
#include "code\modules\clothing\spacesuits\void\station\exploration.dm"
#include "code\modules\clothing\spacesuits\void\station\medical.dm"
#include "code\modules\clothing\spacesuits\void\station\operations.dm"
#include "code\modules\clothing\spacesuits\void\station\security.dm"
#include "code\modules\clothing\spacesuits\void\station\supply.dm"
#include "code\modules\clothing\suits\_suit.dm"
#include "code\modules\clothing\suits\armor.dm"
#include "code\modules\clothing\suits\bio.dm"
Expand Down Expand Up @@ -4419,7 +4431,6 @@
#include "code\modules\reagents\machinery\dispenser\cartridge.dm"
#include "code\modules\reagents\machinery\dispenser\dispenser.dm"
#include "code\modules\reagents\machinery\dispenser\dispenser_presets.dm"
#include "code\modules\reagents\machinery\dispenser\supply.dm"
#include "code\modules\reagents\machinery\dispenser\synthesizer.dm"
#include "code\modules\reagents\machinery\reagent_dispenser\acid.dm"
#include "code\modules\reagents\machinery\reagent_dispenser\beer.dm"
Expand Down Expand Up @@ -4766,6 +4777,7 @@
#include "code\modules\stockmarket\logs.dm"
#include "code\modules\stockmarket\stockmarket.dm"
#include "code\modules\stockmarket\stocks.dm"
#include "code\modules\supply\supply_pack.dm"
#include "code\modules\surgery\_defines.dm"
#include "code\modules\surgery\bones.dm"
#include "code\modules\surgery\encased.dm"
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/_bitfields.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@
#define BITFIELD(thing) #thing = thing
#define BITFIELD_NAMED(name, thing) name = thing

// todo: impl
/// KEY: must be unique, may be arbitrary; not a string, as it's used in typepath generation
/// CONSTRAINTS: list(/type = list(varname, ...), ...)
/// BITFIELDS: list of BITFIELD_NEW().
#define DEFINE_BITFIELD_NEW(KEY, CONSTRAINTS, BITFIELDS)
// todo: impl
/// NAME: must be a string
/// VALUE: the actual enum value, whatever it is
#define BITFIELD_NEW(NAME, VALUE) ##NAME = ##VALUE
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// todo: this is all bad.

/// sent on attempt_dynamic_currency: (list/query) - register on the list to be dynamic_currency_call signal'd
#define COMSIG_ITEM_DYNAMIC_CURRENCY_QUERY "dynamic_currency_query"
/// sent on attempt_dynamic_currency: (mob/user, atom/movable/predicate, amount, force, prevent_types, list/data, silent, visual_range = 7)
Expand Down
226 changes: 226 additions & 0 deletions code/__DEFINES/economy/category.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,226 @@
//* This file is explicitly licensed under the MIT license. *//
//* Copyright (c) 2024 silicons *//

//* economic_category_obj *//

#define ECONOMIC_CATEGORY_OBJ_DEFAULT (NONE)

/// hazardous materials
#define ECONOMIC_CATEGORY_OBJ_HAZARD (1<<0)
/// alien tech / anomalous tech
#define ECONOMIC_CATEGORY_OBJ_ALIEN (1<<1)
/// occultist
#define ECONOMIC_CATEGORY_OBJ_OCCULT (1<<2)
/// exotic tech / goods
#define ECONOMIC_CATEGORY_OBJ_EXOTIC (1<<3)
/// engineering / industrial equipment
#define ECONOMIC_CATEGORY_OBJ_INDUSTRIAL (1<<4)
/// makeshift items; still useful
#define ECONOMIC_CATEGORY_OBJ_MAKESHIFT (1<<5)
/// literally scrap
#define ECONOMIC_CATEGORY_OBJ_SCRAP (1<<6)

/// ordered list; keep it ordered to bit index!
GLOBAL_REAL_LIST(economic_category_obj_names) = list(
"Hazardous Materials",
"Alien Technology",
"Occult Debris",
"Exotic Goods",
"Industrial Equipment",
"Makeshift Equipment",
"Junk",
)

#define ECONOMIC_CATEGORY_OBJ_BIT_TO_NAME(CAT) economic_category_obj_to_name(CAT)
/proc/economic_category_obj_bit_to_name(bit)
var/index = log(2, bit)
if(index > length(global.economic_category_obj_names))
return "Miscellaneous"
return global.economic_category_obj_names[index]

DEFINE_BITFIELD(economic_category_obj, list(
BITFIELD(ECONOMIC_CATEGORY_OBJ_HAZARD),
BITFIELD(ECONOMIC_CATEGORY_OBJ_ALIEN),
BITFIELD(ECONOMIC_CATEGORY_OBJ_OCCULT),
BITFIELD(ECONOMIC_CATEGORY_OBJ_EXOTIC),
BITFIELD_NEW("Industrial Equipment", ECONOMIC_CATEGORY_OBJ_INDUSTRIAL),
BITFIELD_NEW("Makeshift Equipment", ECONOMIC_CATEGORY_OBJ_MAKESHIFT),
BITFIELD_NEW("Junk", ECONOMIC_CATEGORY_OBJ_SCRAP),
))

// todo: everything below shoudl follow the above example of structure (replace switch with global list and log, etc)

//? categories for items

#define ECONOMIC_CATEGORY_ITEM_DEFAULT (NONE)

/// basic fashion
#define ECONOMIC_CATEGORY_ITEM_CLOTHING (1<<0)
/// non-basic fashion
#define ECONOMIC_CATEGORY_ITEM_FASHION (1<<1)
/// ranged weapons
#define ECONOMIC_CATEGORY_ITEM_GUN (1<<2)
/// melee weapons
#define ECONOMIC_CATEGORY_ITEM_MELEE (1<<3)
/// armor, shields ,etc
#define ECONOMIC_CATEGORY_ITEM_ARMOR (1<<4)
/// basic tools / engineering equipment
#define ECONOMIC_CATEGORY_ITEM_TOOL (1<<5)
/// engineering equipment / advanced tools
#define ECONOMIC_CATEGORY_ITEM_ENGINEERING (1<<6)
/// medical equipment / tools
#define ECONOMIC_CATEGORY_ITEM_MEDICAL (1<<7)
/// advanced medical equpiment / tools
#define ECONOMIC_CATEGORY_ITEM_SURGICAL (1<<8)
/// recreational / toys
#define ECONOMIC_CATEGORY_ITEM_TOY (1<<9)
/// collectable items, trading cards, etc
#define ECONOMIC_CATEGORY_ITEM_COLLECTABLE (1<<10)
/// paperwork, camera, etc
#define ECONOMIC_CATEGORY_ITEM_PAPERWORK (1<<11)
/// advanced electronics like pda, tablets, computers, etc
#define ECONOMIC_CATEGORY_ITEM_ELECTRONICS (1<<12)

/proc/economic_category_item_name(cat)
switch(cat)
if(ECONOMIC_CATEGORY_ITEM_CLOTHING)
return "Clothing"
if(ECONOMIC_CATEGORY_ITEM_FASHION)
return "Fashion"
if(ECONOMIC_CATEGORY_ITEM_GUN)
return "Ranged Weaponry"
if(ECONOMIC_CATEGORY_ITEM_MELEE)
return "Melee Weaponry"
if(ECONOMIC_CATEGORY_ITEM_ARMOR)
return "Defense Equipment"
if(ECONOMIC_CATEGORY_ITEM_TOOL)
return "Tools"
if(ECONOMIC_CATEGORY_ITEM_ENGINEERING)
return "Engineering Equipment"
if(ECONOMIC_CATEGORY_ITEM_MEDICAL)
return "Medicine"
if(ECONOMIC_CATEGORY_ITEM_SURGICAL)
return "Medical Equipment"
if(ECONOMIC_CATEGORY_ITEM_TOY)
return "Toys"
if(ECONOMIC_CATEGORY_ITEM_COLLECTABLE)
return "Collectables"
if(ECONOMIC_CATEGORY_ITEM_PAPERWORK)
return "Recordkeeping"
if(ECONOMIC_CATEGORY_ITEM_ELECTRONICS)
return "Information Technology"
else
return "Miscellaneous"

DEFINE_BITFIELD(economic_category_item, list(
BITFIELD(ECONOMIC_CATEGORY_ITEM_CLOTHING),
BITFIELD(ECONOMIC_CATEGORY_ITEM_FASHION),
BITFIELD(ECONOMIC_CATEGORY_ITEM_GUN),
BITFIELD(ECONOMIC_CATEGORY_ITEM_MELEE),
BITFIELD(ECONOMIC_CATEGORY_ITEM_ARMOR),
BITFIELD(ECONOMIC_CATEGORY_ITEM_TOOL),
BITFIELD(ECONOMIC_CATEGORY_ITEM_ENGINEERING),
BITFIELD(ECONOMIC_CATEGORY_ITEM_MEDICAL),
BITFIELD(ECONOMIC_CATEGORY_ITEM_SURGICAL),
BITFIELD(ECONOMIC_CATEGORY_ITEM_TOY),
BITFIELD(ECONOMIC_CATEGORY_ITEM_COLLECTABLE),
BITFIELD(ECONOMIC_CATEGORY_ITEM_PAPERWORK),
BITFIELD(ECONOMIC_CATEGORY_ITEM_ELECTRONICS),
))

//? categories for materials

#define ECONOMIC_CATEGORY_MATERIAL_DEFAULT (NONE)

/// staple bulk construction materials
#define ECONOMIC_CATEGORY_MATERIAL_CONSTRUCTION (1<<0)
/// luxury goods like exotic animal furs or whatever
#define ECONOMIC_CATEGORY_MATERIAL_LUXURY (1<<1)
/// industrial stuff
#define ECONOMIC_CATEGORY_MATERIAL_INDUSTRIAL (1<<2)
/// rare earth stuff like diamonds
#define ECONOMIC_CATEGORY_MATERIAL_RARE (1<<3)
/// extremely rare stuff like morphium
#define ECONOMIC_CATEGORY_MATERIAL_EXOTIC (1<<4)
/// biological like wood or whatever
#define ECONOMIC_CATEGORY_MATERIAL_ORGANIC (1<<5)

/proc/economic_category_material_name(cat)
switch(cat)
if(ECONOMIC_CATEGORY_MATERIAL_CONSTRUCTION)
return "Bulk Construction"
if(ECONOMIC_CATEGORY_MATERIAL_LUXURY)
return "Luxury Materials"
if(ECONOMIC_CATEGORY_MATERIAL_INDUSTRIAL)
return "Industrial Resources"
if(ECONOMIC_CATEGORY_MATERIAL_RARE)
return "Rare Elements"
if(ECONOMIC_CATEGORY_MATERIAL_EXOTIC)
return "Exotic Matter"
if(ECONOMIC_CATEGORY_MATERIAL_ORGANIC)
return "Organic Products"

DEFINE_BITFIELD(economic_category_material, list(
BITFIELD(ECONOMIC_CATEGORY_MATERIAL_CONSTRUCTION),
BITFIELD(ECONOMIC_CATEGORY_MATERIAL_LUXURY),
BITFIELD(ECONOMIC_CATEGORY_MATERIAL_INDUSTRIAL),
BITFIELD(ECONOMIC_CATEGORY_MATERIAL_RARE),
BITFIELD(ECONOMIC_CATEGORY_MATERIAL_EXOTIC),
BITFIELD(ECONOMIC_CATEGORY_MATERIAL_ORGANIC),
))

//? categories for reagents

#define ECONOMIC_CATEGORY_REAGENT_DEFAULT (NONE)

/// medicine
#define ECONOMIC_CATEGORY_REAGENT_MEDICINE (1<<0)
/// raw materials like iron / gold / phoron /etc
#define ECONOMIC_CATEGORY_REAGENT_RAW (1<<1)
/// drugs :devil:
#define ECONOMIC_CATEGORY_REAGENT_NARCOTICS (1<<2)
/// poisons, lethal or otherwise
#define ECONOMIC_CATEGORY_REAGENT_POISON (1<<3)
/// explosives, chlorine triflouride-like fire, etc
#define ECONOMIC_CATEGORY_REAGENT_PYROTECHNICS (1<<4)
/// exotic / rare reagents
#define ECONOMIC_CATEGORY_REAGENT_EXOTIC (1<<5)
/// agricultural
#define ECONOMIC_CATEGORY_REAGENT_AGRICULTURAL (1<<6)
/// food / whatever
#define ECONOMIC_CATEGORY_REAGENT_FOOD (1<<7)
/// crayon powder, recreational coloring, etc
#define ECONOMIC_CATEGORY_REAGENT_TOYS (1<<8)

DEFINE_BITFIELD(economic_category_reagent, list(
BITFIELD(ECONOMIC_CATEGORY_REAGENT_MEDICINE),
BITFIELD(ECONOMIC_CATEGORY_REAGENT_RAW),
BITFIELD(ECONOMIC_CATEGORY_REAGENT_NARCOTICS),
BITFIELD(ECONOMIC_CATEGORY_REAGENT_POISON),
BITFIELD(ECONOMIC_CATEGORY_REAGENT_PYROTECHNICS),
BITFIELD(ECONOMIC_CATEGORY_REAGENT_EXOTIC),
BITFIELD(ECONOMIC_CATEGORY_REAGENT_AGRICULTURAL),
BITFIELD(ECONOMIC_CATEGORY_REAGENT_FOOD),
BITFIELD(ECONOMIC_CATEGORY_REAGENT_TOYS),
))

/proc/economic_category_reagent_name(cat)
switch(cat)
if(ECONOMIC_CATEGORY_REAGENT_MEDICINE)
return "Medicine"
if(ECONOMIC_CATEGORY_REAGENT_RAW)
return "Raw Reagents"
if(ECONOMIC_CATEGORY_REAGENT_NARCOTICS)
return "Drugs"
if(ECONOMIC_CATEGORY_REAGENT_POISON)
return "Toxins"
if(ECONOMIC_CATEGORY_REAGENT_PYROTECHNICS)
return "Explosives"
if(ECONOMIC_CATEGORY_REAGENT_EXOTIC)
return "Exotic"
if(ECONOMIC_CATEGORY_REAGENT_AGRICULTURAL)
return "Hydroponics"
if(ECONOMIC_CATEGORY_REAGENT_FOOD)
return "Catering"
if(ECONOMIC_CATEGORY_REAGENT_TOYS)
return "Toy Products"
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
//* This file is explicitly licensed under the MIT license. *//
//* Copyright (c) 2024 silicons *//

/// currency name singular
#define CURRENCY_NAME_SINGULAR "thaler"
/// currency name singular capitalized
#define CURRENCY_NAME_SINGULAR_PROPER "Thaler"
/// currency name plural
#define CURRENCY_NAME_PLURAL "thalers"
/// currency name plural capitalized
#define CURRENCY_NAME_PLURAL_PROPERR "Thalers"
#define CURRENCY_NAME_PLURAL_PROPER "Thalers"
Loading

0 comments on commit 5134116

Please sign in to comment.