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

Cult markings fix #2471

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
3 changes: 2 additions & 1 deletion Content.Client/Humanoid/MarkingPicker.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ public void Populate(string filter)
var sortedMarkings = GetMarkings(_selectedMarkingCategory).Values.Where(m =>
m.ID.ToLower().Contains(filter.ToLower()) ||
GetMarkingName(m).ToLower().Contains(filter.ToLower())
).OrderBy(p => Loc.GetString(GetMarkingName(p)));
).Where(m => !m.Hidden) // SS220 cult markings fix
.OrderBy(p => Loc.GetString(GetMarkingName(p)));

foreach (var marking in sortedMarkings)
{
Expand Down
50 changes: 26 additions & 24 deletions Content.Server/SS220/CultYogg/Cultists/CultYoggSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ public sealed class CultYoggSystem : SharedCultYoggSystem
[Dependency] private readonly ThirstSystem _thirstSystem = default!;
[Dependency] private readonly VomitSystem _vomitSystem = default!;

private const string CultDefaultMarking = "CultStage-Halo";

public override void Initialize()
{
base.Initialize();
Expand Down Expand Up @@ -78,41 +80,41 @@ private void UpdateStage(Entity<CultYoggComponent> entity, ref ChangeCultYoggSta
huAp.EyeColor = Color.Green;
break;
case 2:
if (!_prototype.HasIndex<MarkingPrototype>("CultStage-Halo"))
{
Log.Error("CultStage-Halo marking doesn't exist");
return;
}

if (!huAp.MarkingSet.Markings.ContainsKey(MarkingCategories.Special))
if (_prototype.HasIndex<MarkingPrototype>(CultDefaultMarking))
{
huAp.MarkingSet.Markings.Add(MarkingCategories.Special, new List<Marking>([new Marking("CultStage-Halo", colorCount: 1)]));
if (!huAp.MarkingSet.Markings.ContainsKey(MarkingCategories.Special))
{
huAp.MarkingSet.Markings.Add(MarkingCategories.Special, new List<Marking>([new Marking(CultDefaultMarking, colorCount: 1)]));
}
else
{
_humanoidAppearance.SetMarkingId(entity.Owner,
MarkingCategories.Special,
0,
CultDefaultMarking,
huAp);
}
}
else
{
_humanoidAppearance.SetMarkingId(entity.Owner,
MarkingCategories.Special,
0,
"CultStage-Halo",
huAp);
Log.Error($"{CultDefaultMarking} marking doesn't exist");
}

Dirty(entity.Owner, huAp);

var newMarkingId = $"CultStage-{huAp.Species}";

if (!_prototype.HasIndex<MarkingPrototype>(newMarkingId))
if (_prototype.HasIndex<MarkingPrototype>(newMarkingId))
{
Log.Error($"{newMarkingId} marking doesn't exist");
return;
if (huAp.MarkingSet.Markings.TryGetValue(MarkingCategories.Tail, out var value))
{
entity.Comp.PreviousTail = value.FirstOrDefault();
value.Clear();
huAp.MarkingSet.Markings[MarkingCategories.Special].Add(new Marking(newMarkingId, colorCount: 1));
}
}

if (huAp.MarkingSet.Markings.TryGetValue(MarkingCategories.Tail, out var value))
else
{
entity.Comp.PreviousTail = value.FirstOrDefault();
value.Clear();
huAp.MarkingSet.Markings[MarkingCategories.Special].Add(new Marking(newMarkingId, colorCount: 1));
Dirty(entity.Owner, huAp);
// We have species-marking only for the Nians, so this log only leads to unnecessary errors.
//Log.Error($"{newMarkingId} marking doesn't exist");
}
break;
case 3:
Expand Down
8 changes: 8 additions & 0 deletions Content.Shared/Humanoid/Markings/MarkingPrototype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ public sealed partial class MarkingPrototype : IPrototype
[DataField("forcedColoring")]
public bool ForcedColoring { get; private set; } = false;

// SS220 cult markings fix begin
/// <summary>
/// Is the marking hidden from the marking picker
/// </summary>
[DataField]
public bool Hidden = false;
// SS220 cult markings fix end

[DataField("coloring")]
public MarkingColors Coloring { get; private set; } = new();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
id: CultStage-Halo
bodyPart: Special
markingCategory: Special
hidden: true
sprites:
- sprite: SS220/Objects/CultYogg/cultstages.rsi
state: halo
Expand All @@ -12,6 +13,7 @@
id: CultStage-Moth
bodyPart: Special
markingCategory: Special
hidden: true
sprites:
- sprite: SS220/Objects/CultYogg/cultstages.rsi
state: moth
Loading