-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
520 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using Content.Server.Atmos.EntitySystems; | ||
using Content.Shared.Atmos; | ||
using Content.Shared.Atmos.Reactions; | ||
using JetBrains.Annotations; | ||
|
||
namespace Content.Server.Atmos.Reactions; | ||
|
||
/// <summary> | ||
/// Forms BZ from mixing Plasma and Nitrous Oxide at low pressure. Also decomposes Nitrous Oxide when there are more than 3 parts Plasma per N2O. | ||
/// </summary> | ||
[UsedImplicitly] | ||
public sealed partial class BZFormationReaction : IGasReactionEffect | ||
{ | ||
public ReactionResult React(GasMixture mixture, IGasMixtureHolder? holder, AtmosphereSystem atmosphereSystem, float heatScale) | ||
{ | ||
var initN2O = mixture.GetMoles(Gas.NitrousOxide); | ||
var initPlasma = mixture.GetMoles(Gas.Plasma); | ||
var pressure = mixture.Pressure; | ||
var volume = mixture.Volume; | ||
|
||
var environmentEfficiency = volume / pressure; // more volume and less pressure gives better rates | ||
var ratioEfficiency = Math.Min(initN2O / initPlasma, 1); // less n2o than plasma gives lower rates | ||
|
||
var totalRate = environmentEfficiency * ratioEfficiency / Atmospherics.BZFormationRate; | ||
|
||
var n2oRemoved = totalRate * 2f; | ||
var plasmaRemoved = totalRate * 4f; | ||
var bzFormed = totalRate * 5f; | ||
|
||
if (n2oRemoved > initN2O || plasmaRemoved > initPlasma) | ||
return ReactionResult.NoReaction; | ||
|
||
mixture.AdjustMoles(Gas.NitrousOxide, -n2oRemoved); | ||
mixture.AdjustMoles(Gas.Plasma, -plasmaRemoved); | ||
mixture.AdjustMoles(Gas.BZ, bzFormed); | ||
|
||
var energyReleased = bzFormed * Atmospherics.BZFormationEnergy; | ||
var heatCap = atmosphereSystem.GetHeatCapacity(mixture, true); | ||
if (heatCap > Atmospherics.MinimumHeatCapacity) | ||
mixture.Temperature = Math.Max((mixture.Temperature * heatCap + energyReleased) / heatCap, Atmospherics.TCMB); | ||
|
||
return ReactionResult.Reacting; | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
Content.Server/Atmos/Reactions/HealiumProductionReaction.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using Content.Server.Atmos.EntitySystems; | ||
using Content.Shared.Atmos; | ||
using Content.Shared.Atmos.Reactions; | ||
using JetBrains.Annotations; | ||
|
||
namespace Content.Server.Atmos.Reactions; | ||
|
||
/// <summary> | ||
/// Produces Healium by mixing BZ and Frezon at temperatures between 23K and 293K. Efficiency increases in colder temperatures. | ||
/// </summary> | ||
[UsedImplicitly] | ||
public sealed partial class HealiumProductionReaction : IGasReactionEffect | ||
{ | ||
public ReactionResult React(GasMixture mixture, IGasMixtureHolder? holder, AtmosphereSystem atmosphereSystem, float heatScale) | ||
{ | ||
var initBZ = mixture.GetMoles(Gas.BZ); | ||
var initFrezon = mixture.GetMoles(Gas.Frezon); | ||
|
||
var rate = mixture.Temperature / Atmospherics.T20C; | ||
var efficiency = 23.15f / mixture.Temperature; | ||
|
||
var bZRemoved = 1f * rate; | ||
var frezonRemoved = 11f * rate; | ||
var healiumProduced = 12f * rate * efficiency; | ||
|
||
if (bZRemoved > initBZ || frezonRemoved > initFrezon || mixture.Temperature > Atmospherics.T20C) | ||
return ReactionResult.NoReaction; | ||
|
||
mixture.AdjustMoles(Gas.BZ, -bZRemoved); | ||
mixture.AdjustMoles(Gas.Frezon, -frezonRemoved); | ||
mixture.AdjustMoles(Gas.Healium, healiumProduced); | ||
|
||
var energyReleased = healiumProduced * Atmospherics.HealiumProductionEnergy; | ||
var heatCap = atmosphereSystem.GetHeatCapacity(mixture, true); | ||
if (heatCap > Atmospherics.MinimumHeatCapacity) | ||
mixture.Temperature = Math.Max((mixture.Temperature * heatCap + energyReleased) / heatCap, Atmospherics.TCMB); | ||
|
||
return ReactionResult.Reacting; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
Resources/Locale/ru-RU/_prototypes/_sunrise/reagents/meta/gases.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
reagent-name-bz = БЗ | ||
reagent-desc-bz = Мощный галлюциноген, который также усыпляет слаймолюдов. | ||
reagent-name-healium = хилиум | ||
reagent-desc-healium = Мощное снотворное средство с регенерирующими свойствами. | ||
gases-healium = Хилиум | ||
gases-bz = БЗ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
- type: gas | ||
id: 9 | ||
name: gases-bz | ||
specificHeat: 20 | ||
heatCapacityRatio: 1.4 | ||
molarMass: 10 | ||
color: 9370db | ||
reagent: BZ | ||
pricePerMole: 0.15 | ||
|
||
- type: gas | ||
id: 10 | ||
name: gases-healium | ||
specificHeat: 20 | ||
heatCapacityRatio: 1.4 | ||
molarMass: 10 | ||
color: 8b0000 | ||
reagent: Healium | ||
pricePerMole: 0.8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
- type: gasReaction | ||
id: bzFormation | ||
priority: 2 | ||
maximumTemperature: 313.149 # Atmospherics.FireMinimumTemperatureToExist - 60 | ||
minimumRequirements: | ||
- 0 # oxygen | ||
- 0 # nitrogen | ||
- 0 # carbon dioxide | ||
- 10 # plasma | ||
- 0 # tritium | ||
- 0 # vapor | ||
- 0 # miasma | ||
- 10 # n2o | ||
- 0 # frezon | ||
effects: | ||
- !type:BZFormationReaction {} | ||
|
||
- type: gasReaction | ||
id: HealiumProduction | ||
priority: 2 | ||
minimumRequirements: | ||
- 0 # oxygen | ||
- 0 # nitrogen | ||
- 0 # carbon dioxide | ||
- 0 # plasma | ||
- 0 # tritium | ||
- 0 # vapor | ||
- 0 # miasma | ||
- 0 # n2o | ||
- 5 # frezon | ||
- 5 # bz | ||
effects: | ||
- !type:HealiumProductionReaction {} |
122 changes: 122 additions & 0 deletions
122
Resources/Prototypes/_Sunrise/Entities/Structures/Storage/Canisters/gas_canisters.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
- type: entity | ||
parent: GasCanister | ||
id: BZCanister | ||
name: канистра БЗ | ||
description: Канистра, в которой может содержаться газ любого вида. В этой, предположительно, содержится БЗ. Можно прикрепить к порту коннектора с помощью гаечного ключа. | ||
components: | ||
- type: Sprite | ||
sprite: _Sunrise/Structures/Storage/canister.rsi | ||
layers: | ||
- state: bz | ||
- type: GasCanister | ||
gasMixture: | ||
volume: 1000 | ||
moles: | ||
- 0 # oxygen | ||
- 0 # nitrogen | ||
- 0 # CO2 | ||
- 0 # Plasma | ||
- 0 # Tritium | ||
- 0 # Water vapor | ||
- 0 # Miasma | ||
- 0 # N2O | ||
- 0 # Frezon | ||
- 1871.71051 # BZ | ||
temperature: 293.15 | ||
- type: Destructible | ||
thresholds: | ||
- trigger: | ||
!type:DamageTrigger | ||
damage: 600 | ||
behaviors: | ||
- !type:DoActsBehavior | ||
acts: [ "Destruction" ] | ||
- trigger: | ||
!type:DamageTrigger | ||
damage: 300 | ||
behaviors: | ||
- !type:PlaySoundBehavior | ||
sound: | ||
collection: MetalBreak | ||
- !type:SpawnEntitiesBehavior | ||
spawn: | ||
BZCanisterBroken: | ||
min: 1 | ||
max: 1 | ||
- !type:DoActsBehavior | ||
acts: [ "Destruction" ] | ||
- !type:DumpCanisterBehavior | ||
- type: Lock | ||
locked: true | ||
|
||
- type: entity | ||
parent: GasCanister | ||
id: HealiumCanister | ||
name: канистра хилиум | ||
description: Канистра, в которой может содержаться газ любого вида. В этой, предположительно, содержится хилиум. Можно прикрепить к порту коннектора с помощью гаечного ключа. | ||
components: | ||
- type: Sprite | ||
sprite: _Sunrise/Structures/Storage/canister.rsi | ||
layers: | ||
- state: healium | ||
- type: GasCanister | ||
gasMixture: | ||
volume: 1000 | ||
moles: | ||
- 0 # oxygen | ||
- 0 # nitrogen | ||
- 0 # CO2 | ||
- 0 # Plasma | ||
- 0 # Tritium | ||
- 0 # Water vapor | ||
- 0 # Miasma | ||
- 0 # N2O | ||
- 0 # Frezon | ||
- 0 # BZ | ||
- 1871.71051 # Healium | ||
temperature: 293.15 | ||
- type: Destructible | ||
thresholds: | ||
- trigger: | ||
!type:DamageTrigger | ||
damage: 600 | ||
behaviors: | ||
- !type:DoActsBehavior | ||
acts: [ "Destruction" ] | ||
- trigger: | ||
!type:DamageTrigger | ||
damage: 300 | ||
behaviors: | ||
- !type:PlaySoundBehavior | ||
sound: | ||
collection: MetalBreak | ||
- !type:SpawnEntitiesBehavior | ||
spawn: | ||
HealiumCanisterBroken: | ||
min: 1 | ||
max: 1 | ||
- !type:DoActsBehavior | ||
acts: [ "Destruction" ] | ||
- !type:DumpCanisterBehavior | ||
- type: Lock | ||
locked: true | ||
|
||
|
||
|
||
- type: entity | ||
parent: GasCanisterBrokenBase | ||
id: BZCanisterBroken | ||
categories: [ HideSpawnMenu ] | ||
components: | ||
- type: Sprite | ||
sprite: _Sunrise/Structures/Storage/canister.rsi | ||
state: bz-1 | ||
|
||
- type: entity | ||
parent: GasCanisterBrokenBase | ||
id: HealiumCanisterBroken | ||
categories: [ HideSpawnMenu ] | ||
components: | ||
- type: Sprite | ||
sprite: _Sunrise/Structures/Storage/canister.rsi | ||
state: healium-1 |
Oops, something went wrong.