--- /dev/null
+using Content.Shared.IgnitionSource;
+
+namespace Content.Client.IgnitionSource;
+
+public sealed partial class IgnitionSourceSystem : SharedIgnitionSourceSystem;
using Content.Server.Administration.Logs;
using Content.Server.Atmos.Components;
-using Content.Server.IgnitionSource;
using Content.Server.Stunnable;
using Content.Server.Temperature.Components;
using Content.Server.Temperature.Systems;
using Content.Shared.Atmos.Components;
using Content.Shared.Damage;
using Content.Shared.Database;
+using Content.Shared.IgnitionSource;
using Content.Shared.Interaction;
using Content.Shared.Inventory;
using Content.Shared.Physics;
[Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!;
[Dependency] private readonly StunSystem _stunSystem = default!;
[Dependency] private readonly TemperatureSystem _temperatureSystem = default!;
- [Dependency] private readonly IgnitionSourceSystem _ignitionSourceSystem = default!;
+ [Dependency] private readonly SharedIgnitionSourceSystem _ignitionSourceSystem = default!;
[Dependency] private readonly DamageableSystem _damageableSystem = default!;
[Dependency] private readonly AlertsSystem _alertsSystem = default!;
[Dependency] private readonly FixtureSystem _fixture = default!;
/// <summary>
/// Ignites for a certain length of time when triggered.
-/// Requires <see cref="IgnitionSourceComponent"/> along with triggering components.
+/// Requires <see cref="Shared.IgnitionSourceComponent"/> along with triggering components.
/// </summary>
[RegisterComponent, Access(typeof(IgniteOnTriggerSystem))]
public sealed partial class IgniteOnTriggerComponent : Component
using Content.Server.Explosion.EntitySystems;
+using Content.Shared.IgnitionSource;
using Content.Shared.Timing;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Timing;
public sealed class IgniteOnTriggerSystem : EntitySystem
{
[Dependency] private readonly IGameTiming _timing = default!;
- [Dependency] private readonly IgnitionSourceSystem _source = default!;
+ [Dependency] private readonly SharedIgnitionSourceSystem _source = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly UseDelaySystem _useDelay = default!;
+++ /dev/null
-namespace Content.Server.IgnitionSource;
-
-/// <summary>
-/// This is used for creating atmosphere hotspots while ignited to start reactions such as fire.
-/// </summary>
-[RegisterComponent, Access(typeof(IgnitionSourceSystem))]
-public sealed partial class IgnitionSourceComponent : Component
-{
- [DataField, ViewVariables(VVAccess.ReadWrite)]
- public bool Ignited;
-
- [DataField, ViewVariables(VVAccess.ReadWrite)]
- public int Temperature = 700;
-}
using Content.Server.Atmos.EntitySystems;
using Content.Shared.IgnitionSource;
-using Content.Shared.Item.ItemToggle.Components;
-using Content.Shared.Temperature;
-using Robust.Server.GameObjects;
namespace Content.Server.IgnitionSource;
-
-/// <summary>
-/// This handles ignition, Jez basically coded this.
-/// </summary>
-public sealed class IgnitionSourceSystem : EntitySystem
+public sealed partial class IgnitionSourceSystem : SharedIgnitionSourceSystem
{
[Dependency] private readonly AtmosphereSystem _atmosphere = default!;
- [Dependency] private readonly TransformSystem _transform = default!;
-
- public override void Initialize()
- {
- base.Initialize();
-
- SubscribeLocalEvent<IgnitionSourceComponent, IsHotEvent>(OnIsHot);
- SubscribeLocalEvent<ItemToggleHotComponent, ItemToggledEvent>(OnItemToggle);
- SubscribeLocalEvent<IgnitionSourceComponent, IgnitionEvent>(OnIgnitionEvent);
- }
-
- private void OnIsHot(Entity<IgnitionSourceComponent> ent, ref IsHotEvent args)
- {
- args.IsHot = ent.Comp.Ignited;
- }
-
- private void OnItemToggle(Entity<ItemToggleHotComponent> ent, ref ItemToggledEvent args)
- {
- if (TryComp<IgnitionSourceComponent>(ent, out var comp))
- SetIgnited((ent.Owner, comp), args.Activated);
- }
-
- private void OnIgnitionEvent(Entity<IgnitionSourceComponent> ent, ref IgnitionEvent args)
- {
- SetIgnited((ent.Owner, ent.Comp), args.Ignite);
- }
-
- /// <summary>
- /// Simply sets the ignited field to the ignited param.
- /// </summary>
- public void SetIgnited(Entity<IgnitionSourceComponent?> ent, bool ignited = true)
- {
- if (!Resolve(ent, ref ent.Comp, false))
- return;
-
- ent.Comp.Ignited = ignited;
- }
+ [Dependency] private readonly SharedTransformSystem _transform = default!;
public override void Update(float frameTime)
{
if (xform.GridUid is { } gridUid)
{
var position = _transform.GetGridOrMapTilePosition(uid, xform);
+ // TODO: Should this be happening every single tick?
_atmosphere.HotspotExpose(gridUid, position, comp.Temperature, 50, uid, true);
}
}
namespace Content.Shared.IgnitionSource;
/// <summary>
-/// Raised in order to toggle the ignitionSourceComponent on an entity on or off
+/// Raised in order to toggle the <see cref="IgnitionSourceComponent"/> on an entity on or off
/// </summary>
[ByRefEvent]
public readonly record struct IgnitionEvent(bool Ignite = false);
--- /dev/null
+using Robust.Shared.GameStates;
+
+namespace Content.Shared.IgnitionSource;
+
+/// <summary>
+/// This is used for creating atmosphere hotspots while ignited to start reactions such as fire.
+/// </summary>
+[RegisterComponent, NetworkedComponent, AutoGenerateComponentState, Access(typeof(SharedIgnitionSourceSystem))]
+public sealed partial class IgnitionSourceComponent : Component
+{
+ /// <summary>
+ /// Is this source currently ignited?
+ /// </summary>
+ [DataField, AutoNetworkedField]
+ public bool Ignited;
+
+ /// <summary>
+ /// The temperature used when creating atmos hotspots.
+ /// </summary>
+ [DataField, AutoNetworkedField]
+ public float Temperature = 700f;
+}
--- /dev/null
+using Content.Shared.Item.ItemToggle.Components;
+using Content.Shared.Temperature;
+
+namespace Content.Shared.IgnitionSource;
+
+/// <summary>
+/// Ignites flammable gases when the ignition source is toggled on.
+/// Also makes the entity hot so that it can be used to ignite matchsticks, cigarettes ect.
+/// </summary>
+public abstract partial class SharedIgnitionSourceSystem : EntitySystem
+{
+ public override void Initialize()
+ {
+ base.Initialize();
+
+ SubscribeLocalEvent<IgnitionSourceComponent, IsHotEvent>(OnIsHot);
+ SubscribeLocalEvent<ItemToggleHotComponent, ItemToggledEvent>(OnItemToggle);
+ SubscribeLocalEvent<IgnitionSourceComponent, IgnitionEvent>(OnIgnitionEvent);
+ }
+
+ private void OnIsHot(Entity<IgnitionSourceComponent> ent, ref IsHotEvent args)
+ {
+ args.IsHot |= ent.Comp.Ignited;
+ }
+
+ private void OnItemToggle(Entity<ItemToggleHotComponent> ent, ref ItemToggledEvent args)
+ {
+ SetIgnited(ent.Owner, args.Activated);
+ }
+
+ private void OnIgnitionEvent(Entity<IgnitionSourceComponent> ent, ref IgnitionEvent args)
+ {
+ SetIgnited((ent.Owner, ent.Comp), args.Ignite);
+ }
+
+ /// <summary>
+ /// Simply sets the ignited field to the ignited param.
+ /// </summary>
+ public void SetIgnited(Entity<IgnitionSourceComponent?> ent, bool ignited = true)
+ {
+ if (!Resolve(ent, ref ent.Comp, false))
+ return;
+
+ ent.Comp.Ignited = ignited;
+ Dirty(ent, ent.Comp);
+ }
+}