mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-13 11:43:31 +00:00
fixed xenoarch chemical analysis, added icons for excavation picks, various misc tweaks
Signed-off-by: Cael_Aislinn <cael_aislinn@yahoo.com.au>
This commit is contained in:
@@ -230,6 +230,15 @@ datum
|
||||
continue
|
||||
|
||||
var/datum/chemical_reaction/C = reaction
|
||||
|
||||
//check if this recipe needs to be heated to mix
|
||||
if(C.requires_heating)
|
||||
if(istype(my_atom.loc, /obj/machinery/bunsen_burner))
|
||||
if(!my_atom.loc:heated)
|
||||
continue
|
||||
else
|
||||
continue
|
||||
|
||||
var/total_required_reagents = C.required_reagents.len
|
||||
var/total_matching_reagents = 0
|
||||
var/total_required_catalysts = C.required_catalysts.len
|
||||
@@ -276,11 +285,25 @@ datum
|
||||
for(var/B in C.required_reagents)
|
||||
remove_reagent(B, (multiplier * C.required_reagents[B]), safety = 1)
|
||||
|
||||
//try and grab any data so we can preserve it across reactions
|
||||
//added for xenoarchaeology, might be useful for other things
|
||||
var/preserved_data = null
|
||||
for(var/B in src.reagent_list)
|
||||
if(!preserved_data)
|
||||
var/temp_data = get_data(B)
|
||||
if(temp_data)
|
||||
preserved_data = temp_data
|
||||
|
||||
var/created_volume = C.result_amount*multiplier
|
||||
if(C.result)
|
||||
feedback_add_details("chemical_reaction","[C.result]|[C.result_amount*multiplier]")
|
||||
multiplier = max(multiplier, 1) //this shouldnt happen ...
|
||||
add_reagent(C.result, C.result_amount*multiplier)
|
||||
set_data(C.result, preserved_data)
|
||||
|
||||
//add secondary products
|
||||
for(var/S in C.secondary_results)
|
||||
add_reagent(S, C.result_amount * C.secondary_results[S] * multiplier)
|
||||
|
||||
var/list/seen = viewers(4, get_turf(my_atom))
|
||||
for(var/mob/M in seen)
|
||||
@@ -490,6 +513,21 @@ datum
|
||||
|
||||
return res
|
||||
|
||||
//two helper functions to preserve data across reactions (needed for xenoarch)
|
||||
get_data(var/reagent_id)
|
||||
for(var/R in reagent_list)
|
||||
var/datum/reagent/D = reagent_list[R]
|
||||
if(D.id == reagent_id)
|
||||
//world << "proffering a data-carrying reagent ([reagent_id])"
|
||||
return D.data
|
||||
|
||||
set_data(var/reagent_id, var/new_data)
|
||||
for(var/R in reagent_list)
|
||||
var/datum/reagent/D = reagent_list[R]
|
||||
if(D.id == reagent_id)
|
||||
//world << "reagent data set ([reagent_id])"
|
||||
D.data = new_data
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
var/recharged = 0
|
||||
var/list/dispensable_reagents = list("hydrogen","lithium","carbon","nitrogen","oxygen","fluorine",
|
||||
"sodium","aluminum","silicon","phosphorus","sulfur","chlorine","potassium","iron",
|
||||
"copper","mercury","radium","water","ethanol","sugar","sacid")
|
||||
"copper","mercury","radium","water","ethanol","sugar","sacid","tungsten")
|
||||
|
||||
/obj/machinery/chem_dispenser/proc/recharge()
|
||||
if(stat & (BROKEN|NOPOWER)) return
|
||||
@@ -743,6 +743,9 @@
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/wheat = list("flour" = -5),
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/cherries = list("cherryjelly" = 0),
|
||||
|
||||
//archaeology!
|
||||
/obj/item/weapon/rocksliver = list("ground_rock" = 50),
|
||||
|
||||
|
||||
|
||||
//All types that you can put into the grinder to transfer the reagents to the beaker. !Put all recipes above this.!
|
||||
@@ -1070,6 +1073,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)
|
||||
|
||||
@@ -480,7 +480,7 @@ datum
|
||||
var/location = get_turf(holder.my_atom)
|
||||
new /obj/item/stack/sheet/mineral/plasma(location)
|
||||
return
|
||||
|
||||
|
||||
virus_food
|
||||
name = "Virus Food"
|
||||
id = "virusfood"
|
||||
|
||||
Reference in New Issue
Block a user