Skip to content

Commit

Permalink
upd
Browse files Browse the repository at this point in the history
  • Loading branch information
Rxup committed Jul 18, 2024
1 parent 6079a7b commit 5e75de8
Show file tree
Hide file tree
Showing 25 changed files with 98 additions and 164 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,17 @@ private void CharacterUpdated(CharacterData data)
Modulate = Color.Gray
};

objectiveControl.AddChild(new Label

var objectiveText = new FormattedMessage();
objectiveText.TryAddMarkup(Loc.GetString($"objective-issuer-{groupId}"), out _); // backmen: locale

var objectiveLabel = new RichTextLabel
{
Text = groupId,
Modulate = Color.LightSkyBlue
});
StyleClasses = {StyleNano.StyleClassTooltipActionTitle}
};
objectiveLabel.SetMessage(objectiveText);

objectiveControl.AddChild(objectiveLabel);

foreach (var condition in conditions)
{
Expand Down
13 changes: 6 additions & 7 deletions Content.Server/Backmen/EvilTwin/EvilTwinSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ private void OnRoundEnd(RoundEndTextAppendEvent ev)
{
var name = mind.CharacterName;
var username = mind.Session?.Name;
var objectives = mind.AllObjectives.ToArray();
var objectives = mind.Objectives.ToArray();
if (objectives.Length == 0)
{
if (username != null)
Expand Down Expand Up @@ -427,15 +427,14 @@ private void OnRoundEnd(RoundEndTextAppendEvent ev)
result.Append("\n" + Loc.GetString("evil-twin-was-an-evil-twin-with-objectives-named", ("name", name)));
}

foreach (var objectiveGroup in objectives.GroupBy(o => Comp<ObjectiveComponent>(o).Issuer))
foreach (var objectiveGroup in objectives.Select(x=>(Entity<ObjectiveComponent>)(x, Comp<ObjectiveComponent>(x)))
.GroupBy(o => o.Comp.LocIssuer))
{
if (objectiveGroup.Key == "SpaceBank")
{
continue;
}

foreach (var objective in objectiveGroup)
{
if(objective.Comp.HideFromTotal)
continue;

var info = _objectivesSystem.GetInfo(objective, mindId);
if (info == null)
continue;
Expand Down
11 changes: 5 additions & 6 deletions Content.Server/Backmen/Fugitive/FugitiveSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -425,15 +425,14 @@ private void OnRoundEnd(RoundEndTextAppendEvent ev)
else if (name != null)
result.AppendLine(Loc.GetString("fugitive-was-a-fugitive-with-objectives-named", ("name", name)));

foreach (var objectiveGroup in objectives.GroupBy(o => Comp<ObjectiveComponent>(o).Issuer))
foreach (var objectiveGroup in objectives.Select(x=>(Entity<ObjectiveComponent>)(x, Comp<ObjectiveComponent>(x)))
.GroupBy(o => o.Comp.LocIssuer))
{
if (objectiveGroup.Key == "SpaceBank")
{
continue;
}

foreach (var objective in objectiveGroup)
{
if(objective.Comp.HideFromTotal)
continue;

var info = _objectivesSystem.GetInfo(objective, mindId, mind);
if (info == null)
continue;
Expand Down
3 changes: 2 additions & 1 deletion Content.Server/Backmen/GameTicking/Rules/BlobRuleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,11 @@ protected override void AppendRoundEndText(EntityUid uid, BlobRuleComponent blob
else if (name != null)
result += "\n" + Loc.GetString("blob-was-a-blob-with-objectives-named", ("name", name));

foreach (var objectiveGroup in objectives.GroupBy(o => Comp<ObjectiveComponent>(o).Issuer))
foreach (var objectiveGroup in objectives.GroupBy(o => Comp<ObjectiveComponent>(o).LocIssuer))
{
foreach (var objective in objectiveGroup)
{

var info = _objectivesSystem.GetInfo(objective, mindId, mind);
if (info == null)
continue;
Expand Down
20 changes: 13 additions & 7 deletions Content.Server/Backmen/GameTicking/Rules/FleshCultRuleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -567,21 +567,27 @@ protected override void AppendRoundEndText(EntityUid uid, FleshCultRuleComponent
("name", name));
}

foreach (var objectiveGroup in objectives.GroupBy(o => Comp<ObjectiveComponent>(o).Issuer))
foreach (var objectiveGroup in objectives.Select(x=>(Entity<ObjectiveComponent>)(x, Comp<ObjectiveComponent>(x)))
.GroupBy(o => o.Comp.LocIssuer))
{
if (objectiveGroup.Key == "SpaceBank")
{
continue;
}

result += "\n" + Loc.GetString($"preset-flesh-cult-objective-issuer-{objectiveGroup.Key}");
var hasTitle = false;

foreach (var objective in objectiveGroup)
{
if(objective.Comp.HideFromTotal)
continue;

var info = _objectivesSystem.GetInfo(objective, mindId);
if (info == null)
continue;

if (!hasTitle)
{
result += "\n" + Loc.GetString($"preset-flesh-cult-objective-issuer-{objectiveGroup.Key}");
hasTitle = true;
}


var objectiveTitle = info.Value.Title;
var progress = info.Value.Progress;
if (progress > 0.99f)
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/CharacterInfo/CharacterInfoSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ private void OnRequestCharacterInfoEvent(RequestCharacterInfoEvent msg, EntitySe
continue;

// group objectives by their issuer
var issuer = Comp<ObjectiveComponent>(objective).LocIssuer;
string issuer = Comp<ObjectiveComponent>(objective).Issuer;
if (!objectives.ContainsKey(issuer))
objectives[issuer] = new List<ObjectiveInfo>();
objectives[issuer].Add(info.Value);
Expand Down
5 changes: 3 additions & 2 deletions Content.Server/Objectives/Commands/ListObjectivesCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ public override void Execute(IConsoleShell shell, string argStr, string[] args)

shell.WriteLine($"Objectives for player {player.UserId}:");
var objectivesGr = mind.Objectives.ToList()
.Select(x=> (Entity<ObjectiveComponent?>)(x,_entities.GetComponentOrNull<ObjectiveComponent>(x))).GroupBy(x=>x.Comp?.Issuer ?? "") //backmen: locale
.Select(x=> (Entity<ObjectiveComponent?>)(x,_entities.GetComponentOrNull<ObjectiveComponent>(x)))
.GroupBy(x=>x.Comp?.LocIssuer ?? "") //backmen: locale
.ToList();
if (objectivesGr.Count == 0)
{
Expand All @@ -47,7 +48,7 @@ public override void Execute(IConsoleShell shell, string argStr, string[] args)
foreach (var objective in objectivesGr)
{
var objectives = objective.ToList();
shell.WriteMarkup(Loc.GetString($"objective-issuer-{objective.Key}")+":");
shell.WriteMarkup(objective.Key+":");
for (var i = 0; i < objectives.Count; i++)
{
var info = objectivesSystem.GetInfo(objectives[i], mindId, mind);
Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/Backmen/GhostTheme/GhostThemePrototype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Content.Shared.Backmen.GhostTheme;

[Prototype("ghostTheme")]
[Prototype("ghostTheme", -2)]
public sealed partial class GhostThemePrototype : IPrototype
{
/// <inheritdoc/>
Expand Down
5 changes: 4 additions & 1 deletion Content.Shared/Objectives/Components/ObjectiveComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public sealed partial class ObjectiveComponent : Component
/// Organisation that issued this objective, used for grouping and as a header above common objectives.
/// </summary>
[DataField("issuer", required: true)]
private LocId Issuer { get; set; }
public LocId Issuer { get; set; }

[ViewVariables(VVAccess.ReadOnly)]
public string LocIssuer => Loc.GetString(Issuer);
Expand All @@ -41,6 +41,9 @@ public sealed partial class ObjectiveComponent : Component
/// </summary>
[DataField]
public SpriteSpecifier? Icon;

[DataField("hideFromTotal")]
public bool HideFromTotal = false;
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@ issuer-Waffle-Corporation = [color=Brown]Waffle Corporation[/color]
При вашем раскрытии, мы используем все возможные силы да бы вытащить вас, не брезгуйте замарать руки.
Убивайте остальных агентов синдиката. Кроме агентов MI13.
objective-issuer-Waffle-Corporation = [color=Brown]Waffle Corporation[/color]
objective-issuer-vamp = objective-issuer-vamp
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ evil-twin-user-was-an-evil-twin-with-objectives-named = [color=White]{ $name }[/
evil-twin-was-an-evil-twin-with-objectives-named = [color=white]{ $name }[/color] был(а) злым двойником со следующими целями:
roles-antag-evil-twin-name = Злой двойник
roles-antag-evil-twin-objective = Ваша задача - устранение и замена оригинальной персоны.
objective-issuer-evil-twin = Злой двойник
objective-issuer-self = Сам
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ ent-ReflectiveBlobTile = Отражающая плитка блоба
.desc = Обновление укреплённой клетки в которой платят меньшой крепкостью, за возможность отражать с шансом 90% только энергетические снаряды и лазеры.
ent-MobObserverBlob = Блоб наблюдатель
.desc = { "" }
objective-issuer-blob = Блоб
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
id: BaseBlobObjective
components:
- type: Objective
issuer: blob
issuer: objective-issuer-blob
unique: true
difficulty: 1
icon:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
description: objective-condition-create-flesh-heart-description
components:
- type: Objective
issuer: flesh-cult
issuer: objective-issuer-flesh-cult
difficulty: 1.3
icon: Interface/Actions/fleshCultistFleshHeart.png
- type: RoleRequirement
Expand All @@ -23,7 +23,7 @@
description: objective-condition-flesh-cultist-survival-description
components:
- type: Objective
issuer: flesh-cult
issuer: objective-issuer-flesh-cult
difficulty: 0.5
icon: Interface/Actions/fleshCultistSurvivalObjective.png
- type: RoleRequirement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
id: BaseEvilTwinObjective
components:
- type: Objective
issuer: Злой Близнец
issuer: objective-issuer-evil-twin
difficulty: 1
- type: RoleRequirement
roles:
Expand Down Expand Up @@ -46,8 +46,9 @@
components:
- type: Objective
difficulty: 0
hideFromTotal: true
unique: true
issuer: SpaceBank
issuer: objective-issuer-SpaceBank
icon:
sprite: Backmen/Objects/Tools/rimbank.rsi
state: icon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
id: BaseFugitiveObjective
components:
- type: Objective
issuer: self
issuer: objective-issuer-self
unique: true
difficulty: 1
icon:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
components:
- TraitorRole
- type: Objective
issuer: Cybersun-Industries
issuer: objective-issuer-Cybersun-Industries
- type: ObjectiveBlacklistRequirement
blacklist:
tags:
Expand Down
2 changes: 1 addition & 1 deletion Resources/Prototypes/_Backmen/Objectives/traitorDonk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
components:
- TraitorRole
- type: Objective
issuer: Donk-Pocket-Corp
issuer: objective-issuer-Donk-Pocket-Corp
- type: ObjectiveBlacklistRequirement
blacklist:
tags:
Expand Down
2 changes: 1 addition & 1 deletion Resources/Prototypes/_Backmen/Objectives/traitorGorlex.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
components:
- TraitorRole
- type: Objective
issuer: Gorlex-Marauders
issuer: objective-issuer-Gorlex-Marauders
- type: ObjectiveBlacklistRequirement
blacklist:
tags:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
components:
- TraitorRole
- type: Objective
issuer: Interdyne-Pharmaceutics
issuer: objective-issuer-Interdyne-Pharmaceutics
- type: ObjectiveBlacklistRequirement
blacklist:
tags:
Expand Down
2 changes: 1 addition & 1 deletion Resources/Prototypes/_Backmen/Objectives/traitorMI13.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
components:
- TraitorRole
- type: Objective
issuer: MI13
issuer: objective-issuer-MI13
- type: ObjectiveBlacklistRequirement
blacklist:
tags:
Expand Down
2 changes: 1 addition & 1 deletion Resources/Prototypes/_Backmen/Objectives/traitorWaffle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
components:
- TraitorRole
- type: Objective
issuer: Waffle-Corporation
issuer: objective-issuer-Waffle-Corporation
- type: ObjectiveBlacklistRequirement
blacklist:
tags:
Expand Down
4 changes: 2 additions & 2 deletions Resources/Prototypes/_Backmen/Objectives/vampire.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
id: BaseBloodsuckerObjective
components:
- type: Objective
issuer: Коалиция вампиров
issuer: objective-issuer-vamp
unique: true
difficulty: 1
icon:
Expand All @@ -58,4 +58,4 @@
- type: RoleRequirement
roles:
components:
- VampireRole
- VampireRole
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 5e75de8

Please sign in to comment.