renamed/reworked some xenoarch files, working xenoarch chemical analysis

Signed-off-by: Cael_Aislinn <cael_aislinn@yahoo.com.au>
This commit is contained in:
Cael_Aislinn
2012-12-24 00:09:09 +10:00
parent e3d326a199
commit a67af8c0b3
13 changed files with 257 additions and 241 deletions

View File

@@ -1078,9 +1078,8 @@
#include "code\modules\research\xenoarchaeology\analysis_gas_chromatography.dm" #include "code\modules\research\xenoarchaeology\analysis_gas_chromatography.dm"
#include "code\modules\research\xenoarchaeology\analysis_hyperspectral.dm" #include "code\modules\research\xenoarchaeology\analysis_hyperspectral.dm"
#include "code\modules\research\xenoarchaeology\analysis_ion_mobility.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\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_excavate.dm"
#include "code\modules\research\xenoarchaeology\archaeo_tools.dm" #include "code\modules\research\xenoarchaeology\archaeo_tools.dm"
#include "code\modules\research\xenoarchaeology\artifact.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_misc.dm"
#include "code\modules\research\xenoarchaeology\artifact_synthetic.dm" #include "code\modules\research\xenoarchaeology\artifact_synthetic.dm"
#include "code\modules\research\xenoarchaeology\bunsen_burner.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\core_sampler.dm"
#include "code\modules\research\xenoarchaeology\crystal.dm" #include "code\modules\research\xenoarchaeology\crystal.dm"
#include "code\modules\research\xenoarchaeology\finds.dm" #include "code\modules\research\xenoarchaeology\finds.dm"
#include "code\modules\research\xenoarchaeology\fossils.dm" #include "code\modules\research\xenoarchaeology\fossils.dm"
#include "code\modules\research\xenoarchaeology\geosample.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\readme.dm"
#include "code\modules\research\xenoarchaeology\tools.dm" #include "code\modules\research\xenoarchaeology\tools.dm"
#include "code\modules\scripting\Errors.dm" #include "code\modules\scripting\Errors.dm"

View File

@@ -36,8 +36,6 @@
/turf/simulated/mineral/New() /turf/simulated/mineral/New()
src.geological_data = new /datum/geosample(src)
spawn(1) spawn(1)
var/turf/T 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))) 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(prob(spreadChance))
if(istype(get_step(src, EAST), /turf/simulated/mineral/random)) if(istype(get_step(src, EAST), /turf/simulated/mineral/random))
new src.type(get_step(src, EAST)) new src.type(get_step(src, EAST))
src.geological_data = new /datum/geosample(src)
return return
/turf/simulated/mineral/random /turf/simulated/mineral/random

View File

@@ -83,10 +83,12 @@
else if(istype(target, /obj/item/clothing/suit/space/space_ninja)) else if(istype(target, /obj/item/clothing/suit/space/space_ninja))
return return
//bunsen burner handles all of this as well
else if(istype(target, /obj/machinery/bunsen_burner)) else if(istype(target, /obj/machinery/bunsen_burner))
return return
else if(istype(target, /obj/machinery/anomaly))
return
else if(reagents.total_volume) else if(reagents.total_volume)
user << "\blue You splash the solution onto [target]." user << "\blue You splash the solution onto [target]."
src.reagents.reaction(target, TOUCH) src.reagents.reaction(target, TOUCH)

View File

@@ -20,9 +20,17 @@
/obj/machinery/anomaly/New() /obj/machinery/anomaly/New()
//connect to a nearby scanner pad //connect to a nearby scanner pad
if(scanner_dir) if(scanner_dir)
scanner = locate(/obj/machinery/anomaly/scanner) in get_step(src, scanner_dir) owned_scanner = locate(/obj/machinery/anomaly/scanner) in get_step(src, scanner_dir)
if(!scanner) if(!owned_scanner)
scanner = locate(/obj/machinery/anomaly/scanner) in orange(1) 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 //this proc should be overriden by each individual machine
/obj/machinery/anomaly/attack_hand(var/mob/user as mob) /obj/machinery/anomaly/attack_hand(var/mob/user as mob)
@@ -30,13 +38,16 @@
return return
user.machine = src user.machine = src
var/dat = "<B>[src.name]</B><BR>" var/dat = "<B>[src.name]</B><BR>"
dat += "[scanner ? "Scanner connected." : "Scanner disconnected."]" dat += "[owned_scanner ? "Scanner connected." : "Scanner disconnected."]<br>"
dat += "Module heat level: [temperature] kelvin<br>" dat += "Module heat level: [temperature] kelvin<br>"
dat += "Safeties set at 600k, shielding failure at 1200k. Failure to maintain safe heat levels may result in equipment damage.<br>" dat += "Safeties set at 600k, shielding failure at 1200k. Failure to maintain safe heat levels may result in equipment damage.<br>"
dat += "<hr>" dat += "<hr>"
if(scanning)
dat += "Scan in progress<br><br><br>"
else
dat += "[held_container ? "<A href='?src=\ref[src];eject_beaker=1'>Eject beaker</a>" : "No beaker inserted."]<br>" dat += "[held_container ? "<A href='?src=\ref[src];eject_beaker=1'>Eject beaker</a>" : "No beaker inserted."]<br>"
dat += "[held_container ? "<A href='?src=\ref[src];eject_fuel=1'>Eject fuel tank</a>" : "No fuel tank inserted."]<br>" dat += "[fuel_container ? "<A href='?src=\ref[src];eject_fuel=1'>Eject fuel tank</a>" : "No fuel tank inserted."]<br>"
dat += "<A href='?src=\ref[src];begin=1'>Begin scanning</a>" dat += "[held_container ? "<A href='?src=\ref[src];begin=1'>Begin scanning</a>" : ""]"
dat += "<hr>" dat += "<hr>"
dat += "<A href='?src=\ref[src];refresh=1'>Refresh</a><BR>" dat += "<A href='?src=\ref[src];refresh=1'>Refresh</a><BR>"
dat += "<A href='?src=\ref[src];close=1'>Close</a><BR>" dat += "<A href='?src=\ref[src];close=1'>Close</a><BR>"
@@ -49,10 +60,10 @@ obj/machinery/anomaly/attackby(obj/item/weapon/W as obj, mob/living/user as mob)
if(held_container) if(held_container)
user << "\red You must remove the [held_container] first." user << "\red You must remove the [held_container] first."
else else
user << "\blue You put the [held_container] into the [src]." user << "\blue You put the [W] into the [src]."
user.drop_item(W) user.drop_item(W)
held_container.loc = src
held_container = W held_container = W
held_container.loc = src
updateDialog() updateDialog()
else if(istype(W, /obj/item/weapon/tank)) 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() /obj/machinery/anomaly/process()
//not sure if everything needs to heat up, or just the GLPC //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) if(scanning)
//heat up as we go, but if the air is freezing then heat up much slower //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) 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) else if(temperature > environmental_temp)
//cool down to match the air //cool down to match the air
temperature -= 10 + rand(-5,5) temperature -= 10 + rand(-5,5)
if(temperature < environmental_temp if(temperature < environmental_temp)
temperature = environmental_temp temperature = environmental_temp
else if(temperature < environmental_temp) else if(temperature < environmental_temp)
//heat up to match the air //heat up to match the air
temperature += 10 + rand(-5,5) temperature += 10 + rand(-5,5)
if(temperature > environmental_temp if(temperature > environmental_temp)
temperature = environmental_temp temperature = environmental_temp
obj/machinery/anomaly/proc/ScanResults() obj/machinery/anomaly/proc/ScanResults()
//instantiate in children to produce unique scan behaviour //instantiate in children to produce unique scan behaviour
return "Error initialising scanning components." return "\red Error initialising scanning components."
obj/machinery/anomaly/proc/BeginScan() obj/machinery/anomaly/proc/BeginScan()
var/total_scan_time = scan_time + scan_time * rand(-0.5, 0.5) 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) spawn(total_scan_time)
if(scanning) if(scanning)
scanning = 0 scanning = 0
updateDialog()
//determine the results and print a report //determine the results and print a report
if(held_container) 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) var/obj/item/weapon/paper/P = new(src.loc)
P.name = "[src] analysis report #[++report_num]" P.name = "[src] report #[++report_num]"
P.info = "<b>[src] analysis report #[report_num]</b><br><br>" + ScanResults() P.info = "<b>[src] analysis report #[report_num]</b><br><br>" + ScanResults()
P.stamped = list(/obj/item/weapon/stamp) P.stamped = list(/obj/item/weapon/stamp)
P.overlays = list("paper_stamped") P.overlays = list("paper_stamped")
else 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) obj/machinery/anomaly/Topic(href, href_list)
if(href_list["close"]) if(href_list["close"])
@@ -131,10 +144,31 @@ obj/machinery/anomaly/Topic(href, href_list)
if(temperature >= 600) if(temperature >= 600)
var/proceed = input("Unsafe internal temperature detected, do you wish to continue?","Warning") var/proceed = input("Unsafe internal temperature detected, do you wish to continue?","Warning")
if(proceed) if(proceed)
if(get_dist(src, usr) <= 1)
safety_enabled = 0 safety_enabled = 0
BeginScan() BeginScan()
else
usr << "\red You must be closer to the [src]!"
else else
BeginScan() BeginScan()
..() ..()
updateDialog() 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

View File

@@ -1,6 +1,46 @@
obj/machinery/anomaly/accelerator obj/machinery/anomaly/accelerator
name = "Accelerator Spectrometer" name = "Accelerator spectrometer"
desc = "A specialised, complex analysis machine." desc = "A specialised, complex analysis machine."
icon = 'virology.dmi' icon = 'virology.dmi'
icon_state = "analyser" 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): <br><br>"
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.<br>"
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.<br>"
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.<br>"
else
var/displayed_age = scanned_sample.age + max(scanned_sample.age * ((1 - accuracy) * (8 * rand() - 4)), 0)
results += "[displayed_age] years.<br>"
results += "<br>Warning, results only valid for ages on the scale of billions of years."
return results

View File

@@ -12,25 +12,30 @@ obj/machinery/anomaly/fourier_transform/ScanResults()
var/carrier var/carrier
var/num_reagents = 0 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 var/datum/reagent/R = A
if(istype(R,datum/reagent/density_separated_liquid)) if(istype(R, /datum/reagent/analysis_sample))
scanned_sample = R.data
else if(istype(R,datum/reagent/analysis_sample))
scanned_sample = R.data scanned_sample = R.data
else else
carrier = R.type carrier = R.id
num_reagents++ num_reagents++
if(num_reagents == 2 && scanned_sample && carrier) if(num_reagents == 2 && scanned_sample && carrier)
//all necessary components are present //all necessary components are present
var/specifity = GetResultSpecifity(scanned_sample, carrier) var/specifity = GetResultSpecifity(scanned_sample, carrier)
var/distance = scanned_sample.artifact_distance var/distance = scanned_sample.artifact_distance
if(distance > 0)
var/accuracy = 0.9
if(specifity > 0.6) if(specifity > 0.6)
artifact_distance += rand(-0.1, 0.1) * artifact_distance distance += (0.2 * rand() - 0.1) * distance
else else
var/offset = 1 - specifity var/offset = 1 - specifity
artifact_distance += rand(-offset, offset) * artifact_distance distance += distance * rand(-100 * offset, 100 * offset) / 100
results = "Anomalous energy absorption through carrier ([carrier.id]) indicates emission radius: [artifact_distance]" 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 += "<br>Warning, analysis may be contaminated by high quantities of molecular carrier present throughout sample."
else
results = "Standard energy dispersion detected throughout sample."
return results return results

View File

@@ -1,6 +1,6 @@
obj/machinery/anomaly/gas_chromatography obj/machinery/anomaly/gas_chromatography
name = "Gas Chromatography Spectrometer" name = "Gas Chromatography spectrometer"
desc = "A specialised, complex analysis machine." desc = "A specialised, complex analysis machine."
icon = 'virology.dmi' icon = 'virology.dmi'
icon_state = "analyser" icon_state = "analyser"
@@ -12,69 +12,32 @@ obj/machinery/anomaly/gas_chromatography/ScanResults()
var/carrier var/carrier
var/num_reagents = 0 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 var/datum/reagent/R = A
if(istype(R,datum/reagent/density_separated_liquid)) if(istype(R, /datum/reagent/analysis_sample))
scanned_sample = R.data
else if(istype(R,datum/reagent/analysis_sample))
scanned_sample = R.data scanned_sample = R.data
else else
carrier = R.type carrier = R.id
num_reagents++ num_reagents++
if(num_reagents == 2 && scanned_sample && carrier) if(num_reagents == 2 && scanned_sample)
//all necessary components are present
results = "Carrier ([carrier.id]) specifity: [GetResultSpecifity(scanned_sample, carrier)]" 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):<br><br>"
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] + "<br>"
num_found++
if(!num_found)
results = "Chromatography partitioning results over carrier ([carrier]) to determine elemental makeup were inconclusive.<br>"
if(!carrier)
results += "<br>No carrier detected, scan accuracy affected.<br>"
return results 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

View File

@@ -1,6 +1,31 @@
obj/machinery/anomaly/hyperspectral obj/machinery/anomaly/hyperspectral
name = "Hypospectral Imager" name = "Hyperspectral Imager"
desc = "A specialised, complex analysis machine." desc = "A specialised, complex analysis machine."
icon = 'virology.dmi' icon = 'icons/obj/computer.dmi'
icon_state = "analyser" 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]):<br>"
results += "<img src=\"http://i.imgur.com/YAcOE.jpg\"></img><br>"
if(scanned_sample.artifact_id && prob(specifity * 100))
results += "Anomalous exotic energy signature detected: [scanned_sample.artifact_id]."
return results

View File

@@ -4,3 +4,33 @@ obj/machinery/anomaly/ion_mobility
desc = "A specialised, complex analysis machine." desc = "A specialised, complex analysis machine."
icon = 'virology.dmi' icon = 'virology.dmi'
icon_state = "analyser" 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:<br><br>"
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]%<br>"
found++
if(!found)
results = "Kinetic analysis on sample's ionic residue in carrier ([carrier]) to determine composition were inconclusive."
return results

View File

@@ -1,6 +0,0 @@
obj/machinery/anomaly/radiometric
name = "Isotope ratio spectrometre"
desc = "A specialised, complex analysis machine."
icon = 'virology.dmi'
icon_state = "analyser"

View File

@@ -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

View File

@@ -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 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 = 0 //age can correspond to different archaeological finds
var/age_thousand = 0 var/age_thousand = 0
var/age_million = 0 var/age_million = 0
var/age_billion = 0 var/age_billion = 0
var/artifact_id = "" //id of a nearby artifact, if there is one var/artifact_id = "" //id of a nearby artifact, if there is one
var/artifact_distance = 0 //proportional to distance var/artifact_distance = -1 //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/source_mineral 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) datum/geosample/New(var/turf/simulated/mineral/container)
UpdateTurf(container) UpdateTurf(container)
artifact_distance = rand(500,999999)
//this should only need to be called once //this should only need to be called once
datum/geosample/proc/UpdateTurf(var/turf/simulated/mineral/container) datum/geosample/proc/UpdateTurf(var/turf/simulated/mineral/container)
source_mineral = container.mineralName source_mineral = container.mineralName
age = rand(1,999) age = rand(1,999)
find_presence[FIND_METEORIC] = rand(1,10) / 10
var/comp_remaining = 1 - find_presence[FIND_METEORIC]
switch(container.mineralName) switch(container.mineralName)
if("Uranium") if("Uranium")
age_million = rand(1, 704) age_million = rand(1, 704)
age_thousand = rand(1,999) age_thousand = rand(1,999)
find_presence[FIND_METALLIC] = comp_remaining * (rand(25, 75) / 100)
comp_remaining -= find_presence[FIND_METALLIC]
if("Iron") if("Iron")
age_thousand = rand(1, 999) age_thousand = rand(1, 999)
age_million = 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") if("Diamond")
age_thousand = rand(1,999) age_thousand = rand(1,999)
age_million = 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") if("Gold")
age_thousand = rand(1,999) age_thousand = rand(1,999)
age_million = rand(1,999) age_million = rand(1,999)
age_billion = rand(3,4) age_billion = rand(3,4)
find_presence[FIND_METALLIC] = comp_remaining * (rand(25, 75) / 100)
comp_remaining -= find_presence[FIND_METALLIC]
if("Silver") if("Silver")
age_thousand = rand(1,999) age_thousand = rand(1,999)
age_million = 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") if("Plasma")
age_thousand = rand(1,999) age_thousand = rand(1,999)
age_million = rand(1,999) age_million = rand(1,999)
age_billion = rand(10, 13) age_billion = rand(10, 13)
find_presence[FIND_METALLIC] = comp_remaining * (rand(25, 75) / 100)
comp_remaining -= find_presence[FIND_METALLIC]
if("Clown") if("Clown")
age = rand(-1,-999) //thats_the_joke.mp4 age = rand(-1,-999) //thats_the_joke.mp4
age_thousand = rand(-1,-999) age_thousand = rand(-1,-999)
/*if("Archaeo")
//snowflake
age_thousand = rand(1,999)*/
else else
source_mineral = "Rock" 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

View File

@@ -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