Dragon Direction Briefing Fixed (#37181)

* All Fixed Up

* Remove Log Manager

* Updated Conventions

* Typo Fix
This commit is contained in:
JCGWE30
2025-05-10 18:35:27 -05:00
committed by GitHub
parent d758e9eaa1
commit 29147edabd
2 changed files with 25 additions and 2 deletions

View File

@@ -1,7 +1,11 @@
using Content.Server.Antag;
using Content.Server.Dragon;
using Content.Server.GameTicking.Rules.Components;
using Content.Server.Mind;
using Content.Server.Roles;
using Content.Server.Station.Components;
using Content.Server.Station.Systems;
using Content.Shared.CharacterInfo;
using Content.Shared.Localizations;
using Robust.Server.GameObjects;
@@ -12,16 +16,37 @@ public sealed class DragonRuleSystem : GameRuleSystem<DragonRuleComponent>
[Dependency] private readonly TransformSystem _transform = default!;
[Dependency] private readonly AntagSelectionSystem _antag = default!;
[Dependency] private readonly StationSystem _station = default!;
[Dependency] private readonly RoleSystem _roleSystem = default!;
[Dependency] private readonly MindSystem _mind = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<DragonRuleComponent, AfterAntagEntitySelectedEvent>(AfterAntagEntitySelected);
SubscribeLocalEvent<DragonRoleComponent, GetBriefingEvent>(UpdateBriefing);
}
private void UpdateBriefing(Entity<DragonRoleComponent> entity, ref GetBriefingEvent args)
{
var ent = args.Mind.Comp.OwnedEntity;
if(ent is null)
return;
args.Append(MakeBriefing(ent.Value));
}
private void AfterAntagEntitySelected(Entity<DragonRuleComponent> ent, ref AfterAntagEntitySelectedEvent args)
{
if (!_mind.TryGetMind(args.EntityUid, out var mindId, out var mind))
return;
_roleSystem.MindHasRole<DragonRoleComponent>(mindId, out var dragonRole);
if(dragonRole is null)
return;
_antag.SendBriefing(args.EntityUid, MakeBriefing(args.EntityUid), null, null);
}

View File

@@ -144,8 +144,6 @@
subtype: role-subtype-dragon
exclusiveAntag: true
- type: DragonRole
- type: RoleBriefing
briefing: dragon-role-briefing
# Ninja
- type: entity