Add ability to burn papers +Flammable tweaks. (#18955)
This commit is contained in:
@@ -35,5 +35,26 @@ namespace Content.Server.Atmos.Components
|
||||
/// </summary>
|
||||
[DataField("flammableCollisionShape")]
|
||||
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")]
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,15 +148,30 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
{
|
||||
if (otherFlammable.OnFire)
|
||||
{
|
||||
var fireSplit = (flammable.FireStacks + otherFlammable.FireStacks) / 2;
|
||||
flammable.FireStacks = fireSplit;
|
||||
otherFlammable.FireStacks = fireSplit;
|
||||
if (flammable.CanExtinguish)
|
||||
{
|
||||
var fireSplit = (flammable.FireStacks + otherFlammable.FireStacks) / 2;
|
||||
flammable.FireStacks = fireSplit;
|
||||
otherFlammable.FireStacks = fireSplit;
|
||||
}
|
||||
else
|
||||
{
|
||||
otherFlammable.FireStacks = flammable.FireStacks / 2;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
flammable.FireStacks /= 2;
|
||||
otherFlammable.FireStacks += flammable.FireStacks;
|
||||
Ignite(otherUid, uid, otherFlammable);
|
||||
if (!flammable.CanExtinguish)
|
||||
{
|
||||
otherFlammable.FireStacks += flammable.FireStacks / 2;
|
||||
Ignite(otherUid, uid, otherFlammable);
|
||||
}
|
||||
else
|
||||
{
|
||||
flammable.FireStacks /= 2;
|
||||
otherFlammable.FireStacks += flammable.FireStacks;
|
||||
Ignite(otherUid, uid, otherFlammable);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (otherFlammable.OnFire)
|
||||
@@ -215,7 +230,7 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
if (!Resolve(uid, ref flammable))
|
||||
return;
|
||||
|
||||
if (!flammable.OnFire)
|
||||
if (!flammable.OnFire || !flammable.CanExtinguish)
|
||||
return;
|
||||
|
||||
_adminLogger.Add(LogType.Flammable, $"{ToPrettyString(flammable.Owner):entity} stopped being on fire damage");
|
||||
@@ -233,6 +248,11 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
if (!Resolve(uid, ref flammable))
|
||||
return;
|
||||
|
||||
if (flammable.AlwaysCombustible)
|
||||
{
|
||||
flammable.FireStacks = Math.Max(flammable.FirestacksOnIgnite, flammable.FireStacks);
|
||||
}
|
||||
|
||||
if (flammable.FireStacks > 0 && !flammable.OnFire)
|
||||
{
|
||||
if (ignitionSourceUser != null)
|
||||
|
||||
@@ -30,6 +30,32 @@
|
||||
- Trash
|
||||
- type: Appearance
|
||||
- type: PaperVisuals
|
||||
- type: Flammable
|
||||
fireSpread: true
|
||||
canResistFire: false
|
||||
alwaysCombustible: true
|
||||
canExtinguish: false # Mwahaha! Let the world burn because of one piece of paper!
|
||||
damage:
|
||||
types:
|
||||
Heat: 1
|
||||
- type: FireVisuals
|
||||
sprite: Effects/fire.rsi
|
||||
normalState: fire
|
||||
- type: Damageable
|
||||
damageModifierSet: Wood
|
||||
- type: Destructible
|
||||
thresholds:
|
||||
- trigger:
|
||||
!type:DamageTrigger
|
||||
damage: 15
|
||||
behaviors:
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
Ash:
|
||||
min: 1
|
||||
max: 1
|
||||
- !type:DoActsBehavior
|
||||
acts: [ "Destruction" ]
|
||||
|
||||
- type: entity
|
||||
name: office paper
|
||||
|
||||
Reference in New Issue
Block a user