From: Fildrance Date: Tue, 15 Apr 2025 00:34:53 +0000 (+0300) Subject: 3mo xeno archeology (first phase) (#33370) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=d38042a0c07dc61504a3585db03ca53a71f0022e;p=space-station-14.git 3mo xeno archeology (first phase) (#33370) * DAG Adjacency Matrix & Tests * Fix sandbox type errors * First pass on procgen * Procgen adjustments * Networking * Cruft and god and beauty and analysis console * convert to data types that dont make me want to kill myself * starting work on console UI * drawing nodes n shit * damn that ui FUCKS * XAT * Add a bunch of basic triggers * Fix trigger gen * Add node info into the analysis console UI * Add node unlocking * more trigger cuz thats pretty cool * final triggers + incorporate gnostic faith * some ui changes, mostly * Fix orphaned procgen segments * its not random dipshit * yeah... this one will make pjb happy.... * we call it a day for the UI * imagine... shared power code... * extraction WIP but we gotta sidequest momentarily * oh hey would you look at that its the actual functionality * distrotrased * Small departure for randomness. * ok yep yep indeed that is an effect very cool. * thanos snap oldcode * fuck it we ball * feat: node scanner now displays triggered nodes. Removed unused old artifact systems and related code (most of it). xml-doc and minor fixups. * refactor: most of preparations, cleanup and groundwork. also segment-related tests * feature: all basic effects returning * feat: finished effects lits, created weight lists for struct and handheld artifacts, fixed throw trigger and music ApplyComponent artifact effects not working * feat: prevent non-first-time-predicted calls in shared artifact effect systems * fix: remove gun effect from artifact effects - as it interferes with 'activate artefact' action * fix: foam reagent selection, neat ApplyComponents art effect scenarios, handheld art is RadiationReceiver again * fix: moved spawn/ pry&throw effect systems back to server part of code - entity duplication bugs were not quite fun * refactor: fix protos * refactor: fix linter * fix: fix old artifact component names in yml * fix: no more throwing error on artifact spawn with empty XAEFoamComponent.Reagents * fix: removed old component usage in maps * fix: remove more deleted components from map * fix: ContainerContainer is now part of initial artifact entity, it won't be affecting UninitializedSaveTest * refactor: fix tests, add loc description to toolshed commands * Changed node scanner to tell the whole story about current artifact state * refactor: remove excessive get of EntityCoordinates in XAE systems, removed Value access in NodeScannerDisplay * fix: turned off TriggerInteraction, removed XAESpawn usage and system, EmpSystem now can use EntityCoordinates, * fix: moved SharedXenoArtifactSystem.CancelUnlockingOnGraphStructureChange into RebuildXenoArtifactMetaData to lessen code coupling * fix: XenoArtifactEffectJunkSpawn moved invalid rolls declaration * refactor: set default value for XenoArtifactComponent.EffectsTable for tests * fix: now explosions XAE can be activated for effect * refactor: added some usedelay so artifactuse would'nt be spammed * refactor: artifact-related hints improvements * fix: artifact no longer spawns fauna into itself * refactor: xml-doc and minor refactoring * refactor: xml-doc for Xeno Artifact systems, renaming of questionable XAT systems * map for playtest, TODO REVERT THIS * fix: magboots trigger art from a mile * refactor: bind artifact animation to unlocking state * feat: radiation dmg now have reference to source (and artifacts won't irradiate themselves) * fix: random artifact node durability now is rolled for max and not current value * refactor: gas effects are more rare, hand-held artifact effects are filtered properly now, rad dmg trigger now requires only 20 dmg for activation * feat: animations and sound effects for artifact force-use and failed finish of unlocking phase * use only 1 file with art use animation * refactor: minor artifact dmg triggers tuning * feat: now nodes that CAN be unlocked are displayed with specific color in console. * feat: now unlocking stage time is dynamic and it depends on amount of triggers player activated correctly. Failed one stops incrementing * feat: now non-active unlocked nodes return more points if durability was not wasted * feat: now puddle/foam effects change description of node * fix: fix test failure * refactor: renamed phasing effect, fixed failing test for elkridge * minor balance changes * refactor: split rare materials into separate effects * feat: unlocked nodes without successor wont listen to unlocks, node unlock is not activating node * fix: removed OnIrradiatedEvent duplicate c-tor * revert changes of reach for playtest * revert last row empty line removal on reach.yml * fix: fix PVS bug, born from attempt to relay event to art nodes that were not synced yet to the client * fix: fix elkridge for tests (again) * refactor: xml-doc, more stuff predicted, allocation optimization in XAE/XAT systems * refactor: naming * refactor: extract variable refactor for XAEApplyComponentsSystem.OnActivated insides * fix: duplicate xeno artifact unlocking sound fixed * feat: CreatePuddle xeno artifact effect now can have min and max borders for chamicals to be drafted, minor XAECreatePuddleSystem refactor * feat: networking for shared XAE components + xml-doc leftovers * refactor: more xml-doc, fix XAEApplyComponentsComponent.Components not being serializable but trying to be * refactor: xml-docs and XAEThrowThingsAroundSystem now uses circle and not box for prying tiles * refactor: xml-docs, minor refactors * revert XenoArtifactCommand.ArtifactPrototype being PrototId * refactor: simplify the way ExtractionResearchLabel works --------- Co-authored-by: EmoGarbage404 Co-authored-by: pa.pecherskij --- diff --git a/Content.Client/Xenoarchaeology/Artifact/XenoArtifactSystem.cs b/Content.Client/Xenoarchaeology/Artifact/XenoArtifactSystem.cs new file mode 100644 index 0000000000..0e8680e22a --- /dev/null +++ b/Content.Client/Xenoarchaeology/Artifact/XenoArtifactSystem.cs @@ -0,0 +1,6 @@ +using Content.Shared.Xenoarchaeology.Artifact; + +namespace Content.Client.Xenoarchaeology.Artifact; + +/// +public sealed class XenoArtifactSystem : SharedXenoArtifactSystem; diff --git a/Content.Client/Xenoarchaeology/Equipment/ArtifactAnalyzerSystem.cs b/Content.Client/Xenoarchaeology/Equipment/ArtifactAnalyzerSystem.cs new file mode 100644 index 0000000000..557d46f46b --- /dev/null +++ b/Content.Client/Xenoarchaeology/Equipment/ArtifactAnalyzerSystem.cs @@ -0,0 +1,40 @@ +using Content.Client.Xenoarchaeology.Ui; +using Content.Shared.Xenoarchaeology.Equipment; +using Content.Shared.Xenoarchaeology.Equipment.Components; +using Robust.Client.GameObjects; + +namespace Content.Client.Xenoarchaeology.Equipment; + +/// +public sealed class ArtifactAnalyzerSystem : SharedArtifactAnalyzerSystem +{ + [Dependency] private readonly UserInterfaceSystem _ui = default!; + + /// + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(OnAnalysisConsoleAfterAutoHandleState); + SubscribeLocalEvent(OnAnalyzerAfterAutoHandleState); + } + + private void OnAnalysisConsoleAfterAutoHandleState(Entity ent, ref AfterAutoHandleStateEvent args) + { + UpdateBuiIfCanGetAnalysisConsoleUi(ent); + } + + private void OnAnalyzerAfterAutoHandleState(Entity ent, ref AfterAutoHandleStateEvent args) + { + if (!TryGetAnalysisConsole(ent, out var analysisConsole)) + return; + + UpdateBuiIfCanGetAnalysisConsoleUi(analysisConsole.Value); + } + + private void UpdateBuiIfCanGetAnalysisConsoleUi(Entity analysisConsole) + { + if (_ui.TryGetOpenUi(analysisConsole.Owner, ArtifactAnalyzerUiKey.Key, out var bui)) + bui.Update(analysisConsole); + } +} diff --git a/Content.Client/Xenoarchaeology/Equipment/ArtifactCrusherSystem.cs b/Content.Client/Xenoarchaeology/Equipment/ArtifactCrusherSystem.cs index a57ef55574..d4a88cdd03 100644 --- a/Content.Client/Xenoarchaeology/Equipment/ArtifactCrusherSystem.cs +++ b/Content.Client/Xenoarchaeology/Equipment/ArtifactCrusherSystem.cs @@ -6,4 +6,4 @@ namespace Content.Client.Xenoarchaeology.Equipment; public sealed class ArtifactCrusherSystem : SharedArtifactCrusherSystem { -} +} \ No newline at end of file diff --git a/Content.Client/Xenoarchaeology/Equipment/NodeScannerSystem.cs b/Content.Client/Xenoarchaeology/Equipment/NodeScannerSystem.cs new file mode 100644 index 0000000000..9b517c06a1 --- /dev/null +++ b/Content.Client/Xenoarchaeology/Equipment/NodeScannerSystem.cs @@ -0,0 +1,31 @@ +using Content.Client.Xenoarchaeology.Ui; +using Content.Shared.Xenoarchaeology.Equipment; +using Content.Shared.Xenoarchaeology.Equipment.Components; +using Robust.Client.GameObjects; + +namespace Content.Client.Xenoarchaeology.Equipment; + +/// +public sealed class NodeScannerSystem : SharedNodeScannerSystem +{ + [Dependency] private readonly UserInterfaceSystem _ui = default!; + + /// + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(OnAnalysisConsoleAfterAutoHandleState); + } + + protected override void TryOpenUi(Entity device, EntityUid actor) + { + _ui.TryOpenUi(device.Owner, NodeScannerUiKey.Key, actor, true); + } + + private void OnAnalysisConsoleAfterAutoHandleState(Entity ent, ref AfterAutoHandleStateEvent args) + { + if (_ui.TryGetOpenUi(ent.Owner, NodeScannerUiKey.Key, out var bui)) + bui.Update(ent); + } +} diff --git a/Content.Client/Xenoarchaeology/Ui/AnalysisConsoleBoundUserInterface.cs b/Content.Client/Xenoarchaeology/Ui/AnalysisConsoleBoundUserInterface.cs index c7a74815b6..a4ecff7530 100644 --- a/Content.Client/Xenoarchaeology/Ui/AnalysisConsoleBoundUserInterface.cs +++ b/Content.Client/Xenoarchaeology/Ui/AnalysisConsoleBoundUserInterface.cs @@ -1,66 +1,50 @@ -using Content.Shared.Xenoarchaeology.Equipment; -using JetBrains.Annotations; -using Robust.Client.GameObjects; +using Content.Shared.Research.Components; +using Content.Shared.Xenoarchaeology.Equipment.Components; using Robust.Client.UserInterface; +using JetBrains.Annotations; namespace Content.Client.Xenoarchaeology.Ui; +/// +/// BUI for artifact analysis console, proxies server-provided UI updates +/// (related to device, connected artifact analyzer, and artifact lying on it). +/// [UsedImplicitly] -public sealed class AnalysisConsoleBoundUserInterface : BoundUserInterface +public sealed class AnalysisConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : BoundUserInterface(owner, uiKey) { [ViewVariables] private AnalysisConsoleMenu? _consoleMenu; - public AnalysisConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) - { - } - + /// protected override void Open() { base.Open(); _consoleMenu = this.CreateWindow(); + _consoleMenu.SetOwner(owner); + + _consoleMenu.OnClose += Close; + _consoleMenu.OpenCentered(); _consoleMenu.OnServerSelectionButtonPressed += () => { - SendMessage(new AnalysisConsoleServerSelectionMessage()); - }; - _consoleMenu.OnScanButtonPressed += () => - { - SendMessage(new AnalysisConsoleScanButtonPressedMessage()); - }; - _consoleMenu.OnPrintButtonPressed += () => - { - SendMessage(new AnalysisConsolePrintButtonPressedMessage()); + SendMessage(new ConsoleServerSelectionMessage()); }; _consoleMenu.OnExtractButtonPressed += () => { SendMessage(new AnalysisConsoleExtractButtonPressedMessage()); }; - _consoleMenu.OnUpBiasButtonPressed += () => - { - SendMessage(new AnalysisConsoleBiasButtonPressedMessage(false)); - }; - _consoleMenu.OnDownBiasButtonPressed += () => - { - SendMessage(new AnalysisConsoleBiasButtonPressedMessage(true)); - }; } - protected override void UpdateState(BoundUserInterfaceState state) + /// + /// Update UI state based on corresponding component. + /// + public void Update(Entity ent) { - base.UpdateState(state); - - switch (state) - { - case AnalysisConsoleUpdateState msg: - _consoleMenu?.SetButtonsDisabled(msg); - _consoleMenu?.UpdateInformationDisplay(msg); - _consoleMenu?.UpdateProgressBar(msg); - break; - } + _consoleMenu?.Update(ent); } + /// protected override void Dispose(bool disposing) { base.Dispose(disposing); diff --git a/Content.Client/Xenoarchaeology/Ui/AnalysisConsoleMenu.xaml b/Content.Client/Xenoarchaeology/Ui/AnalysisConsoleMenu.xaml index 29f4a54847..14db2bdf60 100644 --- a/Content.Client/Xenoarchaeology/Ui/AnalysisConsoleMenu.xaml +++ b/Content.Client/Xenoarchaeology/Ui/AnalysisConsoleMenu.xaml @@ -1,80 +1,91 @@ - + MinSize="700 350" + SetSize="980 550"> - - - - - - - - - - - + + + + + + + - - + + + + + + + + + + + + + + + + + - - - - + + + + + + + +