Merge pull request #12568 from Linzolle/chemmaster

fix analyze function on chem master
This commit is contained in:
Ghom
2020-06-24 16:05:43 +02:00
committed by GitHub
13 changed files with 1948 additions and 1837 deletions

View File

@@ -386,7 +386,8 @@
return FALSE
if("analyze")
var/datum/reagent/R = GLOB.name2reagent[params["id"]]
var/reagent = GLOB.name2reagent[params["id"]]
var/datum/reagent/R = GLOB.chemical_reagents_list[reagent]
if(R)
var/state = "Unknown"
if(initial(R.reagent_state) == 1)
@@ -399,13 +400,9 @@
var/T = initial(R.metabolization_rate) * (60 / P)
if(istype(R, /datum/reagent/fermi))
fermianalyze = TRUE
var/datum/chemical_reaction/Rcr = get_chemical_reaction(R)
var/datum/chemical_reaction/Rcr = get_chemical_reaction(reagent)
var/pHpeakCache = (Rcr.OptimalpHMin + Rcr.OptimalpHMax)/2
var/datum/reagent/targetReagent = reagents.has_reagent(R)
if(!targetReagent)
CRASH("Tried to find a reagent that doesn't exist in the chem_master!")
analyzeVars = list("name" = initial(R.name), "state" = state, "color" = initial(R.color), "description" = initial(R.description), "metaRate" = T, "overD" = initial(R.overdose_threshold), "addicD" = initial(R.addiction_threshold), "purityF" = targetReagent.purity, "inverseRatioF" = initial(R.inverse_chem_val), "purityE" = initial(Rcr.PurityMin), "minTemp" = initial(Rcr.OptimalTempMin), "maxTemp" = initial(Rcr.OptimalTempMax), "eTemp" = initial(Rcr.ExplodeTemp), "pHpeak" = pHpeakCache)
analyzeVars = list("name" = initial(R.name), "state" = state, "color" = initial(R.color), "description" = initial(R.description), "metaRate" = T, "overD" = initial(R.overdose_threshold), "addicD" = initial(R.addiction_threshold), "purityF" = R.purity, "inverseRatioF" = initial(R.inverse_chem_val), "purityE" = initial(Rcr.PurityMin), "minTemp" = initial(Rcr.OptimalTempMin), "maxTemp" = initial(Rcr.OptimalTempMax), "eTemp" = initial(Rcr.ExplodeTemp), "pHpeak" = pHpeakCache)
else
fermianalyze = FALSE
analyzeVars = list("name" = initial(R.name), "state" = state, "color" = initial(R.color), "description" = initial(R.description), "metaRate" = T, "overD" = initial(R.overdose_threshold), "addicD" = initial(R.addiction_threshold))

View File

@@ -87,15 +87,15 @@ export const Bepis = props => {
<Grid.Column>
<Section title="Market Data and Analysis">
<Box>
Average technology cost: {data.mean_value}
Average technology cost: {data.mean_value}
</Box>
<Box>
Current chance of Success: Est. {data.success_estimate}%
Current chance of Success: Est. {data.success_estimate}%
</Box>
{data.error_name && (
<Box color="bad">
Previous Failure Reason: Deposited cash value too low.
Please insert more money for future success.
Please insert more money for future success.
</Box>
)}
<Box m={1} />

View File

@@ -73,7 +73,7 @@ class PaintCanvas extends Component {
height={y_size || 300}
{...rest}
onClick={e => this.clickwrapper(e)}>
Canvas failed to render.
Canvas failed to render.
</canvas>
);
}

View File

@@ -17,7 +17,9 @@ export const ChemMaster = props => {
pillBottleCurrentAmount,
pillBottleMaxAmount,
} = data;
if (screen === "analyze") {
return <AnalysisResults state={state} />;
}
return (
<Fragment>
<Section
@@ -356,9 +358,9 @@ class PackagingControls extends Component {
}
const AnalysisResults = props => {
const { state, fermianalyze } = props;
const { state } = props;
const { ref } = state.config;
const { analyzeVars } = state.data;
const { analyzeVars, fermianalyze } = state.data;
return (
<Section
title="Analysis Results"

View File

@@ -55,7 +55,7 @@ export const GravityGenerator = props => {
)}
{charging_state === 2 && (
<Box color="average">
Discharging
Discharging
</Box>
)}
</LabeledList.Item>

View File

@@ -12,7 +12,7 @@ export const HypnoChair = props => {
The Enhanced Interrogation Chamber is designed to induce a deep-rooted
trance trigger into the subject. Once the procedure is complete,
by using the implanted trigger phrase, the authorities are able to
ensure immediate and complete obedience and truthfulness.
ensure immediate and complete obedience and truthfulness.
</Section>
<Section
title="Occupant Information"

View File

@@ -84,7 +84,7 @@ export const LanguageMenu = props => {
)}>
{language.desc}
{' '}
Key: ,{language.key}
Key: ,{language.key}
{' '}
{language.can_understand
? 'Can understand.'

View File

@@ -154,7 +154,7 @@ export const LaunchpadControl = props => {
inline
bold
mr={1}>
Y:
Y:
</Box>
<NumberInput
value={y}

View File

@@ -109,16 +109,16 @@ export const NaniteRemote = props => {
<Table>
<Table.Row header>
<Table.Cell width="35%">
Name
Name
</Table.Cell>
<Table.Cell width="20%">
Mode
Mode
</Table.Cell>
<Table.Cell collapsing>
Code
Code
</Table.Cell>
<Table.Cell collapsing>
Relay
Relay
</Table.Cell>
</Table.Row>
{saved_settings.map(setting => (
@@ -156,7 +156,7 @@ export const NaniteRemote = props => {
</Table>
) : (
<NoticeBox>
No settings currently saved
No settings currently saved
</NoticeBox>
)}
</Section>

View File

@@ -23,7 +23,7 @@ export const NtosConfiguration = props => {
inline
bold
mr={1}>
Power Draw: {power_usage}W
Power Draw: {power_usage}W
</Box>
)}>
<LabeledList>

View File

@@ -105,7 +105,7 @@ export const OperatingComputer = props => {
{procedure.alt_chems_needed && (
<Fragment>
<b>
Required Chemicals:
Required Chemicals:
</b>
<br />
{procedure.alt_chems_needed}

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff