Incediary Shells (#6208)
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
19
Content.Server/Atmos/Components/IgniteOnCollideComponent.cs
Normal file
19
Content.Server/Atmos/Components/IgniteOnCollideComponent.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Content.Server.Atmos.Components
|
||||
{
|
||||
[RegisterComponent]
|
||||
public class IgniteOnCollideComponent : Component
|
||||
{
|
||||
public override string Name => "IgniteOnCollide";
|
||||
|
||||
[DataField("fireStacks")]
|
||||
public float FireStacks { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -49,6 +49,15 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
SubscribeLocalEvent<FlammableComponent, StartCollideEvent>(OnCollideEvent);
|
||||
SubscribeLocalEvent<FlammableComponent, IsHotEvent>(OnIsHotEvent);
|
||||
SubscribeLocalEvent<FlammableComponent, TileFireEvent>(OnTileFireEvent);
|
||||
SubscribeLocalEvent<IgniteOnCollideComponent, StartCollideEvent>(IgniteOnCollide);
|
||||
}
|
||||
|
||||
private void IgniteOnCollide(EntityUid uid, IgniteOnCollideComponent component, StartCollideEvent args)
|
||||
{
|
||||
var otherfixture = args.OtherFixture.Body.Owner;
|
||||
if (EntityManager.TryGetComponent(otherfixture, out FlammableComponent flammable))
|
||||
flammable.FireStacks += component.FireStacks;
|
||||
Ignite(otherfixture, flammable);
|
||||
}
|
||||
|
||||
private void OnInteractUsingEvent(EntityUid uid, FlammableComponent flammable, InteractUsingEvent args)
|
||||
|
||||
Reference in New Issue
Block a user