public void ProcessHotspot() { if (!Hotspot.Valid) { _gridAtmosphereComponent.RemoveHotspotTile(this); return; } if (!Hotspot.SkippedFirstProcess) { Hotspot.SkippedFirstProcess = true; return; } ExcitedGroup?.ResetCooldowns(); if ((Hotspot.Temperature < Atmospherics.FireMinimumTemperatureToExist) || (Hotspot.Volume <= 1f) || Air == null || Air.Gases[(int)Gas.Oxygen] < 0.5f || Air.Gases[(int)Gas.Phoron] < 0.5f) { Hotspot = new Hotspot(); UpdateVisuals(); return; } PerformHotspotExposure(); if (Hotspot.Bypassing) { Hotspot.State = 3; _gridAtmosphereComponent.BurnTile(GridIndices); if (Air.Temperature > Atmospherics.FireMinimumTemperatureToSpread) { var radiatedTemperature = Air.Temperature * Atmospherics.FireSpreadRadiosityScale; foreach (var(_, tile) in _adjacentTiles) { if (!tile.Hotspot.Valid) { tile.HotspotExpose(radiatedTemperature, Atmospherics.CellVolume / 4); } } } } else { Hotspot.State = Hotspot.Volume > Atmospherics.CellVolume * 0.4f ? 2 : 1; } if (Hotspot.Temperature > MaxFireTemperatureSustained) { MaxFireTemperatureSustained = Hotspot.Temperature; } // TODO ATMOS Maybe destroy location here? }
public void HotspotExpose(float exposedTemperature, float exposedVolume, bool soh = false) { if (Air == null) { return; } var oxygen = Air.GetMoles(Gas.Oxygen); if (oxygen < 0.5f) { return; } var phoron = Air.GetMoles(Gas.Phoron); var tritium = Air.GetMoles(Gas.Tritium); if (Hotspot.Valid) { if (soh) { if (phoron > 0.5f || tritium > 0.5f) { if (Hotspot.Temperature < exposedTemperature) { Hotspot.Temperature = exposedTemperature; } if (Hotspot.Volume < exposedVolume) { Hotspot.Volume = exposedVolume; } } } return; } if ((exposedTemperature > Atmospherics.PhoronMinimumBurnTemperature) && (phoron > 0.5f || tritium > 0.5f)) { Hotspot = new Hotspot { Volume = exposedVolume * 25f, Temperature = exposedTemperature, SkippedFirstProcess = _currentCycle > _gridAtmosphereComponent.UpdateCounter }; Hotspot.Start(); _gridAtmosphereComponent.AddActiveTile(this); _gridAtmosphereComponent.AddHotspotTile(this); } }