Skip to content

Commit

Permalink
and now, for errors
Browse files Browse the repository at this point in the history
  • Loading branch information
XeonMations committed Sep 6, 2024
1 parent 56820fb commit 863a30d
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 74 deletions.
7 changes: 4 additions & 3 deletions code/modules/reagents/chemistry/reagents/other_reagents.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1010,11 +1010,12 @@
color = "#B8B8C0" // rgb: 184, 184, 192
chem_flags = CHEMICAL_RNG_GENERAL | CHEMICAL_RNG_FUN | CHEMICAL_RNG_BOTANY
taste_description = "the inside of a reactor"
var/irradiation_level = 1
process_flags = ORGANIC | SYNTHETIC
/// How much tox damage to deal per tick
var/tox_damage = 0.5

/datum/reagent/uranium/on_mob_life(mob/living/carbon/M)
M.apply_effect(irradiation_level/M.metabolism_efficiency,EFFECT_IRRADIATE,0)
M.adjustToxLoss(tox_damage * delta_time * REM)
..()

/datum/reagent/uranium/reaction_turf(turf/T, reac_volume)
Expand All @@ -1033,7 +1034,7 @@
color = "#C7C7C7" // rgb: 199,199,199
chem_flags = CHEMICAL_BASIC_ELEMENT
taste_description = "the colour blue and regret"
irradiation_level = 2*REM
tox_damage = 1*REM
process_flags = ORGANIC | SYNTHETIC


Expand Down
8 changes: 6 additions & 2 deletions code/modules/reagents/chemistry/reagents/toxin_reagents.dm
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
..()

/datum/reagent/toxin/mutagen/on_mob_life(mob/living/carbon/C)
C.apply_effect(5,EFFECT_IRRADIATE,0)
C.adjustToxLoss(0.5 * delta_time * REM)
return ..()

/datum/reagent/toxin/plasma
Expand Down Expand Up @@ -372,7 +372,11 @@
process_flags = ORGANIC | SYNTHETIC

/datum/reagent/toxin/polonium/on_mob_life(mob/living/carbon/M)
M.radiation += 10
if (!HAS_TRAIT(M, TRAIT_IRRADIATED) && SSradiation.can_irradiate_basic(M))
M.AddComponent(/datum/component/irradiated)
else
M.adjustToxLoss(1 * REM * delta_time)

..()

/datum/reagent/toxin/histamine
Expand Down
10 changes: 0 additions & 10 deletions code/modules/research/designs/mecha_designs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -351,16 +351,6 @@
construction_time = 100
category = list("Exosuit Equipment")

/datum/design/mech_generator_nuclear
name = "Exosuit Module (ExoNuclear Reactor)"
desc = "Compact nuclear reactor module."
id = "mech_generator_nuclear"
build_type = MECHFAB
build_path = /obj/item/mecha_parts/mecha_equipment/generator/nuclear
materials = list(/datum/material/iron=10000,/datum/material/glass = 1000,/datum/material/silver=500)
construction_time = 100
category = list("Exosuit Equipment")

/datum/design/mech_plasma_cutter
name = "Exosuit Mining (217-D Heavy Plasma Cutter)"
desc = "A device that shoots resonant plasma bursts at extreme velocity. The blasts are capable of crushing rock and demolishing solid obstacles."
Expand Down
10 changes: 0 additions & 10 deletions code/modules/research/designs/tool_designs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -300,13 +300,3 @@
build_path = /obj/item/wirebrush
category = list("Equipment")
departmental_flags = DEPARTMENTAL_FLAG_SERVICE

/datum/design/wirebrush_adv
name = "Advanced Wirebrush"
desc = "An advanced wirebrush."
id = "wirebrush_adv"
build_type = PROTOLATHE
materials = list(/datum/material/iron = 200, /datum/material/glass = 200, /datum/material/uranium = 200, /datum/material/plasma = 200)
build_path = /obj/item/wirebrush/advanced
category = list("Equipment")
departmental_flags = DEPARTMENTAL_FLAG_SERVICE
2 changes: 0 additions & 2 deletions code/modules/research/techweb/all_nodes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1551,7 +1551,6 @@
"laserscalpel",
"mechanicalpinches",
"searingtool",
"wirebrush_adv",
)
prereq_ids = list("adv_engi")
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500)
Expand Down Expand Up @@ -1988,7 +1987,6 @@
design_ids = list(
"mech_ccw_armor",
"mech_energy_relay",
"mech_generator_nuclear",
"mech_proj_armor",
)
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500)
Expand Down
26 changes: 26 additions & 0 deletions code/modules/surgery/organs/lungs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@
var/BZ_brain_damage_min = 1
var/gas_stimulation_min = 0.002 //Nitryl and Stimulum

var/tritium_irradiation_moles_min = 1
var/tritium_irradiation_moles_max = 15
var/tritium_irradiation_probability_min = 10
var/tritium_irradiation_probability_max = 60

var/cold_message = "your face freezing and an icicle forming"
var/cold_level_1_threshold = 260
var/cold_level_2_threshold = 200
Expand Down Expand Up @@ -278,6 +283,27 @@
H.hallucination += 5
H.reagents.add_reagent(/datum/reagent/metabolite/bz,1)

// Tritium
var/trit_pp = PP(breath,GAS_TRITIUM)
if (trit_pp > 50)
breather.radiation += trit_pp/2 //If you're breathing in half an atmosphere of radioactive gas, you fucked up.
else
breather.radiation += trit_pp/10
// If you're breathing in half an atmosphere of radioactive gas, you fucked up.
if (trit_pp > tritium_irradiation_moles_min && SSradiation.can_irradiate_basic(breather))
var/lerp_scale = min(tritium_irradiation_moles_max, trit_pp - tritium_irradiation_moles_min) / (tritium_irradiation_moles_max - tritium_irradiation_moles_min)
var/chance = LERP(tritium_irradiation_probability_min, tritium_irradiation_probability_max, lerp_scale)
if (prob(chance))
breather.AddComponent(/datum/component/irradiated)

gas_breathed = PP(breath,GAS_TRITIUM)

if (trit_pp > 0)
var/ratio = gas_breathed * 15
breather.adjustToxLoss(clamp(ratio, MIN_TOXIC_GAS_DAMAGE, MAX_TOXIC_GAS_DAMAGE))

breath.adjust_moles(GAS_TRITIUM, -gas_breathed)

// Nitryl
var/nitryl_pp = PP(breath,GAS_NITRYL)
if (prob(nitryl_pp))
Expand Down
19 changes: 0 additions & 19 deletions code/modules/vehicles/mecha/equipment/tools/other_tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -435,25 +435,6 @@
update_equip_info()
return TRUE


/obj/item/mecha_parts/mecha_equipment/generator/nuclear
name = "exonuclear reactor"
desc = "An exosuit module that generates power using uranium as fuel. Pollutes the environment."
icon_state = "tesla"
max_fuel = 50000
fuel_per_cycle_idle = 10
fuel_per_cycle_active = 30
power_per_cycle = 50
var/rad_per_cycle = 30

/obj/item/mecha_parts/mecha_equipment/generator/nuclear/generator_init()
fuel = new /obj/item/stack/sheet/mineral/uranium(src, 0)

/obj/item/mecha_parts/mecha_equipment/generator/nuclear/process()
if(..())
radiation_pulse(get_turf(src), rad_per_cycle)


/////////////////////////////////////////// THRUSTERS /////////////////////////////////////////////

/obj/item/mecha_parts/mecha_equipment/thrusters
Expand Down
48 changes: 24 additions & 24 deletions tgui/packages/tgui/interfaces/DnaConsole.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ const MUT_COLORS = {
4: 'average',
};

const RADIATION_STRENGTH_MAX = 15;
const RADIATION_DURATION_MAX = 30;
const PULSE_STRENGTH_MAX = 15;
const PULSE_DURATION_MAX = 30;

/**
* The following predicate tests if two mutations are functionally
Expand All @@ -69,16 +69,16 @@ const isSameMutation = (a, b) => {

export const DnaConsole = (props, context) => {
const { data, act } = useBackend(context);
const { isPulsingRads, radPulseSeconds } = data;
const { isPulsing, timeToPulse } = data;
const { consoleMode } = data.view;
return (
<Window title="DNA Console" width={539} height={710} resizable>
{!!isPulsingRads && (
{!!isPulsing && (
<Dimmer fontSize="14px" textAlign="center">
<Icon mr={1} name="spinner" spin />
Radiation pulse in progress...
Pulse in progress...
<Box mt={1} />
{radPulseSeconds}s
{timeToPulse}s
</Dimmer>
)}
<Window.Content scrollable>
Expand All @@ -104,7 +104,7 @@ const DnaScannerButtons = (props, context) => {
const { data, act } = useBackend(context);
const {
hasDelayedAction,
isPulsingRads,
isPulsing,
isScannerConnected,
isScrambleReady,
isViableSubject,
Expand All @@ -120,7 +120,7 @@ const DnaScannerButtons = (props, context) => {
<Fragment>
{!!hasDelayedAction && <Button content="Cancel Delayed Action" onClick={() => act('cancel_delay')} />}
{!!isViableSubject && (
<Button disabled={!isScrambleReady || isPulsingRads} onClick={() => act('scramble_dna')}>
<Button disabled={!isScrambleReady || isPulsing} onClick={() => act('scramble_dna')}>
Scramble DNA
{!isScrambleReady && ` (${scrambleSeconds}s)`}
</Button>
Expand Down Expand Up @@ -183,7 +183,7 @@ const SubjectStatus = (props, context) => {

const DnaScannerContent = (props, context) => {
const { data, act } = useBackend(context);
const { subjectName, isScannerConnected, isViableSubject, subjectHealth, subjectRads, subjectStatus } = data;
const { subjectName, isScannerConnected, isViableSubject, subjectHealth, subjectDamage, subjectStatus } = data;
if (!isScannerConnected) {
return <Box color="bad">DNA Scanner is not connected.</Box>;
}
Expand Down Expand Up @@ -211,9 +211,9 @@ const DnaScannerContent = (props, context) => {
{subjectHealth}%
</ProgressBar>
</LabeledList.Item>
<LabeledList.Item label="Radiation">
<LabeledList.Item label="Genetic Damage">
<ProgressBar
value={subjectRads}
value={subjectDamage}
minValue={0}
maxValue={100}
ranges={{
Expand All @@ -222,7 +222,7 @@ const DnaScannerContent = (props, context) => {
good: [0, 30],
olive: [-Infinity, 0],
}}>
{subjectRads}%
{subjectDamage}%
</ProgressBar>
</LabeledList.Item>
</LabeledList>
Expand Down Expand Up @@ -974,34 +974,34 @@ const DnaConsoleEnzymes = (props, context) => {
<Fragment>
<Flex spacing={1} mb={1}>
<Flex.Item width="155px">
<RadiationEmitterSettings />
<PulseSettings />
</Flex.Item>
<Flex.Item width="140px">
<RadiationEmitterProbs />
<PulseEmitterProbs />
</Flex.Item>
<Flex.Item grow={1} basis={0}>
<RadiationEmitterPulseBoard />
<PulseBoard />
</Flex.Item>
</Flex>
<GeneticMakeupBuffers />
</Fragment>
);
};

const RadiationEmitterSettings = (props, context) => {
const PulseSettings = (props, context) => {
const { data, act } = useBackend(context);
const { radStrength, radDuration } = data;
const { pulseStrength, pulseDuration } = data;
return (
<Section title="Radiation Emitter" minHeight="100%">
<Section title="Emitter Configuration" minHeight="100%">
<LabeledList>
<LabeledList.Item label="Output level">
<NumberInput
animated
width="32px"
stepPixelSize={10}
value={radStrength}
value={pulseStrength}
minValue={1}
maxValue={RADIATION_STRENGTH_MAX}
maxValue={PULSE_STRENGTH_MAX}
onDrag={(e, value) =>
act('set_pulse_strength', {
val: value,
Expand All @@ -1014,9 +1014,9 @@ const RadiationEmitterSettings = (props, context) => {
animated
width="32px"
stepPixelSize={10}
value={radDuration}
value={pulseDuration}
minValue={1}
maxValue={RADIATION_DURATION_MAX}
maxValue={PULSE_DURATION_MAX}
onDrag={(e, value) =>
act('set_pulse_duration', {
val: value,
Expand All @@ -1029,7 +1029,7 @@ const RadiationEmitterSettings = (props, context) => {
);
};

const RadiationEmitterProbs = (props, context) => {
const PulseEmitterProbs = (props, context) => {
const { data } = useBackend(context);
const { stdDevAcc, stdDevStr } = data;
return (
Expand All @@ -1049,7 +1049,7 @@ const RadiationEmitterProbs = (props, context) => {
);
};

const RadiationEmitterPulseBoard = (props, context) => {
const PulseBoard = (props, context) => {
const { data, act } = useBackend(context);
const { subjectUNI = [] } = data;
// Build blocks of buttons of unique enzymes
Expand Down
6 changes: 2 additions & 4 deletions tgui/packages/tgui/interfaces/GravityGenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ import { Box, Button, LabeledList, NoticeBox, ProgressBar, Section } from '../co
import { Window } from '../layouts';

export const GravityGenerator = (props, context) => {
const { act, data } = useBackend(context);
const { charging_state, operational } = data;
const { data } = useBackend(context);
const { operational } = data;
return (
<Window width={400} height={600}>
<Window.Content>
{!operational && <NoticeBox>No data available</NoticeBox>}
{!!operational && charging_state !== 0 && <NoticeBox danger>WARNING - Radiation detected</NoticeBox>}
{!!operational && charging_state === 0 && <NoticeBox success>No radiation detected</NoticeBox>}
{!!operational && <GravityGeneratorContent />}
</Window.Content>
</Window>
Expand Down

0 comments on commit 863a30d

Please sign in to comment.