Skip to content

Commit

Permalink
Cargo rework update (#530)
Browse files Browse the repository at this point in the history
* Cargo rework update

* Updates & Tweaks

* Tiny purchase fix

* Material value tweak

* More trading stations, more updates

* Fixes valid factions check

* Fix trade factions auto-relations

* Adds OBS trade station, more updates

* Fix trade categories in medical trade station

* Value tweaks, chemicals now cost more (usually)

* Defibs added to worth list

* Some fixes
  • Loading branch information
EgorDinamit authored Feb 7, 2024
1 parent 3db6ef2 commit dfe6851
Show file tree
Hide file tree
Showing 39 changed files with 520 additions and 251 deletions.
5 changes: 5 additions & 0 deletions baystation12.dme
Original file line number Diff line number Diff line change
Expand Up @@ -2561,6 +2561,7 @@
#include "code\modules\modular_computers\file_system\programs\generic\reports.dm"
#include "code\modules\modular_computers\file_system\programs\generic\scanner.dm"
#include "code\modules\modular_computers\file_system\programs\generic\supply.dm"
#include "code\modules\modular_computers\file_system\programs\generic\supply_subtypes.dm"
#include "code\modules\modular_computers\file_system\programs\generic\wordprocessor.dm"
#include "code\modules\modular_computers\file_system\programs\medical\suit_sensors.dm"
#include "code\modules\modular_computers\file_system\programs\research\ai_restorer.dm"
Expand Down Expand Up @@ -3287,9 +3288,13 @@
#include "code\modules\tgs\includes.dm"
#include "code\modules\trading_stations\_faction.dm"
#include "code\modules\trading_stations\_trading_station.dm"
#include "code\modules\trading_stations\trading_station_types\0_always_spawn\engineering.dm"
#include "code\modules\trading_stations\trading_station_types\0_always_spawn\eva.dm"
#include "code\modules\trading_stations\trading_station_types\0_always_spawn\materials.dm"
#include "code\modules\trading_stations\trading_station_types\0_always_spawn\medical.dm"
#include "code\modules\trading_stations\trading_station_types\0_always_spawn\security.dm"
#include "code\modules\trading_stations\trading_station_types\2_rare\weapons.dm"
#include "code\modules\trading_stations\trading_station_types\3_very_rare\obs.dm"
#include "code\modules\trusted-players\procs.dm"
#include "code\modules\turbolift\_turbolift.dm"
#include "code\modules\turbolift\turbolift.dm"
Expand Down
3 changes: 3 additions & 0 deletions code/__defines/culture.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@
#define FACTION_TERRASENATE_OBS "Order of the Black Sun" // Not exactly a faction within senate, but it exists
// End <
#define FACTION_ISC "Independent Space Confederation"
// Members of ISC >
#define FACTION_NANOTRASEN "NanoTrasen"
#define FACTION_CYBERSUN "Cybersun Industries"
#define FACTION_REBORN_CHRISTIAN_CHURCH "Reborn Christian Church"
// End <
#define FACTION_FREETRADE "Free Trade Union"
#define FACTION_HEPHAESTUS "Hephaestus Industries"
#define FACTION_XYNERGY "Xynergy"
Expand Down
7 changes: 6 additions & 1 deletion code/__defines/supply.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,19 @@
#define TRADE_CAT_WEAPONS "Weapons"
#define TRADE_CAT_AMMO "Ammunition"
#define TRADE_CAT_ARMOR "Armor"
#define TRADE_CAT_EQUIPMENT "Equipment"
#define TRADE_CAT_CLOTHING "Clothing"
#define TRADE_CAT_SPACESUIT "Space Suits"
#define TRADE_CAT_VOIDSUIT "Void Suits"
#define TRADE_CAT_TOOLS "Tools"
#define TRADE_CAT_RESEARCH "Research"
#define TRADE_CAT_COMPONENTS "Stock Parts & Components"
#define TRADE_CAT_COMPONENTS "Stock Parts and Components"
#define TRADE_CAT_MATERIALS "Materials"
#define TRADE_CAT_RIG "RIG"
#define TRADE_CAT_RIG_MODULES "RIG Modules"
#define TRADE_CAT_MEDICAL "Medical"
#define TRADE_CAT_MEDKIT "Medical Kits"
#define TRADE_CAT_CHEMICAL "Chemical"

// As in - faction is a part of us
#define FACTION_STATE_PROTECTORATE 4
Expand Down
22 changes: 19 additions & 3 deletions code/controllers/subsystems/supply.dm
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,20 @@ SUBSYSTEM_DEF(supply)
var/datum/trade_faction/TF = new faction_type
factions[TF.name] = TF

// Factions that aren't set in relationship list of the datum are set to neutral.
for(var/tf in factions)
var/datum/trade_faction/TF = factions[tf]
for(var/tf2 in factions)
var/datum/trade_faction/TF2 = factions[tf]
if(TF == TF2)
// Technically not, but this will be how we declare same faction relations for now
TF.relationship[TF2.name] = FACTION_STATE_PROTECTORATE
continue
if(!(TF2.name in TF.relationship))
TF.relationship[TF2] = FACTION_STATE_NEUTRAL
// This ensures that relations are always mirrored between two datums
SetFactionRelations(TF, TF2, TF.relationship[TF2])

InitTradeStations()

/datum/controller/subsystem/supply/Destroy()
Expand Down Expand Up @@ -286,18 +300,20 @@ SUBSYSTEM_DEF(supply)
if(QDELETED(senderBeacon) || !istype(senderBeacon) || !account || !RecursiveLen(shopList))
return FALSE

var/obj/structure/closet/secure_closet/personal/trade/C
var/count_of_all = CollectCountsFrom(shopList)
var/price_for_all = CollectPriceForList(shopList)

if(price_for_all && account.money < price_for_all)
return FALSE

var/obj/structure/closet/secure_closet/personal/trade/C
if(isnum(count_of_all) && count_of_all > 1)
C = senderBeacon.DropItem(/obj/structure/closet/secure_closet/personal/trade)
if(is_order)
C.locked = TRUE
C.registered_name = buyer_name
C.name = "[initial(C.name)] ([C.registered_name])"
C.update_icon()
if(price_for_all && account.money < price_for_all)
return FALSE

var/order_contents_info
var/invoice_location
Expand Down
53 changes: 52 additions & 1 deletion code/game/jobs/access_datum.dm
Original file line number Diff line number Diff line change
Expand Up @@ -475,4 +475,55 @@
/datum/access/ascent
id = access_ascent
desc = "Ascent Materiel"
access_type = ACCESS_TYPE_NONE
access_type = ACCESS_TYPE_NONE


/* Supply faction link access levels */
/var/const/access_supplylink_solgov = "ACCESS_SUPPLY_LINK_SOLGOV"
/datum/access/supplylink_solgov
id = access_supplylink_solgov
desc = "Supply Console - SolGov Link"
region = ACCESS_REGION_SUPPLY
access_type = ACCESS_TYPE_NONE

/var/const/access_supplylink_terragov = "ACCESS_SUPPLY_LINK_TERRAGOV"
/datum/access/supplylink_terragov
id = access_supplylink_terragov
desc = "Supply Console - TerraGov Link"
region = ACCESS_REGION_SUPPLY
access_type = ACCESS_TYPE_NONE

/var/const/access_supplylink_isc = "ACCESS_SUPPLY_LINK_ISC"
/datum/access/supplylink_isc
id = access_supplylink_isc
desc = "Supply Console - ISC Link"
region = ACCESS_REGION_SUPPLY
access_type = ACCESS_TYPE_NONE

/var/const/access_supplylink_nanotrasen = "ACCESS_SUPPLY_LINK_NANOTRASEN"
/datum/access/supplylink_nanotrasen
id = access_supplylink_nanotrasen
desc = "Supply Console - Nanotrasen Link"
region = ACCESS_REGION_SUPPLY
access_type = ACCESS_TYPE_NONE

/var/const/access_supplylink_cybersun = "ACCESS_SUPPLY_LINK_CYBERSUN"
/datum/access/supplylink_cybersun
id = access_supplylink_cybersun
desc = "Supply Console - Cybersun Link"
region = ACCESS_REGION_SUPPLY
access_type = ACCESS_TYPE_NONE

/var/const/access_supplylink_obs = "ACCESS_SUPPLY_LINK_OBS"
/datum/access/supplylink_obs
id = access_supplylink_obs
desc = "Supply Console - OBS Link"
region = ACCESS_REGION_SUPPLY
access_type = ACCESS_TYPE_NONE

/var/const/access_supplylink_reborn_church = "ACCESS_SUPPLY_LINK_REBORN_CHURCH"
/datum/access/supplylink_reborn_church
id = access_supplylink_reborn_church
desc = "Supply Console - Reborn Christian Church Link"
region = ACCESS_REGION_SUPPLY
access_type = ACCESS_TYPE_NONE
2 changes: 2 additions & 0 deletions code/game/machinery/trade_beacon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
continue
if(A == src)
continue
if(A.loc == src)
continue
if(A.invisibility)
continue
objects += A
Expand Down
3 changes: 3 additions & 0 deletions code/game/objects/effects/decals/contraband.dm
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@

return FALSE

/obj/item/contraband/poster/order_black_of_sun
poster_type = /decl/poster/illegal/order_black_of_sun

//############################## THE ACTUAL DECALS ###########################

/obj/structure/sign/poster
Expand Down
4 changes: 3 additions & 1 deletion code/modules/item_worth/value_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@
/obj/item/stack/material/Value(base)
if(!material)
return ..()
return material.value * amount
. = material.value * amount
if(reinf_material)
. += reinf_material.value * amount

/obj/item/ore/Value(base)
return material ? material.value : 0
Expand Down
148 changes: 27 additions & 121 deletions code/modules/item_worth/worths_list.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var/list/worths = list(
/obj/item/reagent_containers/hypospray = -90,
/obj/item/reagent_containers/spray = -23,
/obj/item/reagent_containers/food/snacks/monkeycube = -25,
/obj/item/reagent_containers/food/snacks/human = -300,
/obj/item/reagent_containers/food/snacks/human = -50,
/obj/item/reagent_containers/food/snacks/sliceable = -15,
/obj/item/reagent_containers/food/snacks/slice = -3,
/obj/item/reagent_containers/food/drinks/bottle = -11,
Expand Down Expand Up @@ -85,13 +85,13 @@ var/list/worths = list(
/obj/item/stack/material/glass/phoronrglass = -65,
/obj/item/stack/material = -5,
//STACKS,
/obj/item/stack/medical/advanced/bruise_pack = -30,
/obj/item/stack/medical/advanced/ointment = -40,
/obj/item/stack/medical/advanced/bruise_pack = -20,
/obj/item/stack/medical/advanced/ointment = -30,
/obj/item/stack/medical/splint = -25,
/obj/item/stack/medical = -15,
/obj/item/stack/nanopaste = -30,
/obj/item/stack/material/rods = -5,
/obj/item/stack/telecrystal = -100,
/obj/item/stack/telecrystal = -1000,
/obj/item/stack/wax = -5,
/obj/item/stack = -5,
//STORAGE,
Expand All @@ -103,13 +103,13 @@ var/list/worths = list(
/obj/item/device/scanner/mining = 130,
//PICK AXES,
/obj/item/pickaxe/silver = 300,
/obj/item/pickaxe/drill = 100,
/obj/item/pickaxe/jackhammer = 90,
/obj/item/pickaxe/gold = 400,
/obj/item/gun/energy/plasmacutter = 100,
/obj/item/pickaxe/diamond = 600,
/obj/item/pickaxe/diamonddrill = 700,
/obj/item/pickaxe = 30,
/obj/item/pickaxe/drill = 500,
/obj/item/pickaxe/jackhammer = 3500,
/obj/item/pickaxe/gold = 1000,
/obj/item/gun/energy/plasmacutter = 750,
/obj/item/pickaxe/diamond = 1500,
/obj/item/pickaxe/diamonddrill = 2500,
/obj/item/pickaxe = 100,
/obj/item/shovel/spade = 20,
/obj/item/slimepotion = 200,
/obj/item/slimepotion2 = 300,
Expand Down Expand Up @@ -221,7 +221,7 @@ var/list/worths = list(
/obj/item/rcd = 1000,
/obj/item/rcd_ammo = 50,
/obj/item/rsf = 300,
/obj/item/teleportation_scroll = 1000,
/obj/item/teleportation_scroll = 2000,
/obj/item/shield/buckler = 300, //More expensive because people don't make them anymore,
/obj/item/shield/riot = 150,
/obj/item/shield/energy = 1200,
Expand All @@ -244,6 +244,10 @@ var/list/worths = list(
/obj/item/wrench = 30,
/obj/item/screwdriver = 15,
/obj/item/wirecutters = 25,
/obj/item/defibrillator/compact/combat = 2800,
/obj/item/defibrillator/compact = 1400,
/obj/item/defibrillator = 700,
/obj/item/auto_cpr = 500,
//WELDINGTOOLS,
/obj/item/weldingtool/largetank = 150,
/obj/item/weldingtool/hugetank = 300,
Expand All @@ -269,7 +273,7 @@ var/list/worths = list(
//MELEE,
/obj/item/melee/cultblade = 500,
/obj/item/melee/energy/axe = 3400,
/obj/item/melee/energy = 1200,
/obj/item/melee/energy = 2000,
/obj/item/melee/whip = 200,
/obj/item/melee/whip/abyssal = 1025,
/obj/item/melee/baton/cattleprod = 30,
Expand Down Expand Up @@ -335,9 +339,9 @@ var/list/worths = list(
/obj/item/clothing/glasses/sunglasses/prescription = 230,
/obj/item/clothing/glasses/sunglasses/sechud/goggles = 550,
/obj/item/clothing/glasses/sunglasses/sechud = 530,
/obj/item/clothing/glasses/thermal = 1990,
/obj/item/clothing/glasses = 150,
/obj/item/clothing/glasses/thermal = 2200,
/obj/item/clothing/glasses/tacgoggles = 1200,
/obj/item/clothing/glasses = 150,
//GLOVES,
/obj/item/clothing/gloves/boxing = 60,
/obj/item/clothing/gloves/color/white = 20,
Expand Down Expand Up @@ -622,111 +626,13 @@ var/list/worths = list(
/mob/living/simple_animal = 500,
/mob/living = 100,
//MACHINERY,
/obj/machinery/mineral/unloading_machine = -500,
/obj/machinery/mining/brace = -300,
/obj/machinery/drone_fabricator = -3000,
/obj/machinery/photocopier/faxmachine = -500,
/obj/machinery/papershredder = -80,
/obj/machinery/gravity_generator = -16000,
/obj/machinery/light = 25,
/obj/machinery/power/smes/buildable = -15000,
/obj/machinery/compressor = -4000,
/obj/machinery/power/turbine = -6000,
/obj/machinery/computer/turbine_computer = -2000,
/obj/machinery/chem_master = -6000,
/obj/machinery/chemical_dispenser = -5000,
/obj/machinery/conveyor = 200,
/obj/machinery/conveyor_switch = 100,
/obj/machinery/disposal = 500,
/obj/machinery/r_n_d/protolathe = -15000,
/obj/machinery/r_n_d/server = -20000,
/obj/machinery/r_n_d = -1000,
/obj/machinery/auto_cloner = -13000,
/obj/machinery/giga_drill = -1900,
/obj/machinery/artifact = -13500,
/obj/machinery/artifact_analyser = -11900,
/obj/machinery/artifact_harvester = -12300,
/obj/machinery/artifact_scanpad = -1800,
/obj/machinery/suspension_gen = -3000,
/obj/machinery/keycard_auth = -100,
/obj/machinery/power/supermatter/shard = 100000,
/obj/machinery/power/supermatter = 500000,
/obj/machinery/atmospherics/pipe/simple/heat_exchanging = -1000,
/obj/machinery/atmospherics/pipe = -100,
/obj/machinery/atmospherics/portables_connector = -500,
/obj/machinery/atmospherics/tvalve = -150,
/obj/machinery/atmospherics/valve = -120,
/obj/machinery/atmospherics/binary/circulator = -2500,
/obj/machinery/atmospherics/binary/passive_gate = -1600,
/obj/machinery/atmospherics/pipeturbine = -3000,
/obj/machinery/atmospherics/binary/pump = -1900,
/obj/machinery/atmospherics/binary/pump/high_power = -2500,
/obj/machinery/atmospherics/omni/filter = -4000,
/obj/machinery/atmospherics/omni/mixer = -3600,
/obj/machinery/atmospherics/unary/freezer = -6000,
/obj/machinery/atmospherics/unary/generator_input = -2500,
/obj/machinery/atmospherics/unary/heater = -6000,
/obj/machinery/atmospherics/unary/outlet_injector = -2300,
/obj/machinery/atmospherics/unary/oxygen_generator = -10000,
/obj/machinery/atmospherics/unary/vent_pump = -2000,
/obj/machinery/atmospherics/unary/vent_scrubber = -2300,
/obj/machinery/bodyscanner = -6000,
/obj/machinery/body_scanconsole = -1500,
/obj/machinery/alarm = -800,
/obj/machinery/air_sensor = -800,
/obj/machinery/fabricator = -3300,
/obj/machinery/bluespacerelay = -4000,
/obj/machinery/button = 100,
/obj/machinery/cablelayer = -1700,
/obj/machinery/cell_charger = -90,
/obj/machinery/constructable_frame = -500,
/obj/machinery/cryopod = -3000,
/obj/machinery/barrier = -500,
/obj/machinery/floodlight = -200,
/obj/machinery/floor_light = -100,
/obj/machinery/floorlayer = -1500,
/obj/machinery/igniter = -300,
/obj/machinery/sparker = -500,
/obj/structure/iv_drip = -100,
/obj/machinery/jukebox = -700,
/obj/machinery/magnetic_module = -500,
/obj/machinery/magnetic_controller = -500,
/obj/machinery/mass_driver = -500,
/obj/machinery/navbeacon = -90,
/obj/machinery/newscaster = -100,
/obj/machinery/nuclearbomb = -10000,
/obj/machinery/recharger = -200,
/obj/machinery/sleeper = -4000,
/obj/machinery/space_heater = -500,
/obj/machinery/ai_status_display = -600,
/obj/machinery/camera = -700,
/obj/machinery/airlock_sensor = -800,
/obj/machinery/door/airlock = -800,
/obj/machinery/door/blast/shutters = -300,
/obj/machinery/door/blast = -1000,
/obj/machinery/door/firedoor = -600,
/obj/machinery/door = -100,
/obj/machinery/door_timer = -300,
/obj/machinery/embedded_controller/radio/airlock = -600,
/obj/machinery/gibber = -600,
/obj/machinery/microwave = -70,
/obj/machinery/pipedispenser = -100,
/obj/machinery/telecomms/broadcaster = -10000,
/obj/machinery/telecomms = -7000,
/obj/machinery/acting/changer = -3000,
/obj/machinery/artillerycontrol = -1400,
/obj/machinery/dnaforensics = -1200,
/obj/machinery/microscope = -550,
/obj/machinery/computer/account_database = -3000,
/obj/machinery/atm = -4500,
/obj/machinery/readybutton = -0,
/obj/machinery/botany/editor = -16000,
/obj/machinery/botany = -9050,
/obj/machinery/seed_storage = -500,
/obj/machinery/beehive = -500,
/obj/machinery/portable_atmospherics/hydroponics/soil = 1, //its dirt,
/obj/machinery/portable_atmospherics/hydroponics = -2300,
/obj/machinery/libraryscanner = -1000,
/obj/machinery/bookbinder = -1200,
/obj/machinery = -1000,
/obj/machinery/auto_cloner = -15000,
/obj/machinery/giga_drill = -5000,
/obj/machinery/artifact = -15000,
/obj/machinery/power/supermatter/shard = 60000,
/obj/machinery/power/supermatter = 200000,
/obj/machinery/atmospherics/pipe = 0,
/obj/machinery/the_singularitygen = -25000,
/obj/machinery = -50,
) //Must be in descending order. Child before parents, otherwise it doesn't work.,
Loading

0 comments on commit dfe6851

Please sign in to comment.