Skip to content

Commit

Permalink
updated to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
Eagle-0 committed Aug 8, 2024
2 parents bb36a71 + ba9a937 commit b9f4960
Show file tree
Hide file tree
Showing 485 changed files with 4,626 additions and 495 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
using Robust.Client.GameObjects;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface;
using Content.Client.UserInterface.Fragments;
using Content.Shared.CartridgeLoader.Cartridges;
using Content.Shared.CartridgeLoader;

namespace Content.Client.Nyanotrasen.CartridgeLoader.Cartridges;
namespace Content.Client.CartridgeLoader.Cartridges;

public sealed partial class GlimmerMonitorUi : UIFragment
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<cartridges:GlimmerMonitorUiFragment xmlns:cartridges="clr-namespace:Content.Client.Nyanotrasen.CartridgeLoader.Cartridges"
<cartridges:GlimmerMonitorUiFragment xmlns:cartridges="clr-namespace:Content.Client.CartridgeLoader.Cartridges"
xmlns="https://spacestation14.io" Margin="1 0 2 0">
<PanelContainer StyleClasses="BackgroundDark"></PanelContainer>
<BoxContainer Name="SettingsBox" Orientation="Horizontal" HorizontalExpand="True" VerticalExpand="False">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using System.Linq;
using System.Numerics;
using Content.Client.Nyanotrasen.UserInterface;
using Content.Client.UserInterface;
using Robust.Client.AutoGenerated;
using Robust.Client.ResourceManagement;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;

namespace Content.Client.Nyanotrasen.CartridgeLoader.Cartridges;
namespace Content.Client.CartridgeLoader.Cartridges;

[GenerateTypedNameReferences]
public sealed partial class GlimmerMonitorUiFragment : BoxContainer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using Content.Client.Chat.Managers;
using Robust.Client.Player;

namespace Content.Client.Nyanotrasen.Chat
namespace Content.Client.Chat
{
public sealed class PsionicChatUpdateSystem : EntitySystem
{
Expand Down
47 changes: 47 additions & 0 deletions Content.Client/Eye/PenLight/UI/PenLightBoundUserInterface.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
using Content.Shared.Medical;
using JetBrains.Annotations;
using Robust.Client.GameObjects;

namespace Content.Client.Eye.PenLight.UI
{
[UsedImplicitly]
public sealed class PenLightBoundUserInterface : BoundUserInterface
{
[ViewVariables]
private PenLightWindow? _window;

public PenLightBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) { }

protected override void Open()
{
base.Open();
_window = new PenLightWindow
{
Title = EntMan.GetComponent<MetaDataComponent>(Owner).EntityName,
};
_window.OnClose += Close;
_window.OpenCentered();
}

protected override void ReceiveMessage(BoundUserInterfaceMessage message)
{
if (_window == null
|| message is not PenLightUserMessage cast)
return;

_window.Diagnose(cast);
}

protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
if (!disposing)
return;

if (_window != null)
_window.OnClose -= Close;

_window?.Dispose();
}
}
}
11 changes: 11 additions & 0 deletions Content.Client/Eye/PenLight/UI/PenLightWindow.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<controls:FancyWindow xmlns="https://spacestation14.io"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
Title="{Loc 'pen-light-exam-title'}"
SetSize="0 -300">
<ScrollContainer VerticalExpand="True">
<BoxContainer Name="RootContainer" Orientation="Vertical" HorizontalExpand="True">
<Label Name="NoPatientDataText" Text="{Loc 'pen-light-window-no-patient-data-text'}" Visible="False"/>
<Label Name="ExamDataLabel"/>
</BoxContainer>
</ScrollContainer>
</controls:FancyWindow>
78 changes: 78 additions & 0 deletions Content.Client/Eye/PenLight/UI/PenLightWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
using Content.Client.UserInterface.Controls;
using Content.Shared.Damage;
using Content.Shared.IdentityManagement;
using Content.Shared.Medical;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.XAML;
using System.Text;


namespace Content.Client.Eye.PenLight.UI
{
[GenerateTypedNameReferences]
public sealed partial class PenLightWindow : FancyWindow
{
private readonly IEntityManager _entityManager;
private const int LightHeight = 150;
private const int LightWidth = 900;

public PenLightWindow()
{
RobustXamlLoader.Load(this);

var dependencies = IoCManager.Instance!;
_entityManager = dependencies.Resolve<IEntityManager>();
}
public void Diagnose(PenLightUserMessage msg)
{
var target = _entityManager.GetEntity(msg.TargetEntity);

if (target == null || !_entityManager.TryGetComponent<DamageableComponent>(target, out var damageable))
{
NoPatientDataText.Visible = true;
ExamDataLabel.Text = string.Empty;
return;
}

NoPatientDataText.Visible = false;


string entityName = Loc.GetString("pen-light-window-entity-unknown-text");
if (_entityManager.HasComponent<MetaDataComponent>(target.Value))
entityName = Identity.Name(target.Value, _entityManager);

var sb = new StringBuilder();
sb.AppendLine(Loc.GetString("pen-light-window-entity-eyes-text", ("entityName", entityName)));

// Check if Blind and return early if true
if (msg.Blind == true)
{
sb.AppendLine(Loc.GetString("pen-light-exam-blind-text"));
ExamDataLabel.Text = sb.ToString();
SetHeight = LightHeight;
SetWidth = LightWidth;
return;
}
// EyeDamage
if (msg.EyeDamage == true)
sb.AppendLine(Loc.GetString("pen-light-exam-eyedamage-text"));

// Drunk
if (msg.Drunk == true)
sb.AppendLine(Loc.GetString("pen-light-exam-drunk-text"));

// Hallucinating
if (msg.SeeingRainbows == true)
sb.AppendLine(Loc.GetString("pen-light-exam-hallucinating-text"));

// Healthy
if (msg.Healthy == true)
sb.AppendLine(Loc.GetString("pen-light-exam-healthy-text"));

ExamDataLabel.Text = sb.ToString();

SetHeight = LightHeight;
SetWidth = LightWidth;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Robust.Client.ResourceManagement;
using Robust.Client.UserInterface;

namespace Content.Client.Nyanotrasen.UserInterface;
namespace Content.Client.UserInterface;

public sealed class GlimmerGraph : Control
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
using Robust.Shared.Replays;
using Robust.Shared.Timing;
using Robust.Shared.Utility;
using Content.Client.Nyanotrasen.Chat; //Nyano - Summary: chat namespace.

namespace Content.Client.UserInterface.Systems.Chat;

Expand Down
11 changes: 5 additions & 6 deletions Content.Server/Atmos/EntitySystems/BarotraumaSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,11 @@ public override void Update(float frameTime)
var damageScale = MathF.Min(((pressure / Atmospherics.HazardHighPressure) - 1) * Atmospherics.PressureDamageCoefficient, Atmospherics.MaxHighPressureDamage);

_damageableSystem.TryChangeDamage(uid, barotrauma.Damage * damageScale, true, false);

if (!barotrauma.TakingDamage)
{
barotrauma.TakingDamage = true;
_adminLogger.Add(LogType.Barotrauma, $"{ToPrettyString(uid):entity} started taking high pressure damage");
}
_alertsSystem.ShowAlert(uid, AlertType.HighPressure, 2);
}
else
Expand All @@ -258,11 +262,6 @@ public override void Update(float frameTime)
barotrauma.TakingDamage = false;
_adminLogger.Add(LogType.Barotrauma, $"{ToPrettyString(uid):entity} stopped taking pressure damage");
}
if (!barotrauma.TakingDamage)
{
barotrauma.TakingDamage = true;
_adminLogger.Add(LogType.Barotrauma, $"{ToPrettyString(uid):entity} started taking high pressure damage");
}
// Set correct alert.
switch (pressure)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ private bool IsHeater(GasThermoMachineComponent comp)

private void OnToggleMessage(EntityUid uid, GasThermoMachineComponent thermoMachine, GasThermomachineToggleMessage args)
{
var powerState = _power.TogglePower(uid);
var powerState = _power.TryTogglePower(uid);
_adminLogger.Add(LogType.AtmosPowerChanged, $"{ToPrettyString(args.Session.AttachedEntity)} turned {(powerState ? "On" : "Off")} {ToPrettyString(uid)}");
DirtyUI(uid, thermoMachine);
}
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Atmos/Portable/SpaceHeaterSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ private void OnToggle(EntityUid uid, SpaceHeaterComponent spaceHeater, SpaceHeat
if (!Resolve(uid, ref powerReceiver))
return;

_power.TogglePower(uid);
_power.TryTogglePower(uid);

UpdateAppearance(uid);
DirtyUI(uid, spaceHeater);
Expand Down
16 changes: 15 additions & 1 deletion Content.Server/Body/Components/BloodstreamComponent.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Content.Server.Body.Systems;
using Content.Server.Chemistry.EntitySystems;
using Content.Server.Traits.Assorted;
using Content.Shared.Chemistry.Components;
using Content.Shared.Chemistry.Reagent;
using Content.Shared.Damage;
Expand All @@ -11,7 +12,7 @@

namespace Content.Server.Body.Components
{
[RegisterComponent, Access(typeof(BloodstreamSystem), typeof(ReactionMixerSystem))]
[RegisterComponent, Access(typeof(BloodstreamSystem), typeof(ReactionMixerSystem), typeof(BloodDeficiencySystem), typeof(HemophiliaSystem))]
public sealed partial class BloodstreamComponent : Component
{
public static string DefaultChemicalsSolutionName = "chemicals";
Expand Down Expand Up @@ -171,5 +172,18 @@ public sealed partial class BloodstreamComponent : Component
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
public TimeSpan StatusTime;

/// <summary>
/// If this is true, the entity will not passively regenerate blood,
/// and instead will slowly lose blood.
/// </summary>
[DataField]
public bool HasBloodDeficiency = false;

/// <summary>
/// How much reagent of blood should be removed with blood deficiency in each update interval?
/// </summary>
[DataField]
public FixedPoint2 BloodDeficiencyLossAmount;
}
}
22 changes: 20 additions & 2 deletions Content.Server/Body/Systems/BloodstreamSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,14 @@ public override void Update(float frameTime)
if (!_solutionContainerSystem.ResolveSolution(uid, bloodstream.BloodSolutionName, ref bloodstream.BloodSolution, out var bloodSolution))
continue;

// Adds blood to their blood level if it is below the maximum; Blood regeneration. Must be alive.
if (bloodSolution.Volume < bloodSolution.MaxVolume && !_mobStateSystem.IsDead(uid))
// Removes blood for Blood Deficiency constantly.
if (bloodstream.HasBloodDeficiency)
{
if (!_mobStateSystem.IsDead(uid))
RemoveBlood(uid, bloodstream.BloodDeficiencyLossAmount, bloodstream);
}
// Adds blood to their blood level if it is below the maximum.
else if (bloodSolution.Volume < bloodSolution.MaxVolume && !_mobStateSystem.IsDead(uid))
{
TryModifyBloodLevel(uid, bloodstream.BloodRefreshAmount, bloodstream);
}
Expand Down Expand Up @@ -472,4 +478,16 @@ public void ChangeBloodReagent(EntityUid uid, string reagent, BloodstreamCompone
if (currentVolume > 0)
_solutionContainerSystem.TryAddReagent(component.BloodSolution.Value, component.BloodReagent, currentVolume, out _);
}

/// <summary>
/// Remove blood from an entity, without spilling it.
/// </summary>
private void RemoveBlood(EntityUid uid, FixedPoint2 amount, BloodstreamComponent? component = null)
{
if (!Resolve(uid, ref component, logMissing: false)
|| !_solutionContainerSystem.ResolveSolution(uid, component.BloodSolutionName, ref component.BloodSolution, out var bloodSolution))
return;

bloodSolution.RemoveReagent(component.BloodReagent, amount);
}
}
31 changes: 31 additions & 0 deletions Content.Server/Botany/Components/TeleportingTraitComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
namespace Content.Server.Botany
{
[RegisterComponent]

public sealed partial class TeleportingTraitComponent : Component
{
/// <summary>
/// Teleportation radius of produce.
/// </summary>
[DataField]
public float ProduceTeleportRadius;

/// <summary>
/// How much to divide the potency.
/// </summary>
[DataField]
public float PotencyDivide = 10f;

/// <summary>
/// Potency of fruit.
/// </summary>
[DataField]
public float Potency;

/// <summary>
/// Chance of deletion.
/// </summary>
[DataField]
public float DeletionChance = .5f;
}
}
8 changes: 7 additions & 1 deletion Content.Server/Botany/SeedPrototype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,11 @@ public partial class SeedData
/// </summary>
[DataField("ligneous")] public bool Ligneous;

/// <summary>
/// If true, teleports both fruit and player if slippable.
/// </summary>
[DataField] public bool Teleporting;

// No, I'm not removing these.
// if you re-add these, make sure that they get cloned.
//public PlantSpread Spread { get; set; }
Expand All @@ -215,7 +220,6 @@ public partial class SeedData
//public bool Hematophage { get; set; }
//public bool Thorny { get; set; }
//public bool Stinging { get; set; }
// public bool Teleporting { get; set; }
// public PlantJuicy Juicy { get; set; }

#endregion
Expand Down Expand Up @@ -295,6 +299,7 @@ public SeedData Clone()
Slip = Slip,
Sentient = Sentient,
Ligneous = Ligneous,
Teleporting = Teleporting,

PlantRsi = PlantRsi,
PlantIconState = PlantIconState,
Expand Down Expand Up @@ -358,6 +363,7 @@ public SeedData SpeciesChange(SeedData other)
Slip = Slip,
Sentient = Sentient,
Ligneous = Ligneous,
Teleporting = Teleporting,

PlantRsi = other.PlantRsi,
PlantIconState = other.PlantIconState,
Expand Down
5 changes: 5 additions & 0 deletions Content.Server/Botany/Systems/BotanySystem.Seed.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,11 @@ public IEnumerable<EntityUid> GenerateProduct(SeedData proto, EntityCoordinates
var collisionWake = EnsureComp<CollisionWakeComponent>(entity);
_colWakeSystem.SetEnabled(entity, false, collisionWake);
}
if (proto.Teleporting)
{
var teleporting = EnsureComp<TeleportingTraitComponent>(entity);
TeleportingTraitSystem.SetPotencyRadius(proto.Potency, teleporting);
}
}

return products;
Expand Down
Loading

0 comments on commit b9f4960

Please sign in to comment.