Commit Graph

35 Commits

Author SHA1 Message Date
chromiumboy
dfd3e36a0a Sentry turrets - Part 4: The sentry turret and its primary systems (#35123)
* Initial commit

* Removed mention of StationAiTurretComponent (for now)

* Prep for moving out of draft

* Fixing merge conflict

* Re-added new net frequencies to AI turrets

* Removed turret control content

* Removed unintended change

* Final tweaks

* Fixed incorrect file name

* Improvement to fire mode handling

* Addressed review comments

* Updated how turret wire panel auto-closing is handled

* Ranged NPCs no longer waste shots on stunned targets

* Fixed bug in tracking broken state

* Addressed review comments

* Bug fix

* Removed unnecessary event call
2025-03-29 12:55:58 -05:00
metalgearsloth
75a7407e33 Predict some power PowerReceiver stuff (#33834)
* Predict some power PowerReceiver stuff

Need it for some atmos device prediction.

* Also this
2025-03-10 13:00:49 +11:00
metalgearsloth
1d004f4945 Sentry review (#35424)
Co-authored-by: chromiumboy <chromium.boy@gmail.com>
Co-authored-by: chromiumboy <50505512+chromiumboy@users.noreply.github.com>
2025-02-24 00:57:27 +11:00
chromiumboy
066c773965 Sentry turrets - Part 2: Basic prototype (#35031) 2025-02-24 00:39:44 +11:00
ArtisticRoomba
9de569d973 Show battery level for selected devices in Power Monitoring Console (#33854)
* Use class instead of out variables

* Show battery level in power monitoring console

* Better color contrast for battery level + localized string

* Add visualization to battery percentage

* Reverts random ChatSystem.cs whitespace change

* Address review

* Show BatteryLevel stats in child view when selecting devices

---------

Co-authored-by: Crotalus <crotalus@users.noreply.github.com>
2024-12-19 01:46:36 +01:00
slarticodefast
4704309b4e Fix SpawnAndDeleteAllEntitiesInTheSameSpot heisentest (#32330)
What happened was that the new tech anomaly randomly triggered a signal sink on the portable generator, which is currently broken and throws an error if the that sink is activated.

The resolve needed logMissing = false because it does not expect the ActiveGeneratorRevvingComponent to exist.
2024-10-12 11:54:48 -07:00
Fildrance
4bcf3c3c0e Station AI ability to electricute doors (#32012)
* Boom! Emergency access!

* Emergency access sound

* locale

* Updated sounds

* bleh

* Door electrify base

* feat: popups on attempt to activate AI action when wires cut

* refactor: use SharedApcPowerReceiverComponent to check if AI can interact with door

* refactor: added icon and sound for door overcharge

* meta.json should use tabs not spaces

* refactor: extracted sounds for airlock overcharge to static field in system

* refactor: cleanup, ScarKy0 mentions for resources

* refactor: removed unused textures

* feat: now notification is displayed when AI attempting to interact with door which have wire cut

* StationAiWhitelistComponent is properly gating  BUI OnMessageAttempt, SharedPowerReceiverSystem.IsPowered is now used to check if device powered

* refactor: use PlayLocal to play electrify sound only for AI player

* refactor: SetBoltsDown now uses TrySetBoltDown, checks for power.

* bolts now check for power using SharedPowerReceiverSystem

* electrify localization and louder electrify sounds

* extracted ShowDeviceNotRespondingPopup, reverted airlocks not opening/closing when ai wire was cut

* refactor: cleanup

* New sprites and fixes

* Copyright

* even more sprite changes

* refactore: cleanup, rename overcharge => electrify

---------

Co-authored-by: ScarKy0 <scarky0@onet.eu>
Co-authored-by: pa.pecherskij <pa.pecherskij@interfax.ru>
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
2024-09-27 17:22:17 +10:00
Tayrtahn
320135347f Add guidebook protodata tag: embed prototype values in guidebook text (#27570)
* First clumsy implementation of guidebook protodata

* Support for Properties, format strings

* Better null

* Rename file

* Documentation and some cleanup

* Handle errors better

* Added note about client-side components

* A couple of examples

* DataFields

* Use attributes like a sane person

* Outdated doc

* string.Empty

* No IComponent?

* No casting

* Use EntityManager.ComponentFactory

* Use FrozenDictionary

* Cache tagged component fields

* Iterate components and check if they're tagged
2024-09-12 13:31:56 +03:00
Julian Giebel
417d3a87a2 Station Anchor (#26098)
* Work on abstracting out chargeup functionality/ui from grav gen

* Work on station anchor

* Finish implementing station anchors

* uhh yeah

* ok.

* fix tests

* whoops

* Get the last extraneous yaml fail

* PJB review

* beast mode... ACTIVATE!

---------

Co-authored-by: Ed <96445749+TheShuEd@users.noreply.github.com>
Co-authored-by: EmoGarbage404 <retron404@gmail.com>
2024-08-31 10:40:28 -04:00
metalgearsloth
c0a07614c0 ItemToggle + slots stuff (#31312)
* ItemToggle + slots stuff

- Add component for itemslot locks to match LockComponent (surprised this didn't exist).
- Add thing for pointlight to match itemtoggle. In future should be used for PDAs and stuff but need to fix some other stuff first.

* Also this

* grill
2024-08-25 22:30:28 +10:00
metalgearsloth
a89d4c750b Power stuff (#31314)
* Power stuff

- Add shared IsPowered
- Add shared ResolveApc
- Move PowerChangedEvent to shared for now
- Add SlimPoweredLight that actually functions how you'd expect a PoweredLight to function it id didn't have a bunch of bloat on it.

* big update

* boing
2024-08-25 22:18:42 +10:00
Mervill
ec19f9f4a9 Make the powered examine text fully client predicted (#30441)
* Make the powered examine text fully client predicted

* switch to using the Entity<T> API for the examine event
2024-07-29 00:28:17 -07:00
metalgearsloth
e4a5f2a145 Predict ActivatableUIRequiresPower (#28405)
A lot of BUIs aren't going to handle the state coming in cleanly but we can fix em as we find em.
2024-05-30 00:32:16 -07:00
ShadowCommander
e2bf127323 Move ApcPowerReceiverComponent Powered state to shared (#28206)
* Try syncing powered state to client

For some reason the client is not receiving the ApcPowerReceiverComponentState, so it's not working.

* Fix powered state not syncing to client

The client PowerReceiverSystem was abstract, which prevented it from
running initialize.

* Flip check so that it runs bigger checks first

PowerDisabled skips the others.
NeedsPower skips the receiving check.

* Disallow changing Powered manually

* Move Powered update to PowerReceiverSystem

* Move appearance to event subscription

* Move metadata component to AllEntityQuery

* Cleanup

* Move Powered update back to PowerNetSystem

It's easier to use the EntityQueries and it dosen't need to be updated
anywhere else.

* Put appearance updating back

* Move IsPowered to shared

* Simplify IsPowered

* Cleanup

* Remove duplicate PowerChangedEvent

PowerChangedEvent on ProviderChanged doesn't seem to be needed
PowerChangedEvent gets raised by in update if the power state changes
after a new provider is connected
2024-05-30 16:46:22 +10:00
Leon Friedrich
a7e6337cbd Replace NavMap dictionaries with int[] (#27602)
* Replace NavMap dictionaries with int[]

* Remove badly named const

* Remove unnecessary offset

* Prioritize airlocks
2024-05-02 12:51:21 +10:00
metalgearsloth
5896e68752 Content update for UI prediction (#27214)
* Content update for UI refactor

* Big update

* Sharing

* Remaining content updates

* First big update

* Prototype updates

* AUGH

* Fix UI comp ref

* Cleanup

- Fix predicted message, fix item slots, fix interaction range check.

* Fix regressions

* Make this predictive

idk why it wasn't.

* Fix slime merge

* Merge conflict

* Fix merge
2024-04-26 18:16:24 +10:00
Pieter-Jan Briers
68ce53ae17 Random spontaneous cleanup PR (#25131)
* Use new Subs.CVar helper

Removes manual config OnValueChanged calls, removes need to remember to manually unsubscribe.

This both reduces boilerplate and fixes many issues where subscriptions weren't removed on entity system shutdown.

* Fix a bunch of warnings

* More warning fixes

* Use new DateTime serializer to get rid of ISerializationHooks in changelog code.

* Get rid of some more ISerializationHooks for enums

* And a little more

* Apply suggestions from code review

Co-authored-by: 0x6273 <0x40@keemail.me>

---------

Co-authored-by: 0x6273 <0x40@keemail.me>
2024-02-13 16:48:39 -05:00
SpeltIncorrectyl
5d2ddc0d8b Adds signal control to portable generators (#24157)
* added signal control to portable generators

* added documentation

* Discard changes to Content.Server/Radio/EntitySystems/HeadsetSystem.cs

* added DeviceNetworkComponent and WirelessNetworkConnectionComponent to generator prototype

* made GeneratorSignalControlComponent nicer

* implemented auto-revving

* added back necessary dependency

* can't send do-after event manually

* repeat now works with auto revving

* fixed

* removed vv

* stopping generating when it is revving now makes it stop revving

* Update Content.Shared/Power/Generator/ActiveGeneratorRevvingComponent.cs

Co-authored-by: Kara <lunarautomaton6@gmail.com>

* used resolve instead of TryComp

---------

Co-authored-by: Julian Giebel <juliangiebel@live.de>
Co-authored-by: Kara <lunarautomaton6@gmail.com>
2024-01-29 15:56:29 +01:00
Pieter-Jan Briers
f855cb2b00 Make PACMANs a little better (#24604)
* PACMAN generators show network load/supply.

This gives more feedback to players that their PACMAN is properly connected and what the network status is (i.e. you don't have enough generators).

* Buff JRPACMAN to 8 kW.

Shifted all power values up by +3 kW.

They're frequently too weak to power even single rooms so they deserve a buff.

* Change unit format helpers number format.

Always displays one digit of precision. This avoids jumping around when a value is changing live.
2024-01-26 21:53:43 -05:00
Ed
88d7cfb4c0 Tesla (#21124)
* upload all textures
finished easiest part - TeslaGenerator

* Added Tesla energy logic

* add lightning pulse priority

* work

* optimise lightning arc system

* now tesla moving to LightningTarget entity and consume it

* some audio work
add airlock and computers to the LightningTarget

* add nice visual and explosions
add crashing to game

* rsi meta fix

* disabling explosions (crashing server)
I'll get back to that problem later.

* adding important admin logging

* a little bit of cleaning and documentation

* Persistent attempts to fix the server crashing on explosions. Accidental cleaning of everything I see.

* now the tesla incinerates everything it touches except the containment field.

* colliders work

* fix falling tesla on ground after being exploded

* add consume sound, add spawn and collapses sound

* added TeslaGenerator to cargo trading console

* add all tesla part to cargo trading console

* Tesla coils: Turn on and off, get energy from lightning, give energy to the grid.

* tesla coil is ready

* tesla grounding rod is ready

* clean up

* clean up 2

* grounding rods now working without power

* add LightningResistance parameter for LightningTarget Component

* add chaotic teleport

* eletrocution remove?

* deltanedas fix pack

* more fixes

* FIXES

* FIIIXEEES

* The "Grounding Rod" component is removed, and replaced with "LightiningSparking", which is responsible for changing the visuals when hit by lightning. Duplicate code from the coil is removed.

* ops

* fix

* nah, is escaped anyway

* increase tesla collider size

* keron bb

* try fix test?

* fix

* bruh

* check turn off sus comp

* prototype cleaning

* FIIX

* return and fix sus component

* fix tesla eating lightnings, now mini tesla is electrocuted

* commented some issues

* remove linq sorting
fix jumping system
minor fixes

* fix second Linq

* fix tesla colliders! Yeah, it works

* fix componentregistration

* Just retests

* not fix

* FIX TESLA

* fixes

* store targets

* back

* make dictionary of hashsets

* some sloth fixes

* stump

* playtest balance energy generation, return to unpotimized (but working) lightning shoot

* parity

* work on

* some new fix, some new bug (chasingComponent not chasing)

* comment

* fix ChasingWalkSystem

* fix collider tesla problem

* revert old unoptimized shoot lightning

* new fix pack

---------

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2023-12-28 13:11:50 +00:00
chromiumboy
1de682e23f Power monitoring console overhaul (#20927)
* Prototyping whole station wire map

* More prototyping

* Added icons for the different power distributors and toggleable cable displays

* Power cable layouts are now only sent to the client when the power monitor is open

* UI prototyping

* Power monitors can now see the sprites of distant entities, long entity names are truncated

* Updated how network devices are added to the player's PVS

* More feature prototypes

* Added source / load symbols

* Final prototype! Time to actually code it properly...

* Start of code clean up

* Continuing code clean up

* Fixed UI appearance

* Code clean up complete

* Removed unnecessary changes

* Updated how power values are calculated, added UI warnings for power sinks and power net checks

* Updated how power values are calculated again, added support for portable generators

* Removed unnecessary files

* Map beacons start toggled off, console map now works outside the station, fixed substation icon

* Made some of Sloth's requested changes. Power distributors don't blink anymore, unless selected

* Moved a number of static variables in PowerMonitoringHelper to sensible places in the main files. Added a NavMapTrackableComponent so that you can specify how individual entities appear on the navmap

* Updated the colors/positions of HV cables and SMESes to improve contrast

* Fixed SMES color in map legend

* Partially fixed auto-scrolling on device selection, made sublists alphabetical

* Changed how auto-scroll is handled

* Changed the font color of the console warning messages

* Reduced the font size of beacon labels

* Added the station name to the console

* Organized references

* Removed unwanted changes to RobustToolbox

* Fix merge conflict

* Fix merge conflict, maybe

* Fix merge conflict

* Updated outdated reference

* Fixed portable_generator.yml

* Implemented a number of requested changes, move bit masks to a shared component

* Navigate listings via the navmap

* First attempt at improving efficiency

* Second attempt at optimization, entity grouping added for solar panels

* Finished solar panel entity joining

* Finished major revisions, code clean up needed

* Finializing optimizations

* Made requested changes

* Bug fix, removed obsolete code

* Bug fixes

* Bug fixes

* STarted revisions

* Further revisions

* More revision

* Finalizing revisions. Need to make RT PR

* Code tidying

* More code tidying

* Trying to avoid merge conflicts

* Trying to avoid merge conflicts

* Removed use of PVS

* Improving efficiency

* Addressed a bunch of outstanding issues

* Clear old data on console refresh

* UI adjustments

* Made node comparison more robust. More devices can be combined into one entry

* Added missing component 'dirty'
2023-12-24 17:07:41 +11:00
deltanedas
b6a8f5e780 Power switchable refactor (#20419)
Co-authored-by: deltanedas <@deltanedas:kde.org>
2023-10-25 23:57:23 +11:00
Pieter-Jan Briers
bf16698efa Portable Generator Rework (#19302) 2023-08-25 11:40:42 -07:00
DrSmugleaf
a88e747a0b Refactor serialization copying to use source generators (#19412) 2023-08-22 18:14:33 -07:00
Pieter-Jan Briers
a242af506e Adds the thermo-electric generator (#18840)
* Basic TEG start.

Connects via node group.

* Basic TEG test map

* Sensor monitoring basics, TEG circulator flow

* Basic power generation (it doesn't work)

* More sensor monitoring work

* Battery (SMES) monitoring system.

* Sensor monitoring fixes

Make it work properly when mapped.

* Test map improvements

* Revise TEG power output mechanism.

Now uses a fixed supplier with a custom ramping system.

* TEG test map fixes

* Make air alarms and pumps open UI on activate.

* Clean up thermo machines power switch.

Removed separate Enabled bool from the component that always matched the power receiver's state.

This enables adding a PowerSwitch component to give us alt click/verb menu.

* TEG but now fancy

* Make sensor monitoring console obviously WiP to mappers.

* Vending machine sound, because of course.

* Terrible, terrible graph background color

* Examine improvements for the TEG.

* Account for electrical power when equalizing gas mixtures.

* Get rid of the TegCirculatorArrow logic.

Use TimedDespawn instead. The "no show in right-click menuu" goes into a new general-purpose component.

Thanks Julian.

* Put big notice of "not ready, here's why" on the sensor monitoring console.

* TryGetComponent -> TryComp

* Lol there's a HideContextMenu tag

* Test fixes

* Guidebook for TEG

Fixed rotation on GuideEntityEmbed not working correctly.

Added Margin property to GuideEntityEmbed

* Make TEG power bar default to invisible.

So it doesn't appear in the guidebook and spawn menu.
2023-08-12 15:41:55 -05:00
Nemanja
2d08f02d23 Material generators from Afterlight (#18387) 2023-07-31 14:42:38 -04:00
TemporalOroboros
6ff63a6ee7 Resolves SmesVisualizer is Obsolete (#13899)
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2023-05-07 13:43:41 +10:00
metalgearsloth
be4e69b0c0 Station maps (#13027) 2023-04-13 16:21:24 +10:00
Leon Friedrich
19277a2276 More DoAfter Changes (#14609)
* DoAfters

* Compact Clone()

* Fix mice and cuffables

* Try generalize attempt events

* moves climbabledoafter event to shared, fixes issue with climbable target

* Fix merge (cuffing)

* Make all events netserializable

* handful of doafter events moved

* moves the rest of the events to their respective shared folders

* Changes all mentions of server doafter to shared

* stop stripping cancellation

* fix merge errors

* draw paused doafters

* handle unpausing

* missing netserializable ref

* removes break on stun reference

* removes cuffing state reference

* Fix tools

* Fix door prying.

* Fix construction

* Fix dumping

* Fix wielding assert

* fix rev

* Fix test

* more test fixes

---------

Co-authored-by: keronshb <keronshb@live.com>
2023-04-02 21:13:48 -04:00
Flipp Syder
80a68b3867 Wires patches (#8385) 2022-05-23 16:00:51 -07:00
wrexbe
bc68ac96dd Cleanup the namespaces (#8132) 2022-05-13 17:59:03 +10:00
Flipp Syder
2c6158e115 Wires refactor (#7699)
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Co-authored-by: Kara <lunarautomaton6@gmail.com>
2022-05-06 12:35:06 +10:00
20kdc
70cd3d18ca Power Monitoring Console (#7849) 2022-05-04 10:59:40 -07:00
Visne
b7dc3c81ae Remove redundant #nullable enable (#4275) 2021-07-16 17:37:09 -07:00
DrSmugleaf
ff1a2d97ea Re-organize all projects (#4166) 2021-06-09 22:19:39 +02:00