mirror of
https://github.com/wega-team/ss14-wega.git
synced 2026-02-14 19:30:01 +01:00
Чистка сборки (#237)
* buildcleanup * resourcescleanup * fixlinter * fixlinter2 * final
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
using Content.Shared._Wega.Android;
|
||||
using Content.Shared.Android;
|
||||
|
||||
namespace Content.Client._Wega.Android;
|
||||
namespace Content.Client.Android;
|
||||
|
||||
public sealed class AndroidSystem : SharedAndroidSystem
|
||||
{
|
||||
|
||||
@@ -5,6 +5,7 @@ using Content.Shared.Blood.Cult.Components;
|
||||
using Content.Shared.StatusIcon.Components;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Random;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Client.Blood.Cult
|
||||
@@ -13,6 +14,8 @@ namespace Content.Client.Blood.Cult
|
||||
{
|
||||
[Dependency] private readonly AppearanceSystem _appearance = default!;
|
||||
[Dependency] private readonly IPrototypeManager _prototype = default!;
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
[Dependency] private readonly SpriteSystem _sprite = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -28,26 +31,18 @@ namespace Content.Client.Blood.Cult
|
||||
|
||||
private void OnRuneAppearanceChanged(Entity<BloodRuneComponent> entity, ref AppearanceChangeEvent args)
|
||||
{
|
||||
if (args.Sprite == null)
|
||||
return;
|
||||
|
||||
var sprite = args.Sprite;
|
||||
if (!_appearance.TryGetData(entity, RuneColorVisuals.Color, out Color color))
|
||||
return;
|
||||
|
||||
sprite.Color = color;
|
||||
_sprite.SetColor(entity.Owner, color);
|
||||
}
|
||||
|
||||
private void OnRuneAppearanceChanged(Entity<BloodRitualDimensionalRendingComponent> entity, ref AppearanceChangeEvent args)
|
||||
{
|
||||
if (args.Sprite == null)
|
||||
return;
|
||||
|
||||
var sprite = args.Sprite;
|
||||
if (!_appearance.TryGetData(entity, RuneColorVisuals.Color, out Color color))
|
||||
return;
|
||||
|
||||
sprite.Color = color;
|
||||
_sprite.SetColor(entity.Owner, color);
|
||||
}
|
||||
|
||||
private void GetCultistIcons(Entity<BloodCultistComponent> ent, ref GetStatusIconsEvent args)
|
||||
@@ -61,48 +56,48 @@ namespace Content.Client.Blood.Cult
|
||||
if (!TryComp<SpriteComponent>(uid, out var sprite))
|
||||
return;
|
||||
|
||||
if (sprite.LayerMapTryGet(PentagramKey.Halo, out _))
|
||||
if (_sprite.LayerMapTryGet(uid, PentagramKey.Halo, out _, true))
|
||||
return;
|
||||
|
||||
var haloVariant = new Random().Next(1, 6);
|
||||
var haloVariant = _random.Next(1, 6);
|
||||
var haloState = $"halo{haloVariant}";
|
||||
|
||||
var adj = sprite.Bounds.Height / 2 + 1.0f / 32 * 6.0f;
|
||||
var layer = sprite.AddLayer(new SpriteSpecifier.Rsi(new ResPath("_Wega/Interface/Misc/bloodcult_halo.rsi"), haloState));
|
||||
sprite.LayerMapSet(PentagramKey.Halo, layer);
|
||||
var bounds = _sprite.GetLocalBounds((uid, sprite));
|
||||
var adj = bounds.Height / 2 + 1.0f / 32 * 6.0f;
|
||||
|
||||
sprite.LayerSetOffset(layer, new Vector2(0.0f, adj));
|
||||
sprite.LayerSetShader(layer, "unshaded");
|
||||
var layerData = new PrototypeLayerData
|
||||
{
|
||||
Shader = "unshaded",
|
||||
RsiPath = "_Wega/Interface/Misc/bloodcult_halo.rsi",
|
||||
State = haloState,
|
||||
Offset = new Vector2(0.0f, adj)
|
||||
};
|
||||
|
||||
var layer = _sprite.AddLayer(uid, layerData, null);
|
||||
_sprite.LayerMapSet(uid, PentagramKey.Halo, layer);
|
||||
}
|
||||
|
||||
private void RemoveHalo(EntityUid uid, PentagramDisplayComponent component, ComponentShutdown args)
|
||||
{
|
||||
if (!TryComp<SpriteComponent>(uid, out var sprite))
|
||||
return;
|
||||
|
||||
if (sprite.LayerMapTryGet(PentagramKey.Halo, out var layer))
|
||||
if (_sprite.LayerMapTryGet(uid, PentagramKey.Halo, out var layer, true))
|
||||
{
|
||||
sprite.RemoveLayer(layer);
|
||||
_sprite.RemoveLayer(uid, layer);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnSoulStoneAppearanceChanged(EntityUid uid, StoneSoulComponent component, ref AppearanceChangeEvent args)
|
||||
{
|
||||
if (args.Sprite == null)
|
||||
return;
|
||||
|
||||
var sprite = args.Sprite;
|
||||
if (!_appearance.TryGetData(uid, StoneSoulVisuals.HasSoul, out bool hasSoul))
|
||||
hasSoul = false;
|
||||
|
||||
sprite.LayerSetVisible(StoneSoulVisualLayers.Soul, hasSoul);
|
||||
_sprite.LayerSetVisible(uid, StoneSoulVisualLayers.Soul, hasSoul);
|
||||
if (!hasSoul)
|
||||
{
|
||||
sprite.LayerSetVisible(StoneSoulVisualLayers.Base, true);
|
||||
_sprite.LayerSetVisible(uid, StoneSoulVisualLayers.Base, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
sprite.LayerSetVisible(StoneSoulVisualLayers.Base, false);
|
||||
_sprite.LayerSetVisible(uid, StoneSoulVisualLayers.Base, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ public sealed partial class BloodConstructMenu : RadialMenu
|
||||
[Dependency] private readonly ISharedPlayerManager _playerManager = default!;
|
||||
|
||||
public event Action<string>? OnSelectConstruct;
|
||||
public bool IsDisposed { get; private set; }
|
||||
private NetEntity _constructUid;
|
||||
private NetEntity _mindUid;
|
||||
|
||||
@@ -47,14 +46,4 @@ public sealed partial class BloodConstructMenu : RadialMenu
|
||||
_entityNetworkManager.SendSystemNetworkMessage(new BloodConstructMenuClosedEvent(netEntity, _constructUid, _mindUid, constructName));
|
||||
Close();
|
||||
}
|
||||
|
||||
public new void Close()
|
||||
{
|
||||
if (!IsDisposed)
|
||||
{
|
||||
IsDisposed = true;
|
||||
Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ namespace Content.Client.Select.Construct.UI
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
|
||||
private BloodConstructMenu? _menu;
|
||||
private bool _menuDisposed = false;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -27,10 +26,9 @@ namespace Content.Client.Select.Construct.UI
|
||||
|
||||
if (session?.AttachedEntity.HasValue == true && session.AttachedEntity.Value == userEntity)
|
||||
{
|
||||
if (_menu is null || _menu.IsDisposed)
|
||||
if (_menu is null)
|
||||
{
|
||||
_menu = _uiManager.CreateWindow<BloodConstructMenu>();
|
||||
_menu.OnClose += OnMenuClosed;
|
||||
|
||||
_menu.SetData(args.ConstructUid, args.Mind);
|
||||
|
||||
@@ -43,18 +41,12 @@ namespace Content.Client.Select.Construct.UI
|
||||
|
||||
Timer.Spawn(30000, () =>
|
||||
{
|
||||
if (_menu != null && !_menuDisposed)
|
||||
if (_menu != null)
|
||||
{
|
||||
_menu.Close();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void OnMenuClosed()
|
||||
{
|
||||
_menuDisposed = true;
|
||||
_menu = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ public sealed partial class BloodMagicMenu : RadialMenu
|
||||
[Dependency] private readonly ISharedPlayerManager _playerManager = default!;
|
||||
|
||||
public event Action<string>? OnSelectSpell;
|
||||
public bool IsDisposed { get; private set; }
|
||||
|
||||
public BloodMagicMenu()
|
||||
{
|
||||
@@ -45,14 +44,5 @@ public sealed partial class BloodMagicMenu : RadialMenu
|
||||
_entityNetworkManager.SendSystemNetworkMessage(new BloodMagicMenuClosedEvent(netEntity, spellName));
|
||||
Close();
|
||||
}
|
||||
|
||||
public new void Close()
|
||||
{
|
||||
if (!IsDisposed)
|
||||
{
|
||||
IsDisposed = true;
|
||||
Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@ namespace Content.Client.Blood.Magic.UI
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
|
||||
private BloodMagicMenu? _menu;
|
||||
private bool _menuDisposed = false;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -25,7 +24,7 @@ namespace Content.Client.Blood.Magic.UI
|
||||
var userEntity = _entityManager.GetEntity(args.Uid);
|
||||
if (session?.AttachedEntity.HasValue == true && session.AttachedEntity.Value == userEntity)
|
||||
{
|
||||
if (_menu is null || _menu.IsDisposed)
|
||||
if (_menu is null)
|
||||
{
|
||||
_menu = _uiManager.CreateWindow<BloodMagicMenu>();
|
||||
_menu.OnClose += OnMenuClosed;
|
||||
@@ -40,7 +39,6 @@ namespace Content.Client.Blood.Magic.UI
|
||||
|
||||
private void OnMenuClosed()
|
||||
{
|
||||
_menuDisposed = true;
|
||||
_menu = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ public sealed partial class BloodRitesMenu : RadialMenu
|
||||
[Dependency] private readonly ISharedPlayerManager _playerManager = default!;
|
||||
|
||||
public event Action<string>? OnSelectRites;
|
||||
public bool IsDisposed { get; private set; }
|
||||
|
||||
public BloodRitesMenu()
|
||||
{
|
||||
@@ -39,14 +38,5 @@ public sealed partial class BloodRitesMenu : RadialMenu
|
||||
_entityNetworkManager.SendSystemNetworkMessage(new BloodRitesMenuClosedEvent(netEntity, ritesName));
|
||||
Close();
|
||||
}
|
||||
|
||||
public new void Close()
|
||||
{
|
||||
if (!IsDisposed)
|
||||
{
|
||||
IsDisposed = true;
|
||||
Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@ namespace Content.Client.Blood.Rites.UI
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
|
||||
private BloodRitesMenu? _menu;
|
||||
private bool _menuDisposed = false;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -25,7 +24,7 @@ namespace Content.Client.Blood.Rites.UI
|
||||
var userEntity = _entityManager.GetEntity(args.Uid);
|
||||
if (session?.AttachedEntity.HasValue == true && session.AttachedEntity.Value == userEntity)
|
||||
{
|
||||
if (_menu is null || _menu.IsDisposed)
|
||||
if (_menu is null)
|
||||
{
|
||||
_menu = _uiManager.CreateWindow<BloodRitesMenu>();
|
||||
_menu.OnClose += OnMenuClosed;
|
||||
@@ -40,7 +39,6 @@ namespace Content.Client.Blood.Rites.UI
|
||||
|
||||
private void OnMenuClosed()
|
||||
{
|
||||
_menuDisposed = true;
|
||||
_menu = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ public sealed partial class BloodStructureMenu : RadialMenu
|
||||
[Dependency] private readonly ISharedPlayerManager _playerManager = default!;
|
||||
|
||||
public event Action<string>? OnSelectItem;
|
||||
public bool IsDisposed { get; private set; }
|
||||
private NetEntity _structure;
|
||||
|
||||
public BloodStructureMenu()
|
||||
@@ -80,14 +79,4 @@ public sealed partial class BloodStructureMenu : RadialMenu
|
||||
_entityNetworkManager.SendSystemNetworkMessage(new BloodStructureMenuClosedEvent(netEntity, name, _structure));
|
||||
Close();
|
||||
}
|
||||
|
||||
public new void Close()
|
||||
{
|
||||
if (!IsDisposed)
|
||||
{
|
||||
IsDisposed = true;
|
||||
Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ namespace Content.Client.Structure.UI
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
|
||||
private BloodStructureMenu? _menu;
|
||||
private bool _menuDisposed = false;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -26,7 +25,7 @@ namespace Content.Client.Structure.UI
|
||||
var userEntity = _entityManager.GetEntity(args.Uid);
|
||||
if (session?.AttachedEntity.HasValue == true && session.AttachedEntity.Value == userEntity)
|
||||
{
|
||||
if (_menu is null || _menu.IsDisposed)
|
||||
if (_menu is null)
|
||||
{
|
||||
_menu = _uiManager.CreateWindow<BloodStructureMenu>();
|
||||
_menu.OnClose += OnMenuClosed;
|
||||
@@ -42,7 +41,7 @@ namespace Content.Client.Structure.UI
|
||||
|
||||
Timer.Spawn(30000, () =>
|
||||
{
|
||||
if (_menu != null && !_menuDisposed)
|
||||
if (_menu != null)
|
||||
{
|
||||
_menu.Close();
|
||||
}
|
||||
@@ -52,7 +51,6 @@ namespace Content.Client.Structure.UI
|
||||
|
||||
private void OnMenuClosed()
|
||||
{
|
||||
_menuDisposed = true;
|
||||
_menu = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,7 +78,6 @@ public sealed partial class EmpoweringRuneMenu : RadialMenu
|
||||
[Dependency] private readonly ISharedPlayerManager _playerManager = default!;
|
||||
|
||||
public event Action<string>? OnSelectSpell;
|
||||
public bool IsDisposed { get; private set; }
|
||||
|
||||
public EmpoweringRuneMenu()
|
||||
{
|
||||
@@ -109,15 +108,6 @@ public sealed partial class EmpoweringRuneMenu : RadialMenu
|
||||
_entityNetworkManager.SendSystemNetworkMessage(new EmpoweringRuneMenuClosedEvent(netEntity, spellName));
|
||||
Close();
|
||||
}
|
||||
|
||||
public new void Close()
|
||||
{
|
||||
if (!IsDisposed)
|
||||
{
|
||||
IsDisposed = true;
|
||||
Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public sealed partial class SummoningRunePanelMenu : DefaultWindow
|
||||
@@ -138,13 +128,11 @@ public sealed partial class SummoningRunePanelMenu : DefaultWindow
|
||||
|
||||
private void InitializeButtons()
|
||||
{
|
||||
foreach (var cultist in _entityManager.EntityQuery<BloodCultistComponent>())
|
||||
var cultistQuery = _entityManager.EntityQueryEnumerator<BloodCultistComponent, MetaDataComponent>();
|
||||
while (cultistQuery.MoveNext(out var uid, out _, out var metaData))
|
||||
{
|
||||
if (_entityManager.TryGetComponent<MetaDataComponent>(cultist.Owner, out var metaData))
|
||||
{
|
||||
var entityName = metaData.EntityName;
|
||||
AddCultistButton(entityName, cultist.Owner);
|
||||
}
|
||||
var entityName = metaData.EntityName;
|
||||
AddCultistButton(entityName, uid);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ namespace Content.Client.Runes.Panel.Ui
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
|
||||
private RunesPanelMenu? _panel;
|
||||
private bool _panelDisposed = false;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -42,7 +41,6 @@ namespace Content.Client.Runes.Panel.Ui
|
||||
|
||||
private void OnMenuClosed()
|
||||
{
|
||||
_panelDisposed = true;
|
||||
_panel = null;
|
||||
}
|
||||
}
|
||||
@@ -68,7 +66,7 @@ namespace Content.Client.Runes.Panel.Ui
|
||||
var userEntity = _entityManager.GetEntity(args.Uid);
|
||||
if (session?.AttachedEntity.HasValue == true && session.AttachedEntity.Value == userEntity)
|
||||
{
|
||||
if (_menu is null || _menu.IsDisposed)
|
||||
if (_menu is null)
|
||||
{
|
||||
_menu = _uiManager.CreateWindow<EmpoweringRuneMenu>();
|
||||
_menu.OnClose += OnMenuClosed;
|
||||
@@ -103,7 +101,6 @@ namespace Content.Client.Runes.Panel.Ui
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
|
||||
private SummoningRunePanelMenu? _panel;
|
||||
private bool _panelDisposed = false;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -131,7 +128,7 @@ namespace Content.Client.Runes.Panel.Ui
|
||||
|
||||
Timer.Spawn(30000, () =>
|
||||
{
|
||||
if (_panel != null && !_panelDisposed)
|
||||
if (_panel != null)
|
||||
{
|
||||
_panel.Close();
|
||||
}
|
||||
@@ -141,7 +138,6 @@ namespace Content.Client.Runes.Panel.Ui
|
||||
|
||||
private void OnMenuClosed()
|
||||
{
|
||||
_panelDisposed = true;
|
||||
_panel = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
<!-- Chat header -->
|
||||
<PanelContainer StyleClasses="AngleRect">
|
||||
<PanelContainer.PanelOverride>
|
||||
<graphics:StyleBoxFlat BackgroundColor="#878787" />
|
||||
<graphics:StyleBoxFlat BackgroundColor="#131313" />
|
||||
</PanelContainer.PanelOverride>
|
||||
<BoxContainer Orientation="Horizontal" HorizontalExpand="True" Margin="0 0 0 4">
|
||||
<Label Name="ChatTitle" StyleClasses="LabelHeading" Margin="4 0 0 0" VerticalAlignment="Center" HorizontalExpand="True"/>
|
||||
@@ -77,9 +77,6 @@
|
||||
|
||||
<!-- Messages area -->
|
||||
<PanelContainer StyleClasses="AngleRect" VerticalExpand="True">
|
||||
<PanelContainer.PanelOverride>
|
||||
<graphics:StyleBoxFlat BackgroundColor="#bdbdbd" />
|
||||
</PanelContainer.PanelOverride>
|
||||
<ScrollContainer Name="MessagesScroll" HScrollEnabled="False" VerticalExpand="True" HorizontalExpand="True">
|
||||
<BoxContainer Name="MessagesContainer" Orientation="Vertical" Margin="4"/>
|
||||
</ScrollContainer>
|
||||
|
||||
@@ -92,8 +92,8 @@ public sealed partial class NanoChatUiFragment : BoxContainer
|
||||
|
||||
ChatTypeTabs.OnTabChanged += _ => OnTabChanged();
|
||||
|
||||
EmojiButton.AddStyleClass(StyleNano.ButtonOpenBoth);
|
||||
SendButton.AddStyleClass(StyleNano.ButtonOpenLeft);
|
||||
EmojiButton.AddStyleClass(StyleClass.ButtonOpenBoth);
|
||||
SendButton.AddStyleClass(StyleClass.ButtonOpenLeft);
|
||||
|
||||
UpdateUiState();
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ public sealed partial class DetailExaminableWindow : FancyWindow
|
||||
{
|
||||
Text = text,
|
||||
VerticalExpand = true,
|
||||
StyleClasses = { StyleNano.StyleClassLabelBig },
|
||||
StyleClasses = { StyleClass.LabelHeading },
|
||||
FontColorOverride = color
|
||||
};
|
||||
|
||||
@@ -131,7 +131,7 @@ public sealed partial class DetailExaminableWindow : FancyWindow
|
||||
ToolTip = Loc.GetString("humanoid-profile-editor-link-tooltip", ("url", url)),
|
||||
HorizontalExpand = true,
|
||||
HorizontalAlignment = HAlignment.Center,
|
||||
StyleClasses = { StyleNano.ButtonOpenBoth }
|
||||
StyleClasses = { StyleClass.ButtonOpenBoth }
|
||||
};
|
||||
|
||||
button.OnPressed += _ => OpenLink(url);
|
||||
|
||||
@@ -18,12 +18,13 @@ namespace Content.Client.Disease
|
||||
&& 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);
|
||||
SpriteSystem.LayerSetVisible(uid, DiseaseMachineVisualLayers.IsOn, isOn);
|
||||
SpriteSystem.LayerSetRsiState(uid, DiseaseMachineVisualLayers.IsRunning, state);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public enum DiseaseMachineVisualLayers : byte
|
||||
{
|
||||
IsOn,
|
||||
|
||||
@@ -13,6 +13,7 @@ public sealed class DizzyOverlay : Overlay
|
||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
|
||||
private static readonly ProtoId<ShaderPrototype> Dizzy = "Dizzy";
|
||||
public override OverlaySpace Space => OverlaySpace.WorldSpace;
|
||||
public override bool RequestScreenTexture => true;
|
||||
private readonly ShaderInstance _dizzyShader;
|
||||
@@ -27,7 +28,7 @@ public sealed class DizzyOverlay : Overlay
|
||||
public DizzyOverlay()
|
||||
{
|
||||
IoCManager.InjectDependencies(this);
|
||||
_dizzyShader = _prototypeManager.Index<ShaderPrototype>("Dizzy").InstanceUnique();
|
||||
_dizzyShader = _prototypeManager.Index(Dizzy).InstanceUnique();
|
||||
}
|
||||
|
||||
protected override void FrameUpdate(FrameEventArgs args)
|
||||
|
||||
@@ -620,7 +620,7 @@ public sealed partial class DnaModifierWindow : FancyWindow
|
||||
}
|
||||
|
||||
#region Initilize U.I.
|
||||
private void InitilizeUniqueIdentifiers(UniqueIdentifiersPrototype unique)
|
||||
private void InitilizeUniqueIdentifiers(UniqueIdentifiersData unique)
|
||||
{
|
||||
_initializedUi = true;
|
||||
var blocks = new List<(string BlockName, string[] Values)>
|
||||
@@ -701,7 +701,6 @@ public sealed partial class DnaModifierWindow : FancyWindow
|
||||
{
|
||||
Text = blockName,
|
||||
MinWidth = 25,
|
||||
StyleClasses = { StyleNano.StyleClassLabelSecondaryColor }
|
||||
};
|
||||
|
||||
blockContainer.AddChild(blockLabel);
|
||||
@@ -804,7 +803,6 @@ public sealed partial class DnaModifierWindow : FancyWindow
|
||||
{
|
||||
Text = blockName,
|
||||
MinWidth = 25,
|
||||
StyleClasses = { StyleNano.StyleClassLabelSecondaryColor }
|
||||
};
|
||||
|
||||
blockContainer.AddChild(blockLabel);
|
||||
@@ -937,8 +935,7 @@ public sealed partial class DnaModifierWindow : FancyWindow
|
||||
new Label { Text = $"{info.DisplayName}: " },
|
||||
new Label
|
||||
{
|
||||
Text = $"{info.CurrentVolume}/{info.MaxVolume}",
|
||||
StyleClasses = { StyleNano.StyleClassLabelSecondaryColor }
|
||||
Text = $"{info.CurrentVolume}/{info.MaxVolume}"
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -977,8 +974,7 @@ public sealed partial class DnaModifierWindow : FancyWindow
|
||||
new Label { Text = $"{name}: " },
|
||||
new Label
|
||||
{
|
||||
Text = $"{quantity}u",
|
||||
StyleClasses = { StyleNano.StyleClassLabelSecondaryColor }
|
||||
Text = $"{quantity}u"
|
||||
},
|
||||
new Control { HorizontalExpand = true },
|
||||
new PanelContainer
|
||||
|
||||
@@ -26,14 +26,11 @@ public sealed partial class MindCommunicationPanel : DefaultWindow
|
||||
|
||||
private void InitializeTargets()
|
||||
{
|
||||
foreach (var actor in _entityManager.EntityQuery<ActorComponent>())
|
||||
var actorQuery = _entityManager.EntityQueryEnumerator<ActorComponent, MetaDataComponent, HumanoidAppearanceComponent>();
|
||||
while (actorQuery.MoveNext(out var uid, out _, out var metaData, out _))
|
||||
{
|
||||
if (_entityManager.TryGetComponent<MetaDataComponent>(actor.Owner, out var metaData)
|
||||
&& _entityManager.HasComponent<HumanoidAppearanceComponent>(actor.Owner))
|
||||
{
|
||||
var entityName = metaData.EntityName;
|
||||
AddTargetButton(entityName, actor.Owner);
|
||||
}
|
||||
var entityName = metaData.EntityName;
|
||||
AddTargetButton(entityName, uid);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,8 @@ namespace Content.Client.Height
|
||||
{
|
||||
public sealed class HeightSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly SpriteSystem _sprite = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
@@ -24,11 +26,7 @@ namespace Content.Client.Height
|
||||
if (TryComp<HumanoidAppearanceComponent>(ent, out var humanoid) && CheckSpeciesEntity(humanoid))
|
||||
return;
|
||||
|
||||
if (TryComp<SpriteComponent>(ent, out var sprite))
|
||||
{
|
||||
sprite.Scale = new Vector2(0.85f, 0.85f);
|
||||
Dirty(ent, sprite);
|
||||
}
|
||||
_sprite.LayerSetScale(ent.Owner, 0, new Vector2(0.85f, 0.85f));
|
||||
}
|
||||
|
||||
private void OnBigHeightComponentStartup(Entity<BigHeightComponent> ent, ref ComponentStartup args)
|
||||
@@ -36,35 +34,23 @@ namespace Content.Client.Height
|
||||
if (TryComp<HumanoidAppearanceComponent>(ent, out var humanoid) && CheckSpeciesEntity(humanoid))
|
||||
return;
|
||||
|
||||
if (TryComp<SpriteComponent>(ent, out var sprite))
|
||||
{
|
||||
sprite.Scale = new Vector2(1.2f, 1.2f);
|
||||
Dirty(ent, sprite);
|
||||
}
|
||||
_sprite.LayerSetScale(ent.Owner, 0, new Vector2(1.2f, 1.2f));
|
||||
}
|
||||
|
||||
private void OnSmallHeightComponentShutdown(Entity<SmallHeightComponent> ent, ref ComponentShutdown args)
|
||||
{
|
||||
if (TryComp<HumanoidAppearanceComponent>(ent, out var humanoid) && CheckSpeciesEntity(humanoid))
|
||||
return;
|
||||
|
||||
if (TryComp<SpriteComponent>(ent, out var sprite))
|
||||
{
|
||||
sprite.Scale = new Vector2(1.0f, 1.0f);
|
||||
Dirty(ent, sprite);
|
||||
}
|
||||
|
||||
_sprite.LayerSetScale(ent.Owner, 0, new Vector2(1.0f, 1.0f));
|
||||
}
|
||||
|
||||
private void OnBigHeightComponentShutdown(Entity<BigHeightComponent> ent, ref ComponentShutdown args)
|
||||
{
|
||||
if (TryComp<HumanoidAppearanceComponent>(ent, out var humanoid) && CheckSpeciesEntity(humanoid))
|
||||
return;
|
||||
|
||||
if (TryComp<SpriteComponent>(ent, out var sprite))
|
||||
{
|
||||
sprite.Scale = new Vector2(1.0f, 1.0f);
|
||||
Dirty(ent, sprite);
|
||||
}
|
||||
|
||||
_sprite.LayerSetScale(ent.Owner, 0, new Vector2(1.0f, 1.0f));
|
||||
}
|
||||
|
||||
private bool CheckSpeciesEntity(HumanoidAppearanceComponent humanoid)
|
||||
|
||||
@@ -4,6 +4,7 @@ using Robust.Client.GameObjects;
|
||||
public sealed class InjectorFabticatorSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly AppearanceSystem _appearance = default!;
|
||||
[Dependency] private readonly SpriteSystem _sprite = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -17,10 +18,9 @@ public sealed class InjectorFabticatorSystem : EntitySystem
|
||||
if (args.Sprite == null)
|
||||
return;
|
||||
|
||||
var sprite = args.Sprite;
|
||||
if (!_appearance.TryGetData<bool>(uid, InjectorFabticatorVisuals.IsRunning, out var isRunning, args.Component))
|
||||
return;
|
||||
|
||||
sprite.LayerSetVisible(InjectorFabticatorVisuals.IsRunning, isRunning);
|
||||
_sprite.LayerSetVisible(uid, InjectorFabticatorVisuals.IsRunning, isRunning);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,8 +48,10 @@ public sealed class InjectorFabticatorBoundUserInterface : BoundUserInterface
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
base.Dispose(disposing);
|
||||
if (!disposing) return;
|
||||
if (!disposing)
|
||||
return;
|
||||
|
||||
_window?.Dispose();
|
||||
_window?.Close();
|
||||
_window = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace Content.Client.Mining.Visualizers
|
||||
};
|
||||
}
|
||||
|
||||
args.Sprite.LayerSetState(MiningServerVisualLayers.Main, state);
|
||||
SpriteSystem.LayerSetRsiState(uid, MiningServerVisualLayers.Main, state);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ public sealed class ColourblindnessOverlay : Overlay
|
||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
|
||||
private static readonly ProtoId<ShaderPrototype> Colourblindness = "Colourblindness";
|
||||
public override OverlaySpace Space => OverlaySpace.ScreenSpace;
|
||||
public override bool RequestScreenTexture => true;
|
||||
private readonly ShaderInstance _desaturationShader;
|
||||
@@ -19,7 +20,7 @@ public sealed class ColourblindnessOverlay : Overlay
|
||||
public ColourblindnessOverlay()
|
||||
{
|
||||
IoCManager.InjectDependencies(this);
|
||||
_desaturationShader = _prototypeManager.Index<ShaderPrototype>("Colourblindness").InstanceUnique();
|
||||
_desaturationShader = _prototypeManager.Index(Colourblindness).InstanceUnique();
|
||||
}
|
||||
|
||||
protected override bool BeforeDraw(in OverlayDrawArgs args)
|
||||
|
||||
@@ -24,8 +24,8 @@ public sealed class ListenUpOverlay : Overlay
|
||||
|
||||
private Texture _texture;
|
||||
|
||||
protected float Radius;
|
||||
protected SpriteSpecifier Sprite;
|
||||
private float _radius;
|
||||
private SpriteSpecifier _sprite;
|
||||
|
||||
public override bool RequestScreenTexture => true;
|
||||
public override OverlaySpace Space => OverlaySpace.WorldSpace;
|
||||
@@ -39,10 +39,10 @@ public sealed class ListenUpOverlay : Overlay
|
||||
_entityLookup = _entity.System<EntityLookupSystem>();
|
||||
_gameTiming = IoCManager.Resolve<IGameTiming>();
|
||||
|
||||
Radius = radius;
|
||||
Sprite = sprite;
|
||||
_radius = radius;
|
||||
_sprite = sprite;
|
||||
|
||||
_texture = _spriteSystem.GetFrame(Sprite, _gameTiming.CurTime);
|
||||
_texture = _spriteSystem.GetFrame(_sprite, _gameTiming.CurTime);
|
||||
|
||||
|
||||
ZIndex = -1;
|
||||
@@ -55,15 +55,15 @@ public sealed class ListenUpOverlay : Overlay
|
||||
|| (!_entity.TryGetComponent<TransformComponent>(_players.LocalEntity, out var playerTransform)))
|
||||
return;
|
||||
|
||||
_texture = _spriteSystem.GetFrame(Sprite, _gameTiming.CurTime);
|
||||
_texture = _spriteSystem.GetFrame(_sprite, _gameTiming.CurTime);
|
||||
|
||||
var handle = args.WorldHandle;
|
||||
var eye = args.Viewport.Eye;
|
||||
var eyeRot = eye?.Rotation ?? default;
|
||||
|
||||
var entities = _entityLookup.GetEntitiesInRange<MobStateComponent>(playerTransform.Coordinates, Radius);
|
||||
var entities = _entityLookup.GetEntitiesInRange<MobStateComponent>(playerTransform.Coordinates, _radius);
|
||||
|
||||
foreach (var (uid, stateComp) in entities)
|
||||
foreach (var (uid, _) in entities)
|
||||
{
|
||||
|
||||
if (!_entity.TryGetComponent<SpriteComponent>(uid, out var sprite)
|
||||
@@ -91,6 +91,6 @@ public sealed class ListenUpOverlay : Overlay
|
||||
var rotation = Angle.Zero;
|
||||
|
||||
handle.SetTransform(position, rotation);
|
||||
handle.DrawTexture(_texture, new System.Numerics.Vector2(-0.5f));
|
||||
handle.DrawTexture(_texture, new Vector2(-0.5f));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Client.Player;
|
||||
using Content.Shared._Wega.Resomi.Abilities.Hearing;
|
||||
using Content.Shared.Actions;
|
||||
using Content.Shared.DoAfter;
|
||||
using Content.Shared.Resomi.Abilities.Hearing;
|
||||
using Robust.Shared.Utility;
|
||||
using Robust.Shared.Player;
|
||||
using Content.Shared.GameTicking;
|
||||
using Content.Shared.Actions.Components;
|
||||
|
||||
namespace Content.Client._Wega.Overlays;
|
||||
|
||||
@@ -15,10 +11,6 @@ public sealed class ListenUpSystem : SharedListenUpSkillSystem
|
||||
[Dependency] private readonly IPlayerManager _player = default!;
|
||||
[Dependency] private readonly IOverlayManager _overlayMan = default!;
|
||||
|
||||
[Dependency] private readonly SharedDoAfterSystem _doAfterSystem = default!;
|
||||
|
||||
private Entity<ActionComponent> action;
|
||||
|
||||
private ListenUpOverlay _listenUpOverlay = default!;
|
||||
|
||||
public override void Initialize()
|
||||
|
||||
@@ -12,6 +12,7 @@ public sealed class NaturalNightVisionOverlay : Overlay
|
||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
|
||||
private static readonly ProtoId<ShaderPrototype> NaturalNightVision = "NaturalNightVision";
|
||||
public override OverlaySpace Space => OverlaySpace.WorldSpace;
|
||||
public override bool RequestScreenTexture => true;
|
||||
|
||||
@@ -25,7 +26,7 @@ public sealed class NaturalNightVisionOverlay : Overlay
|
||||
public NaturalNightVisionOverlay()
|
||||
{
|
||||
IoCManager.InjectDependencies(this);
|
||||
_nightVisionShader = _prototypeManager.Index<ShaderPrototype>("NaturalNightVision").InstanceUnique();
|
||||
_nightVisionShader = _prototypeManager.Index(NaturalNightVision).InstanceUnique();
|
||||
}
|
||||
|
||||
protected override bool BeforeDraw(in OverlayDrawArgs args)
|
||||
|
||||
@@ -15,6 +15,7 @@ public sealed class NightVisionOverlay : Overlay
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||
|
||||
private static readonly ProtoId<ShaderPrototype> NightVision = "NightVision";
|
||||
public override OverlaySpace Space => OverlaySpace.WorldSpace;
|
||||
public override bool RequestScreenTexture => true;
|
||||
private readonly ShaderInstance _baseShader;
|
||||
@@ -28,7 +29,7 @@ public sealed class NightVisionOverlay : Overlay
|
||||
public NightVisionOverlay()
|
||||
{
|
||||
IoCManager.InjectDependencies(this);
|
||||
_baseShader = _prototypeManager.Index<ShaderPrototype>("NightVision").Instance();
|
||||
_baseShader = _prototypeManager.Index(NightVision).Instance();
|
||||
}
|
||||
|
||||
protected override bool BeforeDraw(in OverlayDrawArgs args)
|
||||
|
||||
@@ -12,6 +12,7 @@ public sealed class NoirVisionOverlay : Overlay
|
||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
|
||||
private static readonly ProtoId<ShaderPrototype> Noir = "Noir";
|
||||
public override OverlaySpace Space => OverlaySpace.WorldSpace;
|
||||
public override bool RequestScreenTexture => true;
|
||||
private readonly ShaderInstance _redHighlightShader;
|
||||
@@ -22,7 +23,7 @@ public sealed class NoirVisionOverlay : Overlay
|
||||
public NoirVisionOverlay()
|
||||
{
|
||||
IoCManager.InjectDependencies(this);
|
||||
_redHighlightShader = _prototypeManager.Index<ShaderPrototype>("Noir").InstanceUnique();
|
||||
_redHighlightShader = _prototypeManager.Index(Noir).InstanceUnique();
|
||||
}
|
||||
|
||||
protected override bool BeforeDraw(in OverlayDrawArgs args)
|
||||
|
||||
@@ -36,7 +36,6 @@ namespace Content.Client._Wega.Surgery.Ui
|
||||
DamagesContainer.AddChild(new Label
|
||||
{
|
||||
Text = Loc.GetString("body-scanner-no-damages"),
|
||||
StyleClasses = { StyleNano.StyleClassLabelSecondaryColor }
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -56,7 +55,7 @@ namespace Content.Client._Wega.Surgery.Ui
|
||||
damageHeader.AddChild(new Label
|
||||
{
|
||||
Text = damage.DamageName,
|
||||
StyleClasses = { StyleNano.StyleClassLabelBig }
|
||||
StyleClasses = { StyleClass.LabelHeading }
|
||||
});
|
||||
|
||||
damageContainer.AddChild(damageHeader);
|
||||
@@ -65,7 +64,6 @@ namespace Content.Client._Wega.Surgery.Ui
|
||||
{
|
||||
Text = Loc.GetString("body-scanner-affected-parts",
|
||||
("parts", string.Join(", ", damage.AffectedParts.Select(p => Loc.GetString($"body-scanner-part-{p}"))))),
|
||||
StyleClasses = { StyleNano.StyleClassLabelSecondaryColor }
|
||||
};
|
||||
|
||||
damageContainer.AddChild(partsLabel);
|
||||
|
||||
@@ -58,6 +58,9 @@ public sealed class TapeRecorderBoundUserInterface(EntityUid owner, Enum uiKey)
|
||||
{
|
||||
base.Dispose(disposing);
|
||||
if (disposing)
|
||||
_window?.Dispose();
|
||||
{
|
||||
_window?.Close();
|
||||
_window = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ public sealed partial class SelectClassMenu : RadialMenu
|
||||
[Dependency] private readonly ISharedPlayerManager _playerManager = default!;
|
||||
|
||||
public event Action<string>? OnSelectClass;
|
||||
public bool IsDisposed { get; private set; }
|
||||
|
||||
public SelectClassMenu()
|
||||
{
|
||||
@@ -40,14 +39,5 @@ public sealed partial class SelectClassMenu : RadialMenu
|
||||
_entityNetworkManager.SendSystemNetworkMessage(new VampireSelectClassMenuClosedEvent(netEntity, className));
|
||||
Close();
|
||||
}
|
||||
|
||||
public new void Close()
|
||||
{
|
||||
if (!IsDisposed)
|
||||
{
|
||||
IsDisposed = true;
|
||||
Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ namespace Content.Client.UserInterface.Systems.Select.Class
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
|
||||
private SelectClassMenu? _menu;
|
||||
private bool _menuDisposed = false;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -26,7 +25,7 @@ namespace Content.Client.UserInterface.Systems.Select.Class
|
||||
var userEntity = _entityManager.GetEntity(args.Uid);
|
||||
if (session?.AttachedEntity.HasValue == true && session.AttachedEntity.Value == userEntity)
|
||||
{
|
||||
if (_menu is null || _menu.IsDisposed)
|
||||
if (_menu is null)
|
||||
{
|
||||
_menu = _uiManager.CreateWindow<SelectClassMenu>();
|
||||
_menu.OnClose += OnMenuClosed;
|
||||
@@ -41,7 +40,6 @@ namespace Content.Client.UserInterface.Systems.Select.Class
|
||||
|
||||
private void OnMenuClosed()
|
||||
{
|
||||
_menuDisposed = true;
|
||||
_menu = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ using Content.Client.Movement.Systems;
|
||||
using Content.Shared.StatusIcon.Components;
|
||||
using Content.Shared.Vampire;
|
||||
using Content.Shared.Vampire.Components;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.Player;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
@@ -14,6 +15,7 @@ public sealed class VampireSystem : SharedVampireSystem
|
||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||
[Dependency] private readonly ContentEyeSystem _contentEye = default!;
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
[Dependency] private readonly SpriteSystem _sprite = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -53,10 +55,9 @@ public sealed class VampireSystem : SharedVampireSystem
|
||||
if (args.Alert.ID != ent.Comp.BloodAlert)
|
||||
return;
|
||||
|
||||
var sprite = args.SpriteViewEnt.Comp;
|
||||
var blood = Math.Clamp(ent.Comp.CurrentBlood.Int(), 0, 999);
|
||||
sprite.LayerSetState(VampireVisualLayers.Digit1, $"{(blood / 100) % 10}");
|
||||
sprite.LayerSetState(VampireVisualLayers.Digit2, $"{(blood / 10) % 10}");
|
||||
sprite.LayerSetState(VampireVisualLayers.Digit3, $"{blood % 10}");
|
||||
_sprite.LayerSetRsiState(args.SpriteViewEnt.Owner, VampireVisualLayers.Digit1, $"{(blood / 100) % 10}");
|
||||
_sprite.LayerSetRsiState(args.SpriteViewEnt.Owner, VampireVisualLayers.Digit2, $"{(blood / 10) % 10}");
|
||||
_sprite.LayerSetRsiState(args.SpriteViewEnt.Owner, VampireVisualLayers.Digit3, $"{blood % 10}");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ namespace Content.Client.Vehicle;
|
||||
|
||||
public sealed class VehicleSystem : SharedVehicleSystem
|
||||
{
|
||||
[Dependency] private readonly SpriteSystem _sprite = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
@@ -20,17 +22,17 @@ public sealed class VehicleSystem : SharedVehicleSystem
|
||||
|
||||
if (component.HideRider
|
||||
&& Appearance.TryGetData<bool>(uid, VehicleVisuals.HideRider, out var hide, args.Component)
|
||||
&& TryComp<SpriteComponent>(component.LastRider, out var riderSprite))
|
||||
riderSprite.Visible = !hide;
|
||||
&& HasComp<SpriteComponent>(component.LastRider))
|
||||
_sprite.SetVisible(component.LastRider.Value, !hide);
|
||||
|
||||
// First check is for the sprite itself
|
||||
if (Appearance.TryGetData<int>(uid, VehicleVisuals.DrawDepth, out var drawDepth, args.Component))
|
||||
args.Sprite.DrawDepth = drawDepth;
|
||||
_sprite.SetDrawDepth(uid, drawDepth);
|
||||
|
||||
// Set vehicle layer to animated or not (i.e. are the wheels turning or not)
|
||||
if (component.AutoAnimate
|
||||
&& Appearance.TryGetData<bool>(uid, VehicleVisuals.AutoAnimate, out var autoAnimate, args.Component))
|
||||
args.Sprite.LayerSetAutoAnimated(VehicleVisualLayers.AutoAnimate, autoAnimate);
|
||||
_sprite.LayerSetAutoAnimated(uid, VehicleVisualLayers.AutoAnimate, autoAnimate);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,8 @@ namespace Content.Client._Wega.Xenobiology;
|
||||
|
||||
public sealed class CellVisualsSystem : SharedCellVisualsSystem
|
||||
{
|
||||
[Dependency] private readonly SpriteSystem _sprite = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
@@ -29,6 +31,6 @@ public sealed class CellVisualsSystem : SharedCellVisualsSystem
|
||||
if (color is null)
|
||||
return;
|
||||
|
||||
args.Sprite?.LayerSetColor(CellContainerVisuals.DishLayer, color.Value);
|
||||
_sprite.LayerSetColor(ent.Owner, CellContainerVisuals.DishLayer, color.Value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ namespace Content.Client._Wega.Xenobiology;
|
||||
public sealed class SlimeVisualSystem : SharedSlimeVisualSystem
|
||||
{
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
[Dependency] private readonly SpriteSystem _sprite = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -30,7 +31,7 @@ public sealed class SlimeVisualSystem : SharedSlimeVisualSystem
|
||||
? $"{type.ToString().ToLower()}_baby_slime"
|
||||
: $"{type.ToString().ToLower()}_adult_slime";
|
||||
|
||||
args.Sprite.LayerSetState(0, state);
|
||||
_sprite.LayerSetRsiState(ent.Owner, 0, state);
|
||||
UpdateDamageVisuals(ent.Owner, stage, type);
|
||||
}
|
||||
|
||||
|
||||
@@ -105,6 +105,8 @@ public sealed partial class AdminVerbSystem
|
||||
private readonly EntProtoId _siliconMindRole = "MindRoleSiliconBrain";
|
||||
private const string SiliconLawBoundUserInterface = "SiliconLawBoundUserInterface";
|
||||
|
||||
private static readonly ProtoId<DiseasePrototype> StageIIIALungCancer = "StageIIIALungCancer"; // Corvax-Wega-Disease
|
||||
|
||||
// All smite verbs have names so invokeverb works.
|
||||
private void AddSmiteVerbs(GetVerbsEvent<Verb> args)
|
||||
{
|
||||
@@ -208,7 +210,8 @@ public sealed partial class AdminVerbSystem
|
||||
args.Verbs.Add(monkey);
|
||||
|
||||
// Corvax-Wega-Disease-start
|
||||
if (TryComp<DiseaseCarrierComponent>(args.Target, out var carrier))
|
||||
if (TryComp<DiseaseCarrierComponent>(args.Target, out var carrier)
|
||||
&& _prototypeManager.TryIndex(StageIIIALungCancer, out var disease))
|
||||
{
|
||||
Verb lungCancer = new()
|
||||
{
|
||||
@@ -217,7 +220,7 @@ public sealed partial class AdminVerbSystem
|
||||
Icon = new SpriteSpecifier.Rsi(new("/Textures/Mobs/Species/Human/organs.rsi"), "lung-l"),
|
||||
Act = () =>
|
||||
{
|
||||
_diseaseSystem.TryInfect(carrier, _prototypeManager.Index<DiseasePrototype>("StageIIIALungCancer"),
|
||||
_diseaseSystem.TryInfect(args.Target, carrier, disease,
|
||||
1.0f, true);
|
||||
},
|
||||
Impact = LogImpact.Extreme,
|
||||
|
||||
@@ -2,9 +2,8 @@ using Content.Server.Actions;
|
||||
using Content.Server.Popups;
|
||||
using Content.Server.PowerCell;
|
||||
using Content.Server.Stunnable;
|
||||
using Content.Shared._Wega.Android;
|
||||
using Content.Shared.Android;
|
||||
using Content.Shared.Alert;
|
||||
using Content.Shared.Damage.Components;
|
||||
using Content.Shared.Humanoid;
|
||||
using Content.Shared.Humanoid.Markings;
|
||||
using Content.Shared.Item.ItemToggle;
|
||||
@@ -25,7 +24,7 @@ using Robust.Shared.Containers;
|
||||
using Robust.Shared.Random;
|
||||
using Robust.Shared.Timing;
|
||||
|
||||
namespace Content.Server._Wega.Android;
|
||||
namespace Content.Server.Android;
|
||||
|
||||
public sealed partial class AndroidSystem : SharedAndroidSystem
|
||||
{
|
||||
|
||||
@@ -13,7 +13,7 @@ public sealed class CoreTempChangeSystem : EntitySystem
|
||||
{
|
||||
base.Update(frameTime);
|
||||
|
||||
var query = EntityQueryEnumerator<CoreTempChangeComponent , TransformComponent>();
|
||||
var query = EntityQueryEnumerator<CoreTempChangeComponent, TransformComponent>();
|
||||
while (query.MoveNext(out var ent, out var comp, out var xform))
|
||||
{
|
||||
var grid = xform.GridUid;
|
||||
|
||||
@@ -183,26 +183,20 @@ public sealed partial class BloodCultSystem
|
||||
var senderName = Name(uid) ?? "Unknown";
|
||||
var popupMessage = Loc.GetString("cult-commune-massage", ("name", senderName), ("massage", finalMessage));
|
||||
|
||||
var cultistQuery = EntityQuery<ActorComponent, BloodCultistComponent>(true);
|
||||
foreach (var (actorComp, cultistComp) in cultistQuery)
|
||||
var cultistQuery = EntityQueryEnumerator<ActorComponent, BloodCultistComponent>();
|
||||
while (cultistQuery.MoveNext(out var cultistUid, out var actorComp, out var cultistComp))
|
||||
{
|
||||
if (actorComp == playerActor) continue;
|
||||
|
||||
if (!TryComp<ActorComponent>(actorComp.Owner, out var cultistActor))
|
||||
continue;
|
||||
|
||||
_prayerSystem.SendSubtleMessage(cultistActor.PlayerSession, cultistActor.PlayerSession, string.Empty, popupMessage);
|
||||
_prayerSystem.SendSubtleMessage(actorComp.PlayerSession, actorComp.PlayerSession, string.Empty, popupMessage);
|
||||
}
|
||||
|
||||
var constructQuery = EntityQuery<ActorComponent, BloodCultConstructComponent>(true);
|
||||
foreach (var (actorComp, constructComp) in constructQuery)
|
||||
var constructQuery = EntityQueryEnumerator<ActorComponent, BloodCultConstructComponent>();
|
||||
while (constructQuery.MoveNext(out var constructUid, out var actorComp, out var constructComp))
|
||||
{
|
||||
if (actorComp == playerActor) continue;
|
||||
|
||||
if (!TryComp<ActorComponent>(actorComp.Owner, out var constructActor))
|
||||
continue;
|
||||
|
||||
_prayerSystem.SendSubtleMessage(constructActor.PlayerSession, constructActor.PlayerSession, string.Empty, popupMessage);
|
||||
_prayerSystem.SendSubtleMessage(actorComp.PlayerSession, actorComp.PlayerSession, string.Empty, popupMessage);
|
||||
}
|
||||
|
||||
_admin.Add(LogType.Chat, LogImpact.Low, $"{ToPrettyString(uid):user} saying the: {finalMessage} in cult commune");
|
||||
@@ -684,7 +678,7 @@ public sealed partial class BloodCultSystem
|
||||
var coords = Transform(target).Coordinates;
|
||||
if (stackPrototype.ID is "Steel" && stack.Count >= 30)
|
||||
{
|
||||
_stack.SetCount(target, stack.Count - 30);
|
||||
_stack.ReduceCount(target, 30);
|
||||
if (stack.Count > 0)
|
||||
{
|
||||
_entityManager.SpawnEntity("BloodCultConstruct", coords);
|
||||
@@ -702,7 +696,7 @@ public sealed partial class BloodCultSystem
|
||||
_entityManager.DeleteEntity(target);
|
||||
if (TryComp<StackComponent>(runeSteel, out var newStack))
|
||||
{
|
||||
_stack.SetCount(runeSteel, count);
|
||||
_stack.SetCount((runeSteel, newStack), count);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -887,20 +881,25 @@ public sealed partial class BloodCultSystem
|
||||
return;
|
||||
|
||||
_entityManager.DeleteEntity(args.Used);
|
||||
var runes = EntityQuery<BloodRuneComponent>(true)
|
||||
.Where(runeEntity =>
|
||||
TryComp<BloodRuneComponent>(runeEntity.Owner, out var runeComp) && runeComp.Prototype == "teleport")
|
||||
.ToList();
|
||||
|
||||
var runes = new List<EntityUid>();
|
||||
var runeQuery = EntityQueryEnumerator<BloodRuneComponent>();
|
||||
|
||||
while (runeQuery.MoveNext(out var runeUid, out var runeComp))
|
||||
{
|
||||
if (runeComp.Prototype == "teleport")
|
||||
runes.Add(runeUid);
|
||||
}
|
||||
|
||||
if (runes.Count > 0)
|
||||
{
|
||||
var randomRune = runes[new Random().Next(runes.Count)];
|
||||
var runeTransform = _entityManager.GetComponent<TransformComponent>(randomRune.Owner);
|
||||
var randomRune = runes[_random.Next(runes.Count)];
|
||||
var runeTransform = _entityManager.GetComponent<TransformComponent>(randomRune);
|
||||
var targetCoords = Transform(args.Target.Value).Coordinates;
|
||||
_entityManager.SpawnEntity("BloodCultOutEffect", targetCoords);
|
||||
_transform.SetCoordinates(args.Target.Value, runeTransform.Coordinates);
|
||||
_entityManager.SpawnEntity("BloodCultInEffect", runeTransform.Coordinates);
|
||||
_entityManager.DeleteEntity(randomRune.Owner);
|
||||
_entityManager.DeleteEntity(randomRune);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ using Content.Shared.Weapons.Melee;
|
||||
using Content.Shared.Weapons.Ranged.Events;
|
||||
using Robust.Server.Audio;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Random;
|
||||
@@ -372,16 +373,16 @@ public sealed partial class BloodCultSystem : SharedBloodCultSystem
|
||||
if (!_firstTriggered)
|
||||
{
|
||||
var actorFilter = Filter.Empty();
|
||||
var actorQuery = EntityQuery<ActorComponent>();
|
||||
foreach (var actor in actorQuery)
|
||||
var actorQuery = EntityQueryEnumerator<ActorComponent, BloodCultistComponent>();
|
||||
while (actorQuery.MoveNext(out var actorUid, out var actor, out _))
|
||||
{
|
||||
if (actor.Owner != EntityUid.Invalid && HasComp<BloodCultistComponent>(actor.Owner))
|
||||
if (actorUid != EntityUid.Invalid)
|
||||
{
|
||||
actorFilter.AddPlayer(actor.PlayerSession);
|
||||
_popup.PopupEntity(Loc.GetString("blood-cult-first-warning"), actor.Owner, actor.Owner, PopupType.SmallCaution);
|
||||
_popup.PopupEntity(Loc.GetString("blood-cult-first-warning"), actorUid, actorUid, PopupType.SmallCaution);
|
||||
}
|
||||
}
|
||||
_audio.PlayGlobal("/Audio/_Wega/Ambience/Antag/bloodcult_eyes.ogg", actorFilter, true);
|
||||
_audio.PlayGlobal(new SoundPathSpecifier("/Audio/_Wega/Ambience/Antag/bloodcult_eyes.ogg"), actorFilter, true);
|
||||
_firstTriggered = true;
|
||||
}
|
||||
}
|
||||
@@ -399,16 +400,16 @@ public sealed partial class BloodCultSystem : SharedBloodCultSystem
|
||||
if (!_secondTriggered)
|
||||
{
|
||||
var actorFilter = Filter.Empty();
|
||||
var actorQuery = EntityQuery<ActorComponent>();
|
||||
foreach (var actor in actorQuery)
|
||||
var actorQuery = EntityQueryEnumerator<ActorComponent, BloodCultistComponent>();
|
||||
while (actorQuery.MoveNext(out var actorUid, out var actor, out _))
|
||||
{
|
||||
if (actor.Owner != EntityUid.Invalid && HasComp<BloodCultistComponent>(actor.Owner))
|
||||
if (actorUid != EntityUid.Invalid)
|
||||
{
|
||||
actorFilter.AddPlayer(actor.PlayerSession);
|
||||
_popup.PopupEntity(Loc.GetString("blood-cult-second-warning"), actor.Owner, actor.Owner, PopupType.SmallCaution);
|
||||
_popup.PopupEntity(Loc.GetString("blood-cult-second-warning"), actorUid, actorUid, PopupType.SmallCaution);
|
||||
}
|
||||
}
|
||||
_audio.PlayGlobal("/Audio/_Wega/Ambience/Antag/bloodcult_halos.ogg", actorFilter, true);
|
||||
_audio.PlayGlobal(new SoundPathSpecifier("/Audio/_Wega/Ambience/Antag/bloodcult_halos.ogg"), actorFilter, true);
|
||||
_secondTriggered = true;
|
||||
}
|
||||
}
|
||||
@@ -835,8 +836,8 @@ public sealed partial class BloodCultSystem : SharedBloodCultSystem
|
||||
structureComp.ActivateTime = currentTime + TimeSpan.FromMinutes(4);
|
||||
|
||||
var item = _entityManager.SpawnEntity(args.Item, Transform(structure).Coordinates);
|
||||
if (structureComp.Sound != string.Empty)
|
||||
_audio.PlayPvs(structureComp.Sound, structure);
|
||||
_audio.PlayPvs(structureComp.Sound, structure);
|
||||
|
||||
var cultistPosition = _transform.GetWorldPosition(user);
|
||||
var structurePosition = _transform.GetWorldPosition(structure);
|
||||
var distance = (structurePosition - cultistPosition).Length();
|
||||
|
||||
@@ -19,7 +19,6 @@ using Content.Shared.Ghost;
|
||||
using Content.Shared.Humanoid;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Interaction.Events;
|
||||
using Content.Shared.Maps;
|
||||
using Content.Shared.Mind;
|
||||
using Content.Shared.Mind.Components;
|
||||
using Content.Shared.Mindshield.Components;
|
||||
@@ -32,11 +31,13 @@ using Content.Shared.Standing;
|
||||
using Content.Shared.Surgery.Components;
|
||||
using Content.Shared.Timing;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Console;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Map.Components;
|
||||
using Robust.Shared.Physics.Components;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Timing;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
@@ -47,12 +48,12 @@ public sealed partial class BloodCultSystem
|
||||
[Dependency] private readonly BloodCultSystem _bloodCult = default!;
|
||||
[Dependency] private readonly IConsoleHost _consoleHost = default!;
|
||||
[Dependency] private readonly FlammableSystem _flammable = default!;
|
||||
[Dependency] private readonly ITileDefinitionManager _tileDefManager = default!;
|
||||
[Dependency] private readonly NavMapSystem _navMap = default!;
|
||||
[Dependency] private readonly IMapManager _mapMan = default!;
|
||||
[Dependency] private readonly SharedMapSystem _map = default!;
|
||||
[Dependency] private readonly RejuvenateSystem _rejuvenate = default!;
|
||||
[Dependency] private readonly SharedGhostSystem _ghost = default!;
|
||||
|
||||
private static readonly EntProtoId ActionComms = "ActionBloodCultComms";
|
||||
private const string BloodCultObserver = "MobObserverIfrit";
|
||||
private static int _offerings = 3;
|
||||
private bool _isRitualRuneUnlocked = false;
|
||||
@@ -104,7 +105,7 @@ public sealed partial class BloodCultSystem
|
||||
else if (selectedRune == "BloodRuneRitualDimensionalRending" && _isRitualRuneUnlocked)
|
||||
{
|
||||
var xform = Transform(uid);
|
||||
if (!TryComp<MapGridComponent>(xform.GridUid, out var grid) || !HasComp<BecomesStationComponent>(grid.Owner))
|
||||
if (!TryComp<MapGridComponent>(xform.GridUid, out var grid) || !HasComp<BecomesStationComponent>(xform.GridUid.Value))
|
||||
{
|
||||
_popup.PopupEntity(Loc.GetString("rune-ritual-failed"), uid, uid, PopupType.MediumCaution);
|
||||
return;
|
||||
@@ -336,16 +337,17 @@ public sealed partial class BloodCultSystem
|
||||
}
|
||||
break;
|
||||
case "teleport":
|
||||
var runes = EntityQuery<BloodRuneComponent>(true)
|
||||
.Where(runeEntity =>
|
||||
TryComp<BloodRuneComponent>(runeEntity.Owner, out var runeComp) &&
|
||||
runeComp.Prototype == "teleport" && runeEntity.Owner != rune)
|
||||
.ToList();
|
||||
var runes = new List<EntityUid>();
|
||||
var runeQuery = EntityQueryEnumerator<BloodRuneComponent>();
|
||||
while (runeQuery.MoveNext(out var runeUid, out var runeCompQ))
|
||||
{
|
||||
if (runeCompQ.Prototype == "teleport" && runeUid != rune)
|
||||
runes.Add(runeUid);
|
||||
}
|
||||
|
||||
if (runes.Any() && CheckRuneActivate(coords, 1))
|
||||
{
|
||||
var randomRuneComponent = runes[new Random().Next(runes.Count)];
|
||||
var randomRuneEntity = randomRuneComponent.Owner;
|
||||
var randomRuneEntity = runes[_random.Next(runes.Count)];
|
||||
var runeTransform = _entityManager.GetComponent<TransformComponent>(randomRuneEntity);
|
||||
var runeCoords = runeTransform.Coordinates;
|
||||
SendCultistMessage(cultist, "teleport");
|
||||
@@ -428,18 +430,12 @@ public sealed partial class BloodCultSystem
|
||||
);
|
||||
_consoleHost.ExecuteCommand(formattedCommand);
|
||||
}
|
||||
else if (HasComp<BodyComponent>(target) && !HasComp<BloodCultistComponent>(target)
|
||||
&& currentState is MobState.Dead && !HasComp<BorgChassisComponent>(target) && !HasComp<BloodCultObjectComponent>(target))
|
||||
else if (HasComp<BodyComponent>(target) && !HasComp<BloodCultistComponent>(target) && currentState is MobState.Dead
|
||||
&& !HasComp<BorgChassisComponent>(target) && !HasComp<BloodCultObjectComponent>(target)
|
||||
&& !HasComp<HumanoidAppearanceComponent>(target)/*Stop killing humanoid this way*/)
|
||||
{
|
||||
SendCultistMessage(cultist, "revive");
|
||||
|
||||
if (HasComp<HumanoidAppearanceComponent>(target))
|
||||
{
|
||||
var soulStone = _entityManager.SpawnEntity("BloodCultSoulStone", Transform(target).Coordinates);
|
||||
if (TryComp<MindContainerComponent>(target, out var mindContainer) && mindContainer.Mind != null)
|
||||
_mind.TransferTo(mindContainer.Mind.Value, soulStone);
|
||||
}
|
||||
|
||||
// Gib
|
||||
var damage = new DamageSpecifier { DamageDict = { { "Blunt", 1000 } } };
|
||||
_damage.TryChangeDamage(target, damage, true);
|
||||
@@ -472,6 +468,7 @@ public sealed partial class BloodCultSystem
|
||||
Entity<BloodRuneComponent>? randomRune = nearbyRunes.Any()
|
||||
? nearbyRunes[new Random().Next(nearbyRunes.Count)]
|
||||
: null;
|
||||
|
||||
if (randomRune != null)
|
||||
{
|
||||
var randomRuneUid = randomRune.Value;
|
||||
@@ -498,10 +495,14 @@ public sealed partial class BloodCultSystem
|
||||
}
|
||||
}
|
||||
|
||||
var barrierRunes = EntityQuery<BloodRuneComponent>(true)
|
||||
.Where(runeEntity =>
|
||||
TryComp<BloodRuneComponent>(runeEntity.Owner, out var runeComp) && runeComp.Prototype == "barrier")
|
||||
.ToList();
|
||||
var barrierRunes = new List<EntityUid>();
|
||||
var barrierRuneQuery = EntityQueryEnumerator<BloodRuneComponent>();
|
||||
|
||||
while (barrierRuneQuery.MoveNext(out var runeUid, out var runeCompQ))
|
||||
{
|
||||
if (runeCompQ.Prototype == "barrier")
|
||||
barrierRunes.Add(runeUid);
|
||||
}
|
||||
|
||||
var damageFormula = 2 * barrierRunes.Count;
|
||||
var damage = new DamageSpecifier { DamageDict = { { "Slash", damageFormula } } };
|
||||
@@ -635,8 +636,8 @@ public sealed partial class BloodCultSystem
|
||||
|
||||
var comp = _entityManager.GetComponent<GhostComponent>(ghost);
|
||||
_action.RemoveAction(ghost, comp.ToggleGhostBarActionEntity); // Ghost-Bar-Block
|
||||
_action.AddAction(ghost, "ActionBloodCultComms");
|
||||
_entityManager.System<SharedGhostSystem>().SetCanReturnToBody(comp, canReturn);
|
||||
_action.AddAction(ghost, ActionComms);
|
||||
_ghost.SetCanReturnToBody((ghost, comp), canReturn);
|
||||
break;
|
||||
}
|
||||
else
|
||||
@@ -660,7 +661,7 @@ public sealed partial class BloodCultSystem
|
||||
var msg = Loc.GetString("blood-ritual-activate-warning",
|
||||
("location", FormattedMessage.RemoveMarkupOrThrow(_navMap.GetNearestBeaconString((rune, xform)))));
|
||||
_chat.DispatchGlobalAnnouncement(msg, playSound: false, colorOverride: Color.Red);
|
||||
_audio.PlayGlobal("/Audio/_Wega/Ambience/Antag/bloodcult_scribe.ogg", Filter.Broadcast(), true);
|
||||
_audio.PlayGlobal(new SoundPathSpecifier("/Audio/_Wega/Ambience/Antag/bloodcult_scribe.ogg"), Filter.Broadcast(), true);
|
||||
Timer.Spawn(TimeSpan.FromSeconds(45), () =>
|
||||
{
|
||||
if (runeComp.Activate)
|
||||
|
||||
@@ -130,8 +130,13 @@ namespace Content.Server.WashingMachine
|
||||
_dirt.CleanDirt(entity, 100f);
|
||||
|
||||
// This is to clean the switchable clothes
|
||||
var attachedClothing = EntityManager.EntityQuery<AttachedClothingComponent>()
|
||||
.Where(ac => ac.AttachedUid == entity).Select(ac => ac.Owner).ToList();
|
||||
var attachedClothing = new List<EntityUid>();
|
||||
var attachedClothingQuery = EntityQueryEnumerator<AttachedClothingComponent>();
|
||||
while (attachedClothingQuery.MoveNext(out var clothingUid, out var ac))
|
||||
{
|
||||
if (ac.AttachedUid == entity)
|
||||
attachedClothing.Add(clothingUid);
|
||||
}
|
||||
|
||||
foreach (var clothing in attachedClothing)
|
||||
{
|
||||
|
||||
@@ -76,7 +76,8 @@ namespace Content.Server.Disease
|
||||
|
||||
_removeQueue.Clear();
|
||||
|
||||
foreach (var (_, diseaseMachine) in EntityQuery<DiseaseMachineRunningComponent, DiseaseMachineComponent>())
|
||||
var query = EntityQueryEnumerator<DiseaseMachineRunningComponent, DiseaseMachineComponent>();
|
||||
while (query.MoveNext(out var uid, out _, out var diseaseMachine))
|
||||
{
|
||||
diseaseMachine.Accumulator += frameTime;
|
||||
|
||||
@@ -84,8 +85,8 @@ namespace Content.Server.Disease
|
||||
{
|
||||
diseaseMachine.Accumulator -= diseaseMachine.Delay;
|
||||
var ev = new DiseaseMachineFinishedEvent(diseaseMachine);
|
||||
RaiseLocalEvent(diseaseMachine.Owner, ev);
|
||||
_removeQueue.Enqueue(diseaseMachine.Owner);
|
||||
RaiseLocalEvent(uid, ev);
|
||||
_removeQueue.Enqueue(uid);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -344,9 +345,12 @@ namespace Content.Server.Disease
|
||||
|
||||
var known = false;
|
||||
|
||||
foreach (var server in EntityQuery<DiseaseServerComponent>(true))
|
||||
var serverQuery = EntityQueryEnumerator<DiseaseServerComponent>();
|
||||
var currentStation = _stationSystem.GetOwningStation(uid);
|
||||
|
||||
while (serverQuery.MoveNext(out var serverUid, out var server))
|
||||
{
|
||||
if (_stationSystem.GetOwningStation(server.Owner) != _stationSystem.GetOwningStation(uid))
|
||||
if (_stationSystem.GetOwningStation(serverUid) != currentStation)
|
||||
continue;
|
||||
|
||||
if (ServerHasDisease(server, args.Machine.Disease))
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace Content.Server.Disease
|
||||
SubscribeLocalEvent<DiseaseVaccineComponent, VaccineDoAfterEvent>(OnDoAfter);
|
||||
}
|
||||
|
||||
private Queue<(DiseaseCarrierComponent carrier, DiseasePrototype disease)> _cureQueue = new();
|
||||
private Queue<(EntityUid uid, DiseaseCarrierComponent carrier, DiseasePrototype disease)> _cureQueue = new();
|
||||
|
||||
/// <summary>
|
||||
/// First, adds or removes diseased component from the queues and clears them.
|
||||
@@ -66,30 +66,31 @@ namespace Content.Server.Disease
|
||||
public override void Update(float frameTime)
|
||||
{
|
||||
base.Update(frameTime);
|
||||
foreach (var entity in _addQueue)
|
||||
foreach (var entity in AddQueue)
|
||||
{
|
||||
EnsureComp<DiseasedComponent>(entity);
|
||||
}
|
||||
|
||||
_addQueue.Clear();
|
||||
AddQueue.Clear();
|
||||
|
||||
foreach (var tuple in _cureQueue)
|
||||
{
|
||||
if (tuple.carrier.Diseases.Count == 1) //This is reliable unlike testing Count == 0 right after removal for reasons I don't quite get
|
||||
RemComp<DiseasedComponent>(tuple.carrier.Owner);
|
||||
RemComp<DiseasedComponent>(tuple.uid);
|
||||
tuple.carrier.PastDiseases.Add(tuple.disease);
|
||||
tuple.carrier.Diseases.Remove(tuple.disease);
|
||||
}
|
||||
_cureQueue.Clear();
|
||||
|
||||
foreach (var (_, carrierComp, mobState) in EntityQuery<DiseasedComponent, DiseaseCarrierComponent, MobStateComponent>())
|
||||
var query = EntityQueryEnumerator<DiseasedComponent, DiseaseCarrierComponent, MobStateComponent>();
|
||||
while (query.MoveNext(out var uid, out var diseased, out var carrierComp, out var mobState))
|
||||
{
|
||||
DebugTools.Assert(carrierComp.Diseases.Count > 0);
|
||||
|
||||
if (_mobStateSystem.IsDead(mobState.Owner, mobState))
|
||||
if (_mobStateSystem.IsDead(uid, mobState))
|
||||
{
|
||||
if (_random.Prob(0.005f * frameTime)) //Mean time to remove is 200 seconds per disease
|
||||
CureDisease(carrierComp, _random.Pick(carrierComp.Diseases));
|
||||
CureDisease(uid, carrierComp, _random.Pick(carrierComp.Diseases));
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -104,7 +105,7 @@ namespace Content.Server.Disease
|
||||
|
||||
// if the disease is on the silent disease list, don't do effects
|
||||
var doEffects = carrierComp.CarrierDiseases?.Contains(disease.ID) != true;
|
||||
var args = new DiseaseEffectArgs(carrierComp.Owner, disease, EntityManager);
|
||||
var args = new DiseaseEffectArgs(uid, disease, EntityManager);
|
||||
disease.Accumulator -= disease.TickTime;
|
||||
|
||||
int stage = 0; //defaults to stage 0 because you should always have one
|
||||
@@ -122,7 +123,7 @@ namespace Content.Server.Disease
|
||||
foreach (var cure in disease.Cures)
|
||||
{
|
||||
if (cure.Stages.AsSpan().Contains(stage) && cure.Cure(args))
|
||||
CureDisease(carrierComp, disease);
|
||||
CureDisease(uid, carrierComp, disease);
|
||||
}
|
||||
|
||||
if (doEffects)
|
||||
@@ -155,7 +156,7 @@ namespace Content.Server.Disease
|
||||
component.PastDiseases.Add(disease);
|
||||
else
|
||||
{
|
||||
Logger.Error($"Failed to index disease prototype {immunity} for {uid}");
|
||||
Log.Error($"Failed to index disease prototype {immunity} for {uid}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -174,12 +175,12 @@ namespace Content.Server.Disease
|
||||
return;
|
||||
if (cureProb > 1)
|
||||
{
|
||||
CureDisease(component, disease);
|
||||
CureDisease(uid, component, disease);
|
||||
return;
|
||||
}
|
||||
if (_random.Prob(cureProb))
|
||||
{
|
||||
CureDisease(component, disease);
|
||||
CureDisease(uid, component, disease);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -230,11 +231,11 @@ namespace Content.Server.Disease
|
||||
/// so it can be safely queued up to be removed from the target
|
||||
/// and added to past disease history (for immunity)
|
||||
/// </summary>
|
||||
private void CureDisease(DiseaseCarrierComponent carrier, DiseasePrototype disease)
|
||||
private void CureDisease(EntityUid uid, DiseaseCarrierComponent carrier, DiseasePrototype disease)
|
||||
{
|
||||
var сureTuple = (carrier, disease);
|
||||
_cureQueue.Enqueue(сureTuple);
|
||||
_popupSystem.PopupEntity(Loc.GetString("disease-cured"), carrier.Owner, carrier.Owner);
|
||||
var cureTuple = (uid, carrier, disease);
|
||||
_cureQueue.Enqueue(cureTuple);
|
||||
_popupSystem.PopupEntity(Loc.GetString("disease-cured"), uid, uid);
|
||||
}
|
||||
|
||||
public void CureAllDiseases(EntityUid uid, DiseaseCarrierComponent? carrier = null)
|
||||
@@ -244,7 +245,7 @@ namespace Content.Server.Disease
|
||||
|
||||
foreach (var disease in carrier.Diseases)
|
||||
{
|
||||
CureDisease(carrier, disease);
|
||||
CureDisease(uid, carrier, disease);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -331,7 +332,7 @@ namespace Content.Server.Disease
|
||||
return;
|
||||
|
||||
var disease = _random.Pick(diseasedCarrier.Diseases);
|
||||
TryInfect(carrier, disease, 0.4f);
|
||||
TryInfect(target, carrier, disease, 0.4f);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -340,11 +341,12 @@ namespace Content.Server.Disease
|
||||
/// rolls the dice to see if they get
|
||||
/// the disease.
|
||||
/// </summary>
|
||||
/// <param name="uid">The target entity UID</param>
|
||||
/// <param name="carrier">The target of the disease</param>
|
||||
/// <param name="disease">The disease to apply</param>
|
||||
/// <param name="chance">% chance of the disease being applied, before considering resistance</param>
|
||||
/// <param name="forced">Bypass the disease's infectious trait.</param>
|
||||
public void TryInfect(DiseaseCarrierComponent carrier, DiseasePrototype? disease, float chance = 0.7f, bool forced = false)
|
||||
public void TryInfect(EntityUid uid, DiseaseCarrierComponent carrier, DiseasePrototype? disease, float chance = 0.7f, bool forced = false)
|
||||
{
|
||||
if (disease == null || !forced && !disease.Infectious)
|
||||
return;
|
||||
@@ -352,15 +354,15 @@ namespace Content.Server.Disease
|
||||
if (infectionChance <= 0)
|
||||
return;
|
||||
if (_random.Prob(infectionChance))
|
||||
TryAddDisease(carrier.Owner, disease, carrier);
|
||||
TryAddDisease(uid, disease, carrier);
|
||||
}
|
||||
|
||||
public void TryInfect(DiseaseCarrierComponent carrier, string? disease, float chance = 0.7f, bool forced = false)
|
||||
public void TryInfect(EntityUid uid, DiseaseCarrierComponent carrier, string? disease, float chance = 0.7f, bool forced = false)
|
||||
{
|
||||
if (disease == null || !_prototypeManager.TryIndex<DiseasePrototype>(disease, out var d))
|
||||
return;
|
||||
|
||||
TryInfect(carrier, d, chance, forced);
|
||||
TryInfect(uid, carrier, d, chance, forced);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -371,7 +373,8 @@ namespace Content.Server.Disease
|
||||
/// </summary>
|
||||
public bool SneezeCough(EntityUid uid, DiseasePrototype? disease, string emoteId, bool airTransmit = true, TransformComponent? xform = null)
|
||||
{
|
||||
if (!Resolve(uid, ref xform)) return false;
|
||||
if (!Resolve(uid, ref xform))
|
||||
return false;
|
||||
|
||||
if (_mobStateSystem.IsDead(uid)) return false;
|
||||
|
||||
@@ -391,12 +394,12 @@ namespace Content.Server.Disease
|
||||
|
||||
var carrierQuery = GetEntityQuery<DiseaseCarrierComponent>();
|
||||
|
||||
foreach (var entity in _lookup.GetEntitiesInRange(xform.MapPosition, 2f))
|
||||
foreach (var entity in _lookup.GetEntitiesInRange(xform.Coordinates, 2f))
|
||||
{
|
||||
if (!carrierQuery.TryGetComponent(entity, out var carrier) ||
|
||||
!_interactionSystem.InRangeUnobstructed(uid, entity)) continue;
|
||||
|
||||
TryInfect(carrier, disease, 0.3f);
|
||||
TryInfect(entity, carrier, disease, 0.3f);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -33,9 +33,7 @@ namespace Content.Server.Disease.Effects
|
||||
if (PolymorphSound != null && polyUid != null)
|
||||
{
|
||||
var audioSystem = args.EntityManager.System<SharedAudioSystem>();
|
||||
var soundPath = audioSystem.GetSound(PolymorphSound);
|
||||
|
||||
audioSystem.PlayGlobal(soundPath, Filter.Pvs(polyUid.Value), true, AudioParams.Default);
|
||||
audioSystem.PlayGlobal(PolymorphSound, Filter.Pvs(polyUid.Value), true, AudioParams.Default);
|
||||
}
|
||||
|
||||
if (PolymorphMessage != null && polyUid != null)
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Content.Server.Disease
|
||||
/// Emote to play when snoughing
|
||||
/// </summary>
|
||||
[DataField("emote", required: true, customTypeSerializer: typeof(PrototypeIdSerializer<EmotePrototype>))]
|
||||
public string EmoteId = String.Empty;
|
||||
public string EmoteId = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Whether to spread the disease through the air
|
||||
|
||||
@@ -12,7 +12,6 @@ namespace Content.Server.Friendly.Faction
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<FriendlyFactionComponent, MeleeHitEvent>(OnMeleeHit);
|
||||
|
||||
}
|
||||
|
||||
private void OnMeleeHit(EntityUid uid, FriendlyFactionComponent component, MeleeHitEvent args)
|
||||
|
||||
@@ -20,15 +20,13 @@ public sealed class HulkGenSystem : EntitySystem
|
||||
[Dependency] private readonly SharedActionsSystem _action = default!;
|
||||
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
||||
[Dependency] private readonly DamageableSystem _damage = default!;
|
||||
|
||||
[Dependency] private readonly DnaModifierSystem _dnaModifier = default!;
|
||||
[Dependency] private readonly PhysicsSystem _physics = default!;
|
||||
[Dependency] private readonly PolymorphSystem _polymorph = default!;
|
||||
[Dependency] private readonly SharedTransformSystem _transform = default!;
|
||||
[Dependency] private readonly SharedStunSystem _stun = default!;
|
||||
|
||||
[ValidatePrototypeId<StructuralEnzymesPrototype>]
|
||||
private const string HulkGen = "GeneticsHulkBasic";
|
||||
private static readonly ProtoId<StructuralEnzymesPrototype> HulkGen = "GeneticsHulkBasic";
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
|
||||
@@ -91,7 +91,7 @@ public sealed class MatterEaterSystem : EntitySystem
|
||||
return;
|
||||
|
||||
if (TryComp<StackComponent>(ent, out var stack) && stack.Count > 1)
|
||||
_stack.SetCount(ent.Owner, stack.Count - 1);
|
||||
_stack.ReduceCount(ent.Owner, 1);
|
||||
else
|
||||
{
|
||||
if (TryComp<StorageComponent>(ent, out var storage))
|
||||
|
||||
@@ -5,6 +5,7 @@ using Content.Shared.DoAfter;
|
||||
using Content.Shared.Genetics;
|
||||
using Content.Shared.Interaction;
|
||||
using Robust.Server.Audio;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Server.Genetics.System;
|
||||
|
||||
@@ -13,8 +14,7 @@ public sealed partial class DnaModifierSystem
|
||||
[Dependency] private readonly AudioSystem _audio = default!;
|
||||
[Dependency] private readonly SharedDoAfterSystem _doAfterSystem = default!;
|
||||
|
||||
[ValidatePrototypeId<DamageTypePrototype>]
|
||||
private const string Damage = "Poison";
|
||||
private static readonly ProtoId<DamageTypePrototype> Damage = "Poison";
|
||||
|
||||
private void InitializeInjector()
|
||||
{
|
||||
@@ -24,7 +24,7 @@ public sealed partial class DnaModifierSystem
|
||||
SubscribeLocalEvent<DnaModifierCleanRandomizeComponent, ComponentStartup>(OnCleanRandomize);
|
||||
}
|
||||
|
||||
public void OnFillingInjector(EntityUid injector, UniqueIdentifiersPrototype? uniqueIdentifiers, List<EnzymesPrototypeInfo>? enzymesPrototypes)
|
||||
public void OnFillingInjector(EntityUid injector, UniqueIdentifiersData? uniqueIdentifiers, List<EnzymesPrototypeInfo>? enzymesPrototypes)
|
||||
{
|
||||
if (!TryComp(injector, out DnaModifierInjectorComponent? comp))
|
||||
return;
|
||||
|
||||
@@ -52,10 +52,8 @@ namespace Content.Server.Genetics.System
|
||||
[Dependency] private readonly SharedTransformSystem _transform = default!;
|
||||
[Dependency] private readonly UserInterfaceSystem _uiSystem = default!;
|
||||
|
||||
[ValidatePrototypeId<EntityPrototype>]
|
||||
private const string Injector = "DnaInjector";
|
||||
[ValidatePrototypeId<DamageTypePrototype>]
|
||||
private const string RadDamage = "Radiation";
|
||||
private static readonly EntProtoId Injector = "DnaInjector";
|
||||
private static readonly ProtoId<DamageTypePrototype> RadDamage = "Radiation";
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -229,7 +227,7 @@ namespace Content.Server.Genetics.System
|
||||
bool scannerInRange = ent.Comp.GeneticScannerInRange;
|
||||
|
||||
EnzymeInfo? enzyme = null;
|
||||
UniqueIdentifiersPrototype? uniqueIdentifiers = null;
|
||||
UniqueIdentifiersData? uniqueIdentifiers = null;
|
||||
List<EnzymesPrototypeInfo>? enzymesPrototypes = null;
|
||||
|
||||
var currentTime = _timing.CurTime;
|
||||
@@ -317,7 +315,7 @@ namespace Content.Server.Genetics.System
|
||||
buffer,
|
||||
currentTime < injectorCooldown ? injectorCooldown - currentTime : TimeSpan.Zero,
|
||||
currentTime < subjectInjectCooldown ? subjectInjectCooldown - currentTime : TimeSpan.Zero
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
private string GetStatus(MobState mobState)
|
||||
@@ -740,7 +738,7 @@ namespace Content.Server.Genetics.System
|
||||
UpdateUserInterface(GetEntity(args.Uid), console);
|
||||
}
|
||||
|
||||
private void ModifyUniqueIdentifiers(UniqueIdentifiersPrototype uniqueIdentifiers, string block, int value, float intensity)
|
||||
private void ModifyUniqueIdentifiers(UniqueIdentifiersData uniqueIdentifiers, string block, int value, float intensity)
|
||||
{
|
||||
var fields = new List<(string[] Field, string Name)>
|
||||
{
|
||||
@@ -834,7 +832,7 @@ namespace Content.Server.Genetics.System
|
||||
field[value] = GenerateRandomHexValue(field[value], intensity, 1.0f);
|
||||
}
|
||||
|
||||
private void ModifyUniqueIdentifiers(UniqueIdentifiersPrototype uniqueIdentifiers, float intensity, float duration)
|
||||
private void ModifyUniqueIdentifiers(UniqueIdentifiersData uniqueIdentifiers, float intensity, float duration)
|
||||
{
|
||||
var fields = new List<(string[] Field, string Name)>
|
||||
{
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
using Content.Shared.GameTicking;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Server.GameObjects;
|
||||
|
||||
namespace Content.Server.Genetics.System;
|
||||
|
||||
public sealed partial class DnaModifierSystem
|
||||
{
|
||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||
[Dependency] private readonly MapSystem _map = default!;
|
||||
|
||||
public EntityUid? PausedMap { get; private set; }
|
||||
|
||||
@@ -27,8 +27,6 @@ public sealed partial class DnaModifierSystem
|
||||
if (PausedMap != null && Exists(PausedMap))
|
||||
return;
|
||||
|
||||
var newmap = _mapManager.CreateMap();
|
||||
_mapManager.SetMapPaused(newmap, true);
|
||||
PausedMap = _mapManager.GetMapEntityId(newmap);
|
||||
PausedMap = _map.CreateMap(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Threading.Tasks;
|
||||
using Content.Server.Administration.Logs;
|
||||
using Content.Server.Chat.Systems;
|
||||
@@ -48,6 +49,8 @@ public sealed partial class DnaModifierSystem : SharedDnaModifierSystem
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
[Dependency] private readonly SharedTransformSystem _transform = default!;
|
||||
|
||||
private static readonly ProtoId<EmotePrototype> Scream = "Scream";
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
@@ -144,12 +147,12 @@ public sealed partial class DnaModifierSystem : SharedDnaModifierSystem
|
||||
}
|
||||
|
||||
#region Deep Cloning
|
||||
public UniqueIdentifiersPrototype? CloneUniqueIdentifiers(UniqueIdentifiersPrototype? source)
|
||||
public UniqueIdentifiersData? CloneUniqueIdentifiers(UniqueIdentifiersData? source)
|
||||
{
|
||||
if (source == null)
|
||||
return null;
|
||||
|
||||
return (UniqueIdentifiersPrototype)source.Clone();
|
||||
return source.Clone(source);
|
||||
}
|
||||
|
||||
public List<EnzymesPrototypeInfo>? CloneEnzymesPrototypes(List<EnzymesPrototypeInfo>? source)
|
||||
@@ -166,7 +169,7 @@ public sealed partial class DnaModifierSystem : SharedDnaModifierSystem
|
||||
{
|
||||
if (TryComp<HumanoidAppearanceComponent>(uid, out var humanoid))
|
||||
{
|
||||
var uniqueIdentifiers = new UniqueIdentifiersPrototype
|
||||
var uniqueIdentifiers = new UniqueIdentifiersData
|
||||
{
|
||||
ID = $"UniqueIdentifiers{uid}",
|
||||
};
|
||||
@@ -407,7 +410,7 @@ public sealed partial class DnaModifierSystem : SharedDnaModifierSystem
|
||||
else
|
||||
{
|
||||
var empty = new[] { "0", "0", "0" };
|
||||
var uniqueIdentifiers = new UniqueIdentifiersPrototype
|
||||
var uniqueIdentifiers = new UniqueIdentifiersData
|
||||
{
|
||||
ID = $"StructuralEnzymes{uid}",
|
||||
HairColorR = GenerateRandomHexValues(),
|
||||
@@ -583,7 +586,7 @@ public sealed partial class DnaModifierSystem : SharedDnaModifierSystem
|
||||
|
||||
_damage.TryChangeDamage(uid, damage, true);
|
||||
|
||||
_chat.TryEmoteWithoutChat(uid, _prototype.Index<EmotePrototype>("Scream"), true);
|
||||
_chat.TryEmoteWithoutChat(uid, _prototype.Index(Scream), true);
|
||||
_popup.PopupEntity(Loc.GetString("dna-instability-stage-two"), uid, uid, PopupType.SmallCaution);
|
||||
}
|
||||
}
|
||||
@@ -596,7 +599,7 @@ public sealed partial class DnaModifierSystem : SharedDnaModifierSystem
|
||||
|
||||
_damage.TryChangeDamage(uid, damage, true);
|
||||
|
||||
_chat.TryEmoteWithoutChat(uid, _prototype.Index<EmotePrototype>("Scream"), true);
|
||||
_chat.TryEmoteWithoutChat(uid, _prototype.Index(Scream), true);
|
||||
_popup.PopupEntity(Loc.GetString("dna-instability-stage-three"), uid, uid, PopupType.LargeCaution);
|
||||
}
|
||||
}
|
||||
@@ -647,10 +650,10 @@ public sealed partial class DnaModifierSystem : SharedDnaModifierSystem
|
||||
Dirty(ent, humanoid);
|
||||
}
|
||||
|
||||
private void UpdateSkin(Entity<HumanoidAppearanceComponent> humanoid, UniqueIdentifiersPrototype uniqueIdentifiers)
|
||||
private void UpdateSkin(Entity<HumanoidAppearanceComponent> humanoid, UniqueIdentifiersData uniqueIdentifiers)
|
||||
{
|
||||
var speciesProto = _prototype.Index<SpeciesPrototype>(humanoid.Comp.Species);
|
||||
var skinColorationProto = _prototype.Index<SkinColorationPrototype>(speciesProto.SkinColoration);
|
||||
var speciesProto = _prototype.Index(humanoid.Comp.Species);
|
||||
var skinColorationProto = _prototype.Index(speciesProto.SkinColoration);
|
||||
|
||||
switch (skinColorationProto.Strategy.InputType)
|
||||
{
|
||||
@@ -678,7 +681,7 @@ public sealed partial class DnaModifierSystem : SharedDnaModifierSystem
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateMarkings(Entity<HumanoidAppearanceComponent> humanoid, UniqueIdentifiersPrototype uniqueIdentifiers)
|
||||
private void UpdateMarkings(Entity<HumanoidAppearanceComponent> humanoid, UniqueIdentifiersData uniqueIdentifiers)
|
||||
{
|
||||
var markingSet = humanoid.Comp.MarkingSet;
|
||||
var markingPrototypes = _markingIndexer.GetAllMarkingPrototypes();
|
||||
@@ -691,7 +694,7 @@ public sealed partial class DnaModifierSystem : SharedDnaModifierSystem
|
||||
_ensureMarking.UpdateMarkingCategory(humanoid, markingSet, MarkingCategories.Tail, uniqueIdentifiers.TailMarkingColorR, uniqueIdentifiers.TailMarkingColorG, uniqueIdentifiers.TailMarkingColorB, uniqueIdentifiers.TailMarkingStyle, humanoid.Comp.Species, markingPrototypes);
|
||||
}
|
||||
|
||||
private void UpdateEyeColor(Entity<HumanoidAppearanceComponent> humanoid, UniqueIdentifiersPrototype uniqueIdentifiers)
|
||||
private void UpdateEyeColor(Entity<HumanoidAppearanceComponent> humanoid, UniqueIdentifiersData uniqueIdentifiers)
|
||||
{
|
||||
string redHex = uniqueIdentifiers.EyeColorR[0] + uniqueIdentifiers.EyeColorR[1];
|
||||
string greenHex = uniqueIdentifiers.EyeColorG[0] + uniqueIdentifiers.EyeColorG[1];
|
||||
@@ -710,7 +713,7 @@ public sealed partial class DnaModifierSystem : SharedDnaModifierSystem
|
||||
humanoid.Comp.EyeColor = eyeColor;
|
||||
}
|
||||
|
||||
private void UpdateGender(Entity<HumanoidAppearanceComponent> humanoid, UniqueIdentifiersPrototype uniqueIdentifiers)
|
||||
private void UpdateGender(Entity<HumanoidAppearanceComponent> humanoid, UniqueIdentifiersData uniqueIdentifiers)
|
||||
{
|
||||
int[] values = uniqueIdentifiers.Gender
|
||||
.Select(hex => Convert.ToInt32(hex, 16))
|
||||
|
||||
@@ -4,6 +4,7 @@ using Content.Shared.Genetics;
|
||||
using Content.Shared.Genetics.Systems;
|
||||
using Content.Shared.Humanoid;
|
||||
using Content.Shared.Humanoid.Markings;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Server.Genetics.System;
|
||||
|
||||
@@ -11,8 +12,7 @@ public sealed class EnsureMarkingSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly HumanoidAppearanceSystem _humanoid = default!;
|
||||
|
||||
[ValidatePrototypeId<MarkingPrototype>]
|
||||
public const string DefaultHorns = "LizardHornsDemonic";
|
||||
public static readonly ProtoId<MarkingPrototype> DefaultHorns = "LizardHornsDemonic";
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.Damage.Components;
|
||||
using Content.Shared.Damage.Prototypes;
|
||||
using Content.Shared.Genetics;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Server.Genetics.System;
|
||||
|
||||
@@ -9,10 +9,8 @@ public sealed class RegenerationGenSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly DamageableSystem _damage = default!;
|
||||
|
||||
[ValidatePrototypeId<DamageTypePrototype>]
|
||||
private const string BluntDamage = "Blunt";
|
||||
[ValidatePrototypeId<DamageTypePrototype>]
|
||||
private const string HeatDamage = "Heat";
|
||||
private static readonly ProtoId<DamageTypePrototype> BluntDamage = "Blunt";
|
||||
private static readonly ProtoId<DamageTypePrototype> HeatDamage = "Heat";
|
||||
|
||||
public override void Update(float frameTime)
|
||||
{
|
||||
|
||||
@@ -16,7 +16,7 @@ public sealed class HeatResistanceGenSystem : EntitySystem
|
||||
|
||||
private void OnInit(Entity<HeatResistanceGenComponent> ent, ref ComponentInit args)
|
||||
{
|
||||
if (TryComp<FlammableComponent>(ent, out _))
|
||||
if (HasComp<FlammableComponent>(ent))
|
||||
{
|
||||
RemComp<FlammableComponent>(ent);
|
||||
ent.Comp.RemFlammable = true;
|
||||
|
||||
@@ -9,6 +9,7 @@ using Robust.Shared.Timing;
|
||||
|
||||
namespace Content.Server.Hallucinations;
|
||||
|
||||
// TODO: Full refactor this shit
|
||||
public sealed partial class HallucinationsSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
|
||||
@@ -2,9 +2,8 @@ using Content.Server.Body.Systems;
|
||||
using Content.Shared._Wega.Implants.Components;
|
||||
using Content.Shared.Body.Components;
|
||||
using Content.Shared.Body.Part;
|
||||
using NetCord.Gateway;
|
||||
|
||||
namespace Content.Shared._Wega.Implants
|
||||
namespace Content.Server.Implants
|
||||
{
|
||||
public sealed class BodyPartImplantSystem : EntitySystem
|
||||
{
|
||||
@@ -22,7 +21,7 @@ namespace Content.Shared._Wega.Implants
|
||||
|
||||
private void OnMapInit(EntityUid uid, BodyPartImplantComponent component, ref MapInitEvent args)
|
||||
{
|
||||
if (!TryComp<BodyPartComponent>(uid, out var bodyPart))
|
||||
if (!TryComp<BodyPartComponent>(uid, out _))
|
||||
return;
|
||||
|
||||
foreach (var connection in component.Connections)
|
||||
|
||||
@@ -7,7 +7,7 @@ using Robust.Server.Audio;
|
||||
using Robust.Server.Containers;
|
||||
using Robust.Shared.Containers;
|
||||
|
||||
namespace Content.Server._Wega.Implants;
|
||||
namespace Content.Server.Implants;
|
||||
|
||||
public sealed class HandItemImplantSystem : EntitySystem
|
||||
{
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
using System.Linq;
|
||||
using Content.Shared.Body.Components;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.Damage.Systems;
|
||||
using Content.Shared.Martial.Arts;
|
||||
using Content.Shared.Martial.Arts.Components;
|
||||
using Content.Shared.StatusEffect;
|
||||
using Content.Shared.StatusEffectNew;
|
||||
using Content.Shared.Stunnable;
|
||||
using Content.Shared.Weapons.Melee.Events;
|
||||
using Robust.Shared.Random;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.Martial.Arts;
|
||||
using Content.Shared.Martial.Arts.Components;
|
||||
using Content.Shared.Speech.Muting;
|
||||
using Content.Shared.Standing;
|
||||
|
||||
namespace Content.Server.Martial.Arts;
|
||||
@@ -59,7 +58,7 @@ public sealed partial class MartialArtsSystem
|
||||
|
||||
private void HandleNeckChop(EntityUid target)
|
||||
{
|
||||
_statusEffect.TryAddStatusEffect<MutedComponent>(target, "Muted", TimeSpan.FromSeconds(20f), true);
|
||||
_statusEffect.TryAddStatusEffectDuration(target, "Muted", TimeSpan.FromSeconds(20f));
|
||||
|
||||
var damage = new DamageSpecifier { DamageDict = { { "Blunt", 15 } } };
|
||||
_damage.TryChangeDamage(target, damage);
|
||||
|
||||
@@ -137,8 +137,11 @@ public sealed class MiningConsoleSystem : EntitySystem
|
||||
|
||||
private EntityUid? EnsureAccount()
|
||||
{
|
||||
var account = EntityQuery<MiningAccountComponent>().FirstOrDefault();
|
||||
return account?.Owner ?? null;
|
||||
var query = EntityQueryEnumerator<MiningAccountComponent>();
|
||||
if (query.MoveNext(out var uid, out _))
|
||||
return uid;
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public void SwitchGlobalMode(EntityUid console, MiningMode mode)
|
||||
|
||||
@@ -26,24 +26,22 @@ public sealed partial class SlimeFindFoodOperator : HTNOperator
|
||||
if (!_entMan.TryGetComponent<TransformComponent>(owner, out var ownerTransform))
|
||||
return (false, null);
|
||||
|
||||
var food = _entMan.EntityQuery<SlimeFoodComponent>()
|
||||
.Select(x => x.Owner)
|
||||
.Where(x =>
|
||||
{
|
||||
if (!_entMan.TryGetComponent<TransformComponent>(x, out var xform))
|
||||
return false;
|
||||
EntityUid food = default;
|
||||
float minDistance = float.MaxValue;
|
||||
|
||||
return xform.Coordinates.TryDistance(_entMan, ownerTransform.Coordinates, out var dist) &&
|
||||
dist <= range;
|
||||
})
|
||||
.OrderBy(x =>
|
||||
var query = _entMan.EntityQueryEnumerator<SlimeFoodComponent, TransformComponent>();
|
||||
while (query.MoveNext(out var uid, out _, out var xform))
|
||||
{
|
||||
if (!xform.Coordinates.TryDistance(_entMan, ownerTransform.Coordinates, out var dist) ||
|
||||
dist > range)
|
||||
continue;
|
||||
|
||||
if (dist < minDistance)
|
||||
{
|
||||
var xform = _entMan.GetComponent<TransformComponent>(x);
|
||||
return xform.Coordinates.TryDistance(_entMan, ownerTransform.Coordinates, out var dist)
|
||||
? dist
|
||||
: float.MaxValue;
|
||||
})
|
||||
.FirstOrDefault();
|
||||
minDistance = dist;
|
||||
food = uid;
|
||||
}
|
||||
}
|
||||
|
||||
if (food == default)
|
||||
return (false, null);
|
||||
|
||||
@@ -29,32 +29,30 @@ public sealed partial class SlimeFindTargetOperator : HTNOperator
|
||||
if (!_entMan.TryGetComponent<TransformComponent>(owner, out var ownerTransform))
|
||||
return (false, null);
|
||||
|
||||
var target = _entMan.EntityQuery<HumanoidAppearanceComponent>()
|
||||
.Select(x => x.Owner)
|
||||
.Where(x =>
|
||||
EntityUid target = default;
|
||||
float minDistance = float.MaxValue;
|
||||
|
||||
var query = _entMan.EntityQueryEnumerator<HumanoidAppearanceComponent, TransformComponent>();
|
||||
while (query.MoveNext(out var uid, out _, out var xform))
|
||||
{
|
||||
if (_entMan.TryGetComponent<SlimeSocialComponent>(owner, out var social) &&
|
||||
social.Friends.Contains(uid))
|
||||
continue;
|
||||
|
||||
if (_entMan.TryGetComponent<MobStateComponent>(uid, out var mobState) &&
|
||||
mobState.CurrentState == MobState.Dead)
|
||||
continue;
|
||||
|
||||
if (!xform.Coordinates.TryDistance(_entMan, ownerTransform.Coordinates, out var dist) ||
|
||||
dist > range)
|
||||
continue;
|
||||
|
||||
if (dist < minDistance)
|
||||
{
|
||||
if (!_entMan.TryGetComponent<TransformComponent>(x, out var xform))
|
||||
return false;
|
||||
|
||||
if (_entMan.TryGetComponent<SlimeSocialComponent>(owner, out var social))
|
||||
if (social.Friends.Contains(x))
|
||||
return false;
|
||||
|
||||
if (_entMan.TryGetComponent<MobStateComponent>(x, out var mobState) &&
|
||||
mobState.CurrentState == MobState.Dead)
|
||||
return false;
|
||||
|
||||
return xform.Coordinates.TryDistance(_entMan, ownerTransform.Coordinates, out var dist) &&
|
||||
dist <= range;
|
||||
})
|
||||
.OrderBy(x =>
|
||||
{
|
||||
var xform = _entMan.GetComponent<TransformComponent>(x);
|
||||
return xform.Coordinates.TryDistance(_entMan, ownerTransform.Coordinates, out var dist)
|
||||
? dist
|
||||
: float.MaxValue;
|
||||
})
|
||||
.FirstOrDefault();
|
||||
minDistance = dist;
|
||||
target = uid;
|
||||
}
|
||||
}
|
||||
|
||||
if (target == default)
|
||||
return (false, null);
|
||||
|
||||
@@ -43,10 +43,11 @@ public sealed class NightLightningSystem : EntitySystem
|
||||
|
||||
private void UpdateNightLights(EntityUid uid, NightLightningComponent comp)
|
||||
{
|
||||
if (!_cfg.GetCVar(WegaCVars.NightLightEnabled) || !TryComp<TransformComponent>(uid, out var transform))
|
||||
if (!_cfg.GetCVar(WegaCVars.NightLightEnabled))
|
||||
return;
|
||||
|
||||
var station = Name(uid);
|
||||
var transform = Transform(uid);
|
||||
if (IsNightTime() && !comp.IsNight)
|
||||
{
|
||||
var lightEntities = _lookup.GetEntitiesInRange<PointLightComponent>(transform.Coordinates, 500f);
|
||||
|
||||
@@ -46,7 +46,7 @@ public sealed class PainSystem : EntitySystem
|
||||
|
||||
private void OnInit(EntityUid uid, PainComponent component, ComponentInit args)
|
||||
{
|
||||
if (!_proto.TryIndex<PainProfilePrototype>(component.Profile, out var profile))
|
||||
if (!_proto.TryIndex(component.Profile, out var profile))
|
||||
return;
|
||||
|
||||
foreach (var (type, level) in profile.PainTypes)
|
||||
|
||||
@@ -1,25 +1,23 @@
|
||||
using Content.Shared.Actions;
|
||||
using Content.Shared.Alert;
|
||||
using Content.Shared.Maps;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Timing;
|
||||
using Content.Shared._Wega.Resomi;
|
||||
using Content.Shared.Resomi;
|
||||
using Content.Shared.Movement.Components;
|
||||
using Content.Shared.Movement.Systems;
|
||||
using Content.Shared._Wega.Resomi.Abilities;
|
||||
using Content.Shared.Resomi.Abilities;
|
||||
using Content.Shared.Damage.Components;
|
||||
using Robust.Shared.Physics;
|
||||
using Content.Shared.Actions.Components;
|
||||
using Content.Server.Damage.Systems;
|
||||
using Content.Server.Popups;
|
||||
|
||||
namespace Content.Server._Wega.Resomi.Abilities;
|
||||
namespace Content.Server.Resomi.Abilities;
|
||||
|
||||
public sealed class AgillitySkillSystem : SharedAgillitySkillSystem
|
||||
{
|
||||
[Dependency] private readonly SharedActionsSystem _actionsSystem = default!;
|
||||
[Dependency] private readonly SharedActionsSystem _actions = default!;
|
||||
[Dependency] private readonly StaminaSystem _stamina = default!;
|
||||
[Dependency] private readonly PopupSystem _popup = default!;
|
||||
[Dependency] private readonly MovementSpeedModifierSystem _movementSpeedModifier = default!;
|
||||
|
||||
private Entity<ActionComponent> action;
|
||||
private Entity<ActionComponent> _action;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -31,26 +29,26 @@ public sealed class AgillitySkillSystem : SharedAgillitySkillSystem
|
||||
|
||||
private void OnComponentInit(Entity<AgillitySkillComponent> ent, ref ComponentInit args)
|
||||
{
|
||||
_actionsSystem.AddAction(ent.Owner, ref ent.Comp.SwitchAgilityActionEntity, ent.Comp.SwitchAgilityAction, ent.Owner);
|
||||
_actions.AddAction(ent.Owner, ref ent.Comp.SwitchAgilityActionEntity, ent.Comp.SwitchAgilityAction, ent.Owner);
|
||||
}
|
||||
|
||||
private void SwitchAgility(Entity<AgillitySkillComponent> ent, ref SwitchAgillityActionEvent args)
|
||||
{
|
||||
action = args.Action;
|
||||
_action = args.Action;
|
||||
|
||||
if (!ent.Comp.Active)
|
||||
{
|
||||
ActivateAgility(ent, action);
|
||||
ActivateAgility(ent, _action);
|
||||
}
|
||||
else
|
||||
{
|
||||
DeactivateAgility(ent.Owner, ent.Comp, action);
|
||||
DeactivateAgility(ent.Owner, ent.Comp, _action);
|
||||
}
|
||||
}
|
||||
|
||||
private void ActivateAgility(Entity<AgillitySkillComponent> ent, Entity<ActionComponent> action)
|
||||
{
|
||||
if (!TryComp<MovementSpeedModifierComponent>(ent.Owner, out var comp))
|
||||
if (!HasComp<MovementSpeedModifierComponent>(ent.Owner))
|
||||
return;
|
||||
|
||||
_popup.PopupEntity(Loc.GetString("agility-activated-massage"), ent.Owner, ent.Owner);
|
||||
@@ -66,7 +64,7 @@ public sealed class AgillitySkillSystem : SharedAgillitySkillSystem
|
||||
|
||||
private void DeactivateAgility(EntityUid uid, AgillitySkillComponent component, Entity<ActionComponent> action)
|
||||
{
|
||||
if (!TryComp<MovementSpeedModifierComponent>(uid, out var comp))
|
||||
if (!HasComp<MovementSpeedModifierComponent>(uid))
|
||||
return;
|
||||
|
||||
_popup.PopupEntity(Loc.GetString("agility-deactivated-massage"), uid, uid);
|
||||
@@ -103,7 +101,7 @@ public sealed class AgillitySkillSystem : SharedAgillitySkillSystem
|
||||
|
||||
_stamina.TryTakeStamina(uid, resomiComp.StaminaDamagePassive);
|
||||
if (stamina.StaminaDamage > stamina.CritThreshold * 0.50f)
|
||||
DeactivateAgility(uid, resomiComp, action);
|
||||
DeactivateAgility(uid, resomiComp, _action);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,18 @@
|
||||
using Content.Shared._Wega.Resomi.Abilities.Hearing;
|
||||
using Content.Server.Actions;
|
||||
using Content.Shared.Resomi.Abilities.Hearing;
|
||||
|
||||
namespace Content.Server._Wega.Resomi.Abilities;
|
||||
namespace Content.Server.Resomi.Abilities;
|
||||
|
||||
public sealed class ListenUpSkillSystem : SharedListenUpSkillSystem
|
||||
{
|
||||
[Dependency] private readonly ActionsSystem _actionsSystem = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<ListenUpSkillComponent, ComponentInit>(OnComponentInit);
|
||||
}
|
||||
|
||||
private void OnComponentInit(Entity<ListenUpSkillComponent> ent, ref ComponentInit args)
|
||||
{
|
||||
_actionsSystem.AddAction(ent.Owner, ref ent.Comp.SwitchListenUpActionEntity, ent.Comp.SwitchListenUpAction, ent.Owner);
|
||||
|
||||
@@ -1,19 +1,18 @@
|
||||
using Content.Shared._Wega.Resomi.Abilities.Hearing;
|
||||
using Content.Shared.Actions;
|
||||
using Content.Shared.DoAfter;
|
||||
using Content.Shared.Movement.Events;
|
||||
using Content.Shared.Resomi.Abilities.Hearing;
|
||||
using Content.Shared.Popups;
|
||||
using Content.Shared.IdentityManagement;
|
||||
|
||||
namespace Content.Server._Wega.Resomi.Abilities;
|
||||
namespace Content.Server.Resomi.Abilities;
|
||||
|
||||
public sealed class ListenUpSystem : EntitySystem
|
||||
{
|
||||
[Dependency] protected readonly SharedPopupSystem _popup = default!;
|
||||
[Dependency] private readonly SharedPopupSystem _popup = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
SubscribeLocalEvent<ListenUpComponent, ComponentStartup>(OnListenStartup);
|
||||
}
|
||||
|
||||
private void OnListenStartup(Entity<ListenUpComponent> ent, ref ComponentStartup args)
|
||||
{
|
||||
_popup.PopupEntity(Loc.GetString("listen-up-activated-massage", ("name", Identity.Entity(ent.Owner, EntityManager))), ent.Owner);
|
||||
|
||||
@@ -14,6 +14,7 @@ using Content.Server.Hands.Systems;
|
||||
using Content.Shared.Hands.Components;
|
||||
using Content.Shared.Movement.Systems;
|
||||
using Robust.Shared.Random;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Server.Shadow;
|
||||
|
||||
@@ -31,8 +32,7 @@ public sealed class PhotophobiaSystem : EntitySystem
|
||||
[Dependency] private readonly MovementSpeedModifierSystem _speed = default!;
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
|
||||
[ValidatePrototypeId<DamageTypePrototype>]
|
||||
private const string Damage = "Heat";
|
||||
private static readonly ProtoId<DamageTypePrototype> Damage = "Heat";
|
||||
|
||||
// private readonly List<EntityUid> _scratchLights = new();
|
||||
|
||||
|
||||
@@ -7,9 +7,22 @@ namespace Content.Server._Wega.Speech.EntitySystems;
|
||||
|
||||
public sealed class ResomiAccentSystem : EntitySystem
|
||||
{
|
||||
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
|
||||
private static readonly Regex RegexSh = new("ш+", RegexOptions.Compiled);
|
||||
private static readonly Regex RegexShUpper = new("Ш+", RegexOptions.Compiled);
|
||||
private static readonly Regex RegexCh = new("ч+", RegexOptions.Compiled);
|
||||
private static readonly Regex RegexChUpper = new("Ч+", RegexOptions.Compiled);
|
||||
private static readonly Regex RegexR = new("р+", RegexOptions.Compiled);
|
||||
private static readonly Regex RegexRUpper = new("Р+", RegexOptions.Compiled);
|
||||
|
||||
private static readonly List<string> ShReplacements = new() { "шш", "шшш" };
|
||||
private static readonly List<string> ShUpperReplacements = new() { "ШШ", "ШШШ" };
|
||||
private static readonly List<string> ChReplacements = new() { "щщ", "щщщ" };
|
||||
private static readonly List<string> ChUpperReplacements = new() { "ЩЩ", "ЩЩЩ" };
|
||||
private static readonly List<string> RReplacements = new() { "рр", "ррр" };
|
||||
private static readonly List<string> RUpperReplacements = new() { "РР", "РРР" };
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
@@ -20,42 +33,13 @@ public sealed class ResomiAccentSystem : EntitySystem
|
||||
{
|
||||
var message = args.Message;
|
||||
|
||||
// ш => шшш
|
||||
message = Regex.Replace(
|
||||
message,
|
||||
"ш+",
|
||||
_random.Pick(new List<string>() { "шш", "шшш" })
|
||||
);
|
||||
// Ш => ШШШ
|
||||
message = Regex.Replace(
|
||||
message,
|
||||
"Ш+",
|
||||
_random.Pick(new List<string>() { "ШШ", "ШШШ" })
|
||||
);
|
||||
// ч => щщщ
|
||||
message = Regex.Replace(
|
||||
message,
|
||||
"ч+",
|
||||
_random.Pick(new List<string>() { "щщ", "щщщ" })
|
||||
);
|
||||
// Ч => ЩЩЩ
|
||||
message = Regex.Replace(
|
||||
message,
|
||||
"Ч+",
|
||||
_random.Pick(new List<string>() { "ЩЩ", "ЩЩЩ" })
|
||||
);
|
||||
// р => ррр
|
||||
message = Regex.Replace(
|
||||
message,
|
||||
"р+",
|
||||
_random.Pick(new List<string>() { "рр", "ррр" })
|
||||
);
|
||||
// Р => РРР
|
||||
message = Regex.Replace(
|
||||
message,
|
||||
"Р+",
|
||||
_random.Pick(new List<string>() { "РР", "РРР" })
|
||||
);
|
||||
message = RegexSh.Replace(message, _random.Pick(ShReplacements));
|
||||
message = RegexShUpper.Replace(message, _random.Pick(ShUpperReplacements));
|
||||
message = RegexCh.Replace(message, _random.Pick(ChReplacements));
|
||||
message = RegexChUpper.Replace(message, _random.Pick(ChUpperReplacements));
|
||||
message = RegexR.Replace(message, _random.Pick(RReplacements));
|
||||
message = RegexRUpper.Replace(message, _random.Pick(RUpperReplacements));
|
||||
|
||||
args.Message = message;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,11 +27,13 @@ public sealed class DiseaseOutbreakRule : StationEventSystem<DiseaseOutbreakRule
|
||||
base.Started(uid, component, gameRule, args);
|
||||
|
||||
HashSet<EntityUid> stationsToNotify = new();
|
||||
List<DiseaseCarrierComponent> aliveList = new();
|
||||
foreach (var (carrier, mobState) in EntityQuery<DiseaseCarrierComponent, MobStateComponent>())
|
||||
List<Entity<DiseaseCarrierComponent>> aliveList = new();
|
||||
|
||||
var query = EntityQueryEnumerator<DiseaseCarrierComponent, MobStateComponent>();
|
||||
while (query.MoveNext(out var entity, out var carrier, out var mobState))
|
||||
{
|
||||
if (!_mobStateSystem.IsDead(mobState.Owner, mobState))
|
||||
aliveList.Add(carrier);
|
||||
if (!_mobStateSystem.IsDead(entity, mobState))
|
||||
aliveList.Add((entity, carrier));
|
||||
}
|
||||
RobustRandom.Shuffle(aliveList);
|
||||
|
||||
@@ -44,14 +46,14 @@ public sealed class DiseaseOutbreakRule : StationEventSystem<DiseaseOutbreakRule
|
||||
return;
|
||||
|
||||
// Now we give it to people in the list of living disease carriers earlier
|
||||
foreach (var target in aliveList)
|
||||
foreach (var (entity, target) in aliveList)
|
||||
{
|
||||
if (toInfect-- == 0)
|
||||
break;
|
||||
|
||||
_diseaseSystem.TryAddDisease(target.Owner, disease, target);
|
||||
_diseaseSystem.TryAddDisease(entity, disease, target);
|
||||
|
||||
var station = StationSystem.GetOwningStation(target.Owner);
|
||||
var station = StationSystem.GetOwningStation(entity);
|
||||
if (station == null) continue;
|
||||
stationsToNotify.Add((EntityUid)station);
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ using Content.Shared.DoAfter;
|
||||
using Content.Shared.Verbs;
|
||||
using Content.Shared.Strangulation;
|
||||
using Content.Shared.Mobs.Systems;
|
||||
using Content.Shared.Hands.Components;
|
||||
using Content.Shared.Hands;
|
||||
using Content.Shared.Popups;
|
||||
using Content.Shared.Garrotte;
|
||||
@@ -21,8 +20,8 @@ using Robust.Shared.Map;
|
||||
using Robust.Shared.Player;
|
||||
using Content.Shared.IdentityManagement;
|
||||
using Content.Shared.Hands.EntitySystems;
|
||||
using Content.Shared.StatusEffect;
|
||||
using Content.Shared.Speech.Muting;
|
||||
using Content.Shared.StatusEffectNew;
|
||||
|
||||
namespace Content.Server.Strangulation
|
||||
{
|
||||
@@ -108,7 +107,7 @@ namespace Content.Server.Strangulation
|
||||
return;
|
||||
|
||||
var target = args.Target ?? default;
|
||||
_statusEffect.TryAddStatusEffect<MutedComponent>(target, "Muted", TimeSpan.FromSeconds(3f), true);
|
||||
_statusEffect.TryAddStatusEffectDuration(target, "Muted", TimeSpan.FromSeconds(3f));
|
||||
|
||||
if (args.Cancelled)
|
||||
{
|
||||
|
||||
@@ -139,7 +139,7 @@ namespace Content.Server.Medical.Surgery
|
||||
var damages = new List<BodyScannerDamageInfo>();
|
||||
foreach (var (damageId, bodyParts) in operated.InternalDamages)
|
||||
{
|
||||
if (!_prototypeManager.TryIndex<InternalDamagePrototype>(damageId, out var damageProto))
|
||||
if (!_prototypeManager.TryIndex(damageId, out var damageProto))
|
||||
continue;
|
||||
|
||||
damages.Add(new BodyScannerDamageInfo(
|
||||
|
||||
@@ -115,7 +115,7 @@ public sealed partial class SurgerySystem
|
||||
|
||||
// For stacks
|
||||
if (TryComp<StackComponent>(item, out var stack) && stack.Count > 1)
|
||||
_stack.SetCount(item, stack.Count - 1);
|
||||
_stack.ReduceCount(item, 1);
|
||||
|
||||
bool foundMatch = false;
|
||||
float successModifier = 1f;
|
||||
|
||||
@@ -5,7 +5,6 @@ using Content.Shared.Body.Components;
|
||||
using Content.Shared.Body.Organ;
|
||||
using Content.Shared.Body.Part;
|
||||
using Content.Shared.Body.Systems;
|
||||
using Content.Shared.Chat.Prototypes;
|
||||
using Content.Shared.Chemistry.Components;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.Database;
|
||||
|
||||
@@ -46,7 +46,7 @@ public sealed class TapeRecorderSystem : SharedTapeRecorderSystem
|
||||
voice.NameOverride = message.Name ?? ent.Comp.DefaultName;
|
||||
// TODO: mimic the exact string chosen when the message was recorded
|
||||
var verb = message.Verb ?? SharedChatSystem.DefaultSpeechVerb;
|
||||
speech.SpeechVerb = _proto.Index<SpeechVerbPrototype>(verb);
|
||||
speech.SpeechVerb = _proto.Index(verb);
|
||||
//Play the message
|
||||
_chat.TrySendInGameICMessage(ent, message.Message, InGameICChatType.Speak, false);
|
||||
}
|
||||
@@ -113,7 +113,7 @@ public sealed class TapeRecorderSystem : SharedTapeRecorderSystem
|
||||
foreach (var message in cassette.Comp.RecordedData)
|
||||
{
|
||||
var name = message.Name ?? ent.Comp.DefaultName;
|
||||
var time = TimeSpan.FromSeconds((double)message.Timestamp);
|
||||
var time = TimeSpan.FromSeconds(message.Timestamp);
|
||||
|
||||
text.AppendLine(Loc.GetString("tape-recorder-print-message-text",
|
||||
("time", time.ToString(@"hh\:mm\:ss")),
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace Content.Server.Traits.Assorted;
|
||||
public sealed partial class UncontrollableCoughComponent : Component
|
||||
{
|
||||
[DataField("emote", required: true, customTypeSerializer: typeof(PrototypeIdSerializer<EmotePrototype>))]
|
||||
public string EmoteId = String.Empty;
|
||||
public string EmoteId = string.Empty;
|
||||
|
||||
[DataField("timeBetweenIncidents", required: true)]
|
||||
public Vector2 TimeBetweenIncidents { get; set; }
|
||||
|
||||
@@ -10,7 +10,6 @@ using Content.Server.Prayer;
|
||||
using Content.Server.Pinpointer;
|
||||
using Content.Shared.Actions.Components;
|
||||
using Content.Shared.Body.Components;
|
||||
using Content.Shared.Chat.Prototypes;
|
||||
using Content.Shared.Chemistry.Components;
|
||||
using Content.Shared.Clothing;
|
||||
using Content.Shared.CombatMode;
|
||||
@@ -34,7 +33,6 @@ using Content.Shared.Prying.Components;
|
||||
using Content.Shared.Roles;
|
||||
using Content.Shared.Stealth;
|
||||
using Content.Shared.Stealth.Components;
|
||||
using Content.Shared.StatusEffect;
|
||||
using Content.Shared.Standing;
|
||||
using Content.Shared.Vampire;
|
||||
using Content.Shared.Vampire.Components;
|
||||
@@ -55,6 +53,7 @@ using Content.Shared.Damage.Systems;
|
||||
using Content.Shared.Flash.Components;
|
||||
using Content.Shared.NullRod.Components;
|
||||
using Content.Shared.Surgery.Components;
|
||||
using Content.Shared.StatusEffectNew;
|
||||
|
||||
namespace Content.Server.Vampire;
|
||||
|
||||
@@ -80,6 +79,8 @@ public sealed partial class VampireSystem
|
||||
[Dependency] private readonly NavMapSystem _navMap = default!;
|
||||
[Dependency] private readonly MovementModStatusSystem _movementMod = default!;
|
||||
|
||||
private static readonly EntProtoId RejuvenateAdvanced = "ActionVampireRejuvenateAdvanced";
|
||||
|
||||
private void InitializePowers()
|
||||
{
|
||||
//Select Class
|
||||
@@ -196,7 +197,7 @@ public sealed partial class VampireSystem
|
||||
_action.RemoveAction(uid, actionId);
|
||||
_container.Remove(actionId, container);
|
||||
|
||||
_action.AddAction(uid, "ActionVampireRejuvenateAdvanced");
|
||||
_action.AddAction(uid, RejuvenateAdvanced);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -256,7 +257,7 @@ public sealed partial class VampireSystem
|
||||
if (HasComp<BibleUserComponent>(target) && !component.TruePowerActive)
|
||||
{
|
||||
_stun.TryUpdateParalyzeDuration(vampire, TimeSpan.FromSeconds(5f));
|
||||
_chat.TryEmoteWithoutChat(vampire, _prototypeManager.Index<EmotePrototype>("Scream"), true);
|
||||
_chat.TryEmoteWithoutChat(vampire, _prototypeManager.Index(Scream), true);
|
||||
_damage.TryChangeDamage(vampire, VampireComponent.HolyDamage);
|
||||
return;
|
||||
}
|
||||
@@ -1465,13 +1466,10 @@ public sealed partial class VampireSystem
|
||||
#endregion
|
||||
|
||||
#region Other Methods
|
||||
public void RemoveKnockdown(EntityUid uid, StatusEffectsComponent? status = null)
|
||||
public void RemoveKnockdown(EntityUid uid)
|
||||
{
|
||||
if (!Resolve(uid, ref status, false))
|
||||
return;
|
||||
|
||||
_statusEffect.TryRemoveStatusEffect(uid, "KnockedDown", status);
|
||||
_statusEffect.TryRemoveStatusEffect(uid, "Stun", status);
|
||||
_statusEffect.TryRemoveStatusEffect(uid, "KnockedDown");
|
||||
_statusEffect.TryRemoveStatusEffect(uid, "Stun");
|
||||
}
|
||||
|
||||
private void CoolSurroundingAtmosphere(EntityUid uid)
|
||||
|
||||
@@ -72,6 +72,8 @@ public sealed partial class VampireSystem : SharedVampireSystem
|
||||
[Dependency] private readonly EntityLookupSystem _entityLookup = default!;
|
||||
[Dependency] private readonly SharedHandsSystem _hands = default!;
|
||||
|
||||
private static readonly ProtoId<EmotePrototype> Scream = "Scream";
|
||||
|
||||
private readonly Dictionary<EntityUid, Dictionary<EntityUid, FixedPoint2>> _bloodConsumedTracker = new();
|
||||
private bool _isDamageBeingHandled = false;
|
||||
|
||||
@@ -143,7 +145,7 @@ public sealed partial class VampireSystem : SharedVampireSystem
|
||||
{
|
||||
flammable.FireStacks = flammable.MaximumFireStacks;
|
||||
_flammable.Ignite(vampire.Owner, uid);
|
||||
_chat.TryEmoteWithoutChat(vampire, _prototypeManager.Index<EmotePrototype>("Scream"), true);
|
||||
_chat.TryEmoteWithoutChat(vampire, _prototypeManager.Index(Scream), true);
|
||||
_popup.PopupEntity(Loc.GetString("vampire-holy-point"), vampire.Owner, vampire.Owner, PopupType.LargeCaution);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ using Content.Shared.Construction.Components;
|
||||
using Content.Shared.Xenobiology;
|
||||
using Content.Shared.Mobs.Systems;
|
||||
using Content.Shared.Body.Components;
|
||||
using Robust.Shared.Audio;
|
||||
|
||||
namespace Content.Server.Xenobiology
|
||||
{
|
||||
@@ -122,7 +123,7 @@ namespace Content.Server.Xenobiology
|
||||
|
||||
if (_random.Prob(0.15f))
|
||||
{
|
||||
_audio.PlayPvs("/Audio/Voice/Slime/slime_squish.ogg", uid);
|
||||
_audio.PlayPvs(new SoundPathSpecifier("/Audio/Voice/Slime/slime_squish.ogg"), uid);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -200,7 +201,7 @@ namespace Content.Server.Xenobiology
|
||||
component.Reinforced = slimeGrowth.Reinforced;
|
||||
|
||||
_jittering.AddJitter(extractor, -10, 100);
|
||||
_audio.PlayPvs("/Audio/Machines/reclaimer_startup.ogg", extractor);
|
||||
_audio.PlayPvs(new SoundPathSpecifier("/Audio/Machines/reclaimer_startup.ogg"), extractor);
|
||||
_ambient.SetAmbience(extractor, true);
|
||||
|
||||
if (TryComp<BloodstreamComponent>(slime, out var bloodstream))
|
||||
|
||||
@@ -12,8 +12,7 @@ public sealed class SlimeGrowthSystem : SharedSlimeGrowthSystem
|
||||
{
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
|
||||
[ValidatePrototypeId<EntityPrototype>]
|
||||
private const string DefaultSlime = "MobXenoSlimeGray";
|
||||
private static readonly EntProtoId DefaultSlime = "MobXenoSlimeGray";
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
|
||||
@@ -101,13 +101,13 @@ public sealed class SlimeAnalyzerSystem : EntitySystem
|
||||
|
||||
private void OnInsertedIntoContainer(Entity<SlimeAnalyzerComponent> analyzer, ref EntGotInsertedIntoContainerMessage args)
|
||||
{
|
||||
if (analyzer.Comp.ScannedEntity is { } target)
|
||||
if (analyzer.Comp.ScannedEntity is { } _)
|
||||
_toggle.TryDeactivate(analyzer.Owner);
|
||||
}
|
||||
|
||||
private void OnDropped(Entity<SlimeAnalyzerComponent> analyzer, ref DroppedEvent args)
|
||||
{
|
||||
if (analyzer.Comp.ScannedEntity is { } target)
|
||||
if (analyzer.Comp.ScannedEntity is { } _)
|
||||
_toggle.TryDeactivate(analyzer.Owner);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ using Content.Shared.Wieldable.Components;
|
||||
using Robust.Shared.Audio.Systems;
|
||||
using Robust.Shared.Collections;
|
||||
using Robust.Shared.Timing;
|
||||
using Content.Shared._Wega.Resomi.Abilities;
|
||||
using Content.Shared.Resomi.Abilities; // Corvax-Wega-Resomi
|
||||
|
||||
namespace Content.Shared.Wieldable;
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
using Content.Shared.Actions;
|
||||
using Content.Shared.Alert;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Prototypes;
|
||||
namespace Content.Shared._Wega.Android;
|
||||
|
||||
namespace Content.Shared.Android;
|
||||
|
||||
public sealed partial class ToggleLockActionEvent : InstantActionEvent;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ using Content.Shared.Movement.Components;
|
||||
using Content.Shared.Movement.Systems;
|
||||
using Content.Shared.Wires;
|
||||
|
||||
namespace Content.Shared._Wega.Android;
|
||||
namespace Content.Shared.Android;
|
||||
|
||||
public abstract partial class SharedAndroidSystem : EntitySystem
|
||||
{
|
||||
@@ -45,10 +45,7 @@ public abstract partial class SharedAndroidSystem : EntitySystem
|
||||
if (!TryComp<WiresPanelComponent>(uid, out var panel))
|
||||
return true;
|
||||
|
||||
if (!panel.Open)
|
||||
return false;
|
||||
|
||||
if (user != null && user == uid)
|
||||
if (!panel.Open || user != null && user == uid)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Content.Shared.StatusIcon;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Prototypes;
|
||||
@@ -29,20 +30,11 @@ public sealed partial class BloodCultistComponent : Component
|
||||
[DataField]
|
||||
public int Empowering = 0;
|
||||
|
||||
[ValidatePrototypeId<EntityPrototype>]
|
||||
public static readonly string CultObjective = "ActionBloodCultObjective";
|
||||
|
||||
[ValidatePrototypeId<EntityPrototype>]
|
||||
public static readonly string CultCommunication = "ActionBloodCultComms";
|
||||
|
||||
[ValidatePrototypeId<EntityPrototype>]
|
||||
public static readonly string BloodMagic = "ActionBloodMagic";
|
||||
|
||||
[ValidatePrototypeId<EntityPrototype>]
|
||||
public static readonly string RecallBloodDagger = "ActionRecallBloodDagger";
|
||||
|
||||
[ValidatePrototypeId<EntityPrototype>]
|
||||
public static readonly string RecallBloodSpear = "RecallBloodCultSpear";
|
||||
public static readonly EntProtoId CultObjective = "ActionBloodCultObjective";
|
||||
public static readonly EntProtoId CultCommunication = "ActionBloodCultComms";
|
||||
public static readonly EntProtoId BloodMagic = "ActionBloodMagic";
|
||||
public static readonly EntProtoId RecallBloodDagger = "ActionRecallBloodDagger";
|
||||
public static readonly EntProtoId RecallBloodSpear = "RecallBloodCultSpear";
|
||||
|
||||
[DataField("cultistStatusIcon")]
|
||||
public ProtoId<FactionIconPrototype> StatusIcon { get; set; } = "BloodCultistFaction";
|
||||
@@ -102,11 +94,11 @@ public sealed partial class BloodStructureComponent : Component
|
||||
[ViewVariables(VVAccess.ReadOnly), DataField]
|
||||
public TimeSpan ActivateTime = TimeSpan.Zero;
|
||||
|
||||
[DataField("fixture", required: true)]
|
||||
[DataField("fixture")]
|
||||
public string FixtureId = string.Empty;
|
||||
|
||||
[DataField]
|
||||
public string Sound = string.Empty;
|
||||
public SoundSpecifier? Sound { get; private set; }
|
||||
|
||||
[DataField]
|
||||
public bool CanInteract = true;
|
||||
|
||||
@@ -28,10 +28,10 @@ public abstract class SharedBloodCultSystem : EntitySystem
|
||||
continue;
|
||||
|
||||
var protoId = meta.EntityPrototype?.ID;
|
||||
if (protoId == BloodCultistComponent.CultObjective
|
||||
|| protoId == BloodCultistComponent.CultCommunication
|
||||
|| protoId == BloodCultistComponent.BloodMagic
|
||||
|| protoId == BloodCultistComponent.RecallBloodDagger)
|
||||
if (protoId == BloodCultistComponent.CultObjective.Id
|
||||
|| protoId == BloodCultistComponent.CultCommunication.Id
|
||||
|| protoId == BloodCultistComponent.BloodMagic.Id
|
||||
|| protoId == BloodCultistComponent.RecallBloodDagger.Id)
|
||||
{
|
||||
_action.RemoveAction(cultist, actionId);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@ namespace Content.Shared.Body.Systems;
|
||||
public sealed class HeartSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||
[Dependency] private readonly SharedBloodstreamSystem _bloodstreamSystem = default!;
|
||||
[Dependency] private readonly AlertsSystem _alertsSystem = default!;
|
||||
[Dependency] private readonly DamageableSystem _damageableSystem = default!;
|
||||
[Dependency] private readonly MobStateSystem _mobStateSystem = default!;
|
||||
|
||||
@@ -3,7 +3,6 @@ using Robust.Shared.Audio;
|
||||
namespace Content.Shared.CartridgeLoader.Cartridges;
|
||||
|
||||
[RegisterComponent, AutoGenerateComponentPause]
|
||||
// [Access(typeof(SharedNanoChatCartridgeSystem))]
|
||||
public sealed partial class NanoChatCartridgeComponent : Component
|
||||
{
|
||||
[DataField]
|
||||
|
||||
@@ -58,13 +58,12 @@ public sealed class SharedDirtSystem : EntitySystem
|
||||
float dirtPercentage = Math.Clamp(entity.Comp.CurrentDirtLevel.Float() / MaxDirtLevel * 100f, 0f, 100f);
|
||||
string colorHex = entity.Comp.DirtColor.ToHex();
|
||||
|
||||
string dirtLevel;
|
||||
if (dirtPercentage < 30)
|
||||
dirtLevel = Loc.GetString("dirt-examined-level-low");
|
||||
else if (dirtPercentage < 70)
|
||||
dirtLevel = Loc.GetString("dirt-examined-level-medium");
|
||||
else
|
||||
dirtLevel = Loc.GetString("dirt-examined-level-high");
|
||||
string dirtLevel = dirtPercentage switch
|
||||
{
|
||||
< 30 => Loc.GetString("dirt-examined-level-low"),
|
||||
< 70 => Loc.GetString("dirt-examined-level-medium"),
|
||||
_ => Loc.GetString("dirt-examined-level-high")
|
||||
};
|
||||
|
||||
args.PushMarkup(
|
||||
Loc.GetString("dirt-examined-message", ("color", colorHex), ("percentage", (int)dirtPercentage), ("level", dirtLevel))
|
||||
|
||||
@@ -9,7 +9,7 @@ public abstract class SharedDiseaseSystem : EntitySystem
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
[Dependency] private readonly ISerializationManager _serializationManager = default!;
|
||||
|
||||
public Queue<EntityUid> _addQueue = new();
|
||||
public Queue<EntityUid> AddQueue = new();
|
||||
|
||||
/// <summary>
|
||||
/// Adds a disease to a target
|
||||
@@ -20,7 +20,7 @@ public abstract class SharedDiseaseSystem : EntitySystem
|
||||
/// </summary>
|
||||
public void TryAddDisease(EntityUid host, DiseasePrototype addedDisease, DiseaseCarrierComponent? target = null)
|
||||
{
|
||||
if (!Resolve(host, ref target, false))
|
||||
if (!Resolve(host, ref target))
|
||||
return;
|
||||
|
||||
foreach (var disease in target.AllDiseases)
|
||||
@@ -30,11 +30,11 @@ public abstract class SharedDiseaseSystem : EntitySystem
|
||||
}
|
||||
|
||||
var freshDisease = _serializationManager.CreateCopy(addedDisease);
|
||||
|
||||
if (freshDisease == null) return;
|
||||
if (freshDisease == null)
|
||||
return;
|
||||
|
||||
target.Diseases.Add(freshDisease);
|
||||
_addQueue.Enqueue(target.Owner);
|
||||
AddQueue.Enqueue(host);
|
||||
}
|
||||
|
||||
public void TryAddDisease(EntityUid host, string? addedDisease, DiseaseCarrierComponent? target = null)
|
||||
|
||||
@@ -4,7 +4,6 @@ using Robust.Shared.Serialization;
|
||||
namespace Content.Shared.ERP.Components
|
||||
{
|
||||
[RegisterComponent]
|
||||
[ComponentProtoName("SexToy")]
|
||||
public sealed partial class SexToyComponent : Component
|
||||
{
|
||||
[DataField]
|
||||
@@ -12,13 +11,11 @@ namespace Content.Shared.ERP.Components
|
||||
}
|
||||
|
||||
[RegisterComponent]
|
||||
[ComponentProtoName("Vibrator")]
|
||||
public sealed partial class VibratorComponent : Component
|
||||
{
|
||||
}
|
||||
|
||||
[RegisterComponent]
|
||||
[ComponentProtoName("Strapon")]
|
||||
public sealed partial class StraponComponent : Component
|
||||
{
|
||||
}
|
||||
|
||||
@@ -11,10 +11,10 @@ public sealed partial class ImpulseFlashComponent : Component
|
||||
{
|
||||
[DataField]
|
||||
public float Range = 1.0f;
|
||||
|
||||
[DataField]
|
||||
|
||||
[DataField]
|
||||
public float FlashCharge = 100f;
|
||||
|
||||
|
||||
[DataField]
|
||||
public EntProtoId FlashAction = "ActionToggleFlashHelm";
|
||||
|
||||
@@ -26,7 +26,7 @@ public sealed partial class ImpulseFlashComponent : Component
|
||||
|
||||
[DataField]
|
||||
public float Probability = 1.0f;
|
||||
|
||||
[DataField]
|
||||
|
||||
[DataField]
|
||||
public float SlowTo = 0.5f;
|
||||
}
|
||||
|
||||
@@ -6,8 +6,7 @@ namespace Content.Shared.Genetics;
|
||||
[RegisterComponent]
|
||||
public sealed partial class HulkComponent : Component
|
||||
{
|
||||
[ValidatePrototypeId<EntityPrototype>]
|
||||
public readonly string[] ActionPrototypes = new[]
|
||||
public readonly EntProtoId[] ActionPrototypes = new EntProtoId[]
|
||||
{
|
||||
"ActionHulkCharge"
|
||||
};
|
||||
@@ -18,14 +17,13 @@ public sealed partial class HulkComponent : Component
|
||||
[RegisterComponent]
|
||||
public sealed partial class HulkGenComponent : Component
|
||||
{
|
||||
[ValidatePrototypeId<EntityPrototype>]
|
||||
public readonly string ActionPrototype = "ActionHulkTransformation";
|
||||
public readonly EntProtoId ActionPrototype = "ActionHulkTransformation";
|
||||
|
||||
public EntityUid? ActionEntity { get; set; }
|
||||
|
||||
[DataField, ValidatePrototypeId<PolymorphPrototype>]
|
||||
public string PolymorphProto = "HulkPolymorph";
|
||||
[DataField]
|
||||
public ProtoId<PolymorphPrototype> PolymorphProto = "HulkPolymorph";
|
||||
|
||||
[DataField, ValidatePrototypeId<PolymorphPrototype>]
|
||||
public string PolymorphAltProto = "HulkPolymorphAlt";
|
||||
[DataField]
|
||||
public ProtoId<PolymorphPrototype> PolymorphAltProto = "HulkPolymorphAlt";
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace Content.Shared.Genetics;
|
||||
public sealed partial class DnaModifierComponent : Component
|
||||
{
|
||||
[ViewVariables(VVAccess.ReadOnly), DataField("uniqueIdentifiers"), AutoNetworkedField]
|
||||
public UniqueIdentifiersPrototype? UniqueIdentifiers { get; set; } = default!;
|
||||
public UniqueIdentifiersData? UniqueIdentifiers { get; set; } = default!;
|
||||
|
||||
[ViewVariables(VVAccess.ReadOnly), AutoNetworkedField]
|
||||
public List<EnzymesPrototypeInfo>? EnzymesPrototypes { get; set; } = default!;
|
||||
@@ -16,9 +16,9 @@ public sealed partial class DnaModifierComponent : Component
|
||||
[ViewVariables(VVAccess.ReadOnly), DataField("instability")]
|
||||
public int Instability { get; set; } = 0;
|
||||
|
||||
[ValidatePrototypeId<EntityPrototype>, ViewVariables(VVAccess.ReadOnly), DataField]
|
||||
public string Upper = string.Empty;
|
||||
[ViewVariables(VVAccess.ReadOnly), DataField]
|
||||
public EntProtoId? Upper = default!;
|
||||
|
||||
[ValidatePrototypeId<EntityPrototype>, ViewVariables(VVAccess.ReadOnly), DataField]
|
||||
public string Lowest = string.Empty;
|
||||
[ViewVariables(VVAccess.ReadOnly), DataField]
|
||||
public EntProtoId? Lowest = default!;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ public sealed partial class DnaModifierInjectorComponent : Component
|
||||
{
|
||||
|
||||
[ViewVariables(VVAccess.ReadOnly), DataField("uniqueIdentifiers")]
|
||||
public UniqueIdentifiersPrototype? UniqueIdentifiers { get; set; } = default!;
|
||||
public UniqueIdentifiersData? UniqueIdentifiers { get; set; } = default!;
|
||||
|
||||
[ViewVariables(VVAccess.ReadOnly)]
|
||||
public List<EnzymesPrototypeInfo>? EnzymesPrototypes { get; set; } = default!;
|
||||
|
||||
@@ -7,17 +7,16 @@ namespace Content.Shared.Genetics;
|
||||
public sealed class EnzymeInfo
|
||||
{
|
||||
public string SampleName { get; set; } = string.Empty;
|
||||
public UniqueIdentifiersPrototype? Identifier { get; set; }
|
||||
public UniqueIdentifiersData? Identifier { get; set; }
|
||||
public List<EnzymesPrototypeInfo>? Info { get; set; }
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
return new EnzymeInfo
|
||||
{
|
||||
SampleName = this.SampleName,
|
||||
Identifier = this.Identifier != null
|
||||
? (UniqueIdentifiersPrototype)this.Identifier.Clone() : null,
|
||||
Info = this.Info?.Select(e => (EnzymesPrototypeInfo)e.Clone()).ToList()
|
||||
SampleName = SampleName,
|
||||
Identifier = Identifier != null ? Identifier.Clone(Identifier) : null,
|
||||
Info = Info?.Select(e => (EnzymesPrototypeInfo)e.Clone()).ToList()
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -33,9 +32,9 @@ public sealed class EnzymesPrototypeInfo
|
||||
{
|
||||
return new EnzymesPrototypeInfo
|
||||
{
|
||||
EnzymesPrototypeId = this.EnzymesPrototypeId,
|
||||
HexCode = (string[])this.HexCode.Clone(),
|
||||
Order = this.Order
|
||||
EnzymesPrototypeId = EnzymesPrototypeId,
|
||||
HexCode = (string[])HexCode.Clone(),
|
||||
Order = Order
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user