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

This commit is contained in:
slarticodefast
2024-06-21 07:42:17 +02:00
committed by GitHub
parent 880fef507d
commit d62dddcfcb
5 changed files with 42 additions and 2 deletions

View File

@@ -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";
@@ -63,6 +66,20 @@ public sealed partial class AdminVerbSystem
};
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"),

View File

@@ -2,6 +2,7 @@ using Content.Server.Antag;
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;
@@ -35,9 +36,27 @@ public sealed class ZombieRuleSystem : GameRuleSystem<ZombieRuleComponent>
{
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)
{

View File

@@ -1,5 +1,6 @@
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.
@@ -7,8 +8,9 @@ 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

View File

@@ -277,7 +277,7 @@
duration: 60
maxDuration: 120
- type: PowerGridCheckRule
- type: entity
parent: BaseGameRule
id: SolarFlare
@@ -404,6 +404,7 @@
maxInitialInfectedGrace: 450
- type: ZombifyOnDeath
- type: IncurableZombie
- type: InitialInfected
mindComponents:
- type: InitialInfectedRole
prototype: InitialInfected

View File

@@ -244,6 +244,7 @@
- type: PendingZombie
- type: ZombifyOnDeath
- type: IncurableZombie
- type: InitialInfected
mindComponents:
- type: InitialInfectedRole
prototype: InitialInfected