From 7968e08753423afe5e8d977761e96b338941c200 Mon Sep 17 00:00:00 2001 From: Finket Date: Thu, 22 Feb 2024 09:23:54 +0200 Subject: [PATCH] Clean up code comments a bit --- Content.Client/Chat/Managers/ChatManager.cs | 6 +- .../Shadowkin/Systems/ShadowkinSystem.Tint.cs | 3 - .../Systems/ShadowkinPowerSystem.Teleport.cs | 4 +- .../Shadowkin/Systems/ShadowkinPowerSystem.cs | 63 +++++++++---------- 4 files changed, 34 insertions(+), 42 deletions(-) diff --git a/Content.Client/Chat/Managers/ChatManager.cs b/Content.Client/Chat/Managers/ChatManager.cs index b5d07551cc..70336fe99c 100644 --- a/Content.Client/Chat/Managers/ChatManager.cs +++ b/Content.Client/Chat/Managers/ChatManager.cs @@ -14,7 +14,7 @@ internal sealed class ChatManager : IChatManager [Dependency] private readonly IEntitySystemManager _systems = default!; private ISawmill _sawmill = default!; - public event Action? PermissionsUpdated; //Nyano - Summary: need to be able to update perms for new psionics. + public event Action? PermissionsUpdated; //Nyano - Summary: need to be able to update perms for new psionics public void Initialize() { _sawmill = Logger.GetSawmill("chat"); @@ -67,7 +67,7 @@ public void SendMessage(string text, ChatSelectChannel channel) _consoleHost.ExecuteCommand($"whisper \"{CommandParsing.Escape(str)}\""); break; - //Nyano - Summary: sends the command for telepath communication. + //Nyano - Summary: sends the command for telepath communication case ChatSelectChannel.Telepathic: _consoleHost.ExecuteCommand($"tsay \"{CommandParsing.Escape(str)}\""); break; @@ -81,7 +81,7 @@ public void SendMessage(string text, ChatSelectChannel channel) throw new ArgumentOutOfRangeException(nameof(channel), channel, null); } } - //Nyano - Summary: fires off the update permissions script. + //Nyano - Summary: fires off the update permissions script public void UpdatePermissions() { PermissionsUpdated?.Invoke(); diff --git a/Content.Client/SimpleStation14/Species/Shadowkin/Systems/ShadowkinSystem.Tint.cs b/Content.Client/SimpleStation14/Species/Shadowkin/Systems/ShadowkinSystem.Tint.cs index 57b0b93190..7f8e49b382 100644 --- a/Content.Client/SimpleStation14/Species/Shadowkin/Systems/ShadowkinSystem.Tint.cs +++ b/Content.Client/SimpleStation14/Species/Shadowkin/Systems/ShadowkinSystem.Tint.cs @@ -84,9 +84,6 @@ public override void Update(float frameTime) // Eye color comp.TintColor = new Vector3(layer.Color.R, layer.Color.G, layer.Color.B); - // intensity = min + (power / max) - // intensity = intensity / 3 - // intensity = clamp intensity min, max const float min = 0.45f; const float max = 0.75f; // TODO This math doesn't match the comments, figure out which is correct diff --git a/Content.Server/SimpleStation14/Species/Shadowkin/Systems/ShadowkinPowerSystem.Teleport.cs b/Content.Server/SimpleStation14/Species/Shadowkin/Systems/ShadowkinPowerSystem.Teleport.cs index 6fa7b03184..c15b68d45c 100644 --- a/Content.Server/SimpleStation14/Species/Shadowkin/Systems/ShadowkinPowerSystem.Teleport.cs +++ b/Content.Server/SimpleStation14/Species/Shadowkin/Systems/ShadowkinPowerSystem.Teleport.cs @@ -41,13 +41,11 @@ private void Startup(EntityUid uid, ShadowkinTeleportPowerComponent component, C { var componentActionShadowkinTeleport = component.ActionShadowkinTeleport; _actions.AddAction(uid, ref componentActionShadowkinTeleport, "ActionShadowkinTeleport"); - // // _actions.AddAction(uid, new WorldTargetAction(_prototype.Index("ShadowkinTeleport")), null); } private void Shutdown(EntityUid uid, ShadowkinTeleportPowerComponent component, ComponentShutdown args) { _actions.RemoveAction(uid, component.ActionShadowkinTeleport); - // // _actions.RemoveAction(uid, new WorldTargetAction(_prototype.Index("ShadowkinTeleport"))); } @@ -66,7 +64,7 @@ private void Teleport(EntityUid uid, ShadowkinTeleportPowerComponent component, var transform = Transform(args.Performer); if (transform.MapID != args.Target.GetMapId(EntityManager)) return; - + SharedPullableComponent? pullable = null; // To avoid "might not be initialized when accessed" warning if (_entity.TryGetComponent(args.Performer, out var puller) && puller.Pulling != null && diff --git a/Content.Server/SimpleStation14/Species/Shadowkin/Systems/ShadowkinPowerSystem.cs b/Content.Server/SimpleStation14/Species/Shadowkin/Systems/ShadowkinPowerSystem.cs index e5218a030e..26d33ed214 100644 --- a/Content.Server/SimpleStation14/Species/Shadowkin/Systems/ShadowkinPowerSystem.cs +++ b/Content.Server/SimpleStation14/Species/Shadowkin/Systems/ShadowkinPowerSystem.cs @@ -29,8 +29,8 @@ public ShadowkinPowerSystem() } - /// The current power level. - /// The name of the power level. + /// The current power level + /// The name of the power level public string GetLevelName(float powerLevel) { // Placeholders @@ -55,11 +55,11 @@ public string GetLevelName(float powerLevel) } /// - /// Sets the alert level of a shadowkin. + /// Sets the alert level of a shadowkin /// - /// The entity uid. + /// The entity uid /// Enable the alert or not - /// The current power level. + /// The current power level public void UpdateAlert(EntityUid uid, bool enabled, float? powerLevel = null) { if (!enabled || powerLevel == null) @@ -86,10 +86,10 @@ public void UpdateAlert(EntityUid uid, bool enabled, float? powerLevel = null) /// - /// Tries to update the power level of a shadowkin based on an amount of seconds. + /// Tries to update the power level of a shadowkin based on an amount of seconds /// - /// The entity uid. - /// The time since the last update in seconds. + /// The entity uid + /// The time since the last update in seconds public bool TryUpdatePowerLevel(EntityUid uid, float frameTime) { // Check if the entity has a shadowkin component @@ -107,10 +107,10 @@ public bool TryUpdatePowerLevel(EntityUid uid, float frameTime) } /// - /// Updates the power level of a shadowkin based on an amount of seconds. + /// Updates the power level of a shadowkin based on an amount of seconds /// - /// The entity uid. - /// The time since the last update in seconds. + /// The entity uid + /// The time since the last update in seconds public void UpdatePowerLevel(EntityUid uid, float frameTime) { // Get shadowkin component @@ -123,7 +123,6 @@ public void UpdatePowerLevel(EntityUid uid, float frameTime) // Calculate new power level (P = P + t * G * M) var newPowerLevel = component.PowerLevel + frameTime * component.PowerLevelGain * component.PowerLevelGainMultiplier; - // Clamp power level using clamp function newPowerLevel = Math.Clamp(newPowerLevel, component.PowerLevelMin, component.PowerLevelMax); // Set the new power level @@ -132,10 +131,10 @@ public void UpdatePowerLevel(EntityUid uid, float frameTime) /// - /// Tries to add to the power level of a shadowkin. + /// Tries to add to the power level of a shadowkin /// - /// The entity uid. - /// The amount to add to the power level. + /// The entity uid + /// The amount to add to the power level public bool TryAddPowerLevel(EntityUid uid, float amount) { // Check if the entity has a shadowkin component @@ -149,10 +148,10 @@ public bool TryAddPowerLevel(EntityUid uid, float amount) } /// - /// Adds to the power level of a shadowkin. + /// Adds to the power level of a shadowkin /// - /// The entity uid. - /// The amount to add to the power level. + /// The entity uid + /// The amount to add to the power level public void AddPowerLevel(EntityUid uid, float amount) { // Get shadowkin component @@ -165,7 +164,6 @@ public void AddPowerLevel(EntityUid uid, float amount) // Get new power level var newPowerLevel = component.PowerLevel + amount; - // Clamp power level using clamp function newPowerLevel = Math.Clamp(newPowerLevel, component.PowerLevelMin, component.PowerLevelMax); // Set the new power level @@ -174,10 +172,10 @@ public void AddPowerLevel(EntityUid uid, float amount) /// - /// Sets the power level of a shadowkin. + /// Sets the power level of a shadowkin /// - /// The entity uid. - /// The new power level. + /// The entity uid + /// The new power level public void SetPowerLevel(EntityUid uid, float newPowerLevel) { // Get shadowkin component @@ -187,7 +185,6 @@ public void SetPowerLevel(EntityUid uid, float newPowerLevel) return; } - // Clamp power level using clamp function newPowerLevel = Math.Clamp(newPowerLevel, component.PowerLevelMin, component.PowerLevelMax); // Set the new power level @@ -196,7 +193,7 @@ public void SetPowerLevel(EntityUid uid, float newPowerLevel) /// - /// Tries to blackeye a shadowkin. + /// Tries to blackeye a shadowkin /// public bool TryBlackeye(EntityUid uid) { @@ -212,7 +209,7 @@ public bool TryBlackeye(EntityUid uid) } /// - /// Blackeyes a shadowkin. + /// Blackeyes a shadowkin /// public void Blackeye(EntityUid uid) { @@ -232,11 +229,11 @@ public void Blackeye(EntityUid uid) /// - /// Tries to add a power multiplier. + /// Tries to add a power multiplier /// - /// The entity uid. - /// The multiplier to add. - /// The time in seconds to wait before removing the multiplier. + /// The entity uid + /// The multiplier to add + /// The time in seconds to wait before removing the multiplier public bool TryAddMultiplier(EntityUid uid, float multiplier, float? time = null) { if (!_entity.HasComponent(uid) || @@ -249,11 +246,11 @@ public bool TryAddMultiplier(EntityUid uid, float multiplier, float? time = null } /// - /// Adds a power multiplier. + /// Adds a power multiplier /// - /// The entity uid. - /// The multiplier to add. - /// The time in seconds to wait before removing the multiplier. + /// The entity uid + /// The multiplier to add + /// The time in seconds to wait before removing the multiplier public void AddMultiplier(EntityUid uid, float multiplier, float? time = null) { // Get shadowkin component