Destroy Interactings System #72
Conversation
|
This pull request has been automatically marked as stale because it has not had 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. |
|
Bot, don't close it |
Roudenn
left a comment
There was a problem hiding this comment.
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
| [DataField(customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))] | ||
| public string SpawnOnDestruction = string.Empty; |
There was a problem hiding this comment.
use EntProtoId and remove serializer
| //TODO:Particles | ||
| #endregion |
There was a problem hiding this comment.
Do the particles please I've already ported them
|
|
||
| namespace Content.Goobstation.Shared.Damage; | ||
|
|
||
| public sealed partial class SharedDestroyInteractinngSystem : EntitySystem |
There was a problem hiding this comment.
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) |
|
|
||
| private void OnCollide(Entity<DestroyInteractingsComponent> destructor, ref StartCollideEvent args) | ||
| { | ||
| if (destructor.Comp.RespectContacts && destructor.Comp.FixtureId == args.OurFixtureId && args.OtherFixture.Hard && args.OurFixture.Hard) |
| /// The colliding fixture | ||
| /// </summary> | ||
| [DataField] | ||
| public string FixtureId = "bzzz"; |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Redundant to specify, you can already see that it's in Goob module
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
Media
Desktop.2026.06.12.-.23.17.13.03.DVR.online-video-cutter.com.mp4
Requirements