Thorium Reactor

## Purpose

### Description

Generates significant amounts of power from thorium. Requires constant cooling. Will explode violently if insufficient amounts of coolant are supplied.

## General

### Build Cost

300  Lead
50  Metaglass
150  Graphite
150  Thorium
200  Silicon

## Input/Output

### Input

1  Thorium (0.17/sec)
2.4  Cryofluid/sec

## Research

### Research Cost

11000  Lead
1500  Metaglass
5200  Graphite
5200  Thorium
7200  Silicon

The **Thorium Reactor** is a power reactor on Serpulo. It uses Thorium to generate large amounts of power based on how much fuel is stored in the block, all the while rapidly accumulating heat that must be cooled with Cryofluid. When overheated or destroyed by enemies while running, it creates a massive explosion that annihilates nearby buildings and heavily damages units.

Due to the destructive nature of the reactor, it can be straightforward to detonate a reactor next to the Core and end online games. As a result, most multiplayer servers disable reactors and block explosions.

## Tips

* The explosion caused by an overheating reactor inflicts 5000 damage at its center, with damage dissipating the further a target is away from the centre of the blast. This is enough to destroy any building and take over half of a tier 4 unit's health. Last-resort detonations against guardians can work, but you will have to rebuild from the fallout and actually build defenses afterward.
* Every unit of thorium adds 30 to the reactor's power generation, up to the maximum of 900 with 30 pieces.
* One Cryofluid Mixer is able to safely cool down 5 reactors, assuming that it and the reactors are under the same overdrive strength. Having Navanax around in multiplayer games may be dangerous in case a griefer decides to overload the reactors with the EMP weapon.
* An overheating Thorium Reactor does not explode if it is picked up by a unit with payload capacity, such as a Quad. This allows you to drop the reactor onto enemy structures that do not have a core nearby, although the Quad will nearly be killed as well.
* While Differential Generators generates slightly more power than the Thorium Reactor and do not carry the risk of exploding, they are very harsh on Cryofluid intake and will net less power overall per Cryofluid Mixer, especially if Water Extractors are used to make the coolant. (1 Cryofluid Mixer can cool down 2 Differential Generators resulting in a gross output of 2160 power per second compared to 5 Thorium Reactors which give a gross output of 4500 power per second.)
* Depending on how many Cryofluid Mixers you dedicate to cooling down reactors, it may be worth it to stick to Thorium Reactors instead of switching to an Impact Reactor due to ratios.
	+ 2 Cryofluid Mixers can cool down 1 Impact Reactor which gives a gross output of 6300 Power per second compared to 10 Thorium Reactors which give a gross output of 9000 power per second while not costing any Surge Alloy to build.
* A Thorium Reactor will still produce power even without any coolant, making it possible to have a reactor kick-start a Cryofluid Mixer and therefore power production, though care has to be taken to make sure the Mixer has sufficient water and titanium to start producing cryofluid before the reactor overheats. Two Water Extractors on neutral ground will handle the water dependency and can also be kick-started by the reactor, leaving just the titanium as an external input.
* Thorium Reactors do not leave ghost blocks behind when they are destroyed in an explosion, as a precaution against accidentally rebuilding a reactor without sufficient coolant and causing another explosion.
* Flares, Antumbras, and Eclipses will prioritize attacking Thorium Reactors, making sufficient air defence a necessity.

## Logic-based Failsafes

In order to make a safe Thorium Reactor, the below code measures the *heat* value of reactor1 and deactivates it if it goes past 0, preventing it from running, overheating and exploding.

```
sensor heat reactor1 @heat
op equal activateBool heat 0
control enabled reactor1 activateBool 0 0 0

```
You can use the *Link* function to cycle through any number of connected reactors. This code checks the amount of cryofluid in each reactor and shuts them down when it gets low.

```
set index 0
getlink reactor index
jump 0 equal reactor null
op add index index 1
sensor cryoLevel reactor @cryofluid
op greaterThan active cryoLevel 5
control enabled reactor active 0 0 0
jump 1 always x false

```

## Changes

 Version 6.0, unknown build
* Cryofluid consumption rate decreased (2.4 Cryofluid per second → 2.39).
* Description changed:
	+ Old description: "Generates significant amounts of power from thorium. Requires constant cooling. Will explode violently if insufficient amounts of coolant are supplied. Power output depends on fullness, with base power generated at full capacity"
 Version 7.0, Build 127
 Version 7.0, Build 140

## Gallery

An overheating reactor. it first changes colours from purple to orange, and finally yellow before explosion occurs. the four marks on its sides blink before the colour changes if no coolant is applied and it can be used for an early visual warning of an explosion imminent.The particle effect of the reactor explosion in Version 6.0 and before. Like its v7 counterpart, it stays for a while before disappearing.A working, stable reactor. Note the light blue that fills the hole, indicating that the reactor is supplied with cryofluid.A visual representation of the effects of a reactor explosion.An exploding reactor.
## References

1. ↑ https://github.com/Anuken/Mindustry/blob/master/core/src/mindustry/world/blocks/power/NuclearReactor.java