mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-10 18:02:57 +00:00
Pushing to review diff
This commit is contained in:
@@ -33,7 +33,6 @@
|
|||||||
var/nopower_state = "dispenser_nopower"
|
var/nopower_state = "dispenser_nopower"
|
||||||
var/has_panel_overlay = TRUE
|
var/has_panel_overlay = TRUE
|
||||||
var/obj/item/reagent_containers/beaker = null
|
var/obj/item/reagent_containers/beaker = null
|
||||||
var/list/stored_beakers = list()
|
|
||||||
var/list/dispensable_reagents = list(
|
var/list/dispensable_reagents = list(
|
||||||
/datum/reagent/hydrogen,
|
/datum/reagent/hydrogen,
|
||||||
/datum/reagent/lithium,
|
/datum/reagent/lithium,
|
||||||
@@ -363,10 +362,11 @@
|
|||||||
return
|
return
|
||||||
var/reagent = text2path(params["id"])
|
var/reagent = text2path(params["id"])
|
||||||
var/datum/reagent/R = beaker.reagents.has_reagent(reagent)
|
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!")
|
say("Not enough storage space left!")
|
||||||
return
|
return
|
||||||
beaker.reagents.trans_id_to(src, R.type, amount)
|
beaker.reagents.trans_id_to(src, R.type, potentialAmount)
|
||||||
work_animation()
|
work_animation()
|
||||||
. = TRUE
|
. = TRUE
|
||||||
|
|
||||||
@@ -455,13 +455,13 @@
|
|||||||
if(M.rating > 3)
|
if(M.rating > 3)
|
||||||
dispensable_reagents |= upgrade_reagents3
|
dispensable_reagents |= upgrade_reagents3
|
||||||
switch(M.rating)
|
switch(M.rating)
|
||||||
if(0)
|
if(-INFINITY to 1)
|
||||||
dispenceUnit = 5
|
dispenceUnit = 5
|
||||||
if(1)
|
|
||||||
dispenceUnit = 3
|
|
||||||
if(2)
|
if(2)
|
||||||
|
dispenceUnit = 3
|
||||||
|
if(3)
|
||||||
dispenceUnit = 2
|
dispenceUnit = 2
|
||||||
if(3 to INFINITY)
|
if(4 to INFINITY)
|
||||||
dispenceUnit = 1
|
dispenceUnit = 1
|
||||||
powerefficiency = round(newpowereff, 0.01)
|
powerefficiency = round(newpowereff, 0.01)
|
||||||
|
|
||||||
|
|||||||
@@ -345,12 +345,16 @@ datum/reagent/fermi/nanite_b_gone/reaction_obj(obj/O, reac_volume)
|
|||||||
|
|
||||||
//Consumes self on addition and shifts pH
|
//Consumes self on addition and shifts pH
|
||||||
/datum/reagent/fermi/acidic_buffer/on_new(datapH)
|
/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))
|
if(holder.has_reagent(/datum/reagent/stabilizing_agent))
|
||||||
return ..()
|
return ..()
|
||||||
data = datapH
|
data = datapH
|
||||||
if(LAZYLEN(holder.reagent_list) == 1)
|
if(LAZYLEN(holder.reagent_list) == 1)
|
||||||
return ..()
|
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>")
|
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)
|
playsound(holder.my_atom, 'sound/FermiChem/bufferadd.ogg', 50, 1)
|
||||||
holder.remove_reagent(type, volume, ignore_pH = TRUE)
|
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
|
strength = 0.4
|
||||||
|
|
||||||
/datum/reagent/fermi/basic_buffer/on_new(datapH)
|
/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))
|
if(holder.has_reagent(/datum/reagent/stabilizing_agent))
|
||||||
return ..()
|
return ..()
|
||||||
data = datapH
|
data = datapH
|
||||||
if(LAZYLEN(holder.reagent_list) == 1)
|
if(LAZYLEN(holder.reagent_list) == 1)
|
||||||
return ..()
|
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>")
|
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)
|
playsound(holder.my_atom, 'sound/FermiChem/bufferadd.ogg', 50, 1)
|
||||||
holder.remove_reagent(type, volume, ignore_pH = TRUE)
|
holder.remove_reagent(type, volume, ignore_pH = TRUE)
|
||||||
|
|||||||
@@ -111,21 +111,21 @@ export const ChemDispenser = (props, context) => {
|
|||||||
title="Dispense"
|
title="Dispense"
|
||||||
buttons={(
|
buttons={(
|
||||||
[<NumberInput
|
[<NumberInput
|
||||||
width="65px"
|
width="65px"
|
||||||
unit="u"
|
unit="u"
|
||||||
step={data.stepAmount}
|
step={data.stepAmount}
|
||||||
stepPixelSize={data.stepAmount}
|
stepPixelSize={data.stepAmount}
|
||||||
value={data.amount}
|
value={data.amount}
|
||||||
minValue={0}
|
minValue={0}
|
||||||
maxValue={data.beakerMaxVolume}
|
maxValue={data.beakerMaxVolume}
|
||||||
onDrag={(e, amount) => act('amount', {
|
onDrag={(e, amount) => act('amount', {
|
||||||
target: amount,
|
target: amount,
|
||||||
})} />,
|
})} />,
|
||||||
<Button icon="cog"
|
<Button icon="cog"
|
||||||
tooltip="Color code the reagents by pH"
|
tooltip="Color code the reagents by pH"
|
||||||
tooltipPosition="bottom-left"
|
tooltipPosition="bottom-left"
|
||||||
selected={hasCol}
|
selected={hasCol}
|
||||||
onClick={() => setHasCol(!hasCol)} />]
|
onClick={() => setHasCol(!hasCol)} />]
|
||||||
)}>
|
)}>
|
||||||
<Box mr={-1}>
|
<Box mr={-1}>
|
||||||
{data.chemicals.map(chemical => (
|
{data.chemicals.map(chemical => (
|
||||||
@@ -150,12 +150,12 @@ export const ChemDispenser = (props, context) => {
|
|||||||
{toFixed(data.storedVol) + ' units'}
|
{toFixed(data.storedVol) + ' units'}
|
||||||
</ProgressBar>
|
</ProgressBar>
|
||||||
<ChemicalBuffer>
|
<ChemicalBuffer>
|
||||||
{storedContents.map(chemical => (
|
{storedContents.map(chemical => (
|
||||||
<ChemicalBufferEntry
|
<ChemicalBufferEntry
|
||||||
key={chemical.id}
|
key={chemical.id}
|
||||||
chemical={chemical}
|
chemical={chemical}
|
||||||
transferTo="beaker" />
|
transferTo="beaker" />
|
||||||
))}
|
))}
|
||||||
</ChemicalBuffer>
|
</ChemicalBuffer>
|
||||||
</Section>
|
</Section>
|
||||||
<Section
|
<Section
|
||||||
@@ -206,7 +206,7 @@ export const ChemDispenser = (props, context) => {
|
|||||||
chemical={chemical}
|
chemical={chemical}
|
||||||
transferTo="beaker" />
|
transferTo="beaker" />
|
||||||
))}
|
))}
|
||||||
</ChemicalBeaker>
|
</ChemicalBeaker>
|
||||||
<Box
|
<Box
|
||||||
key={"pH"}>
|
key={"pH"}>
|
||||||
pH:
|
pH:
|
||||||
@@ -226,7 +226,7 @@ export const ChemDispenser = (props, context) => {
|
|||||||
const ChemicalBuffer = Table;
|
const ChemicalBuffer = Table;
|
||||||
|
|
||||||
const ChemicalBufferEntry = (props, context) => {
|
const ChemicalBufferEntry = (props, context) => {
|
||||||
const { act } = useBackend(context);
|
const { act, data } = useBackend(context);
|
||||||
const { chemical, transferTo } = props;
|
const { chemical, transferTo } = props;
|
||||||
return (
|
return (
|
||||||
<Table.Row key={chemical.id}>
|
<Table.Row key={chemical.id}>
|
||||||
@@ -240,6 +240,7 @@ const ChemicalBufferEntry = (props, context) => {
|
|||||||
<Button
|
<Button
|
||||||
content="Dispense"
|
content="Dispense"
|
||||||
icon="download"
|
icon="download"
|
||||||
|
disabled={!!data.recordingRecipe}
|
||||||
mt={0.5}
|
mt={0.5}
|
||||||
onClick={() => act('unstore', {
|
onClick={() => act('unstore', {
|
||||||
id: chemical.id,
|
id: chemical.id,
|
||||||
@@ -252,7 +253,7 @@ const ChemicalBufferEntry = (props, context) => {
|
|||||||
const ChemicalBeaker = Table;
|
const ChemicalBeaker = Table;
|
||||||
|
|
||||||
const ChemicalBeakerEntry = (props, context) => {
|
const ChemicalBeakerEntry = (props, context) => {
|
||||||
const { act } = useBackend(context);
|
const { act, data } = useBackend(context);
|
||||||
const { chemical, transferTo } = props;
|
const { chemical, transferTo } = props;
|
||||||
return (
|
return (
|
||||||
<Table.Row key={chemical.id}>
|
<Table.Row key={chemical.id}>
|
||||||
@@ -261,11 +262,12 @@ const ChemicalBeakerEntry = (props, context) => {
|
|||||||
value={chemical.volume}
|
value={chemical.volume}
|
||||||
initial={0} />
|
initial={0} />
|
||||||
{` units of ${chemical.name}`}
|
{` units of ${chemical.name}`}
|
||||||
</Table.Cell>
|
</Table.Cell>
|
||||||
<Table.Cell collapsing>
|
<Table.Cell collapsing>
|
||||||
<Button
|
<Button
|
||||||
content="Store"
|
content="Store"
|
||||||
icon="upload"
|
icon="upload"
|
||||||
|
disabled={!!data.recordingRecipe}
|
||||||
mt={0.5}
|
mt={0.5}
|
||||||
onClick={() => act('store', {
|
onClick={() => act('store', {
|
||||||
id: chemical.id,
|
id: chemical.id,
|
||||||
|
|||||||
@@ -403,7 +403,7 @@ const AnalysisResults = (props, context) => {
|
|||||||
<LabeledList.Item label="Purity">
|
<LabeledList.Item label="Purity">
|
||||||
{analyzeVars.purityF}
|
{analyzeVars.purityF}
|
||||||
</LabeledList.Item>
|
</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>
|
<Fragment>
|
||||||
<LabeledList.Item label="Inverse Ratio">
|
<LabeledList.Item label="Inverse Ratio">
|
||||||
{analyzeVars.inverseRatioF}
|
{analyzeVars.inverseRatioF}
|
||||||
|
|||||||
Reference in New Issue
Block a user