Skip to content

Destroy Interactings System #72

Open
BombasterDS2 wants to merge 4 commits into
Goob-Station:masterfrom
BombasterDS2:destroy-interactings-(12-06-2026)
Open

Destroy Interactings System #72
BombasterDS2 wants to merge 4 commits into
Goob-Station:masterfrom
BombasterDS2:destroy-interactings-(12-06-2026)

Conversation

@BombasterDS2

Copy link
Copy Markdown

About the PR

Added Destroy Interactings system that handle entities capable of other destroying interacting entities.
Required for stuff like supermatter.

Technical details

Component contains both whitelist and blacklist that allows destruction of chosen items. In addition, there is boolean datafield that allows to select if entity should count contacts as interaction. Sound and post-destruction spawnable can be set in system.

Known issues:

Destruction of entity controlled by players causes one second screen freeze since ghost system is server sided only.

Test plan

  1. Add DestroyInteractingComponent on any entity.
  2. Try to interact with them or walk over them.
  3. Item in hand or player is destroyed.

Media

Desktop.2026.06.12.-.23.17.13.03.DVR.online-video-cutter.com.mp4

Requirements

  • I have read and am following the Pull Request and Changelog Guidelines.
  • I have tested this pull request and written instructions on how to test it
  • I have added media to this PR or it does not require an in-game showcase.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as stale because it has not had
any activity for 14 days. It will be closed in another 14 days if no further activity occurs.
Thank you for your contributions.

You can always ask for help on our development discord.

If you'd like to keep this open, just leave any comment, and the stale label will be removed.

@BombasterDS2

Copy link
Copy Markdown
Author

Bot, don't close it

@Roudenn Roudenn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also using regions here is redundant, if a system is too big (400+ lines) it's better to split it into multiple partial files, but this system is very short so it doesn't need that

Comment on lines +59 to +60
[DataField(customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
public string SpawnOnDestruction = string.Empty;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use EntProtoId and remove serializer

Comment on lines +62 to +63
//TODO:Particles
#endregion

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do the particles please I've already ported them

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Required #78


namespace Content.Goobstation.Shared.Damage;

public sealed partial class SharedDestroyInteractinngSystem : EntitySystem

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sealed classes shouldn't have Shared prefix

SubscribeLocalEvent<DestroyInteractingsComponent, AttackedEvent>(OnAttacked);
}

private bool TryDestroyEntity(EntityUid entity, Entity<DestroyInteractingsComponent> destructor, out EntityUid? spawned, EntityUid? user = null)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add line breaks


private void OnCollide(Entity<DestroyInteractingsComponent> destructor, ref StartCollideEvent args)
{
if (destructor.Comp.RespectContacts && destructor.Comp.FixtureId == args.OurFixtureId && args.OtherFixture.Hard && args.OurFixture.Hard)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line breaks

/// The colliding fixture
/// </summary>
[DataField]
public string FixtureId = "bzzz";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't use a placeholder name, and possibly make this a required: true datafield in case if this component should always destroy colliding entities

namespace Content.Goobstation.Common.Damage;

/// <summary>
/// Goobstation

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant to specify, you can already see that it's in Goob module

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants