Ports the RBMK reactor from both NSV using Hyper and Splurt code (WIP) (#15847)

* sprites and sounds

* The code for the reactor itself

* Update code/modules/power/reactor/rbmk.dm

Co-authored-by: Putnam3145 <putnam3145@gmail.com>

* Update code/modules/power/reactor/rbmk.dm

Co-authored-by: SandPoot <43283559+SandPoot@users.noreply.github.com>

* Map stuff

* Removes Clamps.

* Matrices separated, this was a mistake on my part.

* Update tgstation.dme

* removal as per putnam's review

* redfines highest available as 1007

* possible soundloop fix? probably not.

* temporary config thing to make engine load

* changes to map template from splurt

* Update code/modules/power/reactor/rbmk.dm

Co-authored-by: SandPoot <43283559+SandPoot@users.noreply.github.com>

* Update code/modules/power/reactor/rbmk.dm

Co-authored-by: SandPoot <43283559+SandPoot@users.noreply.github.com>

* actually somehow fixed the runtimes?

* old maps from hyper, not needed..

* Revert "old maps from hyper, not needed.."

This reverts commit 92ccd89952d360206926d8b57e82084994a6a0d6.

* take two on removal

* fixes power output

* Update code/modules/power/reactor/rbmk.dm

Co-authored-by: SandPoot <43283559+SandPoot@users.noreply.github.com>

* Update code/modules/power/reactor/rbmk.dm

Co-authored-by: SandPoot <43283559+SandPoot@users.noreply.github.com>

* deals with the double turf

* Revert "temporary config thing to make engine load"

This reverts commit 7f52188d5261cd60024ef36cf7c33df0748d0c79.

* was told to bring it back

* don't need to change these

* next time I'll just copy paste it instead of type it.

* a

* Flexi Seal crate so we can fix the reactor

* set power to 0 so it can be fixed

* nerfs power output

Co-authored-by: Putnam3145 <putnam3145@gmail.com>
Co-authored-by: SandPoot <43283559+SandPoot@users.noreply.github.com>
This commit is contained in:
shellspeed1
2022-09-17 13:33:51 -07:00
committed by GitHub
co-authored by Putnam3145 SandPoot
parent b554906511
commit d9e15776ee
43 changed files with 4158 additions and 3 deletions
@@ -0,0 +1,94 @@
import { map, sortBy } from 'common/collections';
import { flow } from 'common/fp';
import { toFixed } from 'common/math';
import { pureComponentHooks } from 'common/react';
import { Component, Fragment } from 'inferno';
import { Box, Button, Chart, ColorBox, Flex, Icon, LabeledList, ProgressBar, Section, Table } from '../components';
import { NtosWindow } from '../layouts';
import { useBackend, useLocalState } from '../backend';
export const NtosRbmkStats = (props, context) => {
const { act, data } = useBackend(context);
const powerData = data.powerData.map((value, i) => [i, value]);
const psiData = data.psiData.map((value, i) => [i, value]);
const tempInputData = data.tempInputData.map((value, i) => [i, value]);
const tempOutputdata = data.tempOutputdata.map((value, i) => [i, value]);
return (
<NtosWindow
resizable
width={440}
height={650}>
<NtosWindow.Content>
<Section title="Legend:" buttons={
<Button
icon="search"
onClick={() => act('swap_reactor')}
content="Change Reactor" />
}>
Reactor Power (%):
<ProgressBar
value={data.power}
minValue={0}
maxValue={100}
color="yellow" />
<br />
Reactor Pressure (PSI):
<ProgressBar
value={data.psi}
minValue={0}
maxValue={2000}
color="white" >
{data.psi} PSI
</ProgressBar>
Coolant temperature (°C):
<ProgressBar
value={data.coolantInput}
minValue={-273.15}
maxValue={1227}
color="blue">
{data.coolantInput} °C
</ProgressBar>
Outlet temperature (°C):
<ProgressBar
value={data.coolantOutput}
minValue={-273.15}
maxValue={1227}
color="bad">
{data.coolantOutput} °C
</ProgressBar>
</Section>
<Section fill title="Reactor Statistics:" height="200px">
<Chart.Line
fillPositionedParent
data={powerData}
rangeX={[0, powerData.length - 1]}
rangeY={[0, 1500]}
strokeColor="rgba(255, 215,0, 1)"
fillColor="rgba(255, 215, 0, 0.1)" />
<Chart.Line
fillPositionedParent
data={psiData}
rangeX={[0, psiData.length - 1]}
rangeY={[0, 1500]}
strokeColor="rgba(255,250,250, 1)"
fillColor="rgba(255,250,250, 0.1)" />
<Chart.Line
fillPositionedParent
data={tempInputData}
rangeX={[0, tempInputData.length - 1]}
rangeY={[-273.15, 1227]}
strokeColor="rgba(127, 179, 255 , 1)"
fillColor="rgba(127, 179, 255 , 0.1)" />
<Chart.Line
fillPositionedParent
data={tempOutputdata}
rangeX={[0, tempOutputdata.length - 1]}
rangeY={[-273.15, 1227]}
strokeColor="rgba(255, 0, 0 , 1)"
fillColor="rgba(255, 0, 0 , 0.1)" />
</Section>
</NtosWindow.Content>
</NtosWindow>
);
};
@@ -0,0 +1,56 @@
import { Fragment } from 'inferno';
import { useBackend, useLocalState } from '../backend';
import { Section, ProgressBar, Slider } from '../components';
import { Window } from '../layouts';
export const RbmkControlRods = (props, context) => {
const { act, data } = useBackend(context);
const control_rods = data.control_rods;
const k = data.k;
const desiredK = data.desiredK;
return (
<Window
resizable
theme="ntos"
width={300}
height={300}>
<Window.Content>
<Section title="Control Rod Management:">
Control Rod Insertion:
<ProgressBar
value={(control_rods / 100 * 100) * 0.01}
ranges={{
good: [0.7, Infinity],
average: [0.4, 0.7],
bad: [-Infinity, 0.4],
}} />
<br />
Neutrons per generation (K):
<br />
<ProgressBar
value={(k / 3 * 100) * 0.01}
ranges={{
good: [-Infinity, 0.4],
average: [0.4, 0.6],
bad: [0.6, Infinity],
}}>
{k}
</ProgressBar>
<br />
Target criticality:
<br />
<Slider
value={desiredK}
fillValue={k}
minValue={0}
maxValue={3}
step={0.1}
stepPixelSize={5}
onDrag={(e, value) => act('input', {
target: value,
})} />
</Section>
</Window.Content>
</Window>
);
};
@@ -0,0 +1,89 @@
import { map, sortBy } from 'common/collections';
import { flow } from 'common/fp';
import { toFixed } from 'common/math';
import { pureComponentHooks } from 'common/react';
import { Component, Fragment } from 'inferno';
import { Box, Button, Chart, ColorBox, Flex, Icon, LabeledList, ProgressBar, Section, Table } from '../components';
import { Window } from '../layouts';
import { useBackend, useLocalState } from '../backend';
export const RbmkStats = (props, context) => {
const { act, data } = useBackend(context);
const powerData = data.powerData.map((value, i) => [i, value]);
const psiData = data.psiData.map((value, i) => [i, value]);
const tempInputData = data.tempInputData.map((value, i) => [i, value]);
const tempOutputdata = data.tempOutputdata.map((value, i) => [i, value]);
return (
<Window
resizable
theme="ntos"
width={350}
height={500}>
<Window.Content>
<Section title="Legend:">
Reactor Power (%):
<ProgressBar
value={data.power}
minValue={0}
maxValue={100}
color="yellow" />
<br />
Reactor Pressure (PSI):
<ProgressBar
value={data.psi}
minValue={0}
maxValue={2000}
color="white" >
{data.psi} PSI
</ProgressBar>
Coolant temperature (°C):
<ProgressBar
value={data.coolantInput}
minValue={-273.15}
maxValue={1227}
color="blue">
{data.coolantInput} °C
</ProgressBar>
Outlet temperature (°C):
<ProgressBar
value={data.coolantOutput}
minValue={-273.15}
maxValue={1227}
color="bad">
{data.coolantOutput} °C
</ProgressBar>
</Section>
<Section fill title="Reactor Statistics:" height="200px">
<Chart.Line
fillPositionedParent
data={powerData}
rangeX={[0, powerData.length - 1]}
rangeY={[0, 1500]}
strokeColor="rgba(255, 215,0, 1)"
fillColor="rgba(255, 215, 0, 0.1)" />
<Chart.Line
fillPositionedParent
data={psiData}
rangeX={[0, psiData.length - 1]}
rangeY={[0, 1500]}
strokeColor="rgba(255,250,250, 1)"
fillColor="rgba(255,250,250, 0.1)" />
<Chart.Line
fillPositionedParent
data={tempInputData}
rangeX={[0, tempInputData.length - 1]}
rangeY={[-273.15, 1227]}
strokeColor="rgba(127, 179, 255 , 1)"
fillColor="rgba(127, 179, 255 , 0.1)" />
<Chart.Line
fillPositionedParent
data={tempOutputdata}
rangeX={[0, tempOutputdata.length - 1]}
rangeY={[-273.15, 1227]}
strokeColor="rgba(255, 0, 0 , 1)"
fillColor="rgba(255, 0, 0 , 0.1)" />
</Section>
</Window.Content>
</Window>
);
};