Skip to content

Commit

Permalink
Proto-nitrate bz response gas reaction can now emit nuclear particles. (
Browse files Browse the repository at this point in the history
tgstation#67808)

The proto-nitrate bz response gas reaction can now emit nuclear particles. One particle can be created per 5 moles of BZ spent in the reaction, up to 6 particles in a single reaction costing 60 moles of BZ. The intensity of the radiation pulses in the reaction have been reduced based on how many nuclear particles have been created. The direction is completely random and out of user control. This has the same requirements as emitting radiation pulses, so putting it in waste or distro won't work.

Adds a fun yet dangerous interaction for atmospheric technicians to play around with. Proto-nitrate tritium response and BZ response felt too similar in what they do, so this should make the reactions feel less duplicated. While it might be possible to use this in a traitorous act, it shouldn't be a very effective choice as the reaction has extremely tight temperature range requirements, and a relatively high energy release compared to its heat capacity, making it only feasible at high efficiency in a controlled and stationary environment.
  • Loading branch information
Pickle-Coding authored Jul 21, 2022
1 parent 7ccfb0c commit cf7ef7c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
6 changes: 6 additions & 0 deletions code/__DEFINES/reactions.dm
Original file line number Diff line number Diff line change
Expand Up @@ -259,3 +259,9 @@
#define PN_BZASE_RAD_RANGE_DIVISOR 1.5
/// A scaling factor for the threshold of the radiation pulses generated when proto-nitrate breaks down BZ.
#define PN_BZASE_RAD_THRESHOLD_BASE 15
/// A scaling factor for the nuclear particle production generated when proto-nitrate breaks down BZ.
#define PN_BZASE_NUCLEAR_PARTICLE_DIVISOR 5
/// The maximum amount of nuclear particles that can be produced from proto-nitrate breaking down BZ.
#define PN_BZASE_NUCLEAR_PARTICLE_MAXIMUM 6
/// How much radiation in consumed amount does a nuclear particle take from radiation when proto-nitrate breaks down BZ.
#define PN_BZASE_NUCLEAR_PARTICLE_RADIATION_ENERGY_CONVERSION 2.5
5 changes: 3 additions & 2 deletions code/modules/atmospherics/gasmixtures/reaction_factors.dm
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@
"Energy" = "[PN_HYDROGEN_CONVERSION_ENERGY] joules of energy is absorbed per reaction rate",
)

/datum/gas_reaction/proto_nitrate_tritium_response/init_factors() // Fixed reaction rate
/datum/gas_reaction/proto_nitrate_tritium_response/init_factors()
factor = list(
/datum/gas/tritium = "Tritium is consumed at 1 reaction rate.",
/datum/gas/proto_nitrate = "Proto nitrate is consumed at 0.01 reaction rate.",
Expand All @@ -194,7 +194,7 @@
"Radiation" = "This reaction emits radiation proportional to the reaction rate.",
)

/datum/gas_reaction/proto_nitrate_bz_response/init_factors() // Fixed reaction rate
/datum/gas_reaction/proto_nitrate_bz_response/init_factors()
factor = list(
/datum/gas/proto_nitrate = "[MINIMUM_MOLE_COUNT] moles of proto-nitrate needs to be present for the reaction to occur",
/datum/gas/bz = "BZ is consumed at 1 reaction rate.",
Expand All @@ -204,4 +204,5 @@
"Energy" = "[PN_BZASE_ENERGY] joules of energy is released per reaction rate",
"Radiation" = "This reaction emits radiation proportional to the reaction rate.",
"Hallucinations" = "This reaction can cause various carbon based lifeforms in the vicinity to hallucinate.",
"Nuclear Particles" = "This reaction emits extremely high energy nuclear particles, up to [PN_BZASE_NUCLEAR_PARTICLE_MAXIMUM] per reaction rate.",
)
6 changes: 5 additions & 1 deletion code/modules/atmospherics/gasmixtures/reactions.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1152,7 +1152,11 @@
else if(isatom(holder))
location = holder
if (location && energy_released > PN_BZASE_RAD_RELEASE_THRESHOLD * (air.volume / CELL_VOLUME) ** ATMOS_RADIATION_VOLUME_EXP)
radiation_pulse(location, max_range = min(sqrt(consumed_amount) / PN_BZASE_RAD_RANGE_DIVISOR, GAS_REACTION_MAXIMUM_RADIATION_PULSE_RANGE), threshold = PN_BZASE_RAD_THRESHOLD_BASE * INVERSE(PN_BZASE_RAD_THRESHOLD_BASE + consumed_amount))
///How many nuclear particles will fire in this reaction.
var/nuclear_particle_amount = min(round(consumed_amount / PN_BZASE_NUCLEAR_PARTICLE_DIVISOR), PN_BZASE_NUCLEAR_PARTICLE_MAXIMUM)
for(var/i in 1 to nuclear_particle_amount)
location.fire_nuclear_particle()
radiation_pulse(location, max_range = min(sqrt(consumed_amount - nuclear_particle_amount * PN_BZASE_NUCLEAR_PARTICLE_RADIATION_ENERGY_CONVERSION) / PN_BZASE_RAD_RANGE_DIVISOR, GAS_REACTION_MAXIMUM_RADIATION_PULSE_RANGE), threshold = PN_BZASE_RAD_THRESHOLD_BASE * INVERSE(PN_BZASE_RAD_THRESHOLD_BASE + consumed_amount - nuclear_particle_amount * PN_BZASE_NUCLEAR_PARTICLE_RADIATION_ENERGY_CONVERSION))
for(var/mob/living/carbon/L in location)
L.hallucination += consumed_amount

Expand Down

0 comments on commit cf7ef7c

Please sign in to comment.