Skip to content

Commit

Permalink
Merge branch 'syndizine' into impStation
Browse files Browse the repository at this point in the history
  • Loading branch information
Kandiyaki committed Oct 27, 2024
2 parents 6d5450d + 6d71858 commit a82ea97
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
19 changes: 15 additions & 4 deletions Content.Server/EntityEffects/Effects/MakeSyndient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,23 @@ public override void Effect(EntityEffectBaseArgs args)
}
}
}
//we have all the DNA in the activated subjuzine. get a random one and find the DNA's source.
if (dnaDataList.Count > 0)

String? chosenName = null;

for(int i=0; i<dnaDataList.Count; i++)
{
DnaData chosenOne = dnaDataList[0];
DnaData candidate = dnaDataList[i];
String? candidateName = forensicSys.GetNameFromDNA(candidate.DNA);

String chosenName = forensicSys.GetNameFromDNA(chosenOne.DNA);
if (candidateName != null)
{
chosenName = candidateName;
}
}

//we have all the DNA in the activated subjuzine. get a random one and find the DNA's source.
if (chosenName!=null)
{
//we FINALLY have the name of the injector. jesus fuck.
//now, we build the role name, description, etc.

Expand Down
8 changes: 5 additions & 3 deletions Content.Server/Forensics/Systems/ForensicsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,13 @@ public void CopyForensicsFrom(ForensicsComponent src, EntityUid target)
dest.Fingerprints.Add(print);
}
}
public string GetNameFromDNA(string DNA)

//gets the name of a person from the DNA inside it. RETURNS NULL FOR ANIMALS, OR ANYTHING ELSE WITH UNKNOWN DNA.
public string? GetNameFromDNA(string DNA)
{
var query = EntityQueryEnumerator<DnaComponent>();

String outputName = "OH GOD OH FUCK IT'S BROKEN";
String? outputName = null;
//iterate over every DNAcomponent in the server until you find one that matches the given DNA
while (query.MoveNext(out var sourceUID, out var sourceComp))
{
Expand Down Expand Up @@ -324,7 +326,7 @@ private void OnTransferDnaEvent(EntityUid uid, DnaComponent component, ref Trans
recipientComp.DNAs.Add(component.DNA);
recipientComp.CanDnaBeCleaned = args.CanDnaBeCleaned;
}

#region Public API

/// <summary>
Expand Down

0 comments on commit a82ea97

Please sign in to comment.