Add examines for damage values (#11090)
* Add examines for damage values Even immersive sims still give you values. We should also do this for armour so people don't have to yml dive and so the general public actually know the balance of things. * Slightly better * Cleanup
This commit is contained in:
@@ -7,6 +7,7 @@ using Content.Shared.MobState.Components;
|
||||
using Content.Shared.Radiation.Events;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Shared.Damage
|
||||
{
|
||||
@@ -22,6 +23,31 @@ namespace Content.Shared.Damage
|
||||
SubscribeLocalEvent<DamageableComponent, OnIrradiatedEvent>(OnIrradiated);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the damage examine values.
|
||||
/// </summary>
|
||||
public FormattedMessage GetDamageExamine(DamageSpecifier damageSpecifier, string? type = null)
|
||||
{
|
||||
var msg = new FormattedMessage();
|
||||
|
||||
if (string.IsNullOrEmpty(type))
|
||||
{
|
||||
msg.AddMarkup(Loc.GetString("damage-examine"));
|
||||
}
|
||||
else
|
||||
{
|
||||
msg.AddMarkup(Loc.GetString("damage-examine-type", ("type", type)));
|
||||
}
|
||||
|
||||
foreach (var damage in damageSpecifier.DamageDict)
|
||||
{
|
||||
msg.PushNewline();
|
||||
msg.AddMarkup(Loc.GetString("damage-value", ("type", damage.Key), ("amount", damage.Value)));
|
||||
}
|
||||
|
||||
return msg;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialize a damageable component
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user