Buncha fixes and QoL stuff. (pH, hypo, heater and dispencer_

This commit is contained in:
Thalpy
2019-06-30 19:16:27 +01:00
parent 538e0fad29
commit 937d6467e6
14 changed files with 126 additions and 51 deletions

View File

@@ -127,7 +127,7 @@ Chemist
backpack = /obj/item/storage/backpack/chemistry
satchel = /obj/item/storage/backpack/satchel/chem
duffelbag = /obj/item/storage/backpack/duffelbag/med
l_hand = /obj/item/FermiChem/pHbooklet
l_hand = /obj/item/fermichem/pHbooklet
chameleon_extras = /obj/item/gun/syringe

View File

@@ -198,7 +198,7 @@
trans_data = copy_data(T)
R.add_reagent(T.id, transfer_amount * multiplier, trans_data, chem_temp, T.purity, pH, no_react = TRUE) //we only handle reaction after every reagent has been transfered.
R.add_reagent(T.id, transfer_amount * multiplier, trans_data, chem_temp, T.purity, pH, no_react = TRUE, ignore_pH = TRUE) //we only handle reaction after every reagent has been transfered.
remove_reagent(T.id, transfer_amount, ignore_pH = TRUE)
@@ -805,7 +805,7 @@
var/obj/item/reagent_containers/RC = my_atom
RC.temp_check()
/datum/reagents/proc/add_reagent(reagent, amount, list/data=null, reagtemp = 300, other_purity = 1, other_pH, no_react = 0)
/datum/reagents/proc/add_reagent(reagent, amount, list/data=null, reagtemp = 300, other_purity = 1, other_pH, no_react = 0, ignore_pH = FALSE)
if(!isnum(amount) || !amount)
return FALSE
@@ -818,7 +818,7 @@
WARNING("[my_atom] attempted to add a reagent called '[reagent]' which doesn't exist. ([usr])")
return FALSE
if (D.id == "water") //Do like an otter, add acid to water.
if (D.id == "water" && no_react == FALSE) //Do like an otter, add acid to water.
if (pH <= 2)
SSblackbox.record_feedback("tally", "fermi_chem", 1, "water-acid explosions")
var/datum/effect_system/smoke_spread/chem/s = new
@@ -858,10 +858,13 @@
chem_temp = thermal_energy / (specific_heat * new_total)
//cacluate reagent based pH shift.
pH = ((cached_pH * cached_total)+(D.pH * amount))/(cached_total + amount)//should be right
if(istype(my_atom, /obj/item/reagent_containers/))
var/obj/item/reagent_containers/RC = my_atom
RC.pH_check()//checks beaker resilience
if(ignore_pH == FALSE)
pH = ((cached_pH * cached_total)+(D.pH * amount))/(cached_total + amount)//should be right
if(istype(my_atom, /obj/item/reagent_containers/))
var/obj/item/reagent_containers/RC = my_atom
RC.pH_check()//checks beaker resilience
else
pH = other_pH
//add the reagent to the existing if it exists
for(var/A in cached_reagents)

View File

@@ -190,6 +190,10 @@
data["beakerMaxVolume"] = beaker.volume
data["beakerTransferAmounts"] = beaker.possible_transfer_amounts
data["beakerCurrentpH"] = beaker.reagents.pH
//pH accuracy
for(var/obj/item/stock_parts/capacitor/C in component_parts)
data["partRating"]= 10**(C.rating-1)
else
data["beakerCurrentVolume"] = null
data["beakerMaxVolume"] = null

View File

@@ -100,11 +100,18 @@
data["currentpH"] = beaker ? beaker.reagents.pH : null
data["beakerCurrentVolume"] = beaker ? beaker.reagents.total_volume : null
data["beakerMaxVolume"] = beaker ? beaker.volume : null
//purity and pH accuracy
for(var/obj/item/stock_parts/micro_laser/M in component_parts)
data["partRating"]= 10**(M.rating-1)
if(M.rating == 4)
data["showPurity"] = 1
else
data["showPurity"] = 0
var beakerContents[0]
if(beaker)
for(var/datum/reagent/R in beaker.reagents.reagent_list)
beakerContents.Add(list(list("name" = R.name, "volume" = R.volume))) // list in a list because Byond merges the first list...
beakerContents.Add(list(list("name" = R.name, "volume" = R.volume, "purity" = R.purity))) // list in a list because Byond merges the first list...
data["beakerContents"] = beakerContents
return data

View File

@@ -468,16 +468,16 @@
build_path = /obj/item/anomaly_neutralizer
category = list("Equipment")
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE | DEPARTMENTAL_FLAG_ENGINEERING
/datum/design/pHmeter
name = "pH meter"
desc = "A a electrode attached to a small circuit box that will tell you the pH of a solution."
id = "pHmeter"
build_type = PROTOLATHE
materials = list(MAT_METAL = 1000, MAT_SILVER = 100, MAT_DIAMOND = 100)
build_path = /obj/item/FermiChem/pHmeter
build_path = /obj/item/fermichem/pHmeter
category = list("Equipment")
departmental_flags = DEPARTMENTAL_FLAG_MEDICAL
departmental_flags = DEPARTMENTAL_FLAG_MEDICAL | DEPARTMENTAL_FLAG_SCIENCE
/////////////////////////////////////////
////////////Armour///////////////////////

View File

@@ -1323,6 +1323,7 @@
var/instill = stripped_input(user, "Instill an emotion in your [(user.lewd?"Your pet":"listener")].", MAX_MESSAGE_LEN)
var/customSpan = list("Notice", "Warning", "Hypnophrase", "Love", "Velvet")
to_chat(H, "<span class='[customSpan]'><i>[instill]</i></span>")
E.cooldown += 1
//RECOGNISE
else if((findtext(message, recognise_words)))

View File

@@ -313,7 +313,7 @@
/obj/item/storage/backpack/chemistry = 3,
/obj/item/storage/backpack/satchel/chem = 3,
/obj/item/storage/bag/chemistry = 3,
/obj/item/FermiChem/pHbooklet = 3)//pH indicator)
/obj/item/fermichem/pHbooklet = 3)//pH indicator)
refill_canister = /obj/item/vending_refill/wardrobe/chem_wardrobe
/obj/item/vending_refill/wardrobe/chem_wardrobe

View File

@@ -310,10 +310,10 @@
if(istype(O, /obj/item/organ/genital))
organCheck = TRUE
if(/obj/item/organ/genital/penis)
dna.features["has_cock"] = TRUE
//dna.features["has_cock"] = TRUE
willyCheck = TRUE
if(/obj/item/organ/genital/breasts)
dna.features["has_breasts"] = TRUE//Goddamnit get in there.
//dna.features["has_breasts"] = TRUE//Goddamnit get in there.
breastCheck = TRUE
if(organCheck == FALSE)
if(ishuman(src) && dna.species.id == "human")

View File

@@ -134,7 +134,7 @@
..()
/datum/reagent/fermi/BEsmaller
name = "Succubus milk"
name = "Modesty milk"
id = "BEsmaller"
description = "A volatile collodial mixture derived from milk that encourages mammary production via a potent estrogen mix."
color = "#E60584" // rgb: 96, 0, 255
@@ -158,18 +158,31 @@
..()
/datum/reagent/fermi/BEsmaller_hypo
name = "Modesty milk"
name = "Rectify milk" //Rectify
id = "BEsmaller_hypo"
color = "#E60584"
taste_description = "a milky ice cream like flavour."
metabolization_rate = 0.25
description = "A medicine used to treat organomegaly in a patient's breasts."
var/sizeConv = list("a" = 1, "b" = 2, "c" = 3, "d" = 4, "e" = 5)
/datum/reagent/fermi/BEsmaller_hypo/on_mob_add(mob/living/carbon/M)
. = ..()
if(M.dna.features["has_vag"])
var/obj/item/organ/genital/vagina/nV = new
nV.Insert(M)
if(M.dna.features["has_womb"])
var/obj/item/organ/genital/womb/nW = new
nW.Insert(M)
/datum/reagent/fermi/BEsmaller_hypo/on_mob_life(mob/living/carbon/M)
var/obj/item/organ/genital/breasts/B = M.getorganslot("breasts")
if(!B)
return..()
if(B.cached_size > (sizeConv[M.dna.features["breasts_size"]]+0.1))
if(!M.dna.features["has_breasts"])//Fast fix for those who don't want it.
B.cached_size = B.cached_size - 0.1
B.update()
else if(B.cached_size > (sizeConv[M.dna.features["breasts_size"]]+0.1))
B.cached_size = B.cached_size - 0.05
B.update()
else if(B.cached_size < (sizeConv[M.dna.features["breasts_size"]])+0.1)
@@ -285,7 +298,7 @@
..()
/datum/reagent/fermi/PEsmaller // Due to cozmo's request...!
name = "Incubus draft"
name = "Chastity draft"
id = "PEsmaller"
description = "A volatile collodial mixture derived from various masculine solutions that encourages a larger gentleman's package via a potent testosterone mix, formula derived from a collaboration from Fermichem and Doctor Ronald Hyatt, who is well known for his phallus palace."
color = "#888888" // This is greyish..?
@@ -310,17 +323,27 @@
..()
/datum/reagent/fermi/PEsmaller_hypo
name = "Chastity draft"
name = "Rectify draft"
id = "PEsmaller_hypo"
color = "#888888" // This is greyish..?
taste_description = "chinese dragon powder"
description = "A medicine used to treat organomegaly in a patient's penis."
metabolization_rate = 0.5
/datum/reagent/fermi/PEsmaller_hypo/on_mob_add(mob/living/carbon/M)
. = ..()
if(M.dna.features["has_balls"])
var/obj/item/organ/genital/testicles/nT = new
nT.Insert(M)
/datum/reagent/fermi/PEsmaller_hypo/on_mob_life(mob/living/carbon/M)
var/obj/item/organ/genital/penis/P = M.getorganslot("penis")
if(!P)
return ..()
if(P.cached_length > (M.dna.features["cock_length"]+0.1))
if(!M.dna.features["has_penis"])//Fast fix for those who don't want it.
P.cached_length = P.cached_length - 0.2
P.update()
else if(P.cached_length > (M.dna.features["cock_length"]+0.1))
P.cached_length = P.cached_length - 0.1
P.update()
else if(P.cached_length < (M.dna.features["cock_length"]+0.1))

View File

@@ -139,8 +139,8 @@
/datum/chemical_reaction/fermi/breast_enlarger
name = "Sucubus milk"
id = "breast_enlarger"
results = list("breast_enlarger" = 0.4)
required_reagents = list("salglu_solution" = 0.1, "milk" = 0.5, "synthflesh" = 0.2, "silicon" = 0.2, "aphro" = 0.2)
results = list("breast_enlarger" = 0.8)
required_reagents = list("salglu_solution" = 0.1, "milk" = 0.1, "synthflesh" = 0.2, "silicon" = 0.3, "aphro" = 0.3)
mix_message = "the reaction gives off a mist of milk."
//FermiChem vars:
OptimalTempMin = 200
@@ -151,7 +151,7 @@
ReactpHLim = 3
CatalystFact = 0
CurveSharpT = 2
CurveSharppH = 2
CurveSharppH = 1
ThermicConstant = 1
HIonRelease = -0.1
RateUpLim = 5
@@ -159,6 +159,14 @@
FermiExplode = TRUE
PurityMin = 0.1
/datum/chemical_reaction/fermi/breast_enlarger/FermiFinish(datum/reagents/holder, var/atom/my_atom)
var/datum/reagent/fermi/breast_enlarger/BE = locate(/datum/reagent/fermi/breast_enlarger) in my_atom.reagents.reagent_list
var/cached_volume = BE.volume
if(BE.purity < 0.35)
holder.remove_reagent(src.id, cached_volume)
holder.add_reagent("BEsmaller", cached_volume)
/datum/chemical_reaction/fermi/breast_enlarger/FermiExplode(datum/reagents, var/atom/my_atom, volume, temp, pH)
var/obj/item/organ/genital/breasts/B = new /obj/item/organ/genital/breasts(get_turf(my_atom))
var/list/seen = viewers(8, get_turf(my_atom))
@@ -171,7 +179,7 @@
/datum/chemical_reaction/fermi/penis_enlarger
name = "Incubus draft"
id = "penis_enlarger"
results = list("penis_enlarger" = 0.4)
results = list("penis_enlarger" = 0.8)
required_reagents = list("blood" = 0.5, "synthflesh" = 0.2, "carbon" = 0.2, "aphro" = 0.2, "salglu_solution" = 0.1,)
mix_message = "the reaction gives off a spicy mist."
//FermiChem vars:
@@ -183,7 +191,7 @@
ReactpHLim = 3
CatalystFact = 0
CurveSharpT = 2
CurveSharppH = 2
CurveSharppH = 1
ThermicConstant = 1
HIonRelease = 0.1
RateUpLim = 5
@@ -200,6 +208,13 @@
P.length = ((PE.volume * PE.purity) / 10)//half as effective.
my_atom.reagents.clear_reagents()
/datum/chemical_reaction/fermi/penis_enlarger/FermiFinish(datum/reagents/holder, var/atom/my_atom)
var/datum/reagent/fermi/penis_enlarger/PE = locate(/datum/reagent/fermi/penis_enlarger) in my_atom.reagents.reagent_list
var/cached_volume = PE.volume
if(PE.purity < 0.35)
holder.remove_reagent(src.id, cached_volume)
holder.add_reagent("PEsmaller", cached_volume)
/datum/chemical_reaction/fermi/astral
name = "Astrogen"
id = "astral"

View File

@@ -1,4 +1,4 @@
/obj/item/FermiChem/pHbooklet
/obj/item/fermichem/pHbooklet
name = "pH indicator booklet"
desc = "A booklet containing paper soaked in universal indicator."
icon_state = "pHbooklet"
@@ -9,10 +9,10 @@
w_class = WEIGHT_CLASS_TINY
//A little janky with pockets
/obj/item/FermiChem/pHbooklet/attack_hand(mob/user)
/obj/item/fermichem/pHbooklet/attack_hand(mob/user)
if(user.get_held_index_of_item(src))//Does this check pockets too..?
if(numberOfPages >= 1)
var/obj/item/FermiChem/pHpaper/P = new /obj/item/FermiChem/pHpaper
var/obj/item/fermichem/pHpaper/P = new /obj/item/fermichem/pHpaper
P.add_fingerprint(user)
P.forceMove(user.loc)
user.put_in_active_hand(P)
@@ -34,10 +34,10 @@
if(!I)
user.put_in_active_hand(src)
/obj/item/FermiChem/pHbooklet/MouseDrop()
/obj/item/fermichem/pHbooklet/MouseDrop()
var/mob/living/user = usr
if(numberOfPages >= 1)
var/obj/item/FermiChem/pHpaper/P = new /obj/item/FermiChem/pHpaper
var/obj/item/fermichem/pHpaper/P = new /obj/item/fermichem/pHpaper
P.add_fingerprint(user)
P.forceMove(user)
user.put_in_active_hand(P)
@@ -54,7 +54,7 @@
return
..()
/obj/item/FermiChem/pHpaper
/obj/item/fermichem/pHpaper
name = "pH indicator strip"
desc = "A piece of paper that will change colour depending on the pH of a solution."
icon_state = "pHpaper"
@@ -65,7 +65,7 @@
resistance_flags = FLAMMABLE
w_class = WEIGHT_CLASS_TINY
/obj/item/FermiChem/pHpaper/afterattack(obj/item/reagent_containers/cont, mob/user, proximity)
/obj/item/fermichem/pHpaper/afterattack(obj/item/reagent_containers/cont, mob/user, proximity)
if(!istype(cont))
return
if(used == TRUE)
@@ -107,20 +107,39 @@
desc += " The paper looks to be around a pH of [round(cont.reagents.pH, 1)]"
used = TRUE
/obj/item/FermiChem/pHmeter
name = "pH meter"
/obj/item/fermichem/pHmeter
name = "Chemistry Analyser"
desc = "A a electrode attached to a small circuit box that will tell you the pH of a solution. The screen currently displays nothing."
icon_state = "pHmeter"
icon = 'modular_citadel/icons/obj/FermiChem.dmi'
resistance_flags = FLAMMABLE
w_class = WEIGHT_CLASS_TINY
var/scanmode = 1
/obj/item/FermiChem/pHmeter/afterattack(atom/A, mob/user, proximity)
/obj/item/fermichem/pHmeter/attack_self(mob/user)
if(!scanmode)
to_chat(user, "<span class='notice'>You switch the chemical analyzer to give a detailed report.</span>")
scanmode = 1
else
to_chat(user, "<span class='notice'>You switch the chemical analyzer to give a reduced report.</span>")
scanmode = 0
/obj/item/fermichem/pHmeter/afterattack(atom/A, mob/user, proximity)
. = ..()
if(!istype(A, /obj/item/reagent_containers))
return
var/obj/item/reagent_containers/cont = A
if(LAZYLEN(cont.reagents.reagent_list) == null)
return
to_chat(user, "<span class='notice'>The pH meter beeps and displays [round(cont.reagents.pH, 0.1)]</span>")
desc = "An electrode attached to a small circuit box that will tell you the pH of a solution. The screen currently displays [round(cont.reagents.pH, 0.1)]."
var/out_message
to_chat(user, "<i>The chemistry meter beeps and displays:</i>")
out_message += "<span class='notice'><b>Total volume: [round(cont.volume, 0.01)] Total pH: [round(cont.reagents.pH, 0.1)]\n"
if(cont.reagents.fermiIsReacting)
out_message += "<span class='warning'>A reaction appears to be occuring currently.<span class='notice'>\n"
out_message += "Chemicals found in the beaker:</b>\n"
for(var/datum/reagent/R in cont.reagents.reagent_list)
out_message += "<b>[R.name]</b>, Purity: [R.purity] [(scanmode?"Overdose: [R.overdose_threshold], Addiction: [R.addiction_threshold], Base pH [R.pH]":"")]\n"
if(scanmode)
out_message += "Analysis: [R.description]\n"
to_chat(user, "[out_message]</span>")
desc = "An electrode attached to a small circuit box that will analyse a beaker. It can be toggled to give a reduced or extended report. The screen currently displays [round(cont.reagents.pH, 0.1)]."

File diff suppressed because one or more lines are too long

View File

@@ -34,7 +34,7 @@
<ui-section label='Contents'>
{{#if data.isBeakerLoaded}}
<span>{{Math.round(adata.beakerCurrentVolume)}}/{{data.beakerMaxVolume}} Units</span>
<span>pH: {{Math.round(adata.beakerCurrentpH*10)/10}}</span>
<span>pH: {{Math.round(adata.beakerCurrentpH*adata.partRating)/adata.partRating}}</span>
<br/>
{{#each adata.beakerContents}}
<span class='highlight' intro-outro='fade'>{{Math.fixed(volume, 2)}} units of {{name}}</span><br/>

View File

@@ -17,10 +17,13 @@
{{#if data.isBeakerLoaded}}
<span>Temperature: {{Math.round(adata.currentTemp)}} K</span>
<br />
<span>pH: {{Math.round(adata.currentpH*10)/10}}</span>
<span>pH: {{Math.round(adata.currentpH*adata.partRating)/adata.partRating}}</span>
<br />
{{#each adata.beakerContents}}
<span class='highlight' intro-outro='fade'>{{Math.fixed(volume, 2)}} units of {{name}}</span><br/>
<span class='highlight' intro-outro='fade'>{{Math.fixed(volume, 2)}} units of {{name}}</span><br />
{{#if data.showPurity}}
<span class='highlight' intro-outro='fade'>Purity: {{Math.fixed(purity, 2)}}</span><br />
{{/if}}
{{else}}
<span class='bad'>Beaker Empty</span>
{{/each}}