This repository was archived by the owner on Aug 22, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Genetics #359
Open
kurokoTurbo
wants to merge
13
commits into
master
Choose a base branch
from
genetics
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Genetics #359
Changes from 6 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
8710eba
first
kurokoTurbo 0719c7c
ByteArray to bool?[], also namespaces
kurokoTurbo 8451a43
retvrn to BitArray
kurokoTurbo 7d28a43
small
kurokoTurbo da1aee5
erm unfinished genome initialization
kurokoTurbo 39c9d1d
GenomeComponent initialization, bitarray operations
kurokoTurbo cdf839b
GenomeSystem.Mutations, Glowing mutation, perekur
kurokoTurbo d3d3609
injectors part 1
kurokoTurbo ec77fb8
future instability and radiations effects, moving stuff around
kurokoTurbo 1b505b3
the server side of injectors done + comments
kurokoTurbo d7574f1
RemoveMutationsReagentEffect
kurokoTurbo e00e08d
tweaks
kurokoTurbo 6d60683
erm
kurokoTurbo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
Content.Client/_White/DNAConsole/DNAConsoleBoundInterface.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| using Content.Shared.DNAConsole; | ||
| using JetBrains.Annotations; | ||
|
|
||
| namespace Content.Client.DNAConsole.UI | ||
| { | ||
| [UsedImplicitly] | ||
| public sealed class DNAConsoleBoundUserInterface : BoundUserInterface | ||
| { | ||
| [ViewVariables] | ||
| private DNAConsoleWindow? _window; | ||
|
|
||
| public DNAConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) | ||
| { | ||
| } | ||
|
|
||
| protected override void Open() | ||
| { | ||
| base.Open(); | ||
| _window = new DNAConsoleWindow | ||
| { | ||
| Title = "DNAConsole" | ||
| }; | ||
| _window.OnClose += Close; | ||
| // _window.ModifierButton.OnPressed += _ => SendMessage(new UiButtonPressedMessage(UiButton.Clone)); | ||
| _window.OpenCentered(); | ||
| } | ||
|
|
||
| protected override void UpdateState(BoundUserInterfaceState state) | ||
| { | ||
| base.UpdateState(state); | ||
|
|
||
| _window?.Populate((DNAConsoleBoundUserInterfaceState) state); | ||
| } | ||
|
|
||
| protected override void Dispose(bool disposing) | ||
| { | ||
| base.Dispose(disposing); | ||
| if (!disposing) | ||
| return; | ||
|
|
||
| if (_window != null) | ||
| { | ||
| _window.OnClose -= Close; | ||
| //_window.DNAButton.OnPressed -= _ => SendMessage(new UiButtonPressedMessage(UiButton.Clone)); | ||
rhailrake marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
| _window?.Dispose(); | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| <DefaultWindow xmlns="https://spacestation14.io" | ||
| Title="{Loc 'comp-pda-ui-menu-title'}" | ||
| SetSize="400 400" | ||
| MinSize="400 400"> | ||
| <TabContainer Name="MasterTabContainer"> | ||
| <BoxContainer Name="DNA" | ||
| Orientation="Vertical" | ||
| VerticalExpand="True" | ||
| HorizontalExpand="True" | ||
| MinSize="100 150"> | ||
| <BoxContainer Name="DNAConsoleContent" Margin="5 5 5 5" Orientation="Vertical" VerticalExpand="True" HorizontalExpand="True"> | ||
| <RichTextLabel Name="ModifierInfoLabel" Access="Public" HorizontalExpand="True" /> | ||
| <Label HorizontalAlignment="Center" Name="ModifierActivity" Access="Public" HorizontalExpand="True" /> | ||
| <BoxContainer Name="DNAModifierMissing" Margin="5 5 5 5" Orientation="Vertical" VerticalExpand="True" HorizontalExpand="True"> | ||
| <Label HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Loc 'DNAModifier missing!'}" /> | ||
| </BoxContainer> | ||
| <BoxContainer Name="DNAModifierFar" Margin="5 5 5 5" Orientation="Vertical" VerticalExpand="True" HorizontalExpand="True"> | ||
| <Label HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Loc 'DNAModifier is far!'}" /> | ||
| </BoxContainer> | ||
|
|
||
| <Label HorizontalAlignment="Center" Text="all is ok." Name="DNATest" /> | ||
|
|
||
| </BoxContainer> | ||
| </BoxContainer> | ||
| </TabContainer> | ||
| </DefaultWindow> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| using Content.Client.Message; | ||
| using Content.Shared.DNAConsole; | ||
| using Robust.Client.AutoGenerated; | ||
| using Robust.Client.UserInterface; | ||
| using Robust.Client.UserInterface.CustomControls; | ||
| using Robust.Client.UserInterface.XAML; | ||
|
|
||
| namespace Content.Client.DNAConsole; | ||
|
|
||
| [GenerateTypedNameReferences] | ||
| public sealed partial class DNAConsoleWindow : DefaultWindow | ||
| { | ||
|
|
||
| public DNAConsoleWindow() | ||
| { | ||
| RobustXamlLoader.Load(this); | ||
| } | ||
|
|
||
| private DNAConsoleBoundUserInterfaceState? _lastUpdate; | ||
|
|
||
| public void Populate(DNAConsoleBoundUserInterfaceState state) | ||
| { | ||
| _lastUpdate = state; | ||
| // BUILD SCANNER UI | ||
| if (state.ModifierConnected) | ||
| { | ||
| if (!state.ModifierInRange) | ||
| { | ||
| DNAModifierFar.Visible = true; | ||
| DNAConsoleContent.Visible = false; | ||
| DNAModifierMissing.Visible = false; | ||
| return; | ||
| } | ||
|
|
||
| DNAConsoleContent.Visible = true; | ||
| DNAModifierFar.Visible = false; | ||
| DNAModifierMissing.Visible = false; | ||
|
|
||
| switch (state.ModifierStatus) | ||
| { | ||
| case ModifierStatus.Ready: | ||
| ModifierActivity.Text = (Loc.GetString("dna-console-component-msg-ready")); | ||
| break; | ||
| case ModifierStatus.ModifierOccupied: | ||
| ModifierActivity.Text = (Loc.GetString("dna-console-component-msg-occupied")); | ||
| break; | ||
| case ModifierStatus.ModifierEmpty: | ||
| ModifierActivity.Text = (Loc.GetString("dna-console-component-msg-empty")); | ||
| break; | ||
| case ModifierStatus.OccupantMetaphyiscal: | ||
| ModifierActivity.Text = (Loc.GetString("dna-console-component-msg-already-alive")); | ||
| break; | ||
| } | ||
| // Set label depending on if scanner is occupied or not. | ||
| ModifierInfoLabel.SetMarkup(state.ModifierBodyInfo != null ? | ||
| Loc.GetString("dna-console-window-scanner-id", ("modifierOccupantName", state.ModifierBodyInfo)) : | ||
| Loc.GetString("dna-console-window-id-blank")); | ||
| } | ||
| else | ||
| { | ||
| // Scanner is missing, set error message visible | ||
| DNAConsoleContent.Visible = false; | ||
| DNAModifierFar.Visible = false; | ||
| DNAModifierMissing.Visible = true; | ||
| } | ||
|
|
||
| // BUILD ClONER UI | ||
| if (state.ModifierConnected) | ||
| { | ||
| if (!state.ModifierInRange) | ||
| { | ||
| DNATest.Visible = false; | ||
| return; | ||
| } | ||
|
|
||
| DNATest.Visible = true; | ||
| } | ||
| else | ||
| { | ||
| // Clone pod is missing, set error message visible | ||
| DNATest.Visible = false; | ||
| } | ||
| } | ||
rhailrake marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| using Content.Shared.DNAModifier; | ||
|
|
||
| namespace Content.Client.DNAModifier; | ||
|
|
||
| [RegisterComponent] | ||
| public sealed partial class DNAModifierComponent : SharedDNAModifierComponent | ||
| { | ||
| } |
9 changes: 9 additions & 0 deletions
9
Content.Server/_White/Genetics/Components/ActiveModifierComponent.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| namespace Content.Server._White.Genetics.Components; | ||
|
|
||
| /// <summary> | ||
| /// Shrimply a tracking component for pods that are cloning. | ||
| /// </summary> | ||
| [RegisterComponent] | ||
| public sealed partial class ActiveModifierComponent : Component | ||
| { | ||
| } |
17 changes: 17 additions & 0 deletions
17
Content.Server/_White/Genetics/Components/DNAConsoleComponent.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| namespace Content.Server._White.Genetics.Components | ||
| { | ||
| [RegisterComponent] | ||
| public sealed partial class DNAConsoleComponent : Component | ||
| { | ||
| public const string ScannerPort = "DNAModifierSender"; | ||
rhailrake marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| [ViewVariables] | ||
| public EntityUid? Modifier = null; | ||
rhailrake marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| /// Maximum distance between console and one if its machines | ||
| [DataField("maxDistance")] | ||
| public float MaxDistance = 4f; | ||
rhailrake marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| public bool ModifierInRange = true; | ||
rhailrake marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
| } | ||
16 changes: 16 additions & 0 deletions
16
Content.Server/_White/Genetics/Components/DNAModifierComponent.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| using Content.Shared.DNAModifier; | ||
| using Robust.Shared.Containers; | ||
|
|
||
| namespace Content.Server._White.Genetics.Components | ||
| { | ||
| [RegisterComponent] | ||
| public sealed partial class DNAModifierComponent : SharedDNAModifierComponent | ||
| { | ||
| public const string ScannerPort = "DNAModifierReceiver"; | ||
rhailrake marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| public ContainerSlot BodyContainer = default!; | ||
rhailrake marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| public EntityUid? ConnectedConsole; | ||
|
|
||
| [DataField, ViewVariables(VVAccess.ReadWrite)] | ||
rhailrake marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| public float CloningFailChanceMultiplier = 1f; | ||
| } | ||
| } | ||
42 changes: 42 additions & 0 deletions
42
Content.Server/_White/Genetics/Components/GenomeComponent.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| using Content.Shared._White.Genetics; | ||
| using Robust.Shared.Prototypes; | ||
|
|
||
| namespace Content.Server._White.Genetics.Components; | ||
|
|
||
| /// <summary> | ||
| /// Gives this entity a genome for traits to be passed on and potentially mutated. | ||
| /// Both of those must be handled by other systems, on its own it has no functionality. | ||
| /// TODO: комплиментарные последовательности | ||
| /// </summary> | ||
| [RegisterComponent] | ||
| public sealed partial class GenomeComponent : Component | ||
| { | ||
| /// <summary> | ||
| /// Name of the <see cref="GenomePrototype"/> to create on init. | ||
| /// </summary> | ||
| [DataField(required: true)] | ||
| public ProtoId<GenomePrototype> GenomeId = string.Empty; | ||
rhailrake marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| /// <summary> | ||
| /// Genome layout to use for this round and genome type. | ||
| /// Stored in <see cref="GeneticsSystem"/>. | ||
| /// </summary> | ||
| [ViewVariables] | ||
| public GenomeLayout Layout = new(); | ||
|
|
||
| [ViewVariables] | ||
| public List<string> Mutations = default!; | ||
|
|
||
| [DataField("humanGenes")] | ||
| public bool HumanGenes = false; | ||
|
|
||
| /// <summary> | ||
| /// Genome bits themselves. | ||
| /// Data can be retrieved with <c>comp.Layout.GetInt(comp.Genome, "name")</c>, etc. | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// Completely empty by default, another system must use <see cref="GenomeSystem"/> to load genes or copy from a parent. | ||
| /// </remarks> | ||
| [DataField] | ||
| public Genome Genome = new(); | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.