Респрайты алертов (#526)
* bleed alert respire + remove hardcoded shit from bloodstreamSystem * resprite thirst icons * ensnared alert meme resprite
This commit is contained in:
@@ -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.
|
||||
/// </summary>
|
||||
[DataField("levels")] public Dictionary<string, AlertLevelDetail> Levels = new();
|
||||
[DataField] public Dictionary<string, AlertLevelDetail> Levels = new();
|
||||
|
||||
/// <summary>
|
||||
/// Default level that the station is on upon initialization.
|
||||
/// If this isn't in the dictionary, this will default to whatever .First() gives.
|
||||
/// </summary>
|
||||
[DataField("defaultLevel")] public string DefaultLevel { get; private set; } = default!;
|
||||
[DataField] public string DefaultLevel { get; private set; } = default!;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -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";
|
||||
|
||||
/// <summary>
|
||||
/// The next time that blood level will be updated and bloodloss damage dealt.
|
||||
|
||||
@@ -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<AlertPrototype>(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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user