Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Content.Client/Xenoarchaeology/Ui/AnalysisConsoleMenu.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
xmlns:customControls="clr-namespace:Content.Client.Administration.UI.CustomControls"
Title="{Loc 'analysis-console-menu-title'}"
MinSize="620 280"
SetSize="620 280">
MinSize="620 295"
SetSize="620 295"> <!-- DeltaV - increase vertical size for glimmer multiplier -->
<BoxContainer Orientation="Horizontal" HorizontalExpand="True" VerticalExpand="True">
<BoxContainer Margin="10 10 10 10" MinWidth="150" Orientation="Vertical"
VerticalExpand="True" SizeFlagsStretchRatio="1">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ public sealed partial class ArtifactAnalyzerComponent : Component
public int ExtractRatio = 750;
// Nyano - End modified code block.

// Begin DeltaV - Tie point output to glimmer
/// <summary>
/// The maximum added multiplier, reached at max glimmer.
/// </summary>
[DataField]
public float PointGlimmerMultiplier = 8f;
// End DeltaV - Tie point output to glimmer

/// <summary>
/// The corresponding console entity.
/// Can be null if not linked.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,9 @@ private void UpdateAnalyzerInformation(EntityUid uid, ArtifactAnalyzerComponent?
? null
: (ArtifactNode?) _artifact.GetNodeFromId(artifact.CurrentNodeId.Value, artifact).Clone();
component.LastAnalyzedNode = lastNode;
component.LastAnalyzerPointValue = _artifact.GetResearchPointValue(component.LastAnalyzedArtifact.Value, artifact);
// DeltaV - dynamic glimmer multiplier doesn't play nice with static artifact point values,
// so clamp this to prevent negative values on analyzer.
component.LastAnalyzerPointValue = Math.Clamp(_artifact.GetResearchPointValue(component.LastAnalyzedArtifact.Value, artifact), 0, int.MaxValue);
}
}

Expand Down Expand Up @@ -344,8 +346,15 @@ private void OnPrintButton(EntityUid uid, AnalysisConsoleComponent component, An
msg.AddMarkupOrThrow(Loc.GetString("analysis-console-info-edges", ("edges", n.Edges.Count)));
msg.PushNewline();

// Begin DeltaV - show glimmer multiplier
if (component.LastAnalyzerPointValue != null)
msg.AddMarkupOrThrow(Loc.GetString("analysis-console-info-value", ("value", component.LastAnalyzerPointValue)));
{
msg.AddMarkupOrThrow(Loc.GetString("analysis-console-info-value", ("value", (int) (component.LastAnalyzerPointValue * GetGlimmerMultiplier(component)))));
msg.PushNewline();
}

msg.AddMarkupOrThrow(Loc.GetString("old-analysis-console-glimmer-multiplier-text", ("mult", GetGlimmerMultiplier(component).ToString("N2"))));
// End DeltaV - show glimmer multiplier

return msg;
}
Expand All @@ -370,19 +379,22 @@ private void OnExtractButton(EntityUid uid, AnalysisConsoleComponent component,

var pointValue = _artifact.GetResearchPointValue(artifact.Value);

// Begin DeltaV Additions - extracting artifacts raises glimmer proportional to the points, floored,
// and artifact point output is proportional to glimmer.
if (TryComp<ArtifactAnalyzerComponent>(component.AnalyzerEntity.Value, out var analyzer) &&
analyzer != null)
{
// DeltaV - divide by multiplier to avoid insane glimmer nukes at high multiplier values. cast to float to avoid loss of fraction
_glimmerSystem.Glimmer += (int)(pointValue / (float)analyzer.ExtractRatio / GetGlimmerMultiplier(analyzer));
pointValue = (int) (pointValue * GetGlimmerMultiplier(analyzer));
}

// no new nodes triggered so nothing to add
if (pointValue == 0)
return;

_research.ModifyServerPoints(server.Value, pointValue, serverComponent);
_artifact.AdjustConsumedPoints(artifact.Value, pointValue);

// Begin DeltaV Additions - extracting artifacts raises glimmer proportional to the points, floored
if (TryComp<ArtifactAnalyzerComponent>(component.AnalyzerEntity.Value, out var analyzer) &&
analyzer != null)
{
_glimmerSystem.Glimmer += (int) pointValue / analyzer.ExtractRatio;
}
// End DeltaV Additions

_audio.PlayPvs(component.ExtractSound, component.AnalyzerEntity.Value, AudioParams.Default.WithVolume(2f));
Expand Down Expand Up @@ -525,5 +537,13 @@ private void OnPowerChanged(EntityUid uid, ActiveArtifactAnalyzerComponent activ
ResumeScan(uid, null, active);
}
}

// Begin DeltaV - glimmer mult calculation
// Exponential curve that reaches 1 + PointGlimmerMultiplier at 1000 glimmer.
private float GetGlimmerMultiplier(ArtifactAnalyzerComponent comp)
{
return 1 + (MathF.Pow(_glimmerSystem.Glimmer / 1000f, 2f) * comp.PointGlimmerMultiplier);
}
// End DeltaV - glimmer mult calculation
}

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
old-analysis-console-glimmer-multiplier-text = Ψ_MULTIPLIER: {$mult}
Loading