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 = () =>
|
||||
{
|
||||
// Fuck you. Burn Forever.
|
||||
flammable.FireStacks = FlammableSystem.MaximumFireStacks;
|
||||
flammable.FireStacks = flammable.MaximumFireStacks;
|
||||
_flammableSystem.Ignite(args.Target, args.User);
|
||||
var xform = Transform(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)]
|
||||
[DataField]
|
||||
public bool OnFire { get; set; }
|
||||
public bool OnFire;
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField]
|
||||
public float FireStacks { get; set; }
|
||||
public float FireStacks;
|
||||
|
||||
[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;
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField("canResistFire")]
|
||||
[DataField]
|
||||
public bool CanResistFire { get; private set; } = false;
|
||||
|
||||
[DataField("damage", required: true)]
|
||||
[DataField(required: true)]
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public DamageSpecifier Damage = new(); // Empty by default, we don't want any funny NREs.
|
||||
|
||||
/// <summary>
|
||||
/// Used for the fixture created to handle passing firestacks when two flammable objects collide.
|
||||
/// </summary>
|
||||
[DataField("flammableCollisionShape")]
|
||||
[DataField]
|
||||
public IPhysShape FlammableCollisionShape = new PhysShapeCircle(0.35f);
|
||||
|
||||
/// <summary>
|
||||
/// Should the component be set on fire by interactions with isHot entities
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField("alwaysCombustible")]
|
||||
[DataField]
|
||||
public bool AlwaysCombustible = false;
|
||||
|
||||
/// <summary>
|
||||
/// Can the component anyhow lose its FireStacks?
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField("canExtinguish")]
|
||||
[DataField]
|
||||
public bool CanExtinguish = true;
|
||||
|
||||
/// <summary>
|
||||
/// How many firestacks should be applied to component when being set on fire?
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField("firestacksOnIgnite")]
|
||||
[DataField]
|
||||
public float FirestacksOnIgnite = 2.0f;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -49,13 +49,9 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
|
||||
private EntityQuery<PhysicsComponent> _physicsQuery;
|
||||
|
||||
public const float MinimumFireStacks = -10f;
|
||||
public const float MaximumFireStacks = 20f;
|
||||
// This should probably be moved to the component, requires a rewrite, all fires tick at the same time
|
||||
private const float UpdateTime = 1f;
|
||||
|
||||
public const float MinIgnitionTemperature = 373.15f;
|
||||
public const string FlammableFixtureID = "flammable";
|
||||
|
||||
private float _timer;
|
||||
|
||||
private readonly Dictionary<Entity<FlammableComponent>, float> _fireEvents = new();
|
||||
@@ -134,7 +130,7 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
if (!TryComp<PhysicsComponent>(uid, out var body))
|
||||
return;
|
||||
|
||||
_fixture.TryCreateFixture(uid, component.FlammableCollisionShape, FlammableFixtureID, hard: false,
|
||||
_fixture.TryCreateFixture(uid, component.FlammableCollisionShape, component.FlammableFixtureID, hard: false,
|
||||
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
|
||||
// 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;
|
||||
|
||||
if (!flammable.FireSpread)
|
||||
@@ -254,7 +250,7 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
|
||||
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);
|
||||
|
||||
@@ -287,7 +283,7 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
if (!Resolve(uid, ref flammable))
|
||||
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)
|
||||
Extinguish(uid, flammable);
|
||||
@@ -439,12 +435,10 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
EnsureComp<IgnitionSourceComponent>(uid);
|
||||
_ignitionSourceSystem.SetIgnited(uid);
|
||||
|
||||
var damageScale = MathF.Min( flammable.FireStacks, 5);
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -192,7 +192,7 @@
|
||||
canResistFire: true
|
||||
damage: #per second, scales with number of fire 'stacks'
|
||||
types:
|
||||
Heat: 3
|
||||
Heat: 1.5
|
||||
- type: FireVisuals
|
||||
sprite: Mobs/Effects/onfire.rsi
|
||||
normalState: Generic_mob_burning
|
||||
|
||||
Reference in New Issue
Block a user