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>
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Content.Shared.Weapons.Ranged.Systems;
|
||||
|
||||
public abstract partial class SharedGunSystem
|
||||
{
|
||||
private void InitializeCartridge()
|
||||
protected virtual void InitializeCartridge()
|
||||
{
|
||||
SubscribeLocalEvent<CartridgeAmmoComponent, ComponentGetState>(OnCartridgeGetState);
|
||||
SubscribeLocalEvent<CartridgeAmmoComponent, ComponentHandleState>(OnCartridgeHandleState);
|
||||
|
||||
@@ -42,6 +42,7 @@ public abstract partial class SharedGunSystem : EntitySystem
|
||||
[Dependency] protected readonly SharedAppearanceSystem Appearance = default!;
|
||||
[Dependency] private readonly SharedCombatModeSystem _combatMode = default!;
|
||||
[Dependency] protected readonly SharedContainerSystem Containers = default!;
|
||||
[Dependency] protected readonly ExamineSystemShared Examine = default!;
|
||||
[Dependency] protected readonly SharedPhysicsSystem Physics = default!;
|
||||
[Dependency] protected readonly SharedPopupSystem PopupSystem = default!;
|
||||
[Dependency] protected readonly ThrowingSystem ThrowingSystem = default!;
|
||||
|
||||
Reference in New Issue
Block a user