diff --git a/Content.Server/AlertLevel/AlertLevelPrototype.cs b/Content.Server/AlertLevel/AlertLevelPrototype.cs index c6740c16cc..5999938e85 100644 --- a/Content.Server/AlertLevel/AlertLevelPrototype.cs +++ b/Content.Server/AlertLevel/AlertLevelPrototype.cs @@ -13,13 +13,13 @@ public sealed partial class AlertLevelPrototype : IPrototype /// part here. Visualizers will use this in order to dictate what alert level to show on /// client side sprites, and localization uses each key to dictate the alert level name. /// - [DataField("levels")] public Dictionary Levels = new(); + [DataField] public Dictionary Levels = new(); /// /// Default level that the station is on upon initialization. /// If this isn't in the dictionary, this will default to whatever .First() gives. /// - [DataField("defaultLevel")] public string DefaultLevel { get; private set; } = default!; + [DataField] public string DefaultLevel { get; private set; } = default!; } /// diff --git a/Content.Server/Body/Components/BloodstreamComponent.cs b/Content.Server/Body/Components/BloodstreamComponent.cs index 3c1c20ff97..ecd30dfc8a 100644 --- a/Content.Server/Body/Components/BloodstreamComponent.cs +++ b/Content.Server/Body/Components/BloodstreamComponent.cs @@ -18,6 +18,7 @@ namespace Content.Server.Body.Components public static string DefaultChemicalsSolutionName = "chemicals"; public static string DefaultBloodSolutionName = "bloodstream"; public static string DefaultBloodTemporarySolutionName = "bloodstreamTemporary"; + public readonly string BloodAlertPrototypeID = "Bleed"; /// /// The next time that blood level will be updated and bloodloss damage dealt. diff --git a/Content.Server/Body/Systems/BloodstreamSystem.cs b/Content.Server/Body/Systems/BloodstreamSystem.cs index d18b83a81c..b54bc4adcf 100644 --- a/Content.Server/Body/Systems/BloodstreamSystem.cs +++ b/Content.Server/Body/Systems/BloodstreamSystem.cs @@ -413,7 +413,13 @@ public sealed class BloodstreamSystem : EntitySystem _alertsSystem.ClearAlert(uid, AlertType.Bleed); else { - var severity = (short) Math.Clamp(Math.Round(component.BleedAmount, MidpointRounding.ToZero), 0, 10); + if (!_prototypeManager.TryIndex(component.BloodAlertPrototypeID, out var alertPrototype)) + return false; + + var severity = (short) Math.Clamp(Math.Round(component.BleedAmount, MidpointRounding.ToZero), + alertPrototype.MinSeverity, + alertPrototype.MaxSeverity); + _alertsSystem.ShowAlert(uid, AlertType.Bleed, severity); } diff --git a/Content.Shared/Alert/AlertPrototype.cs b/Content.Shared/Alert/AlertPrototype.cs index 248cc00ba4..cc79846f91 100644 --- a/Content.Shared/Alert/AlertPrototype.cs +++ b/Content.Shared/Alert/AlertPrototype.cs @@ -1,3 +1,4 @@ +using Robust.Shared.Network; using Robust.Shared.Prototypes; using Robust.Shared.Utility; @@ -6,7 +7,7 @@ namespace Content.Shared.Alert /// /// An alert popup with associated icon, tooltip, and other data. /// - [Prototype("alert")] + [Prototype] public sealed partial class AlertPrototype : IPrototype { [ViewVariables] @@ -22,7 +23,7 @@ namespace Content.Shared.Alert /// List of icons to use for this alert. Each entry corresponds to a different severity level, starting from the /// minimum and incrementing upwards. If severities are not supported, the first entry is used. /// - [DataField("icons", required: true)] + [DataField(required: true)] public List Icons = new(); /// @@ -34,13 +35,13 @@ namespace Content.Shared.Alert /// /// Name to show in tooltip window. Accepts formatting. /// - [DataField("name")] + [DataField] public string Name { get; private set; } = ""; /// /// Description to show in tooltip window. Accepts formatting. /// - [DataField("description")] + [DataField] public string Description { get; private set; } = ""; /// @@ -50,7 +51,7 @@ namespace Content.Shared.Alert /// replace each other and are mutually exclusive, for example lowpressure / highpressure, /// hot / cold. If left unspecified, the alert will not replace or be replaced by any other alerts. /// - [DataField("category")] + [DataField] public AlertCategory? Category { get; private set; } /// @@ -70,7 +71,7 @@ namespace Content.Shared.Alert /// Maximum severity level supported by this state. -1 (default) indicates /// no severity levels are supported by the state. /// - [DataField("maxSeverity")] + [DataField] public short MaxSeverity = -1; /// @@ -82,7 +83,7 @@ namespace Content.Shared.Alert /// Defines what to do when the alert is clicked. /// This will always be null on clientside. /// - [DataField("onClick", serverOnly: true)] + [DataField(serverOnly: true)] public IAlertClick? OnClick { get; private set; } /// severity level, if supported by this alert diff --git a/Resources/Prototypes/Alerts/alerts.yml b/Resources/Prototypes/Alerts/alerts.yml index a8db1c0f19..c52fd3a78c 100644 --- a/Resources/Prototypes/Alerts/alerts.yml +++ b/Resources/Prototypes/Alerts/alerts.yml @@ -149,7 +149,7 @@ id: Ensnared onClick: !type:RemoveEnsnare { } icons: - - sprite: /Textures/Interface/Alerts/ensnared.rsi + - sprite: /Textures/White/Interface/Alerts/ensnared.rsi state: ensnared name: alerts-ensnared-name description: alerts-ensnared-desc @@ -345,7 +345,7 @@ id: Thirsty category: Thirst icons: - - sprite: /Textures/Interface/Alerts/thirst.rsi + - sprite: /Textures/White/Interface/Alerts/thirst.rsi state: thirsty name: alerts-thirsty-name description: alerts-thirsty-desc @@ -354,7 +354,7 @@ id: Parched category: Thirst icons: - - sprite: /Textures/Interface/Alerts/thirst.rsi + - sprite: /Textures/White/Interface/Alerts/thirst.rsi state: parched name: alerts-parched-name description: alerts-parched-desc @@ -396,27 +396,27 @@ - type: alert id: Bleed icons: - - sprite: /Textures/Interface/Alerts/bleed.rsi + - sprite: /Textures/White/Interface/Alerts/bleed.rsi state: bleed0 - - sprite: /Textures/Interface/Alerts/bleed.rsi + - sprite: /Textures/White/Interface/Alerts/bleed.rsi state: bleed1 - - sprite: /Textures/Interface/Alerts/bleed.rsi + - sprite: /Textures/White/Interface/Alerts/bleed.rsi state: bleed2 - - sprite: /Textures/Interface/Alerts/bleed.rsi + - sprite: /Textures/White/Interface/Alerts/bleed.rsi state: bleed3 - - sprite: /Textures/Interface/Alerts/bleed.rsi + - sprite: /Textures/White/Interface/Alerts/bleed.rsi state: bleed4 - - sprite: /Textures/Interface/Alerts/bleed.rsi + - sprite: /Textures/White/Interface/Alerts/bleed.rsi state: bleed5 - - sprite: /Textures/Interface/Alerts/bleed.rsi + - sprite: /Textures/White/Interface/Alerts/bleed.rsi state: bleed6 - - sprite: /Textures/Interface/Alerts/bleed.rsi + - sprite: /Textures/White/Interface/Alerts/bleed.rsi state: bleed7 - - sprite: /Textures/Interface/Alerts/bleed.rsi + - sprite: /Textures/White/Interface/Alerts/bleed.rsi state: bleed8 - - sprite: /Textures/Interface/Alerts/bleed.rsi + - sprite: /Textures/White/Interface/Alerts/bleed.rsi state: bleed9 - - sprite: /Textures/Interface/Alerts/bleed.rsi + - sprite: /Textures/White/Interface/Alerts/bleed.rsi state: bleed10 name: alerts-bleed-name description: alerts-bleed-desc diff --git a/Resources/Textures/White/Interface/Alerts/bleed.rsi/bleed0.png b/Resources/Textures/White/Interface/Alerts/bleed.rsi/bleed0.png new file mode 100644 index 0000000000..08d299331b Binary files /dev/null and b/Resources/Textures/White/Interface/Alerts/bleed.rsi/bleed0.png differ diff --git a/Resources/Textures/White/Interface/Alerts/bleed.rsi/bleed1.png b/Resources/Textures/White/Interface/Alerts/bleed.rsi/bleed1.png new file mode 100644 index 0000000000..e6c8852817 Binary files /dev/null and b/Resources/Textures/White/Interface/Alerts/bleed.rsi/bleed1.png differ diff --git a/Resources/Textures/White/Interface/Alerts/bleed.rsi/bleed10.png b/Resources/Textures/White/Interface/Alerts/bleed.rsi/bleed10.png new file mode 100644 index 0000000000..5cc64ffa4f Binary files /dev/null and b/Resources/Textures/White/Interface/Alerts/bleed.rsi/bleed10.png differ diff --git a/Resources/Textures/White/Interface/Alerts/bleed.rsi/bleed2.png b/Resources/Textures/White/Interface/Alerts/bleed.rsi/bleed2.png new file mode 100644 index 0000000000..98e0281a69 Binary files /dev/null and b/Resources/Textures/White/Interface/Alerts/bleed.rsi/bleed2.png differ diff --git a/Resources/Textures/White/Interface/Alerts/bleed.rsi/bleed3.png b/Resources/Textures/White/Interface/Alerts/bleed.rsi/bleed3.png new file mode 100644 index 0000000000..cbd15842ab Binary files /dev/null and b/Resources/Textures/White/Interface/Alerts/bleed.rsi/bleed3.png differ diff --git a/Resources/Textures/White/Interface/Alerts/bleed.rsi/bleed4.png b/Resources/Textures/White/Interface/Alerts/bleed.rsi/bleed4.png new file mode 100644 index 0000000000..36b48524d9 Binary files /dev/null and b/Resources/Textures/White/Interface/Alerts/bleed.rsi/bleed4.png differ diff --git a/Resources/Textures/White/Interface/Alerts/bleed.rsi/bleed5.png b/Resources/Textures/White/Interface/Alerts/bleed.rsi/bleed5.png new file mode 100644 index 0000000000..e19e2b4e96 Binary files /dev/null and b/Resources/Textures/White/Interface/Alerts/bleed.rsi/bleed5.png differ diff --git a/Resources/Textures/White/Interface/Alerts/bleed.rsi/bleed6.png b/Resources/Textures/White/Interface/Alerts/bleed.rsi/bleed6.png new file mode 100644 index 0000000000..4c75559a31 Binary files /dev/null and b/Resources/Textures/White/Interface/Alerts/bleed.rsi/bleed6.png differ diff --git a/Resources/Textures/White/Interface/Alerts/bleed.rsi/bleed7.png b/Resources/Textures/White/Interface/Alerts/bleed.rsi/bleed7.png new file mode 100644 index 0000000000..fd487172a9 Binary files /dev/null and b/Resources/Textures/White/Interface/Alerts/bleed.rsi/bleed7.png differ diff --git a/Resources/Textures/White/Interface/Alerts/bleed.rsi/bleed8.png b/Resources/Textures/White/Interface/Alerts/bleed.rsi/bleed8.png new file mode 100644 index 0000000000..115b36822f Binary files /dev/null and b/Resources/Textures/White/Interface/Alerts/bleed.rsi/bleed8.png differ diff --git a/Resources/Textures/White/Interface/Alerts/bleed.rsi/bleed9.png b/Resources/Textures/White/Interface/Alerts/bleed.rsi/bleed9.png new file mode 100644 index 0000000000..8b50b5338e Binary files /dev/null and b/Resources/Textures/White/Interface/Alerts/bleed.rsi/bleed9.png differ diff --git a/Resources/Textures/White/Interface/Alerts/bleed.rsi/meta.json b/Resources/Textures/White/Interface/Alerts/bleed.rsi/meta.json new file mode 100644 index 0000000000..b2412dd47f --- /dev/null +++ b/Resources/Textures/White/Interface/Alerts/bleed.rsi/meta.json @@ -0,0 +1,44 @@ +{ + "version": 1, + "size": { + "x": 32, + "y": 32 + }, + "license": "CC-BY-SA-3.0", + "copyright": "Edited by Flareguy for Space Station 14, original sprite taken from https://github.com/tgstation/tgstation/blob/master/icons/effects/bleed.dmi", + "states": [ + { + "name": "bleed0" + }, + { + "name": "bleed1" + }, + { + "name": "bleed2" + }, + { + "name": "bleed3" + }, + { + "name": "bleed4" + }, + { + "name": "bleed5" + }, + { + "name": "bleed6" + }, + { + "name": "bleed7" + }, + { + "name": "bleed8" + }, + { + "name": "bleed9" + }, + { + "name": "bleed10" + } + ] +} diff --git a/Resources/Textures/White/Interface/Alerts/ensnared.rsi/ensnared.png b/Resources/Textures/White/Interface/Alerts/ensnared.rsi/ensnared.png new file mode 100644 index 0000000000..b48f9fbbfd Binary files /dev/null and b/Resources/Textures/White/Interface/Alerts/ensnared.rsi/ensnared.png differ diff --git a/Resources/Textures/White/Interface/Alerts/ensnared.rsi/meta.json b/Resources/Textures/White/Interface/Alerts/ensnared.rsi/meta.json new file mode 100644 index 0000000000..5e9747ee71 --- /dev/null +++ b/Resources/Textures/White/Interface/Alerts/ensnared.rsi/meta.json @@ -0,0 +1,14 @@ +{ + "version": 1, + "license": "CC-BY-SA-3.0", + "copyright": "Ensnared alert created by Hyenh. Bear Trap sprite taken from Citadel Station at https://github.com/Citadel-Station-13/Citadel-Station-13/commit/3cfea7eb92246d311de8b531347795bc76d6dab6", + "size": { + "x": 32, + "y": 32 + }, + "states": [ + { + "name": "ensnared" + } + ] +} diff --git a/Resources/Textures/White/Interface/Alerts/thirst.rsi/meta.json b/Resources/Textures/White/Interface/Alerts/thirst.rsi/meta.json new file mode 100644 index 0000000000..3afe89dc61 --- /dev/null +++ b/Resources/Textures/White/Interface/Alerts/thirst.rsi/meta.json @@ -0,0 +1,11 @@ +{ + "version": 1, + "license": "CC-BY-SA-3.0", + "copyright": "GitHub @Keikiru, iceglass.rsi originally from https://github.com/discordia-space/CEV-Eris/raw/f7aa28fd4b4d0386c3393d829681ebca526f1d2d/icons/obj/drinks.dmi, parched.png big waterbottle derived from https://github.com/discordia-space/CEV-Eris/raw/9c980cb9bc84d07b1c210c5447798af525185f80/icons/obj/food.dmi, toilet.rsi originally from https://github.com/discordia-space/CEV-Eris/commit/2cb66bae0e253e13d37f8939e0983bb94fee243e", + "size": { "x": 32, "y": 32 }, + "states": [ + { "name": "thirsty", "directions": 1, "delays": [[1.0]] }, + { "name": "parched", "directions": 1, "delays": [[0.5, 0.5]] }, + { "name": "overhydrated", "directions": 1, "delays": [[1.0]] } + ] +} diff --git a/Resources/Textures/White/Interface/Alerts/thirst.rsi/overhydrated.png b/Resources/Textures/White/Interface/Alerts/thirst.rsi/overhydrated.png new file mode 100644 index 0000000000..eda3395820 Binary files /dev/null and b/Resources/Textures/White/Interface/Alerts/thirst.rsi/overhydrated.png differ diff --git a/Resources/Textures/White/Interface/Alerts/thirst.rsi/parched.png b/Resources/Textures/White/Interface/Alerts/thirst.rsi/parched.png new file mode 100644 index 0000000000..f08404bc51 Binary files /dev/null and b/Resources/Textures/White/Interface/Alerts/thirst.rsi/parched.png differ diff --git a/Resources/Textures/White/Interface/Alerts/thirst.rsi/thirsty.png b/Resources/Textures/White/Interface/Alerts/thirst.rsi/thirsty.png new file mode 100644 index 0000000000..4390941d9d Binary files /dev/null and b/Resources/Textures/White/Interface/Alerts/thirst.rsi/thirsty.png differ diff --git a/Resources/Textures/White/Interface/Alerts/thirst.rsi/thirsty0.png b/Resources/Textures/White/Interface/Alerts/thirst.rsi/thirsty0.png new file mode 100644 index 0000000000..6f31d22042 Binary files /dev/null and b/Resources/Textures/White/Interface/Alerts/thirst.rsi/thirsty0.png differ diff --git a/Resources/Textures/White/Interface/Alerts/thirst.rsi/thirsty1.png b/Resources/Textures/White/Interface/Alerts/thirst.rsi/thirsty1.png new file mode 100644 index 0000000000..6bdac52e4a Binary files /dev/null and b/Resources/Textures/White/Interface/Alerts/thirst.rsi/thirsty1.png differ diff --git a/Resources/Textures/White/Interface/Alerts/thirst.rsi/thirsty3.png b/Resources/Textures/White/Interface/Alerts/thirst.rsi/thirsty3.png new file mode 100644 index 0000000000..98f4f0c783 Binary files /dev/null and b/Resources/Textures/White/Interface/Alerts/thirst.rsi/thirsty3.png differ diff --git a/Resources/Textures/White/Interface/Alerts/thirst.rsi/thirsty4.png b/Resources/Textures/White/Interface/Alerts/thirst.rsi/thirsty4.png new file mode 100644 index 0000000000..ec1a1f24a7 Binary files /dev/null and b/Resources/Textures/White/Interface/Alerts/thirst.rsi/thirsty4.png differ