Skip to content

Commit

Permalink
rest of the fucking bonfire
Browse files Browse the repository at this point in the history
  • Loading branch information
Darkmajia committed Feb 8, 2025
1 parent 6270ac9 commit 3fce928
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 115 deletions.
7 changes: 7 additions & 0 deletions Content.Server/Atmos/Components/FlammableComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,12 @@ public sealed partial class FlammableComponent : Component

[DataField]
public ProtoId<AlertPrototype> FireAlert = "Fire";

// imp edit
/// <summary>
/// Should the entity enable an AmbientSound component when lit, and disable it when unlit?
/// </summary>
[DataField]
public bool ToggleAmbientSound;
}
}
28 changes: 26 additions & 2 deletions Content.Server/Atmos/EntitySystems/FlammableSystem.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Content.Server.Administration.Logs;
using Content.Server.Atmos.Components;
using Content.Server.Audio;
using Content.Server.IgnitionSource;
using Content.Server.Stunnable;
using Content.Server.Temperature.Components;
Expand All @@ -9,6 +10,7 @@
using Content.Shared.Alert;
using Content.Shared.Atmos;
using Content.Shared.Atmos.Components;
using Content.Shared.Audio;
using Content.Shared.Damage;
using Content.Shared.Database;
using Content.Shared.Interaction;
Expand All @@ -24,6 +26,7 @@
using Content.Shared.Weapons.Melee.Events;
using Content.Shared.FixedPoint;
using Robust.Server.Audio;
using Robust.Shared.Physics;
using Robust.Shared.Physics.Components;
using Robust.Shared.Physics.Events;
using Robust.Shared.Physics.Systems;
Expand All @@ -47,6 +50,7 @@ public sealed class FlammableSystem : EntitySystem
[Dependency] private readonly SharedPopupSystem _popup = default!;
[Dependency] private readonly UseDelaySystem _useDelay = default!;
[Dependency] private readonly AudioSystem _audio = default!;
[Dependency] private readonly AmbientSoundSystem _ambient = default!;
[Dependency] private readonly IRobustRandom _random = default!;

private EntityQuery<InventoryComponent> _inventoryQuery;
Expand Down Expand Up @@ -137,6 +141,10 @@ private void OnMapInit(EntityUid uid, FlammableComponent component, MapInitEvent

_fixture.TryCreateFixture(uid, component.FlammableCollisionShape, component.FlammableFixtureID, hard: false,
collisionMask: (int) CollisionGroup.FullTileLayer, body: body);

// imp edit, disables AmbientSound if it's meant to be handled with a toggle
if (component.ToggleAmbientSound && TryComp<AmbientSoundComponent>(uid, out var ambient))
_ambient.SetAmbience(uid, false, ambient);
}

private void OnInteractUsing(EntityUid uid, FlammableComponent flammable, InteractUsingEvent args)
Expand Down Expand Up @@ -211,8 +219,14 @@ private void OnCollide(EntityUid uid, FlammableComponent flammable, ref StartCol
var mass2 = 1f;
if (_physicsQuery.TryComp(uid, out var physics) && _physicsQuery.TryComp(otherUid, out var otherPhys))
{
mass1 = physics.Mass;
mass2 = otherPhys.Mass;
// imp edit - if either entity has a static BodyType then it has no mass, so just equalise instead
var anyStatic = physics.BodyType == BodyType.Static || otherPhys.BodyType == BodyType.Static;

if (!anyStatic)
{
mass1 = physics.Mass;
mass2 = otherPhys.Mass;
}
}

// when the thing on fire is more massive than the other, the following happens:
Expand Down Expand Up @@ -315,6 +329,10 @@ public void Extinguish(EntityUid uid, FlammableComponent? flammable = null)

_ignitionSourceSystem.SetIgnited(uid, false);

// imp edit
if (flammable.ToggleAmbientSound && TryComp<AmbientSoundComponent>(uid, out var ambient))
_ambient.SetAmbience(uid, false, ambient);

UpdateAppearance(uid, flammable);
}

Expand All @@ -338,6 +356,12 @@ public void Ignite(EntityUid uid, EntityUid ignitionSource, FlammableComponent?
flammable.OnFire = true;
}

// imp edit
if (flammable.ToggleAmbientSound &&
TryComp<AmbientSoundComponent>(uid, out var ambient) &&
!ambient.Enabled)
_ambient.SetAmbience(uid, true, ambient);

UpdateAppearance(uid, flammable);
}

Expand Down
18 changes: 0 additions & 18 deletions Content.Server/_Impstation/FireStructure/FireStructureComponent.cs

This file was deleted.

59 changes: 0 additions & 59 deletions Content.Server/_Impstation/FireStructure/FireStructureSystem.cs

This file was deleted.

77 changes: 42 additions & 35 deletions Resources/Prototypes/Entities/Structures/Decoration/bonfire.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,36 @@
sprite: Structures/Decoration/bonfire.rsi
layers:
- state: bonfire
- state: burning
#- type: PointLight
# radius: 5
# energy: 3
# color: "#FFC90C"
- type: AmbientSound
volume: -5
range: 5
sound:
path: /Audio/Ambience/Objects/fireplace.ogg
- type: Damageable
damageContainer: StructuralInorganic
damageModifierSet: Wood
# imp edits
- type: Appearance
- type: Fixtures
fixtures:
fix1:
shape:
!type:PhysShapeCircle
radius: 0.35
density: 130
mask:
- MachineMask
layer:
- MidImpassable
- LowImpassable
- type: Destructible
thresholds:
- trigger:
!type:DamageTrigger
damage: 100 # imp edit
damage: 100
behaviors:
- !type:DoActsBehavior
acts: [ "Destruction" ]
# imp edits
- trigger:
!type:DamageTrigger
damage: 50
Expand All @@ -40,35 +53,29 @@
MaterialWoodPlank1:
min: 6
max: 10
# end imp edits
#- type: AmbientSound
# volume: -5
# range: 5
# sound:
# path: /Audio/Ambience/Objects/fireplace.ogg
# imp edits
- type: Fixtures
fixtures:
fix1:
shape:
!type:PhysShapeCircle
radius: 0.25
density: 60
mask:
- MachineMask
layer:
- SlipLayer
hard: false
- type: StepTrigger
requiredTriggeredSpeed: 0
intersectRatio: 0.1
- type: TileEntityEffect
effects:
- !type:FlammableReaction
multiplier: 2.5
multiplierOnExisting: 0.75
- !type:Ignite
- type: Reactive
groups:
Flammable: [ Touch ]
Extinguish: [ Touch ]
- type: Climbable
- type: Flammable
damage:
types:
Heat: 0 # adding any damage would make it break loudly into pieces, which feels weird
flammableCollisionShape:
!type:PhysShapeCircle
radius: 0.25
maximumFireStacks: 6
fireSpread: true
alwaysCombustible: true
firestacksOnIgnite: 2
firestackFade: 0.05 # gets hotter the longer it's on
toggleAmbientSound: true
- type: FireVisuals
sprite: Structures/Decoration/bonfire.rsi
normalState: burning
maxLightRadius: 8
maxLightEnergy: 5
- type: Construction
graph: Bonfire
node: bonfire
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Resources/Textures/Structures/Decoration/bonfire.rsi/burning.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "Taken from /tg/station at commit 28b476ab6d17014e6f9e18a748d7c96be28de9a1",
"copyright": "Taken from /tg/station at commit 28b476ab6d17014e6f9e18a748d7c96be28de9a1, extinguished/burning edited by Darkmajia",
"size": {
"x": 32,
"y": 32
Expand Down

0 comments on commit 3fce928

Please sign in to comment.