Files
Bubberstation/code/modules/cargo/exports/seeds.dm
SkyratBot 61ca3472ea [MIRROR] PURE Code Improvements to the Shuttle Subsystem [MDB IGNORE] (#10609)
* PURE Code Improvements to the Shuttle Subsystem

* modular updates

Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com>
Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
2022-01-12 02:47:57 +00:00

39 lines
1.3 KiB
Plaintext

/datum/export/seed
cost = CARGO_CRATE_VALUE * 0.25 // Gets multiplied by potency
k_elasticity = 1 //price inelastic/quantity elastic, only need to export a few samples
unit_name = "new plant species sample"
export_types = list(/obj/item/seeds)
var/needs_discovery = FALSE // Only for undiscovered species
var/static/list/discovered_plants = list()
/datum/export/seed/get_cost(obj/O)
var/obj/item/seeds/S = O
if(!needs_discovery && (S.type in discovered_plants))
return 0
if(needs_discovery && !(S.type in discovered_plants))
return 0
return ..() * S.rarity // That's right, no bonus for potency. Send a crappy sample first to "show improvement" later.
/datum/export/seed/sell_object(obj/O, datum/export_report/report, dry_run, apply_elastic)
. = ..()
if(. && !dry_run)
var/obj/item/seeds/S = O
discovered_plants[S.type] = S.potency
/datum/export/seed/potency
cost = CARGO_CRATE_VALUE * 0.0125 // Gets multiplied by potency and rarity.
unit_name = "improved plant sample"
export_types = list(/obj/item/seeds)
needs_discovery = TRUE // Only for already discovered species
/datum/export/seed/potency/get_cost(obj/O)
var/obj/item/seeds/S = O
var/cost = ..()
if(!cost)
return 0
var/potDiff = (S.potency - discovered_plants[S.type])
return round(..() * potDiff)