From: Velken <8467292+Velken@users.noreply.github.com> Date: Fri, 16 Jan 2026 22:08:52 +0000 (-0300) Subject: Admin Anomaly Scanner (#42443) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=8a59ead61e791ea5d93e7c528f59875f5d270303;p=space-station-14.git Admin Anomaly Scanner (#42443) * admin anom scanner * improvement * green * sprite --- diff --git a/Content.Server/Anomaly/AnomalyScannerSystem.cs b/Content.Server/Anomaly/AnomalyScannerSystem.cs index ba657cf056..b8bc3b6036 100644 --- a/Content.Server/Anomaly/AnomalyScannerSystem.cs +++ b/Content.Server/Anomaly/AnomalyScannerSystem.cs @@ -41,12 +41,12 @@ public sealed class AnomalyScannerSystem : SharedAnomalyScannerSystem Appearance.SetData(scanner, AnomalyScannerVisuals.HasAnomaly, true, appearanceComp); - var stability = _secretData.IsSecret(anomaly, AnomalySecretData.Stability, secretDataComp) + var stability = _secretData.IsSecret(anomaly, AnomalySecretData.Stability, secretDataComp) && !scannerComp.IgnoreSecret ? AnomalyStabilityVisuals.Stable : _anomaly.GetStabilityVisualOrStable((anomaly, anomalyComp)); Appearance.SetData(scanner, AnomalyScannerVisuals.AnomalyStability, stability, appearanceComp); - var severity = _secretData.IsSecret(anomaly, AnomalySecretData.Severity, secretDataComp) + var severity = _secretData.IsSecret(anomaly, AnomalySecretData.Severity, secretDataComp) && !scannerComp.IgnoreSecret ? 0 : anomalyComp.Severity; Appearance.SetData(scanner, AnomalyScannerVisuals.AnomalySeverity, severity, appearanceComp); @@ -109,13 +109,14 @@ public sealed class AnomalyScannerSystem : SharedAnomalyScannerSystem private void OnScannerAnomalySeverityChanged(ref AnomalySeverityChangedEvent args) { - var severity = _secretData.IsSecret(args.Anomaly, AnomalySecretData.Severity) ? 0 : args.Severity; var query = EntityQueryEnumerator(); while (query.MoveNext(out var uid, out var component)) { if (component.ScannedAnomaly != args.Anomaly) continue; + var severity = _secretData.IsSecret(args.Anomaly, AnomalySecretData.Severity) && !component.IgnoreSecret ? 0 : args.Severity; + UpdateScannerUi(uid, component); Appearance.SetData(uid, AnomalyScannerVisuals.AnomalySeverity, severity); } @@ -123,15 +124,16 @@ public sealed class AnomalyScannerSystem : SharedAnomalyScannerSystem private void OnScannerAnomalyStabilityChanged(ref AnomalyStabilityChangedEvent args) { - var stability = _secretData.IsSecret(args.Anomaly, AnomalySecretData.Stability) - ? AnomalyStabilityVisuals.Stable - : _anomaly.GetStabilityVisualOrStable(args.Anomaly); var query = EntityQueryEnumerator(); while (query.MoveNext(out var uid, out var component)) { if (component.ScannedAnomaly != args.Anomaly) continue; + var stability = _secretData.IsSecret(args.Anomaly, AnomalySecretData.Stability) && !component.IgnoreSecret + ? AnomalyStabilityVisuals.Stable + : _anomaly.GetStabilityVisualOrStable(args.Anomaly); + UpdateScannerUi(uid, component); Appearance.SetData(uid, AnomalyScannerVisuals.AnomalyStability, stability); } @@ -154,12 +156,12 @@ public sealed class AnomalyScannerSystem : SharedAnomalyScannerSystem TryComp(uid, out var appearanceComp); TryComp(args.Anomaly, out var secretDataComp); - var severity = _secretData.IsSecret(args.Anomaly, AnomalySecretData.Severity, secretDataComp) + var severity = _secretData.IsSecret(args.Anomaly, AnomalySecretData.Severity, secretDataComp) && !component.IgnoreSecret ? 0 : anomalyComp.Severity; Appearance.SetData(uid, AnomalyScannerVisuals.AnomalySeverity, severity, appearanceComp); - var stability = _secretData.IsSecret(args.Anomaly, AnomalySecretData.Stability, secretDataComp) + var stability = _secretData.IsSecret(args.Anomaly, AnomalySecretData.Stability, secretDataComp) && !component.IgnoreSecret ? AnomalyStabilityVisuals.Stable : _anomaly.GetStabilityVisualOrStable((args.Anomaly, anomalyComp)); Appearance.SetData(uid, AnomalyScannerVisuals.AnomalyStability, stability, appearanceComp); diff --git a/Content.Server/Anomaly/AnomalySystem.cs b/Content.Server/Anomaly/AnomalySystem.cs index 102391baff..4955b4e336 100644 --- a/Content.Server/Anomaly/AnomalySystem.cs +++ b/Content.Server/Anomaly/AnomalySystem.cs @@ -236,14 +236,19 @@ public sealed partial class AnomalySystem : SharedAnomalySystem TryComp(anomaly, out var secret); //Severity - if (secret != null && secret.Secret.Contains(AnomalySecretData.Severity)) + if (secret != null && secret.Secret.Contains(AnomalySecretData.Severity) && !component.IgnoreSecret) msg.AddMarkupOrThrow(Loc.GetString("anomaly-scanner-severity-percentage-unknown")); else - msg.AddMarkupOrThrow(Loc.GetString("anomaly-scanner-severity-percentage", ("percent", anomalyComp.Severity.ToString("P")))); + { + var text = Loc.GetString("anomaly-scanner-severity-percentage", ("percent", anomalyComp.Severity.ToString("P"))); + if (secret != null && secret.Secret.Contains(AnomalySecretData.Severity)) + text += " " + Loc.GetString("anomaly-secret-admin"); + msg.AddMarkupOrThrow(text); + } msg.PushNewline(); //Stability - if (secret != null && secret.Secret.Contains(AnomalySecretData.Stability)) + if (secret != null && secret.Secret.Contains(AnomalySecretData.Stability) && !component.IgnoreSecret) msg.AddMarkupOrThrow(Loc.GetString("anomaly-scanner-stability-unknown")); else { @@ -254,15 +259,24 @@ public sealed partial class AnomalySystem : SharedAnomalySystem stateLoc = Loc.GetString("anomaly-scanner-stability-high"); else stateLoc = Loc.GetString("anomaly-scanner-stability-medium"); + + if (secret != null && secret.Secret.Contains(AnomalySecretData.Stability)) + stateLoc += " " + Loc.GetString("anomaly-secret-admin"); + msg.AddMarkupOrThrow(stateLoc); } msg.PushNewline(); //Point output - if (secret != null && secret.Secret.Contains(AnomalySecretData.OutputPoint)) + if (secret != null && secret.Secret.Contains(AnomalySecretData.OutputPoint) && !component.IgnoreSecret) msg.AddMarkupOrThrow(Loc.GetString("anomaly-scanner-point-output-unknown")); else - msg.AddMarkupOrThrow(Loc.GetString("anomaly-scanner-point-output", ("point", GetAnomalyPointValue(anomaly, anomalyComp)))); + { + var text = Loc.GetString("anomaly-scanner-point-output", ("point", GetAnomalyPointValue(anomaly, anomalyComp))); + if (secret != null && secret.Secret.Contains(AnomalySecretData.OutputPoint)) + text += " " + Loc.GetString("anomaly-secret-admin"); + msg.AddMarkupOrThrow(text); + } msg.PushNewline(); msg.PushNewline(); @@ -271,40 +285,63 @@ public sealed partial class AnomalySystem : SharedAnomalySystem msg.PushNewline(); //Danger - if (secret != null && secret.Secret.Contains(AnomalySecretData.ParticleDanger)) + if (secret != null && secret.Secret.Contains(AnomalySecretData.ParticleDanger) && !component.IgnoreSecret) msg.AddMarkupOrThrow(Loc.GetString("anomaly-scanner-particle-danger-unknown")); else - msg.AddMarkupOrThrow(Loc.GetString("anomaly-scanner-particle-danger", ("type", GetParticleLocale(anomalyComp.SeverityParticleType)))); + { + var text = Loc.GetString("anomaly-scanner-particle-danger", ("type", GetParticleLocale(anomalyComp.SeverityParticleType))); + if (secret != null && secret.Secret.Contains(AnomalySecretData.ParticleDanger)) + text += " " + Loc.GetString("anomaly-secret-admin"); + msg.AddMarkupOrThrow(text); + } msg.PushNewline(); //Unstable - if (secret != null && secret.Secret.Contains(AnomalySecretData.ParticleUnstable)) + if (secret != null && secret.Secret.Contains(AnomalySecretData.ParticleUnstable) && !component.IgnoreSecret) msg.AddMarkupOrThrow(Loc.GetString("anomaly-scanner-particle-unstable-unknown")); else - msg.AddMarkupOrThrow(Loc.GetString("anomaly-scanner-particle-unstable", ("type", GetParticleLocale(anomalyComp.DestabilizingParticleType)))); + { + var text = Loc.GetString("anomaly-scanner-particle-unstable", ("type", GetParticleLocale(anomalyComp.DestabilizingParticleType))); + if (secret != null && secret.Secret.Contains(AnomalySecretData.ParticleUnstable)) + text += " " + Loc.GetString("anomaly-secret-admin"); + msg.AddMarkupOrThrow(text); + } msg.PushNewline(); //Containment - if (secret != null && secret.Secret.Contains(AnomalySecretData.ParticleContainment)) + if (secret != null && secret.Secret.Contains(AnomalySecretData.ParticleContainment) && !component.IgnoreSecret) msg.AddMarkupOrThrow(Loc.GetString("anomaly-scanner-particle-containment-unknown")); else - msg.AddMarkupOrThrow(Loc.GetString("anomaly-scanner-particle-containment", ("type", GetParticleLocale(anomalyComp.WeakeningParticleType)))); + { + var text = Loc.GetString("anomaly-scanner-particle-containment", ("type", GetParticleLocale(anomalyComp.WeakeningParticleType))); + if (secret != null && secret.Secret.Contains(AnomalySecretData.ParticleContainment)) + text += " " + Loc.GetString("anomaly-secret-admin"); + msg.AddMarkupOrThrow(text); + } msg.PushNewline(); //Transformation - if (secret != null && secret.Secret.Contains(AnomalySecretData.ParticleTransformation)) + if (secret != null && secret.Secret.Contains(AnomalySecretData.ParticleTransformation) && !component.IgnoreSecret) msg.AddMarkupOrThrow(Loc.GetString("anomaly-scanner-particle-transformation-unknown")); else - msg.AddMarkupOrThrow(Loc.GetString("anomaly-scanner-particle-transformation", ("type", GetParticleLocale(anomalyComp.TransformationParticleType)))); + { + var text = Loc.GetString("anomaly-scanner-particle-transformation", ("type", GetParticleLocale(anomalyComp.TransformationParticleType))); + if (secret != null && secret.Secret.Contains(AnomalySecretData.ParticleTransformation)) + text += " " + Loc.GetString("anomaly-secret-admin"); + msg.AddMarkupOrThrow(text); + } //Behavior msg.PushNewline(); msg.PushNewline(); - msg.AddMarkupOrThrow(Loc.GetString("anomaly-behavior-title")); + var behaviorTitle = Loc.GetString("anomaly-behavior-title"); + if (secret != null && secret.Secret.Contains(AnomalySecretData.Behavior) && component.IgnoreSecret) + behaviorTitle += " " + Loc.GetString("anomaly-secret-admin"); + msg.AddMarkupOrThrow(behaviorTitle); msg.PushNewline(); - if (secret != null && secret.Secret.Contains(AnomalySecretData.Behavior)) + if (secret != null && secret.Secret.Contains(AnomalySecretData.Behavior) && !component.IgnoreSecret) msg.AddMarkupOrThrow(Loc.GetString("anomaly-behavior-unknown")); else { diff --git a/Content.Shared/Anomaly/Components/AnomalyScannerComponent.cs b/Content.Shared/Anomaly/Components/AnomalyScannerComponent.cs index c49743f630..842445b704 100644 --- a/Content.Shared/Anomaly/Components/AnomalyScannerComponent.cs +++ b/Content.Shared/Anomaly/Components/AnomalyScannerComponent.cs @@ -29,4 +29,10 @@ public sealed partial class AnomalyScannerComponent : Component /// [DataField] public SoundSpecifier? CompleteSound = new SoundPathSpecifier("/Audio/Items/beep.ogg"); + + /// + /// Whether to ignore the secret data on the anomaly. + /// + [DataField] + public bool IgnoreSecret; } diff --git a/Resources/Locale/en-US/anomaly/anomaly.ftl b/Resources/Locale/en-US/anomaly/anomaly.ftl index 77608da435..cb6841ca4b 100644 --- a/Resources/Locale/en-US/anomaly/anomaly.ftl +++ b/Resources/Locale/en-US/anomaly/anomaly.ftl @@ -79,7 +79,7 @@ anomaly-generator-flavor-right = v1.1 anomaly-behavior-unknown = [color=red]ERROR. Cannot be read.[/color] -anomaly-behavior-title = behavior deviation analysis: +anomaly-behavior-title = Behavior Deviation Analysis: anomaly-behavior-point = [color=gold]Anomaly produces {$mod}% of the points[/color] anomaly-behavior-safe = [color=forestgreen]The anomaly is extremely stable. Extremely rare pulsations.[/color] @@ -97,3 +97,4 @@ anomaly-behavior-inconstancy = [color=crimson]Impermanence has been detected. Pa anomaly-behavior-fast = [color=crimson]The pulsation frequency is strongly increased.[/color] anomaly-behavior-strenght = [color=crimson]The pulsation power is significantly increased.[/color] anomaly-behavior-moving = [color=crimson]Coordinate instability was detected.[/color] +anomaly-secret-admin = [color=red](ERROR)[/color] diff --git a/Resources/Prototypes/Entities/Objects/Specific/Research/anomaly.yml b/Resources/Prototypes/Entities/Objects/Specific/Research/anomaly.yml index b2eae73ddf..b9fccd35f0 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Research/anomaly.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Research/anomaly.yml @@ -69,6 +69,18 @@ - type: Item storedRotation: -90 +- type: entity + parent: AnomalyScanner + id: AnomalyScannerAdmin + name: admin anomaly scanner + description: A hand-held scanner built to collect information on various anomalous objects. This one seems to have a few extra features. + suffix: Admin + components: + - type: AnomalyScanner + ignoreSecret: true + - type: Sprite + sprite: Objects/Specific/Research/adminanomalyscanner.rsi + - type: entity id: AnomalyLocatorUnpowered parent: BaseItem diff --git a/Resources/Textures/Objects/Specific/Research/adminanomalyscanner.rsi/decaying.png b/Resources/Textures/Objects/Specific/Research/adminanomalyscanner.rsi/decaying.png new file mode 100644 index 0000000000..7335e13cb0 Binary files /dev/null and b/Resources/Textures/Objects/Specific/Research/adminanomalyscanner.rsi/decaying.png differ diff --git a/Resources/Textures/Objects/Specific/Research/adminanomalyscanner.rsi/growing.png b/Resources/Textures/Objects/Specific/Research/adminanomalyscanner.rsi/growing.png new file mode 100644 index 0000000000..3c9eeba747 Binary files /dev/null and b/Resources/Textures/Objects/Specific/Research/adminanomalyscanner.rsi/growing.png differ diff --git a/Resources/Textures/Objects/Specific/Research/adminanomalyscanner.rsi/icon.png b/Resources/Textures/Objects/Specific/Research/adminanomalyscanner.rsi/icon.png new file mode 100644 index 0000000000..4f2e97776f Binary files /dev/null and b/Resources/Textures/Objects/Specific/Research/adminanomalyscanner.rsi/icon.png differ diff --git a/Resources/Textures/Objects/Specific/Research/adminanomalyscanner.rsi/inhand-left.png b/Resources/Textures/Objects/Specific/Research/adminanomalyscanner.rsi/inhand-left.png new file mode 100644 index 0000000000..0fd106f67f Binary files /dev/null and b/Resources/Textures/Objects/Specific/Research/adminanomalyscanner.rsi/inhand-left.png differ diff --git a/Resources/Textures/Objects/Specific/Research/adminanomalyscanner.rsi/inhand-right.png b/Resources/Textures/Objects/Specific/Research/adminanomalyscanner.rsi/inhand-right.png new file mode 100644 index 0000000000..cdac73f398 Binary files /dev/null and b/Resources/Textures/Objects/Specific/Research/adminanomalyscanner.rsi/inhand-right.png differ diff --git a/Resources/Textures/Objects/Specific/Research/adminanomalyscanner.rsi/meta.json b/Resources/Textures/Objects/Specific/Research/adminanomalyscanner.rsi/meta.json new file mode 100644 index 0000000000..66fa65a74f --- /dev/null +++ b/Resources/Textures/Objects/Specific/Research/adminanomalyscanner.rsi/meta.json @@ -0,0 +1,61 @@ +{ + "version": 1, + "size": { + "x": 32, + "y": 32 + }, + "license": "CC-BY-SA-3.0", + "copyright": "Modified from anomalyscanner.rsi (at commit d0352e734d97f3762f2e9082ea61bd2f83101874) by Samuka-C (github)", + "states": [ + { + "name": "icon" + }, + { + "name": "inhand-left", + "directions": 4 + }, + { + "name": "inhand-right", + "directions": 4 + }, + { + "name": "growing", + "delays": [ + [ 0.2, 0.2, 0.2 ] + ] + }, + { + "name": "decaying", + "delays": [ + [ 0.2, 0.2, 0.2 ] + ] + }, + { + "name": "severity_mask", + "delays": [ + [ 0.25, 0.25, 0.25, 0.25 ] + ] + }, + { + "name": "timer_1" + }, + { + "name": "timer_2" + }, + { + "name": "timer_3" + }, + { + "name": "timer_4" + }, + { + "name": "timer_5" + }, + { + "name": "supercritical", + "delays": [ + [ 0.125, 0.125, 0.125, 0.125 ] + ] + } + ] +} diff --git a/Resources/Textures/Objects/Specific/Research/adminanomalyscanner.rsi/severity_mask.png b/Resources/Textures/Objects/Specific/Research/adminanomalyscanner.rsi/severity_mask.png new file mode 100644 index 0000000000..4d0ae9a3ae Binary files /dev/null and b/Resources/Textures/Objects/Specific/Research/adminanomalyscanner.rsi/severity_mask.png differ diff --git a/Resources/Textures/Objects/Specific/Research/adminanomalyscanner.rsi/supercritical.png b/Resources/Textures/Objects/Specific/Research/adminanomalyscanner.rsi/supercritical.png new file mode 100644 index 0000000000..fedb3ba03b Binary files /dev/null and b/Resources/Textures/Objects/Specific/Research/adminanomalyscanner.rsi/supercritical.png differ diff --git a/Resources/Textures/Objects/Specific/Research/adminanomalyscanner.rsi/timer_1.png b/Resources/Textures/Objects/Specific/Research/adminanomalyscanner.rsi/timer_1.png new file mode 100644 index 0000000000..47b483bf5d Binary files /dev/null and b/Resources/Textures/Objects/Specific/Research/adminanomalyscanner.rsi/timer_1.png differ diff --git a/Resources/Textures/Objects/Specific/Research/adminanomalyscanner.rsi/timer_2.png b/Resources/Textures/Objects/Specific/Research/adminanomalyscanner.rsi/timer_2.png new file mode 100644 index 0000000000..0a13874777 Binary files /dev/null and b/Resources/Textures/Objects/Specific/Research/adminanomalyscanner.rsi/timer_2.png differ diff --git a/Resources/Textures/Objects/Specific/Research/adminanomalyscanner.rsi/timer_3.png b/Resources/Textures/Objects/Specific/Research/adminanomalyscanner.rsi/timer_3.png new file mode 100644 index 0000000000..fd1ebf7da4 Binary files /dev/null and b/Resources/Textures/Objects/Specific/Research/adminanomalyscanner.rsi/timer_3.png differ diff --git a/Resources/Textures/Objects/Specific/Research/adminanomalyscanner.rsi/timer_4.png b/Resources/Textures/Objects/Specific/Research/adminanomalyscanner.rsi/timer_4.png new file mode 100644 index 0000000000..e3c79e9ab2 Binary files /dev/null and b/Resources/Textures/Objects/Specific/Research/adminanomalyscanner.rsi/timer_4.png differ diff --git a/Resources/Textures/Objects/Specific/Research/adminanomalyscanner.rsi/timer_5.png b/Resources/Textures/Objects/Specific/Research/adminanomalyscanner.rsi/timer_5.png new file mode 100644 index 0000000000..943f391907 Binary files /dev/null and b/Resources/Textures/Objects/Specific/Research/adminanomalyscanner.rsi/timer_5.png differ