Skip to content

Commit

Permalink
Clean up code comments a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
vaketola committed Feb 22, 2024
1 parent 54044d9 commit 7968e08
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 42 deletions.
6 changes: 3 additions & 3 deletions Content.Client/Chat/Managers/ChatManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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;
Expand All @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<WorldTargetActionPrototype>("ShadowkinTeleport")), null);
}

private void Shutdown(EntityUid uid, ShadowkinTeleportPowerComponent component, ComponentShutdown args)
{
_actions.RemoveAction(uid, component.ActionShadowkinTeleport);
// // _actions.RemoveAction(uid, new WorldTargetAction(_prototype.Index<WorldTargetActionPrototype>("ShadowkinTeleport")));
}


Expand All @@ -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<SharedPullerComponent>(args.Performer, out var puller) &&
puller.Pulling != null &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ public ShadowkinPowerSystem()
}


/// <param name="powerLevel">The current power level.</param>
/// <returns>The name of the power level.</returns>
/// <param name="powerLevel">The current power level</param>
/// <returns>The name of the power level</returns>
public string GetLevelName(float powerLevel)
{
// Placeholders
Expand All @@ -55,11 +55,11 @@ public string GetLevelName(float powerLevel)
}

/// <summary>
/// Sets the alert level of a shadowkin.
/// Sets the alert level of a shadowkin
/// </summary>
/// <param name="uid">The entity uid.</param>
/// <param name="uid">The entity uid</param>
/// <param name="enabled">Enable the alert or not</param>
/// <param name="powerLevel">The current power level.</param>
/// <param name="powerLevel">The current power level</param>
public void UpdateAlert(EntityUid uid, bool enabled, float? powerLevel = null)
{
if (!enabled || powerLevel == null)
Expand All @@ -86,10 +86,10 @@ public void UpdateAlert(EntityUid uid, bool enabled, float? powerLevel = null)


/// <summary>
/// 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
/// </summary>
/// <param name="uid">The entity uid.</param>
/// <param name="frameTime">The time since the last update in seconds.</param>
/// <param name="uid">The entity uid</param>
/// <param name="frameTime">The time since the last update in seconds</param>
public bool TryUpdatePowerLevel(EntityUid uid, float frameTime)
{
// Check if the entity has a shadowkin component
Expand All @@ -107,10 +107,10 @@ public bool TryUpdatePowerLevel(EntityUid uid, float frameTime)
}

/// <summary>
/// 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
/// </summary>
/// <param name="uid">The entity uid.</param>
/// <param name="frameTime">The time since the last update in seconds.</param>
/// <param name="uid">The entity uid</param>
/// <param name="frameTime">The time since the last update in seconds</param>
public void UpdatePowerLevel(EntityUid uid, float frameTime)
{
// Get shadowkin component
Expand All @@ -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
Expand All @@ -132,10 +131,10 @@ public void UpdatePowerLevel(EntityUid uid, float frameTime)


/// <summary>
/// Tries to add to the power level of a shadowkin.
/// Tries to add to the power level of a shadowkin
/// </summary>
/// <param name="uid">The entity uid.</param>
/// <param name="amount">The amount to add to the power level.</param>
/// <param name="uid">The entity uid</param>
/// <param name="amount">The amount to add to the power level</param>
public bool TryAddPowerLevel(EntityUid uid, float amount)
{
// Check if the entity has a shadowkin component
Expand All @@ -149,10 +148,10 @@ public bool TryAddPowerLevel(EntityUid uid, float amount)
}

/// <summary>
/// Adds to the power level of a shadowkin.
/// Adds to the power level of a shadowkin
/// </summary>
/// <param name="uid">The entity uid.</param>
/// <param name="amount">The amount to add to the power level.</param>
/// <param name="uid">The entity uid</param>
/// <param name="amount">The amount to add to the power level</param>
public void AddPowerLevel(EntityUid uid, float amount)
{
// Get shadowkin component
Expand All @@ -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
Expand All @@ -174,10 +172,10 @@ public void AddPowerLevel(EntityUid uid, float amount)


/// <summary>
/// Sets the power level of a shadowkin.
/// Sets the power level of a shadowkin
/// </summary>
/// <param name="uid">The entity uid.</param>
/// <param name="newPowerLevel">The new power level.</param>
/// <param name="uid">The entity uid</param>
/// <param name="newPowerLevel">The new power level</param>
public void SetPowerLevel(EntityUid uid, float newPowerLevel)
{
// Get shadowkin component
Expand All @@ -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
Expand All @@ -196,7 +193,7 @@ public void SetPowerLevel(EntityUid uid, float newPowerLevel)


/// <summary>
/// Tries to blackeye a shadowkin.
/// Tries to blackeye a shadowkin
/// </summary>
public bool TryBlackeye(EntityUid uid)
{
Expand All @@ -212,7 +209,7 @@ public bool TryBlackeye(EntityUid uid)
}

/// <summary>
/// Blackeyes a shadowkin.
/// Blackeyes a shadowkin
/// </summary>
public void Blackeye(EntityUid uid)
{
Expand All @@ -232,11 +229,11 @@ public void Blackeye(EntityUid uid)


/// <summary>
/// Tries to add a power multiplier.
/// Tries to add a power multiplier
/// </summary>
/// <param name="uid">The entity uid.</param>
/// <param name="multiplier">The multiplier to add.</param>
/// <param name="time">The time in seconds to wait before removing the multiplier.</param>
/// <param name="uid">The entity uid</param>
/// <param name="multiplier">The multiplier to add</param>
/// <param name="time">The time in seconds to wait before removing the multiplier</param>
public bool TryAddMultiplier(EntityUid uid, float multiplier, float? time = null)
{
if (!_entity.HasComponent<ShadowkinComponent>(uid) ||
Expand All @@ -249,11 +246,11 @@ public bool TryAddMultiplier(EntityUid uid, float multiplier, float? time = null
}

/// <summary>
/// Adds a power multiplier.
/// Adds a power multiplier
/// </summary>
/// <param name="uid">The entity uid.</param>
/// <param name="multiplier">The multiplier to add.</param>
/// <param name="time">The time in seconds to wait before removing the multiplier.</param>
/// <param name="uid">The entity uid</param>
/// <param name="multiplier">The multiplier to add</param>
/// <param name="time">The time in seconds to wait before removing the multiplier</param>
public void AddMultiplier(EntityUid uid, float multiplier, float? time = null)
{
// Get shadowkin component
Expand Down

0 comments on commit 7968e08

Please sign in to comment.