mirror of
https://github.com/wega-team/ss14-wega.git
synced 2026-02-15 03:31:44 +01:00
Flare gun 1984 (#15807)
This commit is contained in:
@@ -13,6 +13,7 @@ using Content.Shared.Physics;
|
||||
using Content.Shared.Popups;
|
||||
using Content.Shared.Rejuvenate;
|
||||
using Content.Shared.Temperature;
|
||||
using Content.Shared.Throwing;
|
||||
using Content.Shared.Weapons.Melee.Events;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Physics;
|
||||
@@ -58,7 +59,10 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
SubscribeLocalEvent<FlammableComponent, IsHotEvent>(OnIsHot);
|
||||
SubscribeLocalEvent<FlammableComponent, TileFireEvent>(OnTileFire);
|
||||
SubscribeLocalEvent<FlammableComponent, RejuvenateEvent>(OnRejuvenate);
|
||||
|
||||
SubscribeLocalEvent<IgniteOnCollideComponent, StartCollideEvent>(IgniteOnCollide);
|
||||
SubscribeLocalEvent<IgniteOnCollideComponent, LandEvent>(OnIgniteLand);
|
||||
|
||||
SubscribeLocalEvent<IgniteOnMeleeHitComponent, MeleeHitEvent>(OnMeleeHit);
|
||||
}
|
||||
|
||||
@@ -74,15 +78,27 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
}
|
||||
}
|
||||
|
||||
private void OnIgniteLand(EntityUid uid, IgniteOnCollideComponent component, ref LandEvent args)
|
||||
{
|
||||
RemCompDeferred<IgniteOnCollideComponent>(uid);
|
||||
}
|
||||
|
||||
private void IgniteOnCollide(EntityUid uid, IgniteOnCollideComponent component, ref StartCollideEvent args)
|
||||
{
|
||||
var otherFixture = args.OtherFixture.Body.Owner;
|
||||
if (!args.OtherFixture.Hard || component.Count == 0)
|
||||
return;
|
||||
|
||||
if (!EntityManager.TryGetComponent(otherFixture, out FlammableComponent? flammable))
|
||||
var otherEnt = args.OtherEntity;
|
||||
|
||||
if (!EntityManager.TryGetComponent(otherEnt, out FlammableComponent? flammable))
|
||||
return;
|
||||
|
||||
flammable.FireStacks += component.FireStacks;
|
||||
Ignite(otherFixture, flammable);
|
||||
Ignite(otherEnt, flammable);
|
||||
component.Count--;
|
||||
|
||||
if (component.Count == 0)
|
||||
RemCompDeferred<IgniteOnCollideComponent>(uid);
|
||||
}
|
||||
|
||||
private void OnMapInit(EntityUid uid, FlammableComponent component, MapInitEvent args)
|
||||
|
||||
Reference in New Issue
Block a user