make ringtone and uplink code 6 notes long (#17545)
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
@@ -43,7 +43,7 @@ namespace Content.Client.PDA.Ringer
|
||||
return false;
|
||||
}
|
||||
|
||||
ringtone = new Note[4];
|
||||
ringtone = new Note[_menu.RingerNoteInputs.Length];
|
||||
|
||||
for (int i = 0; i < _menu.RingerNoteInputs.Length; i++)
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<DefaultWindow xmlns="https://spacestation14.io"
|
||||
Title="{Loc 'comp-ringer-ui-menu-title'}"
|
||||
MinSize="256 128"
|
||||
SetSize="256 128">
|
||||
MinSize="320 128"
|
||||
SetSize="320 128">
|
||||
<BoxContainer Orientation="Vertical"
|
||||
VerticalExpand="True"
|
||||
HorizontalExpand="True"
|
||||
@@ -12,7 +12,7 @@
|
||||
VerticalExpand="True"
|
||||
HorizontalExpand="True"
|
||||
HorizontalAlignment="Center"
|
||||
MinSize="120 0">
|
||||
MinSize="180 0">
|
||||
<Label Name = "Indent_0Label"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
@@ -49,6 +49,24 @@
|
||||
MinSize="40 0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" />
|
||||
<Label Name = "Indent_4Label"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Text="-" />
|
||||
<LineEdit Name ="RingerNoteFiveInput"
|
||||
Access="Public"
|
||||
MinSize="40 0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" />
|
||||
<Label Name = "Indent_5Label"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Text="-" />
|
||||
<LineEdit Name ="RingerNoteSixInput"
|
||||
Access="Public"
|
||||
MinSize="40 0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" />
|
||||
</BoxContainer>
|
||||
</PanelContainer>
|
||||
<PanelContainer>
|
||||
|
||||
@@ -10,14 +10,14 @@ namespace Content.Client.PDA.Ringer
|
||||
[GenerateTypedNameReferences]
|
||||
public sealed partial class RingtoneMenu : DefaultWindow
|
||||
{
|
||||
public string[] PreviousNoteInputs = new[] { "A", "A", "A", "A" };
|
||||
public string[] PreviousNoteInputs = new[] { "A", "A", "A", "A", "A", "A" };
|
||||
public LineEdit[] RingerNoteInputs = default!;
|
||||
|
||||
public RingtoneMenu()
|
||||
{
|
||||
RobustXamlLoader.Load(this);
|
||||
|
||||
RingerNoteInputs = new[] { RingerNoteOneInput, RingerNoteTwoInput, RingerNoteThreeInput, RingerNoteFourInput };
|
||||
RingerNoteInputs = new[] { RingerNoteOneInput, RingerNoteTwoInput, RingerNoteThreeInput, RingerNoteFourInput, RingerNoteFiveInput, RingerNoteSixInput };
|
||||
|
||||
for (var i = 0; i < RingerNoteInputs.Length; ++i)
|
||||
{
|
||||
|
||||
@@ -249,7 +249,7 @@ public sealed class TraitorRuleSystem : GameRuleSystem<TraitorRuleComponent>
|
||||
traitorRole.Mind.Briefing = string.Format(
|
||||
"{0}\n{1}",
|
||||
Loc.GetString("traitor-role-codewords-short", ("codewords", string.Join(", ", traitorRule.Codewords))),
|
||||
Loc.GetString("traitor-role-uplink-code-short", ("code", string.Join("", code))));
|
||||
Loc.GetString("traitor-role-uplink-code-short", ("code", string.Join("-", code).Replace("sharp","#"))));
|
||||
|
||||
// Assign traitor roles
|
||||
_mindSystem.AddRole(mind, traitorRole);
|
||||
@@ -295,7 +295,7 @@ public sealed class TraitorRuleSystem : GameRuleSystem<TraitorRuleComponent>
|
||||
{
|
||||
_chatManager.DispatchServerMessage(session, Loc.GetString("traitor-role-greeting"));
|
||||
_chatManager.DispatchServerMessage(session, Loc.GetString("traitor-role-codewords", ("codewords", string.Join(", ", codewords))));
|
||||
_chatManager.DispatchServerMessage(session, Loc.GetString("traitor-role-uplink-code", ("code", string.Join("", code))));
|
||||
_chatManager.DispatchServerMessage(session, Loc.GetString("traitor-role-uplink-code", ("code", string.Join("-", code).Replace("sharp","#"))));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -122,7 +122,30 @@ namespace Content.Server.PDA.Ringer
|
||||
|
||||
public void RandomizeUplinkCode(EntityUid uid, RingerUplinkComponent uplink, ComponentInit args)
|
||||
{
|
||||
uplink.Code = GenerateRingtone();
|
||||
var notes = new[]
|
||||
{
|
||||
Note.A,
|
||||
Note.Asharp,
|
||||
Note.B,
|
||||
Note.C,
|
||||
Note.Csharp,
|
||||
Note.D,
|
||||
Note.Dsharp,
|
||||
Note.E,
|
||||
Note.F,
|
||||
Note.Fsharp,
|
||||
Note.G,
|
||||
Note.Gsharp,
|
||||
};
|
||||
|
||||
var ringtone = new Note[RingtoneLength];
|
||||
|
||||
for (var i = 0; i < RingtoneLength; i++)
|
||||
{
|
||||
ringtone[i] = _random.Pick(notes);
|
||||
}
|
||||
|
||||
uplink.Code = ringtone;
|
||||
}
|
||||
|
||||
//Non Event Functions
|
||||
@@ -141,7 +164,7 @@ namespace Content.Server.PDA.Ringer
|
||||
|
||||
var ringtone = new Note[RingtoneLength];
|
||||
|
||||
for (var i = 0; i < 4; i++)
|
||||
for (var i = 0; i < RingtoneLength; i++)
|
||||
{
|
||||
ringtone[i] = _random.Pick(notes);
|
||||
}
|
||||
@@ -196,7 +219,7 @@ namespace Content.Server.PDA.Ringer
|
||||
|
||||
ringer.NoteCount++;
|
||||
|
||||
if (ringer.NoteCount > 3)
|
||||
if (ringer.NoteCount > RingtoneLength - 1)
|
||||
{
|
||||
remove.Add(uid);
|
||||
UpdateRingerUserInterface(uid, ringer);
|
||||
|
||||
@@ -4,7 +4,7 @@ namespace Content.Shared.PDA;
|
||||
|
||||
public abstract class SharedRingerSystem : EntitySystem
|
||||
{
|
||||
public const int RingtoneLength = 4;
|
||||
public const int RingtoneLength = 6;
|
||||
public const int NoteTempo = 300;
|
||||
public const float NoteDelay = 60f / NoteTempo;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user