Skip to content

Commit

Permalink
Cult markings fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirus59 committed Jan 9, 2025
1 parent 3ea57e2 commit e28c12d
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 25 deletions.
4 changes: 3 additions & 1 deletion Content.Client/Humanoid/MarkingPicker.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,9 @@ 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("CultStage-Halo", colorCount: 1)]));
}
else
{
_humanoidAppearance.SetMarkingId(entity.Owner,
MarkingCategories.Special,
0,
"CultStage-Halo",
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

0 comments on commit e28c12d

Please sign in to comment.