HFR core
This section contain the hfr core with all the variables and the Initialize(mapload) and Destroy() procs
Vars | |
common_channel | The common channel |
---|---|
conduction | Energy from the reaction lost from the molecule colliding between themselves. |
core_temperature | Temperature of the center of the fusion reaction |
corners | Stores the information of the corners of the machine |
critical_threshold_proximity | Integrity of the machine, if reaches 900 the machine will explode |
critical_threshold_proximity_archived | Store the integrity for calculations |
current_damper | User controlled variable to control the flow of the fusion by changing the instability of the reaction |
delta_fuel_list | Amount of gas inside internal fuel being removed or added per tick by the reaction. This is used for tgui only |
delta_mod_list | Amount of gas inside moderator being removed or added per tick by the reaction. This is used for tgui only |
delta_temperature | Difference between the gases temperature and the internal temperature of the reaction |
efficiency | Efficiency of the reaction, it increases with the amount of plasma |
emergency_alert | The alert we send when we've reached emergency_point |
emergency_point | The point at which we start sending messages to the common channel |
energy | Fusion vars E=mc^2 with some addition to allow it gameplaywise |
engineering_channel | The engineering channel |
final_countdown | Var used in the meltdown phase |
fuel_filtering_rate | Set the amount of moles per tick should be removed from the fuel by filtering |
fuel_injection_rate | User controlled variable to control the flow of the fusion by changing the amount of fuel injected |
fuel_remove | Check if the user want to remove the fuel gases |
fusion_temperature_archived | These vars store the temperatures to be used in the GUI |
has_reached_emergency | Boolean used for logging if we've passed the emergency point |
heat_limiter_modifier | Hotter air is easier to heat up and cool down |
heat_output | The amount of heat that is finally emitted, based on the power output. Min and max are variables that depends of the modifier |
heat_output_max | How much the reaction can cool itself |
heat_output_min | How much the reaction can heat itself |
heating_conductor | User controlled variable to control the flow of the fusion by changing the contact of the material |
icon_state_open | Vars for the state of the icon of the object (open, off, active) |
instability | Instability effects how chaotic the behavior of the reaction is |
internal_fusion | Stores the information of the fusion gasmix |
internal_power | *Power emitted from the center of the fusion reaction: Internal power = densityH2 * densityTrit(Pi * (2 * rH2 * rTrit)**2) * Energy * density is calculated with moles/volume, rH2 and rTrit are values calculated with moles/(radius of the gas) both of the density can be varied by the power_modifier |
iron_content | Stores the iron content produced by the fusion |
last_accent_sound | cooldown tracker for accent sounds |
lastwarning | Time in 1/10th of seconds since the last sent warning |
linked_input | Stores the information of the fuel input |
linked_interface | Hypertorus internal objects and gasmixes. Stores the informations of the interface machine |
linked_moderator | Stores the information of the moderator input |
linked_output | Stores the information of the waste output |
machine_parts | Stores the three inputs/outputs of the HFR, needed for cracking the parts |
magnetic_constrictor | User controlled variable to control the flow of the fusion by changing the volume of the gasmix by controlling the power of the magnetic fields |
melting_point | The point at which we melt |
moderator_filtering_rate | Set the amount of moles per tick should be removed from the moderator by filtering |
moderator_injection_rate | User controlled variable to control the flow of the fusion by changing the amount of moderators injected |
moderator_internal | Stores the information of the moderators gasmix |
moderator_scrubbing | Set the filtering list of the waste remove |
power_level | Stores the current fusion mix power level |
power_output | *The effective power transmission of the fusion reaction, power_output = efficiency * (internal_power - conduction - radiation) * Conduction is the heat value that is transmitted by the molecular interactions and it gets removed from the internal_power lowering the effective output * Radiation is the irradiation released by the fusion reaction, it comprehends all wavelenghts in the spectrum, it lowers the effective output of the reaction |
rad_power | Amount of radiation that the machine can output |
radiation | The remaining wavelength that actually can do damage to mobs. |
radio | Our internal radio |
radio_key | The key our internal radio uses |
safe_alert | Our "Shit is no longer fucked" message. We send it when critical_threshold_proximity is less then critical_threshold_proximity_archived |
selected_fuel | Stores the current fuel mix that the user has selected |
soundloop | Our soundloop |
start_cooling | Checks for the cooling to start |
start_fuel | Checks for the fuel to be injected |
start_moderator | Checks for the moderators to be injected |
start_power | Processing checks Checks if the user has started the machine |
temperature_period | Time between current and _archived temperatures |
warning_alert | The alert we send when we've reached warning_point |
warning_damage_flags | Flags used in the alert proc to select what messages to show when the HFR is delaminating (HYPERTORUS_FLAG_HIGH_POWER_DAMAGE | HYPERTORUS_FLAG_HIGH_FUEL_MIX_MOLE | HYPERTORUS_FLAG_IRON_CONTENT_DAMAGE | HYPERTORUS_FLAG_IRON_CONTENT_INCREASE | HYPERTORUS_FLAG_EMPED) |
warning_point | The point at which we should start sending messeges about the critical_threshold_proximity to the engi channels. |
waste_remove | Check if the user want to remove the waste gases |
Procs | |
activate | Called by multitool_act() in hfr_parts.dm It sets the pieces to active, allowing the player to start the main reaction Arguments: |
alarm | Called by check_alert() in this file Play a sound from the machine, the type depends on the status of the hfr |
check_alert | Called by process_atmos() in hfr_main_processes.dm Called after checking the damage of the machine, calls alarm() and countdown() Broadcast messages into engi and common radio |
check_fuel | Called by the main fusion processes in hfr_main_processes.dm Getter for fusion fuel moles |
check_gas_requirements | Checks if the gases in the input are the ones needed by the recipe |
check_part_connectivity | This section contain all procs that helps building, destroy and control the hfr |
check_power_use | Called by the main fusion processes in hfr_main_processes.dm Check the power use of the machine, return TRUE if there is enough power in the powernet |
countdown | Called by check_alert() in this file Called when the damage has reached critical levels, start the countdown before the destruction, calls meltdown() |
deactivate | Called by unregister_signals() in this file, called when the main fusion processes check_part_connectivity() returns false Deactivate the various machines by setting the active var to false, updates the machines icon and set the linked machine vars to null |
dump_gases | Removes the gases from the internal gasmix when the recipe is changed |
emit_rads | Emit radiation |
fusion_process | Called by process() Contains the main fusion calculations and checks, for more informations check the comments along the code. |
get_area_cell_percent | Get how charged the area's APC is |
get_integrity_percent | Getter for the machine integrity |
get_status | Called by alarm() in this file Check the integrity level and returns the status of the machine |
induce_hallucination | Induce hallucinations in nearby humans. |
meltdown | Called by countdown() in this file Create the explosion + the gas emission before deleting the machine core. |
moderator_common_process | Perform common fusion actions: |
moderator_fuel_process | Store the fuel gases and the byproduct gas quantities Scaled down moles of gases, no less than 0 Store the moderators gases quantities Scaled down moles of gases, no less than 0 Those are the scaled gases that gets consumed and adjust energy Between 0.25 and 100, this value is used to modify the behaviour of the internal energy and the core temperature based on the gases present in the mix Minimum 0.25, this value is used to modify the behaviour of the energy emission based on the gases present in the mix Between 0.005 and 1000, this value modify the radiation emission of the reaction, higher values increase the emission Perform recipe specific actions. Fuel consumption and recipe based gas production happens here. |
play_ambience | Infrequently plays accent sounds, and adjusts main loop parameters |
process_atmos | Main Fusion processes process() Organizes all other calls, and is the best starting point for top-level logic. fusion_process() handles all the main fusion reaction logic and consequences (lightning, radiation, particles) from an active fusion reaction. |
send_radio_explanation | Called by check_alert() in this file Called to explain in radio what the issues are with the HFR |
unregister_signals | Called when a part gets deleted around the hfr, called on Destroy() of the hfr core in hfr_core.dm Unregister the signals attached to the core from the various machines, if only_signals is false it will also call deactivate() Arguments: |
update_pipenets | Updates all related pipenets from all connected components |
Var Details
common_channel
The common channel
conduction
Energy from the reaction lost from the molecule colliding between themselves.
core_temperature
Temperature of the center of the fusion reaction
corners
Stores the information of the corners of the machine
critical_threshold_proximity
Integrity of the machine, if reaches 900 the machine will explode
critical_threshold_proximity_archived
Store the integrity for calculations
current_damper
User controlled variable to control the flow of the fusion by changing the instability of the reaction
delta_fuel_list
Amount of gas inside internal fuel being removed or added per tick by the reaction. This is used for tgui only
delta_mod_list
Amount of gas inside moderator being removed or added per tick by the reaction. This is used for tgui only
delta_temperature
Difference between the gases temperature and the internal temperature of the reaction
efficiency
Efficiency of the reaction, it increases with the amount of plasma
emergency_alert
The alert we send when we've reached emergency_point
emergency_point
The point at which we start sending messages to the common channel
energy
Fusion vars E=mc^2 with some addition to allow it gameplaywise
engineering_channel
The engineering channel
final_countdown
Var used in the meltdown phase
fuel_filtering_rate
Set the amount of moles per tick should be removed from the fuel by filtering
fuel_injection_rate
User controlled variable to control the flow of the fusion by changing the amount of fuel injected
fuel_remove
Check if the user want to remove the fuel gases
fusion_temperature_archived
These vars store the temperatures to be used in the GUI
has_reached_emergency
Boolean used for logging if we've passed the emergency point
heat_limiter_modifier
Hotter air is easier to heat up and cool down
heat_output
The amount of heat that is finally emitted, based on the power output. Min and max are variables that depends of the modifier
heat_output_max
How much the reaction can cool itself
heat_output_min
How much the reaction can heat itself
heating_conductor
User controlled variable to control the flow of the fusion by changing the contact of the material
icon_state_open
Vars for the state of the icon of the object (open, off, active)
instability
Instability effects how chaotic the behavior of the reaction is
internal_fusion
Stores the information of the fusion gasmix
internal_power
*Power emitted from the center of the fusion reaction: Internal power = densityH2 * densityTrit(Pi * (2 * rH2 * rTrit)**2) * Energy * density is calculated with moles/volume, rH2 and rTrit are values calculated with moles/(radius of the gas) both of the density can be varied by the power_modifier
iron_content
Stores the iron content produced by the fusion
last_accent_sound
cooldown tracker for accent sounds
lastwarning
Time in 1/10th of seconds since the last sent warning
linked_input
Stores the information of the fuel input
linked_interface
Hypertorus internal objects and gasmixes. Stores the informations of the interface machine
linked_moderator
Stores the information of the moderator input
linked_output
Stores the information of the waste output
machine_parts
Stores the three inputs/outputs of the HFR, needed for cracking the parts
magnetic_constrictor
User controlled variable to control the flow of the fusion by changing the volume of the gasmix by controlling the power of the magnetic fields
melting_point
The point at which we melt
moderator_filtering_rate
Set the amount of moles per tick should be removed from the moderator by filtering
moderator_injection_rate
User controlled variable to control the flow of the fusion by changing the amount of moderators injected
moderator_internal
Stores the information of the moderators gasmix
moderator_scrubbing
Set the filtering list of the waste remove
power_level
Stores the current fusion mix power level
power_output
*The effective power transmission of the fusion reaction, power_output = efficiency * (internal_power - conduction - radiation) * Conduction is the heat value that is transmitted by the molecular interactions and it gets removed from the internal_power lowering the effective output * Radiation is the irradiation released by the fusion reaction, it comprehends all wavelenghts in the spectrum, it lowers the effective output of the reaction
rad_power
Amount of radiation that the machine can output
radiation
The remaining wavelength that actually can do damage to mobs.
radio
Our internal radio
radio_key
The key our internal radio uses
safe_alert
Our "Shit is no longer fucked" message. We send it when critical_threshold_proximity is less then critical_threshold_proximity_archived
selected_fuel
Stores the current fuel mix that the user has selected
soundloop
Our soundloop
start_cooling
Checks for the cooling to start
start_fuel
Checks for the fuel to be injected
start_moderator
Checks for the moderators to be injected
start_power
Processing checks Checks if the user has started the machine
temperature_period
Time between current and _archived temperatures
warning_alert
The alert we send when we've reached warning_point
warning_damage_flags
Flags used in the alert proc to select what messages to show when the HFR is delaminating (HYPERTORUS_FLAG_HIGH_POWER_DAMAGE | HYPERTORUS_FLAG_HIGH_FUEL_MIX_MOLE | HYPERTORUS_FLAG_IRON_CONTENT_DAMAGE | HYPERTORUS_FLAG_IRON_CONTENT_INCREASE | HYPERTORUS_FLAG_EMPED)
warning_point
The point at which we should start sending messeges about the critical_threshold_proximity to the engi channels.
waste_remove
Check if the user want to remove the waste gases
Proc Details
activate
Called by multitool_act() in hfr_parts.dm It sets the pieces to active, allowing the player to start the main reaction Arguments:
- -user: the player doing the action
alarm
Called by check_alert() in this file Play a sound from the machine, the type depends on the status of the hfr
check_alert
Called by process_atmos() in hfr_main_processes.dm Called after checking the damage of the machine, calls alarm() and countdown() Broadcast messages into engi and common radio
check_fuel
Called by the main fusion processes in hfr_main_processes.dm Getter for fusion fuel moles
check_gas_requirements
Checks if the gases in the input are the ones needed by the recipe
check_part_connectivity
This section contain all procs that helps building, destroy and control the hfr
Called by multitool_act() in hfr_parts.dm, by atmos_process() in hfr_main_processes.dm and by fusion_process() in the same file This proc checks the surrounding of the core to ensure that the machine has been build correctly, returns false if there is a missing piece/wrong placed one
check_power_use
Called by the main fusion processes in hfr_main_processes.dm Check the power use of the machine, return TRUE if there is enough power in the powernet
countdown
Called by check_alert() in this file Called when the damage has reached critical levels, start the countdown before the destruction, calls meltdown()
deactivate
Called by unregister_signals() in this file, called when the main fusion processes check_part_connectivity() returns false Deactivate the various machines by setting the active var to false, updates the machines icon and set the linked machine vars to null
dump_gases
Removes the gases from the internal gasmix when the recipe is changed
emit_rads
Emit radiation
fusion_process
Called by process() Contains the main fusion calculations and checks, for more informations check the comments along the code.
get_area_cell_percent
Get how charged the area's APC is
get_integrity_percent
Getter for the machine integrity
get_status
Called by alarm() in this file Check the integrity level and returns the status of the machine
induce_hallucination
Induce hallucinations in nearby humans.
force will make hallucinations ignore meson protection.
meltdown
Called by countdown() in this file Create the explosion + the gas emission before deleting the machine core.
moderator_common_process
Perform common fusion actions:
- Gases that get produced irrespective of recipe
- Temperature modifiers, radiation modifiers, and the application of each
- Committing staged output, performing filtering, and making !FUN! emissions
moderator_fuel_process
Store the fuel gases and the byproduct gas quantities Scaled down moles of gases, no less than 0 Store the moderators gases quantities Scaled down moles of gases, no less than 0 Those are the scaled gases that gets consumed and adjust energy Between 0.25 and 100, this value is used to modify the behaviour of the internal energy and the core temperature based on the gases present in the mix Minimum 0.25, this value is used to modify the behaviour of the energy emission based on the gases present in the mix Between 0.005 and 1000, this value modify the radiation emission of the reaction, higher values increase the emission Perform recipe specific actions. Fuel consumption and recipe based gas production happens here.
play_ambience
Infrequently plays accent sounds, and adjusts main loop parameters
process_atmos
Main Fusion processes process() Organizes all other calls, and is the best starting point for top-level logic. fusion_process() handles all the main fusion reaction logic and consequences (lightning, radiation, particles) from an active fusion reaction.
send_radio_explanation
Called by check_alert() in this file Called to explain in radio what the issues are with the HFR
unregister_signals
Called when a part gets deleted around the hfr, called on Destroy() of the hfr core in hfr_core.dm Unregister the signals attached to the core from the various machines, if only_signals is false it will also call deactivate() Arguments:
- only_signals: default FALSE, if true the proc will not call the deactivate() proc
update_pipenets
Updates all related pipenets from all connected components