Remove diseases (#15684)
This commit is contained in:
@@ -1,8 +0,0 @@
|
||||
using Content.Shared.Atmos.Miasma;
|
||||
using Robust.Shared.GameStates;
|
||||
|
||||
namespace Content.Client.Atmos.Miasma;
|
||||
|
||||
[NetworkedComponent, RegisterComponent]
|
||||
public sealed class FliesComponent : SharedFliesComponent
|
||||
{ }
|
||||
@@ -1,41 +0,0 @@
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Client.Atmos.Miasma;
|
||||
|
||||
public sealed class FliesSystem : EntitySystem
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
SubscribeLocalEvent<FliesComponent, ComponentStartup>(FliesAdded);
|
||||
SubscribeLocalEvent<FliesComponent, ComponentShutdown>(FliesRemoved);
|
||||
}
|
||||
|
||||
private void FliesRemoved(EntityUid uid, FliesComponent component, ComponentShutdown args)
|
||||
{
|
||||
if (!TryComp<SpriteComponent>(uid, out var sprite))
|
||||
return;
|
||||
|
||||
if (!sprite.LayerMapTryGet(FliesKey.Key, out var layer))
|
||||
return;
|
||||
|
||||
sprite.RemoveLayer(layer);
|
||||
}
|
||||
|
||||
private void FliesAdded(EntityUid uid, FliesComponent component, ComponentStartup args)
|
||||
{
|
||||
if (!TryComp<SpriteComponent>(uid, out var sprite))
|
||||
return;
|
||||
|
||||
if (sprite.LayerMapTryGet(FliesKey.Key, out var _))
|
||||
return;
|
||||
|
||||
var layer = sprite.AddLayer(new SpriteSpecifier.Rsi(new ("Objects/Misc/flies.rsi"), "flies"));
|
||||
sprite.LayerMapSet(FliesKey.Key, layer);
|
||||
}
|
||||
|
||||
private enum FliesKey
|
||||
{
|
||||
Key,
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
using Robust.Client.GameObjects;
|
||||
using Content.Shared.Disease;
|
||||
|
||||
namespace Content.Client.Disease
|
||||
{
|
||||
/// <summary>
|
||||
/// Controls client-side visuals for the
|
||||
/// disease machines.
|
||||
/// </summary>
|
||||
public sealed class DiseaseMachineSystem : VisualizerSystem<DiseaseMachineVisualsComponent>
|
||||
{
|
||||
protected override void OnAppearanceChange(EntityUid uid, DiseaseMachineVisualsComponent component, ref AppearanceChangeEvent args)
|
||||
{
|
||||
if (args.Sprite == null)
|
||||
return;
|
||||
|
||||
if (AppearanceSystem.TryGetData<bool>(uid, DiseaseMachineVisuals.IsOn, out var isOn, args.Component)
|
||||
&& AppearanceSystem.TryGetData<bool>(uid, DiseaseMachineVisuals.IsRunning, out var isRunning, args.Component))
|
||||
{
|
||||
var state = isRunning ? component.RunningState : component.IdleState;
|
||||
args.Sprite.LayerSetVisible(DiseaseMachineVisualLayers.IsOn, isOn);
|
||||
args.Sprite.LayerSetState(DiseaseMachineVisualLayers.IsRunning, state);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public enum DiseaseMachineVisualLayers : byte
|
||||
{
|
||||
IsOn,
|
||||
IsRunning
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
namespace Content.Client.Disease;
|
||||
|
||||
/// <summary>
|
||||
/// Holds the idle and running state for machines to control
|
||||
/// playing animtions on the client.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed class DiseaseMachineVisualsComponent : Component
|
||||
{
|
||||
[DataField("idleState", required: true)]
|
||||
public string IdleState = default!;
|
||||
|
||||
[DataField("runningState", required: true)]
|
||||
public string RunningState = default!;
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
using System.Text;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.Damage.Prototypes;
|
||||
using Content.Shared.Disease.Components;
|
||||
using Content.Shared.FixedPoint;
|
||||
using Content.Shared.IdentityManagement;
|
||||
using Content.Shared.MedicalScanner;
|
||||
@@ -32,20 +31,11 @@ namespace Content.Client.HealthAnalyzer.UI
|
||||
entities.TryGetComponent<MetaDataComponent>(msg.TargetEntity.Value, out var metaData))
|
||||
entityName = Identity.Name(msg.TargetEntity.Value, entities);
|
||||
|
||||
IReadOnlyDictionary<string, FixedPoint2> DamagePerGroup = damageable.DamagePerGroup;
|
||||
IReadOnlyDictionary<string, FixedPoint2> DamagePerType = damageable.Damage.DamageDict;
|
||||
IReadOnlyDictionary<string, FixedPoint2> damagePerGroup = damageable.DamagePerGroup;
|
||||
IReadOnlyDictionary<string, FixedPoint2> damagePerType = damageable.Damage.DamageDict;
|
||||
|
||||
text.Append($"{Loc.GetString("health-analyzer-window-entity-health-text", ("entityName", entityName))}\n");
|
||||
|
||||
// Status Effects / Components
|
||||
if (entities.HasComponent<DiseasedComponent>(msg.TargetEntity))
|
||||
{
|
||||
text.Append($"{Loc.GetString("disease-scanner-diseased")}\n");
|
||||
}else
|
||||
{
|
||||
text.Append($"{Loc.GetString("disease-scanner-not-diseased")}\n");
|
||||
}
|
||||
|
||||
// Damage
|
||||
text.Append($"\n{Loc.GetString("health-analyzer-window-entity-damage-total-text", ("amount", damageable.TotalDamage))}\n");
|
||||
|
||||
@@ -54,14 +44,14 @@ namespace Content.Client.HealthAnalyzer.UI
|
||||
var protos = IoCManager.Resolve<IPrototypeManager>();
|
||||
|
||||
// Show the total damage and type breakdown for each damage group.
|
||||
foreach (var (damageGroupId, damageAmount) in DamagePerGroup)
|
||||
foreach (var (damageGroupId, damageAmount) in damagePerGroup)
|
||||
{
|
||||
text.Append($"\n{Loc.GetString("health-analyzer-window-damage-group-text", ("damageGroup", Loc.GetString("health-analyzer-window-damage-group-" + damageGroupId)), ("amount", damageAmount))}");
|
||||
// Show the damage for each type in that group.
|
||||
var group = protos.Index<DamageGroupPrototype>(damageGroupId);
|
||||
foreach (var type in group.DamageTypes)
|
||||
{
|
||||
if (DamagePerType.TryGetValue(type, out var typeAmount))
|
||||
if (damagePerType.TryGetValue(type, out var typeAmount))
|
||||
{
|
||||
// If damage types are allowed to belong to more than one damage group, they may appear twice here. Mark them as duplicate.
|
||||
if (!shownTypes.Contains(type))
|
||||
|
||||
9
Content.Client/Medical/DiseaseSystem.cs
Normal file
9
Content.Client/Medical/DiseaseSystem.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace Content.Client.Medical;
|
||||
|
||||
/* Here be dragons */
|
||||
|
||||
public enum DiseaseMachineVisualLayers : byte
|
||||
{
|
||||
IsOn,
|
||||
IsRunning
|
||||
}
|
||||
Reference in New Issue
Block a user