Skip to content

Commit

Permalink
Limit research points generating atmos reactions to station zlevels o…
Browse files Browse the repository at this point in the history
…nly (#21492)

* fix inf research

* fixes this

* use get_turf

* holder
  • Loading branch information
jupyterkat authored Feb 23, 2024
1 parent 17a8d92 commit ea38b6a
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions code/modules/atmospherics/gasmixtures/reactions.dm
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@
GAS_PLASMA = 10,
)

/datum/gas_reaction/bzformation/react(datum/gas_mixture/air)
/datum/gas_reaction/bzformation/react(datum/gas_mixture/air, datum/holder)
var/pressure = air.return_pressure()
var/old_thermal_energy = air.thermal_energy()

Expand All @@ -448,7 +448,9 @@
air.adjust_moles(GAS_PLASMA, -2*reaction_efficency)

//clamps by a minimum amount in the event of an underflow.
SSresearch.science_tech.add_point_type(TECHWEB_POINT_TYPE_DEFAULT, clamp((reaction_efficency**2)*BZ_RESEARCH_AMOUNT,0.01,BZ_RESEARCH_MAX_AMOUNT))
var/turf/holder_turf = get_holder_turf(holder)
if(holder_turf && SSmapping.level_trait(holder_turf.z, ZTRAIT_STATION))
SSresearch.science_tech.add_point_type(TECHWEB_POINT_TYPE_DEFAULT, clamp((reaction_efficency**2)*BZ_RESEARCH_AMOUNT,0.01,BZ_RESEARCH_MAX_AMOUNT))

if(energy_released > 0)
var/new_heat_capacity = air.heat_capacity()
Expand All @@ -467,7 +469,7 @@
GAS_TRITIUM = 10,
"TEMP" = 5000000)

/datum/gas_reaction/nobliumformation/react(datum/gas_mixture/air)
/datum/gas_reaction/nobliumformation/react(datum/gas_mixture/air, datum/holder)
var/initial_trit = air.get_moles(GAS_TRITIUM)
var/initial_n2 = air.get_moles(GAS_N2)
var/initial_bz = air.get_moles(GAS_BZ)
Expand All @@ -480,7 +482,11 @@
air.adjust_moles(GAS_TRITIUM, -10*nob_formed)
air.adjust_moles(GAS_N2, -20*nob_formed)
air.adjust_moles(GAS_HYPERNOB, nob_formed)
SSresearch.science_tech.add_point_type(TECHWEB_POINT_TYPE_DEFAULT, clamp(nob_formed*NOBLIUM_RESEARCH_AMOUNT, 0.01, NOBLIUM_RESEARCH_MAX_AMOUNT))

var/turf/holder_turf = get_holder_turf(holder)
if(holder_turf && SSmapping.level_trait(holder_turf.z, ZTRAIT_STATION))
SSresearch.science_tech.add_point_type(TECHWEB_POINT_TYPE_DEFAULT, clamp(nob_formed*NOBLIUM_RESEARCH_AMOUNT, 0.01, NOBLIUM_RESEARCH_MAX_AMOUNT))

var/new_heat_capacity = air.heat_capacity()
if(new_heat_capacity > MINIMUM_HEAT_CAPACITY)
air.set_temperature(max(((old_thermal_energy - energy_taken)/new_heat_capacity),TCMB))
Expand Down Expand Up @@ -510,7 +516,10 @@

//Possibly burning a bit of organic matter through maillard reaction, so a *tiny* bit more heat would be understandable
air.set_temperature(air.return_temperature() + cleaned_air * 0.002)
SSresearch.science_tech.add_point_type(TECHWEB_POINT_TYPE_DEFAULT, clamp(cleaned_air*MIASMA_RESEARCH_AMOUNT,0.01, MIASMA_RESEARCH_MAX_AMOUNT))//Turns out the burning of miasma is kinda interesting to scientists

var/turf/holder_turf = get_holder_turf(holder)
if(holder_turf && SSmapping.level_trait(holder_turf.z, ZTRAIT_STATION))
SSresearch.science_tech.add_point_type(TECHWEB_POINT_TYPE_DEFAULT, clamp(cleaned_air*MIASMA_RESEARCH_AMOUNT,0.01, MIASMA_RESEARCH_MAX_AMOUNT))//Turns out the burning of miasma is kinda interesting to scientists
return REACTING

/datum/gas_reaction/nitro_ball
Expand Down Expand Up @@ -730,7 +739,9 @@
if (prob(25 * increase_factor))
air.adjust_moles(GAS_H2, -(heat_efficency * 10))
new /obj/item/stack/sheet/mineral/metal_hydrogen(location)
SSresearch.science_tech.add_point_type(TECHWEB_POINT_TYPE_DEFAULT, min((heat_efficency * increase_factor * 0.5), METAL_HYDROGEN_RESEARCH_MAX_AMOUNT))
var/turf/holder_turf = get_holder_turf(holder)
if(holder_turf && SSmapping.level_trait(holder_turf.z, ZTRAIT_STATION))
SSresearch.science_tech.add_point_type(TECHWEB_POINT_TYPE_DEFAULT, min((heat_efficency * increase_factor * 0.5), METAL_HYDROGEN_RESEARCH_MAX_AMOUNT))

if(energy_used > 0)
var/new_heat_capacity = air.heat_capacity()
Expand Down

0 comments on commit ea38b6a

Please sign in to comment.