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;
|
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]
|
2021-07-21 20:32:00 +10:00
|
|
|
public bool OnFire { get; set; }
|
2020-09-22 15:40:04 +02:00
|
|
|
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
2023-11-14 22:55:45 +11:00
|
|
|
[DataField]
|
2021-07-21 20:32:00 +10:00
|
|
|
public float FireStacks { get; set; }
|
2020-09-22 15:40:04 +02:00
|
|
|
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
2021-03-05 01:08:38 +01:00
|
|
|
[DataField("fireSpread")]
|
2020-09-22 15:40:04 +02:00
|
|
|
public bool FireSpread { get; private set; } = false;
|
|
|
|
|
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
2021-03-05 01:08:38 +01:00
|
|
|
[DataField("canResistFire")]
|
2020-09-22 15:40:04 +02:00
|
|
|
public bool CanResistFire { get; private set; } = false;
|
2021-11-19 17:54:01 +01:00
|
|
|
|
|
|
|
|
[DataField("damage", required: true)]
|
|
|
|
|
[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>
|
|
|
|
|
[DataField("flammableCollisionShape")]
|
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)]
|
|
|
|
|
[DataField("alwaysCombustible")]
|
|
|
|
|
public bool AlwaysCombustible = false;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Can the component anyhow lose its FireStacks?
|
|
|
|
|
/// </summary>
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
|
|
|
|
[DataField("canExtinguish")]
|
|
|
|
|
public bool CanExtinguish = true;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// How many firestacks should be applied to component when being set on fire?
|
|
|
|
|
/// </summary>
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
|
|
|
|
[DataField("firestacksOnIgnite")]
|
|
|
|
|
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;
|
2020-09-22 15:40:04 +02:00
|
|
|
}
|
|
|
|
|
}
|