Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frontier-specific ion storm entries #2477

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@ public SiliconLawContainer()
if (Corrupted.Pressed)
{
_law!.LawIdentifierOverride = CorruptedString;
_law!.LawPrintOverride = Loc.GetString("silicon-law-print-error"); // Frontier
}
else
{
_law!.LawIdentifierOverride = null;
_law!.LawPrintOverride = null; // Frontier
}
};

Expand Down
3 changes: 2 additions & 1 deletion Content.Client/Silicons/Laws/Ui/LawDisplay.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ public LawDisplay(EntityUid uid, SiliconLaw law, HashSet<string>? radioChannels)
var identifier = law.LawIdentifierOverride ?? $"{law.Order}";
var lawIdentifier = Loc.GetString("laws-ui-law-header", ("id", identifier));
var lawDescription = Loc.GetString(law.LawString);
var lawIdentifierPlaintext = FormattedMessage.RemoveMarkupPermissive(lawIdentifier);
//var lawIdentifierPlaintext = FormattedMessage.RemoveMarkupPermissive(lawIdentifier); // Frontier
var lawIdentifierPlaintext = FormattedMessage.RemoveMarkupPermissive(law.LawPrintOverride != null ? Loc.GetString("laws-ui-law-header", ("id", law.LawPrintOverride)) : lawIdentifier); // Frontier
var lawDescriptionPlaintext = FormattedMessage.RemoveMarkupPermissive(lawDescription);

LawNumberLabel.SetMarkup(lawIdentifier);
Expand Down
7 changes: 4 additions & 3 deletions Content.Server/Silicons/Laws/IonStormSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ public void IonStormTarget(Entity<SiliconLawBoundComponent, IonStormTargetCompon
{
LawString = newLaw,
Order = -1,
LawIdentifierOverride = Loc.GetString("ion-storm-law-scrambled-number", ("length", _robustRandom.Next(5, 10)))
LawIdentifierOverride = Loc.GetString("ion-storm-law-scrambled-number", ("length", _robustRandom.Next(5, 10))),
LawPrintOverride = Loc.GetString("silicon-law-error") // Frontier
});
}

Expand Down Expand Up @@ -173,8 +174,8 @@ private string GenerateLaw()
var verb = Pick(Verbs);
var number = Pick(NumberBase) + " " + Pick(NumberMod);
var area = Pick(Areas);
var feeling = Pick(Feelings);
var feelingPlural = Pick(FeelingsPlural);
var feeling = Pick(FeelingsPlural); // Frontier: Feelings < FeelingsPlural (not plural subjects, "with an S")
var feelingPlural = Pick(Feelings); // Frontier: FeelingsPlural < Feelings (not plural subjects, "with an S")
var must = Pick(Musts);
var require = Pick(Requires);
var action = Pick(Actions);
Expand Down
9 changes: 8 additions & 1 deletion Content.Shared/Silicons/Laws/SiliconLawPrototype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ public partial class SiliconLaw : IComparable<SiliconLaw>, IEquatable<SiliconLaw
[DataField, ViewVariables(VVAccess.ReadWrite)]
public string? LawIdentifierOverride;

/// <summary>
/// Frontier: an identifier that overrides <see cref="Order"/> when printing the stated law.
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
public string? LawPrintOverride;

public int CompareTo(SiliconLaw? other)
{
if (other == null)
Expand Down Expand Up @@ -69,7 +75,8 @@ public SiliconLaw ShallowClone()
{
LawString = LawString,
Order = Order,
LawIdentifierOverride = LawIdentifierOverride
LawIdentifierOverride = LawIdentifierOverride,
LawPrintOverride = LawPrintOverride, // Frontier
};
}
}
Expand Down
1 change: 1 addition & 0 deletions Resources/Locale/en-US/_NF/silicons/silicon.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
silicon-law-error = ERR@
Loading
Loading