Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes plasma being worth 100x its value when in a stack of 2 or greater #10443

Merged
merged 3 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions code/modules/cargo/exports.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,15 @@ Credit dupes that require a lot of manual work shouldn't be removed, unless they
var/list/contents = AM.GetAllContents()

var/datum/export_report/report = external_report

if(!report) //If we don't have any longer transaction going on
report = new

// We go backwards, so it'll be innermost objects sold first
for(var/i in reverse_range(contents))
var/atom/movable/thing = i
var/sold = FALSE

for(var/datum/export/E in GLOB.exports_list)
if(!E)
continue
Expand Down Expand Up @@ -146,11 +148,18 @@ Credit dupes that require a lot of manual work shouldn't be removed, unless they
return FALSE
return TRUE

// Called only once, when the object is actually sold by the datum.
// Adds item's cost and amount to the current export cycle.
// get_cost, get_amount and applies_to do not neccesary mean a successful sale.
/**
* Calculates the exact export value of the object, while factoring in all the relivant variables.
*
* Called only once, when the object is actually sold by the datum.
* Adds item's cost and amount to the current export cycle.
* get_cost, get_amount and applies_to do not neccesary mean a successful sale.
*
*/
/datum/export/proc/sell_object(obj/O, datum/export_report/report, dry_run = TRUE, allowed_categories = EXPORT_CARGO , apply_elastic = TRUE)
///This is the value of the object, as derived from export datums.
var/the_cost = get_cost(O, allowed_categories , apply_elastic)
///Quantity of the object in question.
var/amount = get_amount(O)

if(amount <=0 || the_cost <=0)
Expand Down
23 changes: 11 additions & 12 deletions code/modules/cargo/exports/materials.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,38 +32,37 @@
/datum/export/material/bananium
cost = 1000
material_id = /datum/material/bananium
message = "cm<sup>3</sup> of bananium"
message = "cm3 of bananium"

/datum/export/material/diamond
cost = 500
material_id = /datum/material/diamond
message = "cm<sup>3</sup> of diamonds"
message = "cm3 of diamonds"

/datum/export/material/plasma
cost = 200
k_elasticity = 0
material_id = /datum/material/plasma
message = "cm<sup>3</sup> of plasma"
message = "cm3 of plasma"

/datum/export/material/uranium
cost = 100
material_id = /datum/material/uranium
message = "cm<sup>3</sup> of uranium"
message = "cm3 of uranium"

/datum/export/material/gold
cost = 125
material_id = /datum/material/gold
message = "cm<sup>3</sup> of gold"
message = "cm3 of gold"

/datum/export/material/copper
cost = 15
material_id = /datum/material/copper
message = "cm<sup>3</sup> of copper"
message = "cm3 of copper"

/datum/export/material/silver
cost = 50
material_id = /datum/material/silver
message = "cm<sup>3</sup> of silver"
message = "cm3 of silver"

/datum/export/material/titanium
cost = 125
Expand All @@ -73,7 +72,7 @@
/datum/export/material/adamantine
cost = 500
material_id = /datum/material/adamantine
message = "cm<sup>3</sup> of adamantine"
message = "cm3 of adamantine"

/datum/export/material/bscrystal
cost = 300
Expand All @@ -82,20 +81,20 @@

/datum/export/material/plastic
cost = 25
message = "cm<sup>3</sup> of plastic"
message = "cm3 of plastic"
material_id = /datum/material/plastic

/datum/export/material/iron
cost = 5
message = "cm<sup>3</sup> of metal"
message = "cm3 of metal"
material_id = /datum/material/iron
export_types = list(
/obj/item/stack/sheet/iron, /obj/item/stack/tile/plasteel,
/obj/item/stack/rods, /obj/item/stack/ore, /obj/item/coin)

/datum/export/material/glass
cost = 5
message = "cm<sup>3</sup> of glass"
message = "cm3 of glass"
material_id = /datum/material/glass
export_types = list(/obj/item/stack/sheet/glass, /obj/item/stack/ore,
/obj/item/shard)
Loading