mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-01-02 05:23:01 +00:00
cleanup and standardisation of xenoarchaeology analysis machinery
Signed-off-by: Cael_Aislinn <cael_aislinn@yahoo.com.au>
This commit is contained in:
@@ -18,26 +18,23 @@ obj/machinery/anomaly/accelerator/ScanResults()
|
||||
num_reagents++
|
||||
|
||||
if(num_reagents == 2 && scanned_sample && carrier_name)
|
||||
var/accuracy = GetResultSpecifity(scanned_sample, carrier_name)
|
||||
accuracy += 0.5 * (1 - accuracy) / scanned_sample.total_spread
|
||||
if(!accuracy)
|
||||
accuracy = rand(0.01, 0.5)
|
||||
results = "Kinetic acceleration of carrier ([carrier_name]) indicates age ([100 * accuracy]% accuracy): <br><br>"
|
||||
var/specifity = GetResultSpecifity(scanned_sample, carrier_name)
|
||||
results = "Kinetic acceleration of carrier ([carrier_name]) indicates age ([100 * specifity]% 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)
|
||||
var/displayed_age_millions = scanned_sample.age_million + max(scanned_sample.age_million * ((1 - specifity) * (2 * rand() - 1)), 0)
|
||||
var/displayed_age_billions = scanned_sample.age_billion + max(scanned_sample.age_billion * ((1 - specifity) * (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_thousand * ((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)
|
||||
var/displayed_age_thousands = scanned_sample.age_thousand + max(scanned_sample.age_thousand * ((1 - specifity) * (4 * rand() - 2)), 0)
|
||||
var/displayed_age_millions = scanned_sample.age_million + max(scanned_sample.age_million * ((1 - specifity) * (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)
|
||||
var/displayed_age = scanned_sample.age + max(scanned_sample.age * ((1 - specifity) * (8 * rand() - 4)), 0)
|
||||
var/displayed_age_thousands = scanned_sample.age_thousand + max(scanned_sample.age * ((1 - specifity) * (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)
|
||||
var/displayed_age = scanned_sample.age + max(scanned_sample.age * ((1 - specifity) * (8 * rand() - 4)), 0)
|
||||
results += "[displayed_age] years.<br>"
|
||||
|
||||
results += "<br>Warning, results only valid for ages on the scale of billions of years."
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
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 += "[fuel_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 += "[held_container ? "<A href='?src=\ref[src];begin=1'>Begin scanning</a>" : ""]"
|
||||
dat += "<hr>"
|
||||
dat += "<A href='?src=\ref[src];refresh=1'>Refresh</a><BR>"
|
||||
@@ -130,7 +130,7 @@ obj/machinery/anomaly/attackby(obj/item/weapon/W as obj, mob/living/user as mob)
|
||||
held_container.loc = src
|
||||
updateDialog()
|
||||
|
||||
else if(istype(W, /obj/item/weapon/tank))
|
||||
/*else if(istype(W, /obj/item/weapon/tank))
|
||||
//var/obj/item/weapon/reagent_containers/glass/G = W
|
||||
if(fuel_container)
|
||||
user << "\red You must remove the [fuel_container] first."
|
||||
@@ -139,7 +139,7 @@ obj/machinery/anomaly/attackby(obj/item/weapon/W as obj, mob/living/user as mob)
|
||||
user.drop_item(W)
|
||||
fuel_container.loc = src
|
||||
fuel_container = W
|
||||
updateDialog()
|
||||
updateDialog()*/
|
||||
else
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -19,16 +19,11 @@ obj/machinery/anomaly/fourier_transform/ScanResults()
|
||||
|
||||
if(num_reagents == 2 && scanned_sample && carrier)
|
||||
//all necessary components are present
|
||||
var/accuracy = GetResultSpecifity(scanned_sample, carrier)
|
||||
var/specifity = GetResultSpecifity(scanned_sample, carrier)
|
||||
var/distance = scanned_sample.artifact_distance
|
||||
if(distance > 0)
|
||||
if(prob(accuracy))
|
||||
distance += (2 * rand() - 1) * distance * 0.05
|
||||
accuracy = 0.95 + 0.05 * (2 * rand() - 1)
|
||||
else
|
||||
var/offset = 1 - accuracy
|
||||
distance += (2 * rand() - 1) * distance * offset
|
||||
results = "Fourier transform analysis on anomalous energy absorption through carrier ([carrier]) indicates source located inside emission radius ([100 * accuracy]% accuracy): [distance]."
|
||||
distance += (2 * rand() - 1) * distance * 0.05
|
||||
results = "Fourier transform analysis on anomalous energy absorption through carrier ([carrier]) indicates source located inside emission radius ([95 * specifity]% accuracy): [distance]."
|
||||
else
|
||||
results = "Energy dispersion detected throughout sample consistent with background readings.<br>"
|
||||
if(carrier == scanned_sample.source_mineral)
|
||||
|
||||
@@ -18,16 +18,13 @@ obj/machinery/anomaly/gas_chromatography/ScanResults()
|
||||
num_reagents++
|
||||
|
||||
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):<br><br>"
|
||||
var/specifity = GetResultSpecifity(scanned_sample, carrier)
|
||||
results = "Chromatography partitioning analysis over carrier ([carrier]) indicates the following elements present ([100 * specifity]% 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)) ))
|
||||
if(find && prob(100 * specifity))
|
||||
results += " - " + finds_as_strings[index] + "<br>"
|
||||
num_found++
|
||||
|
||||
|
||||
Reference in New Issue
Block a user