Skip to content

Commit

Permalink
fix changeling upstream, though dont shows briefing in character menu
Browse files Browse the repository at this point in the history
  • Loading branch information
TokenStyle committed Nov 3, 2024
1 parent 6ec9b33 commit 5acb66f
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 11 deletions.
12 changes: 10 additions & 2 deletions Content.Server/GameTicking/Rules/ChangelingRuleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ public sealed partial class ChangelingRuleSystem : GameRuleSystem<ChangelingRule

public readonly SoundSpecifier BriefingSound = new SoundPathSpecifier("/Audio/Ambience/Antag/changeling_start.ogg");

public readonly EntProtoId ChangelingPrototypeEntityId = "Changeling";

public readonly ProtoId<AntagPrototype> ChangelingPrototypeId = "Changeling";

public readonly ProtoId<NpcFactionPrototype> ChangelingFactionId = "Changeling";
Expand All @@ -39,6 +41,13 @@ public override void Initialize()

SubscribeLocalEvent<ChangelingRuleComponent, AfterAntagEntitySelectedEvent>(OnSelectAntag);
SubscribeLocalEvent<ChangelingRuleComponent, ObjectivesTextPrependEvent>(OnTextPrepend);
SubscribeLocalEvent<ChangelingRuleComponent, GetBriefingEvent>(OnGetBriefing);
}

private void OnGetBriefing(EntityUid uid, ChangelingRuleComponent comp, ref GetBriefingEvent args)
{
TryComp<MetaDataComponent>(uid, out var metaData);
args.Append(Loc.GetString("changeling-role-greeting", ("name", metaData?.EntityName ?? "Unknown")));
}

private void OnSelectAntag(EntityUid uid, ChangelingRuleComponent comp, ref AfterAntagEntitySelectedEvent args)
Expand All @@ -54,10 +63,9 @@ public bool MakeChangeling(EntityUid target, ChangelingRuleComponent rule)
if (TryComp<MetaDataComponent>(target, out var metaData))
{
var briefing = Loc.GetString("changeling-role-greeting", ("name", metaData?.EntityName ?? "Unknown"));
var briefingShort = Loc.GetString("changeling-role-greeting-short", ("name", metaData?.EntityName ?? "Unknown"));

_antag.SendBriefing(target, briefing, Color.Yellow, BriefingSound);
_role.MindAddRole(mindId, new RoleBriefingComponent { Briefing = briefingShort }, mind, true);
_role.MindAddRole(mindId, ChangelingPrototypeEntityId.ToString(), mind, true);
}
// hivemind stuff
_npcFaction.RemoveFaction(target, NanotrasenFactionId, false);
Expand Down
7 changes: 5 additions & 2 deletions Content.Server/Roles/ChangelingRoleComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

namespace Content.Server.Roles;

[RegisterComponent, ExclusiveAntagonist]
public sealed partial class ChangelingRoleComponent : AntagonistRoleComponent
/// <summary>
/// Added to mind role entities to tag that they are a changeling.
/// </summary>
[RegisterComponent]
public sealed partial class ChangelingRoleComponent : BaseMindRoleComponent
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,3 @@ changeling-role-greeting =
You are a changeling who has absorbed and taken the form of {$name}!
Your objectives are listed in the character menu.
Absorb, shapeshift and evolve to complete them!
changeling-role-greeting-short =
You are a changeling who has absorbed and taken the initial form of {$name}.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,3 @@ changeling-role-greeting =
Вы — генокрад, который поглотил и принял форму {$name}!
Ваши цели указаны в меню персонажа.
Поглощайте, изменяйте облик и эволюционируйте, чтобы выполнить их!
changeling-role-greeting-short =
Вы — генокрад, который поглотил и принял начальную форму {$name}.
11 changes: 11 additions & 0 deletions Resources/Prototypes/Roles/MindRoles/mind_roles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,3 +180,14 @@
antagPrototype: Zombie
exclusiveAntag: true
- type: ZombieRole

- type: entity
parent: BaseMindRoleAntag
id: MindRoleChangeling
name: Changeling Role
# description: mind-role-changeling-description
components:
- type: MindRole
antagPrototype: Changeling
exclusiveAntag: true
- type: ChangelingRole
2 changes: 1 addition & 1 deletion Resources/Prototypes/StatusIcon/faction.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
sprite: /Textures/Interface/Misc/job_icons.rsi
state: Syndicate

- type: statusIcon
- type: factionIcon
id: HivemindFaction
priority: 11
showTo:
Expand Down

0 comments on commit 5acb66f

Please sign in to comment.