From a67af8c0b3921a803addefc20705ba6c968df2f9 Mon Sep 17 00:00:00 2001 From: Cael_Aislinn Date: Mon, 24 Dec 2012 00:09:09 +1000 Subject: [PATCH] renamed/reworked some xenoarch files, working xenoarch chemical analysis Signed-off-by: Cael_Aislinn --- baystation12.dme | 5 +- code/modules/mining/mine_turfs.dm | 5 +- .../reagents/reagent_containers/glass.dm | 4 +- .../research/xenoarchaeology/analysis.dm | 72 ++++++++--- .../xenoarchaeology/analysis_accelerator.dm | 42 ++++++- .../analysis_fourier_transform.dm | 25 ++-- .../analysis_gas_chromatography.dm | 83 ++++--------- .../xenoarchaeology/analysis_hyperspectral.dm | 31 ++++- .../xenoarchaeology/analysis_ion_mobility.dm | 30 +++++ .../xenoarchaeology/analysis_radiometric.dm | 6 - .../research/xenoarchaeology/archaeo_chem.dm | 113 ------------------ .../research/xenoarchaeology/geosample.dm | 69 +++++++++-- .../xenoarchaeology/global_placeholder.dm | 13 -- 13 files changed, 257 insertions(+), 241 deletions(-) delete mode 100644 code/modules/research/xenoarchaeology/analysis_radiometric.dm delete mode 100644 code/modules/research/xenoarchaeology/archaeo_chem.dm delete mode 100644 code/modules/research/xenoarchaeology/global_placeholder.dm diff --git a/baystation12.dme b/baystation12.dme index 8a293d2f4e6..38201fe54ba 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -1078,9 +1078,8 @@ #include "code\modules\research\xenoarchaeology\analysis_gas_chromatography.dm" #include "code\modules\research\xenoarchaeology\analysis_hyperspectral.dm" #include "code\modules\research\xenoarchaeology\analysis_ion_mobility.dm" -#include "code\modules\research\xenoarchaeology\analysis_radiometric.dm" +#include "code\modules\research\xenoarchaeology\analysis_isotope_ratio.dm" #include "code\modules\research\xenoarchaeology\analysis_scanner.dm" -#include "code\modules\research\xenoarchaeology\archaeo_chem.dm" #include "code\modules\research\xenoarchaeology\archaeo_excavate.dm" #include "code\modules\research\xenoarchaeology\archaeo_tools.dm" #include "code\modules\research\xenoarchaeology\artifact.dm" @@ -1091,12 +1090,12 @@ #include "code\modules\research\xenoarchaeology\artifact_misc.dm" #include "code\modules\research\xenoarchaeology\artifact_synthetic.dm" #include "code\modules\research\xenoarchaeology\bunsen_burner.dm" +#include "code\modules\research\xenoarchaeology\chemistry.dm" #include "code\modules\research\xenoarchaeology\core_sampler.dm" #include "code\modules\research\xenoarchaeology\crystal.dm" #include "code\modules\research\xenoarchaeology\finds.dm" #include "code\modules\research\xenoarchaeology\fossils.dm" #include "code\modules\research\xenoarchaeology\geosample.dm" -#include "code\modules\research\xenoarchaeology\global_placeholder.dm" #include "code\modules\research\xenoarchaeology\readme.dm" #include "code\modules\research\xenoarchaeology\tools.dm" #include "code\modules\scripting\Errors.dm" diff --git a/code/modules/mining/mine_turfs.dm b/code/modules/mining/mine_turfs.dm index 39a7add1dba..a3d832dcc9a 100644 --- a/code/modules/mining/mine_turfs.dm +++ b/code/modules/mining/mine_turfs.dm @@ -36,8 +36,6 @@ /turf/simulated/mineral/New() - src.geological_data = new /datum/geosample(src) - spawn(1) var/turf/T if((istype(get_step(src, NORTH), /turf/simulated/floor)) || (istype(get_step(src, NORTH), /turf/space)) || (istype(get_step(src, NORTH), /turf/simulated/shuttle/floor))) @@ -70,6 +68,9 @@ if(prob(spreadChance)) if(istype(get_step(src, EAST), /turf/simulated/mineral/random)) new src.type(get_step(src, EAST)) + + src.geological_data = new /datum/geosample(src) + return /turf/simulated/mineral/random diff --git a/code/modules/reagents/reagent_containers/glass.dm b/code/modules/reagents/reagent_containers/glass.dm index 5f2db222668..2da3e786a07 100644 --- a/code/modules/reagents/reagent_containers/glass.dm +++ b/code/modules/reagents/reagent_containers/glass.dm @@ -83,10 +83,12 @@ else if(istype(target, /obj/item/clothing/suit/space/space_ninja)) return - //bunsen burner handles all of this as well else if(istype(target, /obj/machinery/bunsen_burner)) return + else if(istype(target, /obj/machinery/anomaly)) + return + else if(reagents.total_volume) user << "\blue You splash the solution onto [target]." src.reagents.reaction(target, TOUCH) diff --git a/code/modules/research/xenoarchaeology/analysis.dm b/code/modules/research/xenoarchaeology/analysis.dm index 0dc309a3d39..c864915d3a4 100644 --- a/code/modules/research/xenoarchaeology/analysis.dm +++ b/code/modules/research/xenoarchaeology/analysis.dm @@ -20,9 +20,17 @@ /obj/machinery/anomaly/New() //connect to a nearby scanner pad if(scanner_dir) - scanner = locate(/obj/machinery/anomaly/scanner) in get_step(src, scanner_dir) - if(!scanner) - scanner = locate(/obj/machinery/anomaly/scanner) in orange(1) + owned_scanner = locate(/obj/machinery/anomaly/scanner) in get_step(src, scanner_dir) + if(!owned_scanner) + owned_scanner = locate(/obj/machinery/anomaly/scanner) in orange(1) + + var/obj/item/weapon/reagent_containers/glass/solution_tray/S = new(src.loc) + var/turf/simulated/mineral/diamond/D + for(var/turf/simulated/mineral/diamond/M in world) + D = M + break + S.reagents.add_reagent("analysis_sample", 1, D.geological_data) + S.reagents.add_reagent("chlorine", 1, D.geological_data) //this proc should be overriden by each individual machine /obj/machinery/anomaly/attack_hand(var/mob/user as mob) @@ -30,13 +38,16 @@ return user.machine = src var/dat = "[src.name]
" - dat += "[scanner ? "Scanner connected." : "Scanner disconnected."]" - dat += "Module heat level:[temperature] kelvin
" + dat += "[owned_scanner ? "Scanner connected." : "Scanner disconnected."]
" + dat += "Module heat level: [temperature] kelvin
" dat += "Safeties set at 600k, shielding failure at 1200k. Failure to maintain safe heat levels may result in equipment damage.
" dat += "
" - dat += "[held_container ? "Eject beaker" : "No beaker inserted."]
" - dat += "[held_container ? "Eject fuel tank" : "No fuel tank inserted."]
" - dat += "Begin scanning" + if(scanning) + dat += "Scan in progress


" + else + dat += "[held_container ? "Eject beaker" : "No beaker inserted."]
" + dat += "[fuel_container ? "Eject fuel tank" : "No fuel tank inserted."]
" + dat += "[held_container ? "Begin scanning" : ""]" dat += "
" dat += "Refresh
" dat += "Close
" @@ -49,10 +60,10 @@ obj/machinery/anomaly/attackby(obj/item/weapon/W as obj, mob/living/user as mob) if(held_container) user << "\red You must remove the [held_container] first." else - user << "\blue You put the [held_container] into the [src]." + user << "\blue You put the [W] into the [src]." user.drop_item(W) - held_container.loc = src held_container = W + held_container.loc = src updateDialog() else if(istype(W, /obj/item/weapon/tank)) @@ -70,7 +81,8 @@ obj/machinery/anomaly/attackby(obj/item/weapon/W as obj, mob/living/user as mob) /obj/machinery/anomaly/process() //not sure if everything needs to heat up, or just the GLPC - var/environmental_temp = loc.return_air().temperature + var/datum/gas_mixture/env = loc.return_air() + var/environmental_temp = env.temperature if(scanning) //heat up as we go, but if the air is freezing then heat up much slower var/new_heat = heat_accumulation_rate + heat_accumulation_rate * rand(-0.5,0.5) @@ -86,17 +98,17 @@ obj/machinery/anomaly/attackby(obj/item/weapon/W as obj, mob/living/user as mob) else if(temperature > environmental_temp) //cool down to match the air temperature -= 10 + rand(-5,5) - if(temperature < environmental_temp + if(temperature < environmental_temp) temperature = environmental_temp else if(temperature < environmental_temp) //heat up to match the air temperature += 10 + rand(-5,5) - if(temperature > environmental_temp + if(temperature > environmental_temp) temperature = environmental_temp obj/machinery/anomaly/proc/ScanResults() //instantiate in children to produce unique scan behaviour - return "Error initialising scanning components." + return "\red Error initialising scanning components." obj/machinery/anomaly/proc/BeginScan() var/total_scan_time = scan_time + scan_time * rand(-0.5, 0.5) @@ -105,17 +117,18 @@ obj/machinery/anomaly/proc/BeginScan() spawn(total_scan_time) if(scanning) scanning = 0 + updateDialog() //determine the results and print a report if(held_container) - src.visible_message("The [src] chimes.", 2) + src.visible_message("\icon[src] makes an insistent chime.", 2) var/obj/item/weapon/paper/P = new(src.loc) - P.name = "[src] analysis report #[++report_num]" + P.name = "[src] report #[++report_num]" P.info = "[src] analysis report #[report_num]

" + ScanResults() P.stamped = list(/obj/item/weapon/stamp) P.overlays = list("paper_stamped") else - src.visible_message("The [src] buzzes.", 2) + src.visible_message("\icon[src] makes a low buzzing noise.", 2) obj/machinery/anomaly/Topic(href, href_list) if(href_list["close"]) @@ -131,10 +144,31 @@ obj/machinery/anomaly/Topic(href, href_list) if(temperature >= 600) var/proceed = input("Unsafe internal temperature detected, do you wish to continue?","Warning") if(proceed) - safety_enabled = 0 - BeginScan() + if(get_dist(src, usr) <= 1) + safety_enabled = 0 + BeginScan() + else + usr << "\red You must be closer to the [src]!" else BeginScan() ..() updateDialog() + +//whether the carrier sample matches the possible finds +//results greater than a threshold of 0.6 means a positive result +obj/machinery/anomaly/proc/GetResultSpecifity(var/datum/geosample/scanned_sample, var/datum/reagent/carrier) + var/specifity = 0 + var/remaining = 1 + if(scanned_sample && carrier) + + for(var/index=1,index <= scanned_sample.find_presence.len, index++) + var/find = scanned_sample.find_presence[index] + if(find && responsive_carriers[index] == carrier) + specifity += 0.5 * remaining + rand(0, 0.25 * remaining) + remaining = 1 - specifity + + if(!specifity) + specifity += rand(0, 0.5) + + return specifity diff --git a/code/modules/research/xenoarchaeology/analysis_accelerator.dm b/code/modules/research/xenoarchaeology/analysis_accelerator.dm index 1e15854e847..0315220f99d 100644 --- a/code/modules/research/xenoarchaeology/analysis_accelerator.dm +++ b/code/modules/research/xenoarchaeology/analysis_accelerator.dm @@ -1,6 +1,46 @@ obj/machinery/anomaly/accelerator - name = "Accelerator Spectrometer" + name = "Accelerator spectrometer" desc = "A specialised, complex analysis machine." icon = 'virology.dmi' icon_state = "analyser" + +obj/machinery/anomaly/accelerator/ScanResults() + var/results = "The scan was inconclusive. Check sample integrity and carrier consistency." + + var/datum/geosample/scanned_sample + var/carrier + var/num_reagents = 0 + + for(var/datum/reagent/A in held_container.reagents.reagent_list) + var/datum/reagent/R = A + if(istype(R, /datum/reagent/analysis_sample)) + scanned_sample = R.data + else + carrier = R.id + num_reagents++ + + if(num_reagents == 2 && scanned_sample && carrier) + var/specifity = GetResultSpecifity(scanned_sample, carrier) + var/accuracy = (specifity / (specifity + 0.2)) + results = "Kinetic acceleration of carrier ([carrier]) indicates age ([100 * accuracy]% accuracy):

" + + if(scanned_sample.age_billion) + var/displayed_age_millions = scanned_sample.age_million + max(scanned_sample.age_million * ((1 - accuracy) * (2 * rand() - 1)), 0) + var/displayed_age_billions = scanned_sample.age_billion + max(scanned_sample.age_billion * ((1 - accuracy) * (2 * rand() - 1)), 0) + results += "[displayed_age_billions + displayed_age_millions / 1000] billion years.
" + else if(scanned_sample.age_million) + var/displayed_age_thousands = scanned_sample.age_thousand + max(scanned_sample.age * ((1 - accuracy) * (4 * rand() - 2)), 0) + var/displayed_age_millions = scanned_sample.age_million + max(scanned_sample.age_million * ((1 - accuracy) * (2 * rand() - 1)), 0) + results += "[displayed_age_millions + displayed_age_thousands / 1000] million years.
" + else if(scanned_sample.age_thousand) + var/displayed_age = scanned_sample.age + max(scanned_sample.age * ((1 - accuracy) * (8 * rand() - 4)), 0) + var/displayed_age_thousands = scanned_sample.age_thousand + max(scanned_sample.age * ((1 - accuracy) * (4 * rand() - 2)), 0) + results += "[displayed_age_thousands + displayed_age / 1000] thousand years.
" + else + var/displayed_age = scanned_sample.age + max(scanned_sample.age * ((1 - accuracy) * (8 * rand() - 4)), 0) + results += "[displayed_age] years.
" + + results += "
Warning, results only valid for ages on the scale of billions of years." + + return results diff --git a/code/modules/research/xenoarchaeology/analysis_fourier_transform.dm b/code/modules/research/xenoarchaeology/analysis_fourier_transform.dm index 597ee1817be..7a402fdcd99 100644 --- a/code/modules/research/xenoarchaeology/analysis_fourier_transform.dm +++ b/code/modules/research/xenoarchaeology/analysis_fourier_transform.dm @@ -12,25 +12,30 @@ obj/machinery/anomaly/fourier_transform/ScanResults() var/carrier var/num_reagents = 0 - for(var/reagent/A in held_container.reagents.reagent_list) + for(var/datum/reagent/A in held_container.reagents.reagent_list) var/datum/reagent/R = A - if(istype(R,datum/reagent/density_separated_liquid)) - scanned_sample = R.data - else if(istype(R,datum/reagent/analysis_sample)) + if(istype(R, /datum/reagent/analysis_sample)) scanned_sample = R.data else - carrier = R.type + carrier = R.id num_reagents++ if(num_reagents == 2 && scanned_sample && carrier) //all necessary components are present var/specifity = GetResultSpecifity(scanned_sample, carrier) var/distance = scanned_sample.artifact_distance - if(specifity > 0.6) - artifact_distance += rand(-0.1, 0.1) * artifact_distance + if(distance > 0) + var/accuracy = 0.9 + if(specifity > 0.6) + distance += (0.2 * rand() - 0.1) * distance + else + var/offset = 1 - specifity + distance += distance * rand(-100 * offset, 100 * offset) / 100 + accuracy = specifity + results = "Fourier transform analysis on anomalous energy absorption through carrier ([carrier]) indicates source located inside emission radius ([100 * accuracy]% accuracy): [distance]." + if(carrier == scanned_sample.source_mineral) + results += "
Warning, analysis may be contaminated by high quantities of molecular carrier present throughout sample." else - var/offset = 1 - specifity - artifact_distance += rand(-offset, offset) * artifact_distance - results = "Anomalous energy absorption through carrier ([carrier.id]) indicates emission radius: [artifact_distance]" + results = "Standard energy dispersion detected throughout sample." return results diff --git a/code/modules/research/xenoarchaeology/analysis_gas_chromatography.dm b/code/modules/research/xenoarchaeology/analysis_gas_chromatography.dm index fbbb7fe47e4..69116ca117b 100644 --- a/code/modules/research/xenoarchaeology/analysis_gas_chromatography.dm +++ b/code/modules/research/xenoarchaeology/analysis_gas_chromatography.dm @@ -1,6 +1,6 @@ obj/machinery/anomaly/gas_chromatography - name = "Gas Chromatography Spectrometer" + name = "Gas Chromatography spectrometer" desc = "A specialised, complex analysis machine." icon = 'virology.dmi' icon_state = "analyser" @@ -12,69 +12,32 @@ obj/machinery/anomaly/gas_chromatography/ScanResults() var/carrier var/num_reagents = 0 - for(var/reagent/A in held_container.reagents.reagent_list) + for(var/datum/reagent/A in held_container.reagents.reagent_list) var/datum/reagent/R = A - if(istype(R,datum/reagent/density_separated_liquid)) - scanned_sample = R.data - else if(istype(R,datum/reagent/analysis_sample)) + if(istype(R, /datum/reagent/analysis_sample)) scanned_sample = R.data else - carrier = R.type + carrier = R.id num_reagents++ - if(num_reagents == 2 && scanned_sample && carrier) - //all necessary components are present - results = "Carrier ([carrier.id]) specifity: [GetResultSpecifity(scanned_sample, carrier)]" + if(num_reagents == 2 && scanned_sample) + + var/specifity = 0.15 + if(carrier) + specifity = GetResultSpecifity(scanned_sample, carrier) + results = "Chromatography partitioning analysis over carrier ([carrier]) indicates the following elements present ([110 * (specifity / (specifity + 0.1))]% accuracy):

" + + var/num_found = 0 + for(var/index=1,index <= scanned_sample.find_presence.len, index++) + var/find = scanned_sample.find_presence[index] + if(find && prob( 110 * (specifity / (specifity + 0.1)) )) + results += " - " + finds_as_strings[index] + "
" + num_found++ + + if(!num_found) + results = "Chromatography partitioning results over carrier ([carrier]) to determine elemental makeup were inconclusive.
" + + if(!carrier) + results += "
No carrier detected, scan accuracy affected.
" return results - -obj/machinery/anomaly/proc/GetResultSpecifity(var/datum/geosample/scanned_sample, var/datum/reagent/carrier) - var/specifity = 0 - if(scanned_sample && carrier) - var/threshold = 0.6 - - if(scanned_sample.main_find == carrier.id) - specifity += threshold + rand(0, 1 - threshold) - if(scanned_sample.secondary_find == carrier.id) - specifity += threshold + rand(0, 1 - threshold) - - /* - //check the main turf - if(scanned_sample.main_find == FIND_NOTHING) - //nothing? - else if(scanned_sample.main_find == FIND_PLANT || scanned_sample.main_find == FIND_BIO || scanned_sample.main_find == FIND_SKULL) - //preserved plant or animal - if(carrier.id == "carbon") - specifity += threshold + rand(0,1 - threshold) - else if(scanned_sample.main_find == FIND_METEORIC) - //deep space - if(carrier.id == "neon") - specifity += threshold + rand(0,1 - threshold) - else if(scanned_sample.main_find == FIND_ICE) - //solid h20 - if(carrier.id == "beryllium") - specifity += threshold + rand(0,1 - threshold) - else if(scanned_sample.main_find == FIND_IGNEOUS || scanned_sample.main_find == FIND_METAMORPHIC || scanned_sample.main_find == FIND_CARBONATE) - //rock - if(carrier.id == "calcium" || carrier.id == "chlorine") - specifity += threshold + rand(0,1 - threshold) - else if(scanned_sample.main_find == FIND_CRYSTALLINE) - //some kind of refractive, crystalline matter - if(carrier.id == "helium") - specifity += threshold + rand(0,1 - threshold) - else if(scanned_sample.main_find == FIND_METALLIC) - //something metal (could be just ores, not necessarily a synthetic artifact) - if(carrier.id == "silicon") - specifity += threshold + rand(0,1 - threshold) - else if(scanned_sample.main_find == FIND_SEDIMENTARY) - //sandy rock - if(carrier.id == "aluminium") - specifity += threshold + rand(0,1 - threshold) - */ - - if(specifity > 1) - specifity = 0.9 + rand(0,0.1) - else if(specifity <= 0) - specifity += rand(0, threshold) - - return specifity diff --git a/code/modules/research/xenoarchaeology/analysis_hyperspectral.dm b/code/modules/research/xenoarchaeology/analysis_hyperspectral.dm index 08f1d85cded..d6bc7c74041 100644 --- a/code/modules/research/xenoarchaeology/analysis_hyperspectral.dm +++ b/code/modules/research/xenoarchaeology/analysis_hyperspectral.dm @@ -1,6 +1,31 @@ obj/machinery/anomaly/hyperspectral - name = "Hypospectral Imager" + name = "Hyperspectral Imager" desc = "A specialised, complex analysis machine." - icon = 'virology.dmi' - icon_state = "analyser" + icon = 'icons/obj/computer.dmi' + icon_state = "rdcomp" + +obj/machinery/anomaly/hyperspectral/ScanResults() + var/results = "The scan was inconclusive. Check sample integrity and carrier consistency." + + var/datum/geosample/scanned_sample + var/carrier + var/num_reagents = 0 + + for(var/datum/reagent/A in held_container.reagents.reagent_list) + var/datum/reagent/R = A + if(istype(R, /datum/reagent/analysis_sample)) + scanned_sample = R.data + else + carrier = R.id + num_reagents++ + + if(num_reagents == 2 && scanned_sample && carrier) + //all necessary components are present + var/specifity = GetResultSpecifity(scanned_sample, carrier) + results = "Spectral signature over carrier ([carrier], [specifity]):
" + results += "
" + if(scanned_sample.artifact_id && prob(specifity * 100)) + results += "Anomalous exotic energy signature detected: [scanned_sample.artifact_id]." + + return results diff --git a/code/modules/research/xenoarchaeology/analysis_ion_mobility.dm b/code/modules/research/xenoarchaeology/analysis_ion_mobility.dm index 21dc0ad52fc..221b4417b51 100644 --- a/code/modules/research/xenoarchaeology/analysis_ion_mobility.dm +++ b/code/modules/research/xenoarchaeology/analysis_ion_mobility.dm @@ -4,3 +4,33 @@ obj/machinery/anomaly/ion_mobility desc = "A specialised, complex analysis machine." icon = 'virology.dmi' icon_state = "analyser" + +obj/machinery/anomaly/ion_mobility/ScanResults() + var/results = "The scan was inconclusive. Check sample integrity and carrier consistency." + + var/datum/geosample/scanned_sample + var/carrier + var/num_reagents = 0 + + for(var/datum/reagent/A in held_container.reagents.reagent_list) + var/datum/reagent/R = A + if(istype(R, /datum/reagent/analysis_sample)) + scanned_sample = R.data + else + carrier = R.id + num_reagents++ + + if(num_reagents == 2 && scanned_sample && carrier) + //all necessary components are present + results = "Kinetic analysis on sample's ionic residue in carrier ([carrier]) indicates the following composition:

" + var/found = 0 + for(var/index=1,index <= scanned_sample.find_presence.len, index++) + var/find = scanned_sample.find_presence[index] + //world << "index: [index], find: [find], response: [responsive_carriers[index]], carrier: [carrier]" + if(find && responsive_carriers[index] == carrier) + results += " - [finds_as_strings[index]] [find * 100]%
" + found++ + if(!found) + results = "Kinetic analysis on sample's ionic residue in carrier ([carrier]) to determine composition were inconclusive." + + return results diff --git a/code/modules/research/xenoarchaeology/analysis_radiometric.dm b/code/modules/research/xenoarchaeology/analysis_radiometric.dm deleted file mode 100644 index 9b9b280b2c4..00000000000 --- a/code/modules/research/xenoarchaeology/analysis_radiometric.dm +++ /dev/null @@ -1,6 +0,0 @@ - -obj/machinery/anomaly/radiometric - name = "Isotope ratio spectrometre" - desc = "A specialised, complex analysis machine." - icon = 'virology.dmi' - icon_state = "analyser" diff --git a/code/modules/research/xenoarchaeology/archaeo_chem.dm b/code/modules/research/xenoarchaeology/archaeo_chem.dm deleted file mode 100644 index c12a530a7ff..00000000000 --- a/code/modules/research/xenoarchaeology/archaeo_chem.dm +++ /dev/null @@ -1,113 +0,0 @@ - -//chemistry stuff here so that it can be easily viewed/modified -datum - reagent - tungsten //purely used to make lith-sodi-tungs - name = "Tungsten" - id = "tungsten" - description = "A chemical element, and a strong oxidising agent." - reagent_state = SOLID - color = "#808080" // rgb: 128, 128, 128 - //todo: make this silvery grey - - neon //purely used as a carrier - name = "Neon" - id = "neon" - description = "A chemical element, commonly used in lighting." - reagent_state = LIQUID - color = "#808080" // rgb: 128, 128, 128, - //todo: make this fluro/bright purple - - beryllium //purely used as a carrier - name = "Beryllium" - id = "beryllium" - description = "A chemical element, prized for it's rigidity, thermal stability and low density when used in alloys." - reagent_state = LIQUID - color = "#808080" // rgb: 128, 128, 128, - //todo: make this dark grey - - calcium //purely used as a carrier - name = "Calcium" - id = "calcium" - description = "An extremely common chemical element found throughout living organisms." - reagent_state = LIQUID - color = "#808080" // rgb: 128, 128, 128, - //todo: make this bone-white colour - - lithiumsodiumtungstate - name = "Lithium Sodium Tungstate" - id = "lithiumsodiumtungstate" - description = "A reducing agent for geological compounds." - reagent_state = LIQUID - color = "#808080" // rgb: 128, 128, 128 - //todo: make this silvery grey - - ground_rock - name = "Ground Rock" - id = "ground_rock" - description = "A fine dust made of ground up rock." - reagent_state = SOLID - color = "#C81040" //rgb: 200, 16, 64 - //todo: make this brown - - density_separated_sample - name = "Analysis liquid" - id = "density_separated_sample" - description = "A watery paste used in chemical analysis." - reagent_state = LIQUID - color = "#C81040" //rgb: 200, 16, 64 - //todo: make this browny-white - - analysis_sample - name = "Analysis liquid" - id = "analysis_sample" - description = "A watery paste used in chemical analysis." - reagent_state = LIQUID - color = "#C81040" //rgb: 200, 16, 64 - //todo: make this white - - chemical_waste - name = "Chemical Waste" - id = "chemical_waste" - description = "A viscous, toxic liquid left over from many chemical processes." - reagent_state = LIQUID - color = "#C81040" //rgb: 200, 16, 64 - //todo: make this fluoro/bright green - -datum - chemical_reaction - lithiumsodiumtungstate //LiNa2WO4, not the easiest chem to mix - name = "Lithium Sodium Tungstate" - id = "lithiumsodiumtungstate" - result = "lithiumsodiumtungstate" - required_reagents = list("lithium" = 1, "sodium" = 2, "tungsten" = 1, "oxygen" = 4) - result_amount = 8 - - density_separated_liquid - name = "Density separated sample" - id = "density_separated_sample" - result = "density_separated_sample" - secondary_results = list("chemical_waste" = 1) - required_reagents = list("ground_rock" = 1, "lithiumsodiumtungstate" = 2) - result_amount = 2 - - analysis_liquid - name = "Analysis sample" - id = "analysis_sample" - result = "analysis_sample" - secondary_results = list("chemical_waste" = 1) - required_reagents = list("density_separated_sample" = 5) - result_amount = 4 - requires_heating = 1 - -/obj/item/weapon/reagent_containers/glass/solution_tray - icon = 'icons/obj/device.dmi' - icon_state = "solution_tray" - desc = "A small, open-topped glass container for delicate research samples." - m_amt = 0 - g_amt = 5 - w_class = 1.0 - amount_per_transfer_from_this = 1 - possible_transfer_amounts = list(1) - volume = 2 - flags = FPRINT | OPENCONTAINER diff --git a/code/modules/research/xenoarchaeology/geosample.dm b/code/modules/research/xenoarchaeology/geosample.dm index 43da9ccb142..98064c676f2 100644 --- a/code/modules/research/xenoarchaeology/geosample.dm +++ b/code/modules/research/xenoarchaeology/geosample.dm @@ -1,54 +1,103 @@ +#define FIND_PLANT 1 +#define FIND_BIO 2 +#define FIND_METEORIC 3 +#define FIND_ICE 4 +#define FIND_CRYSTALLINE 5 +#define FIND_METALLIC 6 +#define FIND_IGNEOUS 7 +#define FIND_METAMORPHIC 8 +#define FIND_SEDIMENTARY 9 +#define FIND_NOTHING 10 + +var/list/responsive_carriers = list( \ + "carbon", \ + "carbon", \ + "neon", \ + "beryllium", \ + "helium", \ + "silicon", \ + "calcium", \ + "chlorine", \ + "aluminium", \ + "plasma" ) + +var/list/finds_as_strings = list( \ + "Dead plant cells", \ + "Dead organism cells", \ + "Long exposure particles", \ + "Trace water particles", \ + "Crystalline structures", \ + "Metals", \ + "Igneous rock", \ + "Metamorphic rock", \ + "Sedimentary rock", \ + "Anomalous material" ) + datum/geosample - var/scrambled = 0 //if this sample has been mixed with other samples - // var/age = 0 //age can correspond to different archaeological finds var/age_thousand = 0 var/age_million = 0 var/age_billion = 0 var/artifact_id = "" //id of a nearby artifact, if there is one - var/artifact_distance = 0 //proportional to distance - var/main_find = "" //carrier reagent that the main body of the tile responds to - var/secondary_find = "" //carrier reagent that the floor of the turf responds to + var/artifact_distance = -1 //proportional to distance // var/source_mineral - var/list/specifity_offsets = list() + //all potential finds are initialised to null, so nullcheck before you access them + var/list/find_presence[10] datum/geosample/New(var/turf/simulated/mineral/container) + UpdateTurf(container) - artifact_distance = rand(500,999999) //this should only need to be called once datum/geosample/proc/UpdateTurf(var/turf/simulated/mineral/container) source_mineral = container.mineralName age = rand(1,999) + + find_presence[FIND_METEORIC] = rand(1,10) / 10 + + var/comp_remaining = 1 - find_presence[FIND_METEORIC] switch(container.mineralName) if("Uranium") age_million = rand(1, 704) age_thousand = rand(1,999) + find_presence[FIND_METALLIC] = comp_remaining * (rand(25, 75) / 100) + comp_remaining -= find_presence[FIND_METALLIC] if("Iron") age_thousand = rand(1, 999) age_million = rand(1, 999) + find_presence[FIND_METALLIC] = comp_remaining * (rand(25, 75) / 100) + comp_remaining -= find_presence[FIND_METALLIC] if("Diamond") age_thousand = rand(1,999) age_million = rand(1,999) + find_presence[FIND_CRYSTALLINE] = comp_remaining * (rand(25, 75) / 100) + comp_remaining -= find_presence[FIND_CRYSTALLINE] if("Gold") age_thousand = rand(1,999) age_million = rand(1,999) age_billion = rand(3,4) + find_presence[FIND_METALLIC] = comp_remaining * (rand(25, 75) / 100) + comp_remaining -= find_presence[FIND_METALLIC] if("Silver") age_thousand = rand(1,999) age_million = rand(1,999) + find_presence[FIND_METALLIC] = comp_remaining * (rand(25, 75) / 100) + comp_remaining -= find_presence[FIND_METALLIC] if("Plasma") age_thousand = rand(1,999) age_million = rand(1,999) age_billion = rand(10, 13) + find_presence[FIND_METALLIC] = comp_remaining * (rand(25, 75) / 100) + comp_remaining -= find_presence[FIND_METALLIC] if("Clown") age = rand(-1,-999) //thats_the_joke.mp4 age_thousand = rand(-1,-999) - /*if("Archaeo") - //snowflake - age_thousand = rand(1,999)*/ else source_mineral = "Rock" + find_presence[FIND_IGNEOUS] = comp_remaining * (rand(25, 75) / 100) + comp_remaining -= find_presence[FIND_IGNEOUS] + + find_presence[FIND_METAMORPHIC] = comp_remaining diff --git a/code/modules/research/xenoarchaeology/global_placeholder.dm b/code/modules/research/xenoarchaeology/global_placeholder.dm deleted file mode 100644 index c1291abc016..00000000000 --- a/code/modules/research/xenoarchaeology/global_placeholder.dm +++ /dev/null @@ -1,13 +0,0 @@ -//todo: move these into global.dm - -var/FIND_NOTHING = 0 -var/FIND_PLANT = 1 -var/FIND_BIO = 2 -var/FIND_METEORIC = 3 -var/FIND_ICE = 4 -var/FIND_CRYSTALLINE = 6 -var/FIND_METALLIC = 7 -var/FIND_IGNEOUS = 8 -var/FIND_METAMORPHIC = 9 -var/FIND_CARBONATE = 10 -var/FIND_SEDIMENTARY = 11