Add ability to burn papers +Flammable tweaks. (#18955)
This commit is contained in:
@@ -35,5 +35,26 @@ namespace Content.Server.Atmos.Components
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField("flammableCollisionShape")]
|
[DataField("flammableCollisionShape")]
|
||||||
public IPhysShape FlammableCollisionShape = new PhysShapeCircle(0.35f);
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -147,18 +147,33 @@ namespace Content.Server.Atmos.EntitySystems
|
|||||||
if (flammable.OnFire)
|
if (flammable.OnFire)
|
||||||
{
|
{
|
||||||
if (otherFlammable.OnFire)
|
if (otherFlammable.OnFire)
|
||||||
|
{
|
||||||
|
if (flammable.CanExtinguish)
|
||||||
{
|
{
|
||||||
var fireSplit = (flammable.FireStacks + otherFlammable.FireStacks) / 2;
|
var fireSplit = (flammable.FireStacks + otherFlammable.FireStacks) / 2;
|
||||||
flammable.FireStacks = fireSplit;
|
flammable.FireStacks = fireSplit;
|
||||||
otherFlammable.FireStacks = fireSplit;
|
otherFlammable.FireStacks = fireSplit;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
otherFlammable.FireStacks = flammable.FireStacks / 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!flammable.CanExtinguish)
|
||||||
|
{
|
||||||
|
otherFlammable.FireStacks += flammable.FireStacks / 2;
|
||||||
|
Ignite(otherUid, uid, otherFlammable);
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
flammable.FireStacks /= 2;
|
flammable.FireStacks /= 2;
|
||||||
otherFlammable.FireStacks += flammable.FireStacks;
|
otherFlammable.FireStacks += flammable.FireStacks;
|
||||||
Ignite(otherUid, uid, otherFlammable);
|
Ignite(otherUid, uid, otherFlammable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (otherFlammable.OnFire)
|
else if (otherFlammable.OnFire)
|
||||||
{
|
{
|
||||||
otherFlammable.FireStacks /= 2;
|
otherFlammable.FireStacks /= 2;
|
||||||
@@ -215,7 +230,7 @@ namespace Content.Server.Atmos.EntitySystems
|
|||||||
if (!Resolve(uid, ref flammable))
|
if (!Resolve(uid, ref flammable))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!flammable.OnFire)
|
if (!flammable.OnFire || !flammable.CanExtinguish)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_adminLogger.Add(LogType.Flammable, $"{ToPrettyString(flammable.Owner):entity} stopped being on fire damage");
|
_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))
|
if (!Resolve(uid, ref flammable))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (flammable.AlwaysCombustible)
|
||||||
|
{
|
||||||
|
flammable.FireStacks = Math.Max(flammable.FirestacksOnIgnite, flammable.FireStacks);
|
||||||
|
}
|
||||||
|
|
||||||
if (flammable.FireStacks > 0 && !flammable.OnFire)
|
if (flammable.FireStacks > 0 && !flammable.OnFire)
|
||||||
{
|
{
|
||||||
if (ignitionSourceUser != null)
|
if (ignitionSourceUser != null)
|
||||||
|
|||||||
@@ -30,6 +30,32 @@
|
|||||||
- Trash
|
- Trash
|
||||||
- type: Appearance
|
- type: Appearance
|
||||||
- type: PaperVisuals
|
- 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
|
- type: entity
|
||||||
name: office paper
|
name: office paper
|
||||||
|
|||||||
Reference in New Issue
Block a user