]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Dragon Direction Briefing Fixed (#37181)
authorJCGWE30 <70826117+JCGWE30@users.noreply.github.com>
Sat, 10 May 2025 23:35:27 +0000 (18:35 -0500)
committerGitHub <noreply@github.com>
Sat, 10 May 2025 23:35:27 +0000 (19:35 -0400)
* All Fixed Up

* Remove Log Manager

* Updated Conventions

* Typo Fix

Content.Server/GameTicking/Rules/DragonRuleSystem.cs
Resources/Prototypes/Roles/MindRoles/mind_roles.yml

index 96021e6123be55e463530ae888123662ff26fcff..de13218568e441ae3de2ec665ca1b5e339a6c30d 100644 (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);
     }
 
index 687b7e17bf8d90109fb1305a39cc19518eb2aaca..79223ed67da2a17412a73c74e2328b86dc20c949 100644 (file)
     subtype: role-subtype-dragon
     exclusiveAntag: true
   - type: DragonRole
-  - type: RoleBriefing
-    briefing: dragon-role-briefing
 
 # Ninja
 - type: entity