2024-05-23 22:43:04 -04:00
|
|
|
using Content.Shared.Alert;
|
2020-09-22 15:40:04 +02:00
|
|
|
using Content.Shared.Damage;
|
2022-07-04 18:30:45 -07:00
|
|
|
using Robust.Shared.Physics.Collision.Shapes;
|
2024-05-23 22:43:04 -04:00
|
|
|
using Robust.Shared.Prototypes;
|
2020-09-22 15:40:04 +02:00
|
|
|
|
2021-06-19 13:25:05 +02:00
|
|
|
namespace Content.Server.Atmos.Components
|
2020-09-22 15:40:04 +02:00
|
|
|
{
|
|
|
|
|
[RegisterComponent]
|
2023-08-22 18:14:33 -07:00
|
|
|
public sealed partial class FlammableComponent : Component
|
2020-09-22 15:40:04 +02:00
|
|
|
{
|
2023-11-14 22:55:45 +11:00
|
|
|
[DataField]
|
|
|
|
|
public bool Resisting;
|
2020-09-22 15:40:04 +02:00
|
|
|
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
2023-11-14 22:55:45 +11:00
|
|
|
[DataField]
|
2024-04-23 07:30:01 -04:00
|
|
|
public bool OnFire;
|
2020-09-22 15:40:04 +02:00
|
|
|
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
2023-11-14 22:55:45 +11:00
|
|
|
[DataField]
|
2024-04-23 07:30:01 -04:00
|
|
|
public float FireStacks;
|
2020-09-22 15:40:04 +02:00
|
|
|
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
2024-04-23 07:30:01 -04:00
|
|
|
[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]
|
2020-09-22 15:40:04 +02:00
|
|
|
public bool FireSpread { get; private set; } = false;
|
|
|
|
|
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
2024-04-23 07:30:01 -04:00
|
|
|
[DataField]
|
2020-09-22 15:40:04 +02:00
|
|
|
public bool CanResistFire { get; private set; } = false;
|
2021-11-19 17:54:01 +01:00
|
|
|
|
2024-04-23 07:30:01 -04:00
|
|
|
[DataField(required: true)]
|
2021-11-19 17:54:01 +01:00
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
2022-03-04 17:00:35 +01:00
|
|
|
public DamageSpecifier Damage = new(); // Empty by default, we don't want any funny NREs.
|
2022-07-04 18:30:45 -07:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Used for the fixture created to handle passing firestacks when two flammable objects collide.
|
|
|
|
|
/// </summary>
|
2024-04-23 07:30:01 -04:00
|
|
|
[DataField]
|
2023-01-15 15:38:59 +11:00
|
|
|
public IPhysShape FlammableCollisionShape = new PhysShapeCircle(0.35f);
|
2023-08-15 02:45:55 +07:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Should the component be set on fire by interactions with isHot entities
|
|
|
|
|
/// </summary>
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
2024-04-23 07:30:01 -04:00
|
|
|
[DataField]
|
2023-08-15 02:45:55 +07:00
|
|
|
public bool AlwaysCombustible = false;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Can the component anyhow lose its FireStacks?
|
|
|
|
|
/// </summary>
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
2024-04-23 07:30:01 -04:00
|
|
|
[DataField]
|
2023-08-15 02:45:55 +07:00
|
|
|
public bool CanExtinguish = true;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// How many firestacks should be applied to component when being set on fire?
|
|
|
|
|
/// </summary>
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
2024-04-23 07:30:01 -04:00
|
|
|
[DataField]
|
2023-08-15 02:45:55 +07:00
|
|
|
public float FirestacksOnIgnite = 2.0f;
|
2023-11-04 08:53:51 +03:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Determines how quickly the object will fade out. With positive values, the object will flare up instead of going out.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
|
|
|
|
public float FirestackFade = -0.1f;
|
2024-05-03 20:40:31 +03:00
|
|
|
|
2024-05-23 22:43:04 -04:00
|
|
|
[DataField]
|
|
|
|
|
public ProtoId<AlertPrototype> FireAlert = "Fire";
|
2024-05-25 18:49:49 +03:00
|
|
|
|
2024-05-03 20:40:31 +03:00
|
|
|
/// <summary>
|
2024-11-18 14:40:52 +03:00
|
|
|
/// CrystallEdge fireplace fuel
|
2024-05-03 20:40:31 +03:00
|
|
|
/// </summary>
|
|
|
|
|
[DataField]
|
|
|
|
|
public float CP14FireplaceFuel = 10f;
|
2020-09-22 15:40:04 +02:00
|
|
|
}
|
|
|
|
|
}
|