Smokables can now expose temperature to the atmosphere, causing fires. (#6142)
Co-authored-by: ShadowCommander <10494922+ShadowCommander@users.noreply.github.com> Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
98e5b5e484
commit
c2bbc01ff2
@@ -25,6 +25,12 @@ namespace Content.Server.Nutrition.Components
|
||||
[DataField("state")]
|
||||
public SmokableState State { get; set; } = SmokableState.Unlit;
|
||||
|
||||
[DataField("exposeTemperature")]
|
||||
public float ExposeTemperature { get; set; } = 0;
|
||||
|
||||
[DataField("exposeVolume")]
|
||||
public float ExposeVolume { get; set; } = 1f;
|
||||
|
||||
// clothing prefixes
|
||||
[DataField("burntPrefix")]
|
||||
public string BurntPrefix = "unlit";
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Content.Server.Atmos.EntitySystems;
|
||||
using Content.Server.Body.Components;
|
||||
using Content.Server.Body.Systems;
|
||||
using Content.Server.Chemistry.EntitySystems;
|
||||
@@ -21,6 +22,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
[Dependency] private readonly ReactiveSystem _reactiveSystem = default!;
|
||||
[Dependency] private readonly SolutionContainerSystem _solutionContainerSystem = default!;
|
||||
[Dependency] private readonly BloodstreamSystem _bloodstreamSystem = default!;
|
||||
[Dependency] private readonly AtmosphereSystem _atmos = default!;
|
||||
|
||||
private const float UpdateTimer = 3f;
|
||||
|
||||
@@ -80,7 +82,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
|
||||
foreach (var uid in _active.ToArray())
|
||||
{
|
||||
if (!EntityManager.TryGetComponent(uid, out SmokableComponent? smokable))
|
||||
if (!TryComp(uid, out SmokableComponent? smokable))
|
||||
{
|
||||
_active.Remove(uid);
|
||||
continue;
|
||||
@@ -92,6 +94,12 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
continue;
|
||||
}
|
||||
|
||||
if (smokable.ExposeTemperature > 0 && smokable.ExposeVolume > 0)
|
||||
{
|
||||
var transform = Transform(uid);
|
||||
_atmos.HotspotExpose(transform.Coordinates, smokable.ExposeTemperature, smokable.ExposeVolume, true);
|
||||
}
|
||||
|
||||
var inhaledSolution = _solutionContainerSystem.SplitSolution(uid, solution, smokable.InhaleAmount * _timer);
|
||||
|
||||
if (solution.TotalVolume == FixedPoint2.Zero)
|
||||
@@ -105,7 +113,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
// This is awful. I hate this so much.
|
||||
// TODO: Please, someone refactor containers and free me from this bullshit.
|
||||
if (!smokable.Owner.TryGetContainerMan(out var containerManager) ||
|
||||
!EntityManager.TryGetComponent(containerManager.Owner, out BloodstreamComponent? bloodstream))
|
||||
!TryComp(containerManager.Owner, out BloodstreamComponent? bloodstream))
|
||||
continue;
|
||||
|
||||
_reactiveSystem.ReactionEntity(containerManager.Owner, ReactionMethod.Ingestion, inhaledSolution);
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
id: BaseCigar
|
||||
abstract: true
|
||||
components:
|
||||
- type: Smokable
|
||||
exposeTemperature: 1173.15
|
||||
- type: Cigar
|
||||
- type: InjectableSolution
|
||||
solution: smokable
|
||||
|
||||
Reference in New Issue
Block a user