Commit Graph

11 Commits

Author SHA1 Message Date
Tayrtahn
e33f0341ad Code cleanup: radio jammer (#29052)
* Code cleanup for radio jammer

* More Entity<T> for the people, and fix an accidental variable reuse
2024-06-20 01:13:40 +10:00
Nemanja
a1a8f04036 Decouple interactions from hands, cleanup old events, add new fears (#28393)
* ok basic shit

* second part

* pretend it isn't real it can't hurt you.

* 👁️ 👁️

* shadowcommander review
2024-05-31 13:26:19 -07:00
beck-thompson
d3b1178428 Radio jammer update! (#25912)
* Added selectable power level to radio jammer

* Cleaned up OnGetVerb

* Settings are now stored in the .yml file. Simplified stuff a lot!

* Minor fixes!

* Small little baby fix :)

* Added the power level switch to the examine menu and also removed the ftl file as it was in the incorrect location.

* Minor code cleanup

* Changed byte -> int

* Update sprite

* Fixed licence

* Added power LED that changes if the jammer is on low power.

* Removed tabs

* Changed github link to the commit

* Changed all the RemComp to RemComDeferred

* Moved NetworkedComponent to shared

* Changed radio jammer textures back with minor edits

* Added a space because it was annoying me

* Jammer now updates range for suit sensors properly! Thanks nikthechampiongr :)

* Removed useless comment

* Cleaned up code that updates the range of tracking devices.

* Fixed client namespace and removed newline

* Cleaned up ChangeLEDState and ChangeChargeLevel.

* Added comments

* Read only

* Fixed another comment

* Locked in

* Made server inherit shared

* Update Content.Shared/Radio/EntitySystems/SharedJammerSystem.cs

* Update Content.Shared/Radio/EntitySystems/SharedJammerSystem.cs

* review fixes

---------

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2024-04-25 12:19:16 +10:00
nikthechampiongr
29c81bcc05 Fix radio jammer not blocking suit sensors. (#26632)
As it turns out, they are not in fact on their own netid. They are
actually just on wireless. The way I had tested my previous pr led to
this mistake being made. I originally had the radio jammer block
wireless as well, but decided to take out under the flase assumption
that it suit sensors were actually on their own netid and did not
require the ability to block all wireless packets at the last moment.
2024-04-01 13:13:51 +11:00
nikthechampiongr
266cc85f57 Create DeviceNetworkJammerComponent & System as a general way for entities to act as jammers (#26342)
* Add DeviceNetworkJammerComponent & System

Allows for entities to "jam" DeviceNetwork packets.

Whenever a device attempts to send a packet, the
DeviceNetworkJammerSystem listens for the BeforePacketSentEvent.
From there if any entity with the jammer component is within range of
either the sender or receiver of the packet the event will be cancelled.
Additionally jammers can only block packets in certain networks. If a
packet is not being transmitted in one of the networks it can block then
even if the jammer is in range the event will not be cancelled.

The range is stored in the jammer component along with the networks it
can jam.

Jammable network ids are stored as strings which seems to be how custom
networks are stored (E.g. network ids for suit sensors).

To allow for all of this, the BeforePacketSentEvent was modified to
provide the NetworkId.

* Make JammerSystem for the radio jammer use the DeviceNetworkJammer. Remove redundant event.

* Replace calls to TryDistance with InRange
2024-03-24 21:59:16 -04:00
nikthechampiongr
dce24dfd03 Make radio jammer block suit sensors (#26046)
* Make radio jammer block suit sensors

* Fix stupid

Use CancellableEventArgs instead of doing what the hell I was doing before.

* Address Reviews.

Change the event from a CancellableEntityEventArgs to a ByRefEvent.
2024-03-14 11:55:14 -04:00
Tayrtahn
e5536e0652 Hotfix for errors in handheld lights and radio jammers (#25880) 2024-03-07 00:44:14 +11:00
Tayrtahn
2935e5bd78 Remove all obsolete BatteryComponent method calls (#25871)
Removed all obsolete, non-ECS method calls to BatteryComponent
2024-03-06 16:34:50 +11:00
Slava0135
811b35a1cf display item charge on examine (#16116) 2023-05-05 22:44:21 +10:00
Slava0135
8aef835d33 radio systems replace all entity query with enumerator (#15449) 2023-04-23 18:29:08 +10:00
Slava0135
7886d27dda Add radio jammer (#14369) 2023-04-14 12:50:19 -07:00