Pushing to review diff

This commit is contained in:
Fermi
2021-01-04 10:53:21 +00:00
parent 37c3bbbd9c
commit c7965d3b4a
4 changed files with 44 additions and 34 deletions

View File

@@ -33,7 +33,6 @@
var/nopower_state = "dispenser_nopower"
var/has_panel_overlay = TRUE
var/obj/item/reagent_containers/beaker = null
var/list/stored_beakers = list()
var/list/dispensable_reagents = list(
/datum/reagent/hydrogen,
/datum/reagent/lithium,
@@ -363,10 +362,11 @@
return
var/reagent = text2path(params["id"])
var/datum/reagent/R = beaker.reagents.has_reagent(reagent)
if(reagents.total_volume+amount > reagents.maximum_volume)
var/potentialAmount = min(amount, R.volume)
if(reagents.total_volume+potentialAmount > reagents.maximum_volume)
say("Not enough storage space left!")
return
beaker.reagents.trans_id_to(src, R.type, amount)
beaker.reagents.trans_id_to(src, R.type, potentialAmount)
work_animation()
. = TRUE
@@ -455,13 +455,13 @@
if(M.rating > 3)
dispensable_reagents |= upgrade_reagents3
switch(M.rating)
if(0)
if(-INFINITY to 1)
dispenceUnit = 5
if(1)
dispenceUnit = 3
if(2)
dispenceUnit = 3
if(3)
dispenceUnit = 2
if(3 to INFINITY)
if(4 to INFINITY)
dispenceUnit = 1
powerefficiency = round(newpowereff, 0.01)

View File

@@ -345,12 +345,16 @@ datum/reagent/fermi/nanite_b_gone/reaction_obj(obj/O, reac_volume)
//Consumes self on addition and shifts pH
/datum/reagent/fermi/acidic_buffer/on_new(datapH)
if(!holder)
return ..()
if(holder.reagents_holder_flags & NO_REACT)
return..()
if(holder.has_reagent(/datum/reagent/stabilizing_agent))
return ..()
data = datapH
if(LAZYLEN(holder.reagent_list) == 1)
return ..()
holder.pH = ((holder.pH * (holder.total_volume-volume))+(pH * (volume*strength)))/(holder.total_volume + volume)
holder.pH = ((holder.pH * (holder.total_volume-volume))+(pH * volume*strength))/holder.total_volume //This is BEFORE removal
holder.my_atom.visible_message("<span class='warning'>The beaker fizzes as the pH changes!</b></span>")
playsound(holder.my_atom, 'sound/FermiChem/bufferadd.ogg', 50, 1)
holder.remove_reagent(type, volume, ignore_pH = TRUE)
@@ -382,12 +386,16 @@ datum/reagent/fermi/nanite_b_gone/reaction_obj(obj/O, reac_volume)
strength = 0.4
/datum/reagent/fermi/basic_buffer/on_new(datapH)
if(!holder)
return ..()
if(holder.reagents_holder_flags & NO_REACT)
return..()
if(holder.has_reagent(/datum/reagent/stabilizing_agent))
return ..()
data = datapH
if(LAZYLEN(holder.reagent_list) == 1)
return ..()
holder.pH = ((holder.pH * (holder.total_volume-volume))+(pH * (volume*strength)))/(holder.total_volume + volume)
holder.pH = ((holder.pH * (holder.total_volume-volume))+(pH * volume*strength))/holder.total_volume //This is BEFORE removal
holder.my_atom.visible_message("<span class='warning'>The beaker froths as the pH changes!</b></span>")
playsound(holder.my_atom, 'sound/FermiChem/bufferadd.ogg', 50, 1)
holder.remove_reagent(type, volume, ignore_pH = TRUE)

View File

@@ -111,21 +111,21 @@ export const ChemDispenser = (props, context) => {
title="Dispense"
buttons={(
[<NumberInput
width="65px"
unit="u"
step={data.stepAmount}
stepPixelSize={data.stepAmount}
value={data.amount}
minValue={0}
maxValue={data.beakerMaxVolume}
onDrag={(e, amount) => act('amount', {
target: amount,
})} />,
width="65px"
unit="u"
step={data.stepAmount}
stepPixelSize={data.stepAmount}
value={data.amount}
minValue={0}
maxValue={data.beakerMaxVolume}
onDrag={(e, amount) => act('amount', {
target: amount,
})} />,
<Button icon="cog"
tooltip="Color code the reagents by pH"
tooltipPosition="bottom-left"
selected={hasCol}
onClick={() => setHasCol(!hasCol)} />]
tooltip="Color code the reagents by pH"
tooltipPosition="bottom-left"
selected={hasCol}
onClick={() => setHasCol(!hasCol)} />]
)}>
<Box mr={-1}>
{data.chemicals.map(chemical => (
@@ -150,12 +150,12 @@ export const ChemDispenser = (props, context) => {
{toFixed(data.storedVol) + ' units'}
</ProgressBar>
<ChemicalBuffer>
{storedContents.map(chemical => (
<ChemicalBufferEntry
key={chemical.id}
chemical={chemical}
transferTo="beaker" />
))}
{storedContents.map(chemical => (
<ChemicalBufferEntry
key={chemical.id}
chemical={chemical}
transferTo="beaker" />
))}
</ChemicalBuffer>
</Section>
<Section
@@ -206,7 +206,7 @@ export const ChemDispenser = (props, context) => {
chemical={chemical}
transferTo="beaker" />
))}
</ChemicalBeaker>
</ChemicalBeaker>
<Box
key={"pH"}>
pH:
@@ -226,7 +226,7 @@ export const ChemDispenser = (props, context) => {
const ChemicalBuffer = Table;
const ChemicalBufferEntry = (props, context) => {
const { act } = useBackend(context);
const { act, data } = useBackend(context);
const { chemical, transferTo } = props;
return (
<Table.Row key={chemical.id}>
@@ -240,6 +240,7 @@ const ChemicalBufferEntry = (props, context) => {
<Button
content="Dispense"
icon="download"
disabled={!!data.recordingRecipe}
mt={0.5}
onClick={() => act('unstore', {
id: chemical.id,
@@ -252,7 +253,7 @@ const ChemicalBufferEntry = (props, context) => {
const ChemicalBeaker = Table;
const ChemicalBeakerEntry = (props, context) => {
const { act } = useBackend(context);
const { act, data } = useBackend(context);
const { chemical, transferTo } = props;
return (
<Table.Row key={chemical.id}>
@@ -261,11 +262,12 @@ const ChemicalBeakerEntry = (props, context) => {
value={chemical.volume}
initial={0} />
{` units of ${chemical.name}`}
</Table.Cell>
</Table.Cell>
<Table.Cell collapsing>
<Button
content="Store"
icon="upload"
disabled={!!data.recordingRecipe}
mt={0.5}
onClick={() => act('store', {
id: chemical.id,

View File

@@ -403,7 +403,7 @@ const AnalysisResults = (props, context) => {
<LabeledList.Item label="Purity">
{analyzeVars.purityF}
</LabeledList.Item>
{!! data.fermianalyze && ( // why did you do that before? it's fucking bad.
{!! data.fermianalyze && ( // why did you do that before? it's bad.
<Fragment>
<LabeledList.Item label="Inverse Ratio">
{analyzeVars.inverseRatioF}