Merge pull request #13178 from lolman360/plumb
[READY] ports plumbing (no more waiting for tgui4)
This commit is contained in:
@@ -1165,3 +1165,9 @@
|
||||
random_reagents += R
|
||||
var/picked_reagent = pick(random_reagents)
|
||||
return picked_reagent
|
||||
|
||||
/proc/get_chem_id(chem_name)
|
||||
for(var/X in GLOB.chemical_reagents_list)
|
||||
var/datum/reagent/R = GLOB.chemical_reagents_list[X]
|
||||
if(ckey(chem_name) == ckey(lowertext(R.name)))
|
||||
return X
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#define PILL_STYLE_COUNT 22 //Update this if you add more pill icons or you die
|
||||
#define RANDOM_PILL_STYLE 22 //Dont change this one though
|
||||
|
||||
/obj/machinery/chem_master
|
||||
name = "ChemMaster 3000"
|
||||
|
||||
@@ -36,6 +36,14 @@
|
||||
for(var/obj/item/stock_parts/matter_bin/B in component_parts)
|
||||
reagents.maximum_volume += REAGENTS_BASE_VOLUME * B.rating
|
||||
|
||||
/obj/machinery/smoke_machine/ComponentInitialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/simple_rotation, ROTATION_ALTCLICK | ROTATION_CLOCKWISE | ROTATION_COUNTERCLOCKWISE | ROTATION_VERBS, null, CALLBACK(src, .proc/can_be_rotated))
|
||||
AddComponent(/datum/component/plumbing/simple_demand) //this SURELY CANT' LEAD TO BAD THINGS HAPPENING.
|
||||
|
||||
/obj/machinery/smoke_machine/proc/can_be_rotated(mob/user, rotation_type)
|
||||
return !anchored
|
||||
|
||||
/obj/machinery/smoke_machine/update_icon_state()
|
||||
if((!is_operational()) || (!on) || (reagents.total_volume == 0))
|
||||
if (panel_open)
|
||||
|
||||
@@ -8,6 +8,7 @@ GLOBAL_LIST_INIT(name2reagent, build_name2reagent())
|
||||
if (length(initial(R.name)))
|
||||
.[ckey(initial(R.name))] = t
|
||||
|
||||
|
||||
//Various reagents
|
||||
//Toxin & acid reagents
|
||||
//Hydroponics stuff
|
||||
@@ -52,6 +53,14 @@ GLOBAL_LIST_INIT(name2reagent, build_name2reagent())
|
||||
var/metabolizing = FALSE
|
||||
var/chemical_flags // See fermi/readme.dm REAGENT_DEAD_PROCESS, REAGENT_DONOTSPLIT, REAGENT_ONLYINVERSE, REAGENT_ONMOBMERGE, REAGENT_INVISIBLE, REAGENT_FORCEONNEW, REAGENT_SNEAKYNAME
|
||||
var/value = REAGENT_VALUE_NONE //How much does it sell for in cargo?
|
||||
var/datum/material/material //are we made of material?
|
||||
|
||||
/datum/reagent/New()
|
||||
. = ..()
|
||||
|
||||
if(material)
|
||||
material = SSmaterials.GetMaterialRef(material)
|
||||
|
||||
|
||||
/datum/reagent/Destroy() // This should only be called by the holder, so it's already handled clearing its references
|
||||
. = ..()
|
||||
@@ -220,4 +229,3 @@ GLOBAL_LIST_INIT(name2reagent, build_name2reagent())
|
||||
bloodsuckerdatum.handle_eat_human_food(disgust, blood_puke, force)
|
||||
if(blood_change)
|
||||
bloodsuckerdatum.AddBloodVolume(blood_change)
|
||||
|
||||
|
||||
@@ -515,12 +515,13 @@
|
||||
overdose_threshold = 30
|
||||
pH = 2
|
||||
value = REAGENT_VALUE_UNCOMMON
|
||||
var/healing = 0.5
|
||||
|
||||
/datum/reagent/medicine/omnizine/on_mob_life(mob/living/carbon/M)
|
||||
M.adjustToxLoss(-0.5*REM, 0)
|
||||
M.adjustOxyLoss(-0.5*REM, 0)
|
||||
M.adjustBruteLoss(-0.5*REM, 0)
|
||||
M.adjustFireLoss(-0.5*REM, 0)
|
||||
M.adjustToxLoss(-healing*REM, 0)
|
||||
M.adjustOxyLoss(-healing*REM, 0)
|
||||
M.adjustBruteLoss(-healing*REM, 0)
|
||||
M.adjustFireLoss(-healing*REM, 0)
|
||||
..()
|
||||
. = 1
|
||||
|
||||
@@ -532,6 +533,12 @@
|
||||
..()
|
||||
. = 1
|
||||
|
||||
/datum/reagent/medicine/omnizine/protozine
|
||||
name = "Protozine"
|
||||
description = "A less environmentally friendly and somewhat weaker variant of omnizine."
|
||||
color = "#d8c7b7"
|
||||
healing = 0.2
|
||||
|
||||
/datum/reagent/medicine/calomel
|
||||
name = "Calomel"
|
||||
description = "Quickly purges the body of all chemicals. Toxin damage is dealt if the patient is in good condition."
|
||||
|
||||
@@ -313,6 +313,13 @@
|
||||
metabolization_rate = 45 * REAGENTS_METABOLISM
|
||||
. = 1
|
||||
|
||||
/datum/reagent/water/hollowwater
|
||||
name = "Hollow Water"
|
||||
description = "An ubiquitous chemical substance that is composed of hydrogen and oxygen, but it looks kinda hollow."
|
||||
color = "#88878777"
|
||||
taste_description = "emptyiness"
|
||||
|
||||
|
||||
/datum/reagent/water/holywater
|
||||
name = "Holy Water"
|
||||
description = "Water blessed by some deity."
|
||||
@@ -950,6 +957,7 @@
|
||||
color = "#1C1300" // rgb: 30, 20, 0
|
||||
taste_description = "sour chalk"
|
||||
pH = 5
|
||||
material = /datum/material/diamond
|
||||
|
||||
/datum/reagent/carbon/reaction_turf(turf/T, reac_volume)
|
||||
if(!isspaceturf(T))
|
||||
@@ -1072,6 +1080,7 @@
|
||||
pH = 6
|
||||
overdose_threshold = 30
|
||||
color = "#c2391d"
|
||||
material = /datum/material/iron
|
||||
|
||||
/datum/reagent/iron/on_mob_life(mob/living/carbon/C)
|
||||
if((HAS_TRAIT(C, TRAIT_NOMARROW)))
|
||||
@@ -1103,6 +1112,7 @@
|
||||
reagent_state = SOLID
|
||||
color = "#F7C430" // rgb: 247, 196, 48
|
||||
taste_description = "expensive metal"
|
||||
material = /datum/material/gold
|
||||
|
||||
/datum/reagent/silver
|
||||
name = "Silver"
|
||||
@@ -1110,6 +1120,7 @@
|
||||
reagent_state = SOLID
|
||||
color = "#D0D0D0" // rgb: 208, 208, 208
|
||||
taste_description = "expensive yet reasonable metal"
|
||||
material = /datum/material/silver
|
||||
|
||||
/datum/reagent/silver/reaction_mob(mob/living/M, method=TOUCH, reac_volume)
|
||||
if(M.has_bane(BANE_SILVER))
|
||||
@@ -1123,6 +1134,7 @@
|
||||
color = "#B8B8C0" // rgb: 184, 184, 192
|
||||
taste_description = "the inside of a reactor"
|
||||
pH = 4
|
||||
material = /datum/material/uranium
|
||||
|
||||
/datum/reagent/uranium/on_mob_life(mob/living/carbon/M)
|
||||
M.apply_effect(1/M.metabolism_efficiency,EFFECT_IRRADIATE,0)
|
||||
@@ -1144,6 +1156,7 @@
|
||||
taste_description = "fizzling blue"
|
||||
pH = 12
|
||||
value = REAGENT_VALUE_RARE
|
||||
material = /datum/material/bluespace
|
||||
|
||||
/datum/reagent/bluespace/reaction_mob(mob/living/M, method=TOUCH, reac_volume)
|
||||
if(method == TOUCH || method == VAPOR)
|
||||
@@ -1182,6 +1195,7 @@
|
||||
color = "#A8A8A8" // rgb: 168, 168, 168
|
||||
taste_mult = 0
|
||||
pH = 10
|
||||
material = /datum/material/glass
|
||||
|
||||
/datum/reagent/fuel
|
||||
name = "Welding fuel"
|
||||
@@ -2206,6 +2220,66 @@
|
||||
color = "#f7685e"
|
||||
metabolization_rate = REAGENTS_METABOLISM * 0.25
|
||||
|
||||
/datum/reagent/wittel
|
||||
name = "Wittel"
|
||||
description = "An extremely rare metallic-white substance only found on demon-class planets."
|
||||
color = "#FFFFFF" // rgb: 255, 255, 255
|
||||
taste_mult = 0 // oderless and tasteless
|
||||
|
||||
/datum/reagent/metalgen
|
||||
name = "Metalgen"
|
||||
data = list("material"=null)
|
||||
description = "A purple metal morphic liquid, said to impose it's metallic properties on whatever it touches."
|
||||
color = "#b000aa"
|
||||
taste_mult = 0 // oderless and tasteless
|
||||
var/applied_material_flags = MATERIAL_ADD_PREFIX | MATERIAL_COLOR
|
||||
var/minumum_material_amount = 100
|
||||
|
||||
/datum/reagent/metalgen/reaction_obj(obj/O, volume)
|
||||
metal_morph(O)
|
||||
return
|
||||
|
||||
/datum/reagent/metalgen/reaction_turf(turf/T, volume)
|
||||
metal_morph(T)
|
||||
return
|
||||
|
||||
///turn an object into a special material
|
||||
/datum/reagent/metalgen/proc/metal_morph(atom/A)
|
||||
var/metal_ref = data["material"]
|
||||
if(!metal_ref)
|
||||
return
|
||||
var/metal_amount = 0
|
||||
|
||||
for(var/B in A.custom_materials) //list with what they're made of
|
||||
metal_amount += A.custom_materials[B]
|
||||
|
||||
if(!metal_amount)
|
||||
metal_amount = minumum_material_amount //some stuff doesn't have materials at all. To still give them properties, we give them a material. Basically doesnt exist
|
||||
|
||||
var/list/metal_dat = list()
|
||||
metal_dat[metal_ref] = metal_amount //if we pass the list directly, byond turns metal_ref into "metal_ref" kjewrg8fwcyvf
|
||||
|
||||
A.material_flags = applied_material_flags
|
||||
A.set_custom_materials(metal_dat)
|
||||
|
||||
/datum/reagent/gravitum
|
||||
name = "Gravitum"
|
||||
description = "A rare kind of null fluid, capable of temporalily removing all weight of whatever it touches." //i dont even
|
||||
color = "#050096" // rgb: 5, 0, 150
|
||||
taste_mult = 0 // oderless and tasteless
|
||||
metabolization_rate = 0.1 * REAGENTS_METABOLISM //20 times as long, so it's actually viable to use
|
||||
var/time_multiplier = 1 MINUTES //1 minute per unit of gravitum on objects. Seems overpowered, but the whole thing is very niche
|
||||
|
||||
/datum/reagent/gravitum/reaction_obj(obj/O, volume)
|
||||
O.AddElement(/datum/element/forced_gravity, 0)
|
||||
|
||||
addtimer(CALLBACK(O, .proc/_RemoveElement, /datum/element/forced_gravity, 0), volume * time_multiplier)
|
||||
|
||||
/datum/reagent/gravitum/on_mob_add(mob/living/L)
|
||||
L.AddElement(/datum/element/forced_gravity, 0) //0 is the gravity, and in this case weightless
|
||||
|
||||
/datum/reagent/gravitum/on_mob_end_metabolize(mob/living/L)
|
||||
L.RemoveElement(/datum/element/forced_gravity, 0)
|
||||
|
||||
//body bluids
|
||||
/datum/reagent/consumable/semen
|
||||
@@ -2334,6 +2408,7 @@ datum/reagent/eldritch
|
||||
color = "#E6E6DA"
|
||||
taste_mult = 0
|
||||
|
||||
|
||||
/datum/reagent/hairball
|
||||
name = "Hairball"
|
||||
description = "A bundle of keratinous bits and fibers, not easily digestible."
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
toxpwr = 3
|
||||
pH = 4
|
||||
value = REAGENT_VALUE_RARE //sheets are worth more
|
||||
material = /datum/material/plasma
|
||||
|
||||
/datum/reagent/toxin/plasma/on_mob_life(mob/living/carbon/C)
|
||||
if(holder.has_reagent(/datum/reagent/medicine/epinephrine))
|
||||
|
||||
@@ -219,6 +219,12 @@
|
||||
results = list(/datum/reagent/medicine/strange_reagent = 3)
|
||||
required_reagents = list(/datum/reagent/medicine/omnizine = 1, /datum/reagent/water/holywater = 1, /datum/reagent/toxin/mutagen = 1)
|
||||
|
||||
/datum/chemical_reaction/strange_reagent/alt
|
||||
name = "Strange Reagent"
|
||||
id = /datum/reagent/medicine/strange_reagent
|
||||
results = list(/datum/reagent/medicine/strange_reagent = 2)
|
||||
required_reagents = list(/datum/reagent/medicine/omnizine/protozine = 1, /datum/reagent/water/holywater = 1, /datum/reagent/toxin/mutagen = 1)
|
||||
|
||||
/datum/chemical_reaction/mannitol
|
||||
name = "Mannitol"
|
||||
id = /datum/reagent/medicine/mannitol
|
||||
@@ -345,4 +351,20 @@
|
||||
/datum/chemical_reaction/medmesh/on_reaction(datum/reagents/holder, created_volume)
|
||||
var/location = get_turf(holder.my_atom)
|
||||
for(var/i = 1, i <= created_volume, i++)
|
||||
new /obj/item/stack/medical/mesh/advanced(location)
|
||||
new /obj/item/stack/medical/mesh/advanced(location)
|
||||
|
||||
/datum/chemical_reaction/suture
|
||||
required_reagents = list(/datum/reagent/cellulose = 2, /datum/reagent/medicine/styptic_powder = 2)
|
||||
|
||||
/datum/chemical_reaction/suture/on_reaction(datum/reagents/holder, created_volume)
|
||||
var/location = get_turf(holder.my_atom)
|
||||
for(var/i = 1, i <= created_volume, i++)
|
||||
new /obj/item/stack/medical/suture/(location)
|
||||
|
||||
/datum/chemical_reaction/mesh
|
||||
required_reagents = list(/datum/reagent/cellulose = 2, /datum/reagent/medicine/silver_sulfadiazine = 2)
|
||||
|
||||
/datum/chemical_reaction/mesh/on_reaction(datum/reagents/holder, created_volume)
|
||||
var/location = get_turf(holder.my_atom)
|
||||
for(var/i = 1, i <= created_volume, i++)
|
||||
new /obj/item/stack/medical/mesh/(location)
|
||||
|
||||
@@ -1,3 +1,34 @@
|
||||
/datum/chemical_reaction/metalgen
|
||||
name = "metalgen"
|
||||
id = /datum/reagent/metalgen
|
||||
required_reagents = list(/datum/reagent/wittel = 1, /datum/reagent/bluespace = 1, /datum/reagent/toxin/mutagen = 1)
|
||||
results = list(/datum/reagent/metalgen = 1)
|
||||
|
||||
/datum/chemical_reaction/metalgen_imprint
|
||||
name = "metalgen imprint"
|
||||
id = /datum/reagent/metalgen
|
||||
required_reagents = list(/datum/reagent/metalgen = 1, /datum/reagent/liquid_dark_matter = 1)
|
||||
results = list(/datum/reagent/metalgen = 1)
|
||||
|
||||
/datum/chemical_reaction/holywater
|
||||
name = "Holy Water"
|
||||
id = /datum/reagent/water/holywater
|
||||
results = list(/datum/reagent/water/holywater = 1)
|
||||
required_reagents = list(/datum/reagent/water/hollowwater = 1)
|
||||
required_catalysts = list(/datum/reagent/water/holywater = 1)
|
||||
|
||||
/datum/chemical_reaction/metalgen_imprint/on_reaction(datum/reagents/holder, created_volume)
|
||||
var/datum/reagent/metalgen/MM = holder.get_reagent(/datum/reagent/metalgen)
|
||||
for(var/datum/reagent/R in holder.reagent_list)
|
||||
if(R.material && R.volume >= 40)
|
||||
MM.data["material"] = R.material
|
||||
holder.remove_reagent(R.type, 40)
|
||||
|
||||
/datum/chemical_reaction/gravitum
|
||||
name = "gravitum"
|
||||
id = /datum/reagent/gravitum
|
||||
required_reagents = list(/datum/reagent/wittel = 1, /datum/reagent/sorium = 10)
|
||||
results = list(/datum/reagent/gravitum = 10)
|
||||
|
||||
/datum/chemical_reaction/sterilizine
|
||||
name = "Sterilizine"
|
||||
@@ -711,7 +742,7 @@
|
||||
/datum/chemical_reaction/slime_extractification/on_reaction(datum/reagents/holder, created_volume)
|
||||
var/location = get_turf(holder.my_atom)
|
||||
new /obj/item/slime_extract/grey(location)
|
||||
|
||||
|
||||
// Liquid Carpets
|
||||
|
||||
/datum/chemical_reaction/carpet
|
||||
|
||||
@@ -24,7 +24,8 @@
|
||||
|
||||
/obj/structure/reagent_dispensers/Initialize()
|
||||
create_reagents(tank_volume, DRAINABLE | AMOUNT_VISIBLE)
|
||||
reagents.add_reagent(reagent_id, tank_volume)
|
||||
if(reagent_id)
|
||||
reagents.add_reagent(reagent_id, tank_volume)
|
||||
. = ..()
|
||||
|
||||
/obj/structure/reagent_dispensers/proc/boom()
|
||||
@@ -91,6 +92,38 @@
|
||||
user.put_in_hands(S)
|
||||
paper_cups--
|
||||
|
||||
/obj/structure/reagent_dispensers/plumbed
|
||||
name = "stationairy water tank"
|
||||
anchored = TRUE
|
||||
icon_state = "water_stationairy"
|
||||
desc = "A stationairy, plumbed, water tank."
|
||||
|
||||
/obj/structure/reagent_dispensers/plumbed/wrench_act(mob/living/user, obj/item/I)
|
||||
default_unfasten_wrench(user, I)
|
||||
return TRUE
|
||||
|
||||
/obj/structure/reagent_dispensers/plumbed/default_unfasten_wrench(mob/user, obj/item/I, time = 20)
|
||||
. = ..()
|
||||
if(. == SUCCESSFUL_UNFASTEN)
|
||||
user.visible_message("<span class='notice'>[user.name] [anchored ? "fasten" : "unfasten"] [src]</span>", \
|
||||
"<span class='notice'>You [anchored ? "fasten" : "unfasten"] [src]</span>")
|
||||
var/datum/component/plumbing/CP = GetComponent(/datum/component/plumbing)
|
||||
if(anchored)
|
||||
CP.enable()
|
||||
else
|
||||
CP.disable()
|
||||
|
||||
/obj/structure/reagent_dispensers/plumbed/ComponentInitialize()
|
||||
AddComponent(/datum/component/plumbing/simple_supply)
|
||||
|
||||
/obj/structure/reagent_dispensers/plumbed/storage
|
||||
name = "stationairy storage tank"
|
||||
icon_state = "tank_stationairy"
|
||||
reagent_id = null //start empty
|
||||
|
||||
/obj/structure/reagent_dispensers/plumbed/storage/ComponentInitialize()
|
||||
AddComponent(/datum/component/plumbing/tank)
|
||||
|
||||
//////////////
|
||||
//Fuel Tanks//
|
||||
//////////////
|
||||
@@ -271,5 +304,3 @@
|
||||
icon_state = "bluekeg"
|
||||
reagent_id = /datum/reagent/consumable/ethanol/neurotoxin
|
||||
tank_volume = 100 //2.5x less than the other kegs because it's harder to get
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user