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

fix initial infected icons and add a briefing to the character menu #29259

Merged
merged 1 commit into from
Jun 21, 2024
Merged
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
17 changes: 17 additions & 0 deletions Content.Server/Administration/Systems/AdminVerbSystem.Antags.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ public sealed partial class AdminVerbSystem
[ValidatePrototypeId<EntityPrototype>]
private const string DefaultTraitorRule = "Traitor";

[ValidatePrototypeId<EntityPrototype>]
private const string DefaultInitialInfectedRule = "Zombie";

[ValidatePrototypeId<EntityPrototype>]
private const string DefaultNukeOpRule = "LoneOpsSpawn";

Expand Down Expand Up @@ -63,6 +66,20 @@ private void AddAntagVerbs(GetVerbsEvent<Verb> args)
};
args.Verbs.Add(traitor);

Verb initialInfected = new()
{
Text = Loc.GetString("admin-verb-text-make-initial-infected"),
Category = VerbCategory.Antag,
Icon = new SpriteSpecifier.Rsi(new("/Textures/Interface/Misc/job_icons.rsi"), "InitialInfected"),
Act = () =>
{
_antag.ForceMakeAntag<ZombieRuleComponent>(targetPlayer, DefaultInitialInfectedRule);
},
Impact = LogImpact.High,
Message = Loc.GetString("admin-verb-make-initial-infected"),
};
args.Verbs.Add(initialInfected);

Verb zombie = new()
{
Text = Loc.GetString("admin-verb-text-make-zombie"),
Expand Down
19 changes: 19 additions & 0 deletions Content.Server/GameTicking/Rules/ZombieRuleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Content.Server.Chat.Systems;
using Content.Server.GameTicking.Rules.Components;
using Content.Server.Popups;
using Content.Server.Roles;
using Content.Server.RoundEnd;
using Content.Server.Station.Components;
using Content.Server.Station.Systems;
Expand Down Expand Up @@ -35,9 +36,27 @@ public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<InitialInfectedRoleComponent, GetBriefingEvent>(OnGetBriefing);
SubscribeLocalEvent<ZombieRoleComponent, GetBriefingEvent>(OnGetBriefing);
SubscribeLocalEvent<IncurableZombieComponent, ZombifySelfActionEvent>(OnZombifySelf);
}

private void OnGetBriefing(EntityUid uid, InitialInfectedRoleComponent component, ref GetBriefingEvent args)
{
if (!TryComp<MindComponent>(uid, out var mind) || mind.OwnedEntity == null)
return;
if (HasComp<ZombieRoleComponent>(uid)) // don't show both briefings
return;
args.Append(Loc.GetString("zombie-patientzero-role-greeting"));
}

private void OnGetBriefing(EntityUid uid, ZombieRoleComponent component, ref GetBriefingEvent args)
{
if (!TryComp<MindComponent>(uid, out var mind) || mind.OwnedEntity == null)
return;
args.Append(Loc.GetString("zombie-infection-greeting"));
}

protected override void AppendRoundEndText(EntityUid uid, ZombieRuleComponent component, GameRuleComponent gameRule,
ref RoundEndTextAppendEvent args)
{
Expand Down
4 changes: 3 additions & 1 deletion Resources/Locale/en-US/administration/antag.ftl
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
verb-categories-antag = Antag ctrl
admin-verb-make-traitor = Make the target into a traitor.
admin-verb-make-initial-infected = Make the target into an Initial Infected.
admin-verb-make-zombie = Zombifies the target immediately.
admin-verb-make-nuclear-operative = Make target into a lone Nuclear Operative.
admin-verb-make-pirate = Make the target into a pirate. Note this doesn't configure the game rule.
admin-verb-make-head-rev = Make the target into a Head Revolutionary.
admin-verb-make-thief = Make the target into a thief.

admin-verb-text-make-traitor = Make Traitor
admin-verb-text-make-initial-infected = Make Initial Infected
admin-verb-text-make-zombie = Make Zombie
admin-verb-text-make-nuclear-operative = Make Nuclear Operative
admin-verb-text-make-pirate = Make Pirate
admin-verb-text-make-head-rev = Make Head Rev
admin-verb-text-make-thief = Make Thief
admin-verb-text-make-thief = Make Thief
3 changes: 2 additions & 1 deletion Resources/Prototypes/GameRules/events.yml
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@
duration: 60
maxDuration: 120
- type: PowerGridCheckRule

- type: entity
parent: BaseGameRule
id: SolarFlare
Expand Down Expand Up @@ -404,6 +404,7 @@
maxInitialInfectedGrace: 450
- type: ZombifyOnDeath
- type: IncurableZombie
- type: InitialInfected
mindComponents:
- type: InitialInfectedRole
prototype: InitialInfected
Expand Down
1 change: 1 addition & 0 deletions Resources/Prototypes/GameRules/roundstart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@
- type: PendingZombie
- type: ZombifyOnDeath
- type: IncurableZombie
- type: InitialInfected
mindComponents:
- type: InitialInfectedRole
prototype: InitialInfected
Expand Down
Loading