lower max firestacks to 10, refactor flammable (#27159)
* lower max firestacks to 10, refactor flammable * fix * uncap fire stack damage, lower fire stack damage
This commit is contained in:
@@ -152,7 +152,7 @@ public sealed partial class AdminVerbSystem
|
|||||||
Act = () =>
|
Act = () =>
|
||||||
{
|
{
|
||||||
// Fuck you. Burn Forever.
|
// Fuck you. Burn Forever.
|
||||||
flammable.FireStacks = FlammableSystem.MaximumFireStacks;
|
flammable.FireStacks = flammable.MaximumFireStacks;
|
||||||
_flammableSystem.Ignite(args.Target, args.User);
|
_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,
|
||||||
|
|||||||
@@ -11,49 +11,65 @@ namespace Content.Server.Atmos.Components
|
|||||||
|
|
||||||
[ViewVariables(VVAccess.ReadWrite)]
|
[ViewVariables(VVAccess.ReadWrite)]
|
||||||
[DataField]
|
[DataField]
|
||||||
public bool OnFire { get; set; }
|
public bool OnFire;
|
||||||
|
|
||||||
[ViewVariables(VVAccess.ReadWrite)]
|
[ViewVariables(VVAccess.ReadWrite)]
|
||||||
[DataField]
|
[DataField]
|
||||||
public float FireStacks { get; set; }
|
public float FireStacks;
|
||||||
|
|
||||||
[ViewVariables(VVAccess.ReadWrite)]
|
[ViewVariables(VVAccess.ReadWrite)]
|
||||||
[DataField("fireSpread")]
|
[DataField]
|
||||||
|
public float MaximumFireStacks = 10f;
|
||||||
|
|
||||||
|
[ViewVariables(VVAccess.ReadWrite)]
|
||||||
|
[DataField]
|
||||||
|
public float MinimumFireStacks = -10f;
|
||||||
|
|
||||||
|
[ViewVariables(VVAccess.ReadWrite)]
|
||||||
|
[DataField]
|
||||||
|
public string FlammableFixtureID = "flammable";
|
||||||
|
|
||||||
|
[ViewVariables(VVAccess.ReadWrite)]
|
||||||
|
[DataField]
|
||||||
|
public float MinIgnitionTemperature = 373.15f;
|
||||||
|
|
||||||
|
[ViewVariables(VVAccess.ReadWrite)]
|
||||||
|
[DataField]
|
||||||
public bool FireSpread { get; private set; } = false;
|
public bool FireSpread { get; private set; } = false;
|
||||||
|
|
||||||
[ViewVariables(VVAccess.ReadWrite)]
|
[ViewVariables(VVAccess.ReadWrite)]
|
||||||
[DataField("canResistFire")]
|
[DataField]
|
||||||
public bool CanResistFire { get; private set; } = false;
|
public bool CanResistFire { get; private set; } = false;
|
||||||
|
|
||||||
[DataField("damage", required: true)]
|
[DataField(required: true)]
|
||||||
[ViewVariables(VVAccess.ReadWrite)]
|
[ViewVariables(VVAccess.ReadWrite)]
|
||||||
public DamageSpecifier Damage = new(); // Empty by default, we don't want any funny NREs.
|
public DamageSpecifier Damage = new(); // Empty by default, we don't want any funny NREs.
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Used for the fixture created to handle passing firestacks when two flammable objects collide.
|
/// Used for the fixture created to handle passing firestacks when two flammable objects collide.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField("flammableCollisionShape")]
|
[DataField]
|
||||||
public IPhysShape FlammableCollisionShape = new PhysShapeCircle(0.35f);
|
public IPhysShape FlammableCollisionShape = new PhysShapeCircle(0.35f);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Should the component be set on fire by interactions with isHot entities
|
/// Should the component be set on fire by interactions with isHot entities
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ViewVariables(VVAccess.ReadWrite)]
|
[ViewVariables(VVAccess.ReadWrite)]
|
||||||
[DataField("alwaysCombustible")]
|
[DataField]
|
||||||
public bool AlwaysCombustible = false;
|
public bool AlwaysCombustible = false;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Can the component anyhow lose its FireStacks?
|
/// Can the component anyhow lose its FireStacks?
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ViewVariables(VVAccess.ReadWrite)]
|
[ViewVariables(VVAccess.ReadWrite)]
|
||||||
[DataField("canExtinguish")]
|
[DataField]
|
||||||
public bool CanExtinguish = true;
|
public bool CanExtinguish = true;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// How many firestacks should be applied to component when being set on fire?
|
/// How many firestacks should be applied to component when being set on fire?
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ViewVariables(VVAccess.ReadWrite)]
|
[ViewVariables(VVAccess.ReadWrite)]
|
||||||
[DataField("firestacksOnIgnite")]
|
[DataField]
|
||||||
public float FirestacksOnIgnite = 2.0f;
|
public float FirestacksOnIgnite = 2.0f;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -49,13 +49,9 @@ namespace Content.Server.Atmos.EntitySystems
|
|||||||
|
|
||||||
private EntityQuery<PhysicsComponent> _physicsQuery;
|
private EntityQuery<PhysicsComponent> _physicsQuery;
|
||||||
|
|
||||||
public const float MinimumFireStacks = -10f;
|
// This should probably be moved to the component, requires a rewrite, all fires tick at the same time
|
||||||
public const float MaximumFireStacks = 20f;
|
|
||||||
private const float UpdateTime = 1f;
|
private const float UpdateTime = 1f;
|
||||||
|
|
||||||
public const float MinIgnitionTemperature = 373.15f;
|
|
||||||
public const string FlammableFixtureID = "flammable";
|
|
||||||
|
|
||||||
private float _timer;
|
private float _timer;
|
||||||
|
|
||||||
private readonly Dictionary<Entity<FlammableComponent>, float> _fireEvents = new();
|
private readonly Dictionary<Entity<FlammableComponent>, float> _fireEvents = new();
|
||||||
@@ -134,7 +130,7 @@ namespace Content.Server.Atmos.EntitySystems
|
|||||||
if (!TryComp<PhysicsComponent>(uid, out var body))
|
if (!TryComp<PhysicsComponent>(uid, out var body))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_fixture.TryCreateFixture(uid, component.FlammableCollisionShape, FlammableFixtureID, hard: false,
|
_fixture.TryCreateFixture(uid, component.FlammableCollisionShape, component.FlammableFixtureID, hard: false,
|
||||||
collisionMask: (int) CollisionGroup.FullTileLayer, body: body);
|
collisionMask: (int) CollisionGroup.FullTileLayer, body: body);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -192,7 +188,7 @@ namespace Content.Server.Atmos.EntitySystems
|
|||||||
|
|
||||||
// Normal hard collisions, though this isn't generally possible since most flammable things are mobs
|
// Normal hard collisions, though this isn't generally possible since most flammable things are mobs
|
||||||
// which don't collide with one another, shouldn't work here.
|
// which don't collide with one another, shouldn't work here.
|
||||||
if (args.OtherFixtureId != FlammableFixtureID && args.OurFixtureId != FlammableFixtureID)
|
if (args.OtherFixtureId != flammable.FlammableFixtureID && args.OurFixtureId != flammable.FlammableFixtureID)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!flammable.FireSpread)
|
if (!flammable.FireSpread)
|
||||||
@@ -254,7 +250,7 @@ namespace Content.Server.Atmos.EntitySystems
|
|||||||
|
|
||||||
private void OnTileFire(Entity<FlammableComponent> ent, ref TileFireEvent args)
|
private void OnTileFire(Entity<FlammableComponent> ent, ref TileFireEvent args)
|
||||||
{
|
{
|
||||||
var tempDelta = args.Temperature - MinIgnitionTemperature;
|
var tempDelta = args.Temperature - ent.Comp.MinIgnitionTemperature;
|
||||||
|
|
||||||
_fireEvents.TryGetValue(ent, out var maxTemp);
|
_fireEvents.TryGetValue(ent, out var maxTemp);
|
||||||
|
|
||||||
@@ -287,7 +283,7 @@ namespace Content.Server.Atmos.EntitySystems
|
|||||||
if (!Resolve(uid, ref flammable))
|
if (!Resolve(uid, ref flammable))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
flammable.FireStacks = MathF.Min(MathF.Max(MinimumFireStacks, flammable.FireStacks + relativeFireStacks), MaximumFireStacks);
|
flammable.FireStacks = MathF.Min(MathF.Max(flammable.MinimumFireStacks, flammable.FireStacks + relativeFireStacks), flammable.MaximumFireStacks);
|
||||||
|
|
||||||
if (flammable.OnFire && flammable.FireStacks <= 0)
|
if (flammable.OnFire && flammable.FireStacks <= 0)
|
||||||
Extinguish(uid, flammable);
|
Extinguish(uid, flammable);
|
||||||
@@ -439,12 +435,10 @@ namespace Content.Server.Atmos.EntitySystems
|
|||||||
EnsureComp<IgnitionSourceComponent>(uid);
|
EnsureComp<IgnitionSourceComponent>(uid);
|
||||||
_ignitionSourceSystem.SetIgnited(uid);
|
_ignitionSourceSystem.SetIgnited(uid);
|
||||||
|
|
||||||
var damageScale = MathF.Min( flammable.FireStacks, 5);
|
|
||||||
|
|
||||||
if (TryComp(uid, out TemperatureComponent? temp))
|
if (TryComp(uid, out TemperatureComponent? temp))
|
||||||
_temperatureSystem.ChangeHeat(uid, 12500 * damageScale, false, temp);
|
_temperatureSystem.ChangeHeat(uid, 12500 * flammable.FireStacks, false, temp);
|
||||||
|
|
||||||
_damageableSystem.TryChangeDamage(uid, flammable.Damage * damageScale, interruptsDoAfters: false);
|
_damageableSystem.TryChangeDamage(uid, flammable.Damage * flammable.FireStacks, interruptsDoAfters: false);
|
||||||
|
|
||||||
AdjustFireStacks(uid, flammable.FirestackFade * (flammable.Resisting ? 10f : 1f), flammable);
|
AdjustFireStacks(uid, flammable.FirestackFade * (flammable.Resisting ? 10f : 1f), flammable);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -192,7 +192,7 @@
|
|||||||
canResistFire: true
|
canResistFire: true
|
||||||
damage: #per second, scales with number of fire 'stacks'
|
damage: #per second, scales with number of fire 'stacks'
|
||||||
types:
|
types:
|
||||||
Heat: 3
|
Heat: 1.5
|
||||||
- type: FireVisuals
|
- type: FireVisuals
|
||||||
sprite: Mobs/Effects/onfire.rsi
|
sprite: Mobs/Effects/onfire.rsi
|
||||||
normalState: Generic_mob_burning
|
normalState: Generic_mob_burning
|
||||||
|
|||||||
Reference in New Issue
Block a user