diff --git a/baystation12.dme b/baystation12.dme index ce69add117c..9063b0fda61 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -1304,6 +1304,7 @@ #include "code\modules\research\xenoarchaeology\artifact_harvester.dm" #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\core_sampler.dm" #include "code\modules\research\xenoarchaeology\finds.dm" #include "code\modules\research\xenoarchaeology\geosample.dm" diff --git a/code/modules/mining/mine_turfs.dm b/code/modules/mining/mine_turfs.dm index 7285b4628b0..192446d262b 100644 --- a/code/modules/mining/mine_turfs.dm +++ b/code/modules/mining/mine_turfs.dm @@ -16,6 +16,7 @@ var/spreadChance = 0 //the percentual chance of an ore spreading to the neighbouring tiles var/artifactChance = 0.3 //percent chance to spawn a xenoarchaelogical artifact var/last_act = 0 + var/datum/geosample/geological_data /turf/simulated/mineral/Del() return @@ -54,6 +55,9 @@ if (T) T.overlays += image('icons/turf/walls.dmi', "rock_side_e", layer=6) + src.geological_data = new /datum/geosample + src.geological_data.UpdateTurf(src) + if (mineralName && mineralAmt && spread && spreadChance) if(prob(spreadChance)) if(istype(get_step(src, SOUTH), /turf/simulated/mineral/random)) @@ -102,6 +106,9 @@ if(M) src = M M.levelupdate() + if(!geological_data) + src.geological_data = new /datum/geosample + src.geological_data.UpdateTurf(src) else if (prob(artifactChance)) //spawn a rare, xeno-arch artifact here new/obj/machinery/artifact(src) @@ -220,6 +227,11 @@ usr << "\red You don't have the dexterity to do this!" return + if (istype(W, /obj/item/device/core_sampler)) + var/obj/item/device/core_sampler/C = W + C.sample_item(src, user) + return + if (istype(W, /obj/item/weapon/pickaxe)) var/turf/T = user.loc if (!( istype(T, /turf) )) @@ -250,27 +262,34 @@ if ((src.mineralName != "") && (src.mineralAmt > 0) && (src.mineralAmt < 11)) var/i for (i=0;i= beaker.reagents.maximum_volume) @@ -1061,6 +1064,20 @@ break remove_object(O) + //xenoarch + for(var/obj/item/weapon/rocksliver/O in holdingitems) + if (beaker.reagents.total_volume >= beaker.reagents.maximum_volume) + break + var/allowed = get_allowed_by_id(O) + for (var/r_id in allowed) + var/space = beaker.reagents.maximum_volume - beaker.reagents.total_volume + var/amount = allowed[r_id] + beaker.reagents.add_reagent(r_id,min(amount, space), O.geological_data) + + if (beaker.reagents.total_volume >= beaker.reagents.maximum_volume) + break + remove_object(O) + //Everything else - Transfers reagents from it into beaker for (var/obj/item/weapon/reagent_containers/O in holdingitems) if (beaker.reagents.total_volume >= beaker.reagents.maximum_volume) diff --git a/code/modules/reagents/Chemistry-Recipes.dm b/code/modules/reagents/Chemistry-Recipes.dm index b1e972b502d..0c849879d05 100644 --- a/code/modules/reagents/Chemistry-Recipes.dm +++ b/code/modules/reagents/Chemistry-Recipes.dm @@ -13,6 +13,8 @@ datum var/result_amount = 0 var/secondary = 0 // set to nonzero if secondary reaction + var/list/secondary_results = list() //additional reagents produced by the reaction + var/requires_heating = 0 proc on_reaction(var/datum/reagents/holder, var/created_volume) diff --git a/code/modules/reagents/reagent_containers/glass.dm b/code/modules/reagents/reagent_containers/glass.dm index 3a89cef6dd4..5f2db222668 100644 --- a/code/modules/reagents/reagent_containers/glass.dm +++ b/code/modules/reagents/reagent_containers/glass.dm @@ -83,6 +83,10 @@ 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(reagents.total_volume) user << "\blue You splash the solution onto [target]." src.reagents.reaction(target, TOUCH) diff --git a/code/modules/research/xenoarchaeology/archaeo_chem.dm b/code/modules/research/xenoarchaeology/archaeo_chem.dm index 4b81fd774b1..a39120e7864 100644 --- a/code/modules/research/xenoarchaeology/archaeo_chem.dm +++ b/code/modules/research/xenoarchaeology/archaeo_chem.dm @@ -1,6 +1,5 @@ //chemistry stuff here so that it can be easily viewed/modified -/* datum reagent tungsten //used purely to make lith-sodi-tungs @@ -20,18 +19,18 @@ datum ground_rock name = "Ground Rock" id = "ground_rock" - description = "A fine dust made of ground up geological samples." + 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 = "Density separated sample" + name = "Analysis sample" id = "density_separated_sample" - description = "A watery paste which has had density separation applied to its contents." + description = "A watery paste used in chemical analysis." reagent_state = LIQUID color = "#C81040" //rgb: 200, 16, 64 - //todo: make this white + //todo: make this browny-white analysis_sample name = "Analysis sample" @@ -57,6 +56,7 @@ datum result = "lithiumsodiumtungstate" required_reagents = list("lithium" = 1, "sodium" = 2, "tungsten" = 1, "oxygen" = 4) result_amount = 8 + requires_heating = 1 density_separated_liquid name = "Density separated sample" @@ -74,4 +74,3 @@ datum required_reagents = list("density_separated_sample" = 5) result_amount = 4 requires_heating = 1 -*/ \ No newline at end of file diff --git a/code/modules/research/xenoarchaeology/bunsen_burner.dm b/code/modules/research/xenoarchaeology/bunsen_burner.dm new file mode 100644 index 00000000000..bbb3d0c9c94 --- /dev/null +++ b/code/modules/research/xenoarchaeology/bunsen_burner.dm @@ -0,0 +1,58 @@ + +/obj/machinery/bunsen_burner + name = "bunsen burner" + desc = "A flat, self-heating device designed for bringing chemical mixtures to boil." + icon = 'icons/obj/device.dmi' + icon_state = "bunsen0" + var/heating = 0 //whether the bunsen is turned on + var/heated = 0 //whether the bunsen has been on long enough to let stuff react + var/obj/item/weapon/reagent_containers/held_container + var/heat_time = 50 + +/obj/machinery/bunsen_burner/attackby(obj/item/weapon/W as obj, mob/user as mob) + if(istype(W, /obj/item/weapon/reagent_containers)) + if(held_container) + user << "\red You must remove the [held_container] first." + else + user.drop_item(src) + held_container = W + held_container.loc = src + user << "\blue You put the [held_container] onto the [src]." + var/image/I = image("icon"=W, "layer"=FLOAT_LAYER) + underlays += I + if(heating) + spawn(heat_time) + try_heating() + else + user << "\red You can't put the [W] onto the [src]." + + + +/obj/machinery/bunsen_burner/attack_hand(mob/user as mob) + if(held_container) + underlays = null + user << "\blue You remove the [held_container] from the [src]." + held_container.loc = src.loc + held_container.attack_hand(user) + held_container = null + else + user << "\red There is nothing on the [src]." + +/obj/machinery/bunsen_burner/proc/try_heating() + if(held_container && heating) + heated = 1 + held_container.reagents.handle_reactions() + heated = 0 + spawn(heat_time) + try_heating() + +/obj/machinery/bunsen_burner/verb/toggle() + set src in oview(1) + set name = "Toggle bunsen burner" + set category = "IC" + + heating = !heating + icon_state = "bunsen[heating]" + if(heating) + spawn(heat_time) + try_heating() diff --git a/code/modules/research/xenoarchaeology/core_sampler.dm b/code/modules/research/xenoarchaeology/core_sampler.dm index c9adaf51af1..b123fed02e1 100644 --- a/code/modules/research/xenoarchaeology/core_sampler.dm +++ b/code/modules/research/xenoarchaeology/core_sampler.dm @@ -1,18 +1,15 @@ //device to take core samples from mineral turfs - used for various types of analysis -/obj/item/weapon/storage/samplebag - name = "sample bag" - desc = "A geological sample bag." - icon_state = "evidenceobj" - w_class = 1 - max_w_class = 1 - max_combined_w_class = 7 - storage_slots = 7 - -////////////////////////////////////////////////////////////////// - -/turf/simulated/mineral - var/datum/geosample/geological_data +/obj/item/weapon/storage/box/samplebags + name = "sample bag box" + desc = "A box claiming to contain sample bags." + New() + for(var/i=0, i<7, i++) + var/obj/item/weapon/evidencebag/S = new(src) + S.name = "sample bag" + S.desc = "a bag for holding research samples." + ..() + return ////////////////////////////////////////////////////////////////// @@ -27,43 +24,76 @@ //slot_flags = SLOT_BELT var/sampled_turf = "" var/num_stored_bags = 10 - var/obj/item/weapon/storage/samplebag/filled_bag - -/obj/item/device/core_sampler/attack_hand(var/mob/user) - user << "\blue The core sampler is [sampled_turf ? "full" : "empty"], and has [num_stored_bags] sample bag[num_stored_bags != 1] remaining." - -/obj/item/device/core_sampler/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(istype(W,/obj/item/weapon/storage/samplebag)) - if(num_stored_bags < 10) - del(W) - num_stored_bags += 1 - user << "\blue You insert the sample bag into the core sampler." - else - user << "\red The core sampler can not fit any more sample bags!" - else - return ..() - -/obj/item/device/core_sampler/proc/sample_turf(var/turf/simulated/mineral/T, var/mob/user as mob) - if(filled_bag) - user << "\red The core sampler is full!" - else if(num_stored_bags < 1) - user << "\red The core sampler is out of sample bags!" - else - filled_bag = new /obj/item/weapon/storage/samplebag(src) - icon_state = "sampler1" - - for(var/i=0, i<7, i++) - var/obj/item/weapon/rocksliver/R = new(filled_bag) - R.source_rock = T.type - R.geological_data = T.geological_data - - user << "\blue You take a core sample of the [T]." + var/obj/item/weapon/evidencebag/filled_bag /obj/item/device/core_sampler/examine() if (!( usr )) return if(get_dist(src, usr) < 2) usr << "That's \a [src]." - usr << "\blue Used to extract geological core samples - this one is [sampled_turf ? "full" : "empty"], and has [num_stored_bags] sample bag[num_stored_bags != 1] remaining." + usr << "\blue Used to extract geological core samples - this one is [sampled_turf ? "full" : "empty"], and has [num_stored_bags] bag[num_stored_bags != 1 ? "s" : ""] remaining." else return ..() + +/obj/item/device/core_sampler/attackby(obj/item/weapon/W as obj, mob/user as mob) + if(istype(W,/obj/item/weapon/evidencebag)) + if(num_stored_bags < 10) + del(W) + num_stored_bags += 1 + user << "\blue You insert the [W] into the core sampler." + else + user << "\red The core sampler can not fit any more bags!" + else + return ..() + +/obj/item/device/core_sampler/proc/sample_item(var/item_to_sample, var/mob/user as mob) + var/datum/geosample/geo_data + if(istype(item_to_sample, /turf/simulated/mineral)) + var/turf/simulated/mineral/T = item_to_sample + geo_data = T.geological_data + else if(istype(item_to_sample, /obj/item/weapon/ore)) + var/obj/item/weapon/ore/O = item_to_sample + geo_data = O.geological_data + + if(geo_data) + if(filled_bag) + user << "\red The core sampler is full!" + else if(num_stored_bags < 1) + user << "\red The core sampler is out of sample bags!" + else + //create a new sample bag which we'll fill with rock samples + filled_bag = new /obj/item/weapon/evidencebag(src) + filled_bag.name = "sample bag" + filled_bag.desc = "a bag for holding research samples." + + icon_state = "sampler1" + num_stored_bags-- + + //put in a rock sliver + var/obj/item/weapon/rocksliver/R = new() + R.geological_data = geo_data + R.loc = filled_bag + + //update the sample bag + filled_bag.icon_state = "evidence" + var/image/I = image("icon"=R, "layer"=FLOAT_LAYER) + filled_bag.underlays += I + filled_bag.w_class = 1 + + user << "\blue You take a core sample of the [item_to_sample]." + else + user << "\red You are unable to take a sample of [item_to_sample]." + +/obj/item/device/core_sampler/attack_self() + if(filled_bag) + usr << "\blue You eject the full sample bag." + var/success = 0 + if(istype(src.loc, /mob)) + var/mob/M = src.loc + success = M.put_in_inactive_hand(filled_bag) + if(!success) + filled_bag.loc = get_turf(src) + filled_bag = null + icon_state = "sampler0" + else + usr << "\red The core sampler is empty." diff --git a/code/modules/research/xenoarchaeology/finds.dm b/code/modules/research/xenoarchaeology/finds.dm index 4e448e8518e..082f20ebb32 100644 --- a/code/modules/research/xenoarchaeology/finds.dm +++ b/code/modules/research/xenoarchaeology/finds.dm @@ -1,4 +1,4 @@ -//original code and idea from Alfie275 (luna) and ISaidNo (goon) - with thanks +//original code and idea from Alfie275 (luna era) and ISaidNo (goonservers) - with thanks @@ -11,13 +11,14 @@ desc = "It looks extremely delicate." icon = 'mining.dmi' icon_state = "sliver0" //0-4 + w_class = 1 //item_state = "electronic" var/source_rock = "/turf/simulated/mineral/archaeo" item_state = "" var/datum/geosample/geological_data /obj/item/weapon/rocksliver/New() - icon_state = "sliver[rand(0,4)]" + icon_state = "ore2"//"sliver[rand(0,4)]" @@ -25,10 +26,6 @@ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // strange rocks -/obj/item/weapon/ore/strangerock - var/datum/geosample/geological_data - var/source_rock = "/turf/simulated/mineral" - /obj/item/weapon/ore/strangerock/New() ..() //var/datum/reagents/r = new/datum/reagents(50) @@ -66,19 +63,7 @@ else if(istype(W,/obj/item/device/core_sampler/)) var/obj/item/device/core_sampler/S = W - if(S.filled_bag) - user << "\red The core sampler is full!" - else if(S.num_stored_bags < 1) - user << "\red The core sampler is out of sample bags!" - else - S.filled_bag = new /obj/item/weapon/storage/samplebag(S) - S.icon_state = "sampler1" - - for(var/i=0, i<7, i++) - var/obj/item/weapon/rocksliver/R = new /obj/item/weapon/rocksliver(S.filled_bag) - R.source_rock = src.source_rock - R.geological_data = src.geological_data - user << "\blue You take a core sample of the [src]." + S.sample_item(src, user) /*Code does not work, likely due to removal/change of acid_act proc //Strange rocks currently melt to gooey grey w/ acid application (see reactions) diff --git a/code/modules/research/xenoarchaeology/geosample.dm b/code/modules/research/xenoarchaeology/geosample.dm index cf45b88b24b..a3d64309464 100644 --- a/code/modules/research/xenoarchaeology/geosample.dm +++ b/code/modules/research/xenoarchaeology/geosample.dm @@ -2,20 +2,24 @@ datum/geosample var/scrambled = 0 //if this sample has been mixed with other samples // - var/age_thousand = 1 //age can correspond to different artifacts + var/age = 0 + var/age_thousand = 0 //age can correspond to different artifacts var/age_million = 0 var/age_billion = 0 var/artifact_id = "" //id of a nearby artifact, if there is one var/artifact_strength = 0 //proportional to distance var/responsive_reagent = "" ///each reagent corresponds to a different type of find var/reagent_response = "" //likelihood of there being finds there + // + var/source_mineral datum/geosample/New(var/turf/simulated/mineral/container) UpdateTurf(container) //this function should only be called once. it's here just in case datum/geosample/proc/UpdateTurf(var/turf/simulated/mineral/container) - src = null + source_mineral = container.mineralName + age = rand(1,999) switch(container.mineralName) if("Uranium") age_million = rand(1, 704) @@ -37,6 +41,11 @@ datum/geosample/proc/UpdateTurf(var/turf/simulated/mineral/container) age_thousand = rand(1,999) age_million = rand(1,999) age_billion = rand(10, 13) - if("Archaeo") + if("Clown") + age = rand(-1,-999) + age_thousand = rand(-1,-999) + /*if("Archaeo") //snowflake - age_thousand = rand(1,999) + age_thousand = rand(1,999)*/ + else + source_mineral = "Rock" diff --git a/icons/obj/device.dmi b/icons/obj/device.dmi index e57a75e0525..1104878db8e 100644 Binary files a/icons/obj/device.dmi and b/icons/obj/device.dmi differ