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