improve ignite logs (#18669)
This commit is contained in:
@@ -150,7 +150,7 @@ public sealed partial class AdminVerbSystem
|
||||
{
|
||||
// Fuck you. Burn Forever.
|
||||
flammable.FireStacks = FlammableSystem.MaximumFireStacks;
|
||||
_flammableSystem.Ignite(args.Target);
|
||||
_flammableSystem.Ignite(args.Target, args.User);
|
||||
var xform = Transform(args.Target);
|
||||
_popupSystem.PopupEntity(Loc.GetString("admin-smite-set-alight-self"), args.Target,
|
||||
args.Target, PopupType.LargeCaution);
|
||||
|
||||
@@ -25,23 +25,23 @@ public sealed class PyroclasticAnomalySystem : EntitySystem
|
||||
{
|
||||
var xform = Transform(uid);
|
||||
var ignitionRadius = component.MaximumIgnitionRadius * args.Stability;
|
||||
IgniteNearby(xform.Coordinates, args.Severity, ignitionRadius);
|
||||
IgniteNearby(uid, xform.Coordinates, args.Severity, ignitionRadius);
|
||||
}
|
||||
|
||||
private void OnSupercritical(EntityUid uid, PyroclasticAnomalyComponent component, ref AnomalySupercriticalEvent args)
|
||||
{
|
||||
var xform = Transform(uid);
|
||||
IgniteNearby(xform.Coordinates, 1, component.MaximumIgnitionRadius * 2);
|
||||
IgniteNearby(uid, xform.Coordinates, 1, component.MaximumIgnitionRadius * 2);
|
||||
}
|
||||
|
||||
public void IgniteNearby(EntityCoordinates coordinates, float severity, float radius)
|
||||
public void IgniteNearby(EntityUid uid, EntityCoordinates coordinates, float severity, float radius)
|
||||
{
|
||||
foreach (var flammable in _lookup.GetComponentsInRange<FlammableComponent>(coordinates, radius))
|
||||
{
|
||||
var ent = flammable.Owner;
|
||||
var stackAmount = 1 + (int) (severity / 0.15f);
|
||||
_flammable.AdjustFireStacks(ent, stackAmount, flammable);
|
||||
_flammable.Ignite(ent, flammable);
|
||||
_flammable.Ignite(ent, uid, flammable);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
continue;
|
||||
|
||||
flammable.FireStacks += component.FireStacks;
|
||||
Ignite(entity, flammable);
|
||||
Ignite(entity, args.Weapon, flammable, args.User);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
return;
|
||||
|
||||
flammable.FireStacks += component.FireStacks;
|
||||
Ignite(otherEnt, flammable);
|
||||
Ignite(otherEnt, uid, flammable);
|
||||
component.Count--;
|
||||
|
||||
if (component.Count == 0)
|
||||
@@ -125,7 +125,7 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
if (!isHotEvent.IsHot)
|
||||
return;
|
||||
|
||||
Ignite(uid, flammable);
|
||||
Ignite(uid, args.Used, flammable, args.User);
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
@@ -156,14 +156,14 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
{
|
||||
flammable.FireStacks /= 2;
|
||||
otherFlammable.FireStacks += flammable.FireStacks;
|
||||
Ignite(otherUid, otherFlammable);
|
||||
Ignite(otherUid, uid, otherFlammable);
|
||||
}
|
||||
}
|
||||
else if (otherFlammable.OnFire)
|
||||
{
|
||||
otherFlammable.FireStacks /= 2;
|
||||
flammable.FireStacks += otherFlammable.FireStacks;
|
||||
Ignite(uid, flammable);
|
||||
Ignite(uid, otherUid, flammable);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -227,14 +227,18 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
UpdateAppearance(uid, flammable);
|
||||
}
|
||||
|
||||
public void Ignite(EntityUid uid, FlammableComponent? flammable = null)
|
||||
public void Ignite(EntityUid uid, EntityUid ignitionSource, FlammableComponent? flammable = null,
|
||||
EntityUid? ignitionSourceUser = null)
|
||||
{
|
||||
if (!Resolve(uid, ref flammable))
|
||||
return;
|
||||
|
||||
if (flammable.FireStacks > 0 && !flammable.OnFire)
|
||||
{
|
||||
_adminLogger.Add(LogType.Flammable, $"{ToPrettyString(flammable.Owner):entity} is on fire");
|
||||
if (ignitionSourceUser != null)
|
||||
_adminLogger.Add(LogType.Flammable, $"{ToPrettyString(uid):target} set on fire by {ToPrettyString(ignitionSourceUser.Value):actor} with {ToPrettyString(ignitionSource):tool}");
|
||||
else
|
||||
_adminLogger.Add(LogType.Flammable, $"{ToPrettyString(uid):target} set on fire by {ToPrettyString(ignitionSource):actor}");
|
||||
flammable.OnFire = true;
|
||||
}
|
||||
|
||||
@@ -272,11 +276,12 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
// 100 -> 1, 200 -> 2, 400 -> 3...
|
||||
var fireStackMod = Math.Max(MathF.Log2(deltaTemp / 100) + 1, 0);
|
||||
var fireStackDelta = fireStackMod - flammable.FireStacks;
|
||||
var flammableEntity = flammable.Owner;
|
||||
if (fireStackDelta > 0)
|
||||
{
|
||||
AdjustFireStacks(flammable.Owner, fireStackDelta, flammable);
|
||||
AdjustFireStacks(flammableEntity, fireStackDelta, flammable);
|
||||
}
|
||||
Ignite(flammable.Owner, flammable);
|
||||
Ignite(flammableEntity, flammableEntity, flammable);
|
||||
}
|
||||
_fireEvents.Clear();
|
||||
|
||||
|
||||
@@ -20,6 +20,6 @@ public sealed class Ignite : ReagentEffect
|
||||
public override void Effect(ReagentEffectArgs args)
|
||||
{
|
||||
var flamSys = EntitySystem.Get<FlammableSystem>();
|
||||
flamSys.Ignite(args.SolutionEntity);
|
||||
flamSys.Ignite(args.SolutionEntity, args.OrganEntity ?? args.SolutionEntity);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ public sealed class LavaSystem : EntitySystem
|
||||
// Apply the fury of a thousand suns
|
||||
var multiplier = flammable.FireStacks == 0f ? 5f : 1f;
|
||||
_flammable.AdjustFireStacks(otherUid, component.FireStacks * multiplier, flammable);
|
||||
_flammable.Ignite(otherUid, flammable);
|
||||
_flammable.Ignite(otherUid, uid, flammable);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ public sealed class IgniteArtifactSystem : EntitySystem
|
||||
if (!flammable.TryGetComponent(target, out var fl))
|
||||
continue;
|
||||
fl.FireStacks += _random.Next(component.MinFireStack, component.MaxFireStack);
|
||||
_flammable.Ignite(target, fl);
|
||||
_flammable.Ignite(target, uid, fl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user