From: ScarKy0 <106310278+ScarKy0@users.noreply.github.com> Date: Thu, 14 Nov 2024 13:45:55 +0000 (+0100) Subject: Merge branch 'master' into ion-storm-refactor X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=755f322e29d40a08cd4952d7042a4c0f2d8c40bd;p=space-station-14.git Merge branch 'master' into ion-storm-refactor --- 755f322e29d40a08cd4952d7042a4c0f2d8c40bd diff --cc Content.Server/Silicons/Laws/SiliconLawSystem.cs index 27ed6702d6,9a361132a5..c2aa20f401 --- a/Content.Server/Silicons/Laws/SiliconLawSystem.cs +++ b/Content.Server/Silicons/Laws/SiliconLawSystem.cs @@@ -180,37 -177,10 +179,35 @@@ public sealed class SiliconLawSystem : if (component.AntagonistRole == null || !_mind.TryGetMind(uid, out var mindId, out _)) return; - if (_roles.MindHasRole(mindId)) - return; - - _roles.MindAddRole(mindId, new SubvertedSiliconRoleComponent { PrototypeId = component.AntagonistRole }); + if (!_roles.MindHasRole(mindId)) + _roles.MindAddRole(mindId, "MindRoleSubvertedSilicon"); } + private void OnStartIonStormedMindAdded(EntityUid uid, StartIonStormedComponent component, MindAddedMessage args) + { + if (HasComp(uid)) + EnsureStartIonStormedRole(uid, component); + } + + private void OnStartIonStormedMindRemoved(EntityUid uid, StartIonStormedComponent component, MindRemovedMessage args) + { + if (component.AntagonistRole == null) + return; + + _roles.MindTryRemoveRole(args.Mind); + } + + private void EnsureStartIonStormedRole(EntityUid uid, StartIonStormedComponent component) + { + if (component.AntagonistRole == null || !_mind.TryGetMind(uid, out var mindId, out _)) + return; + + if (_roles.MindHasRole(mindId)) + return; + + _roles.MindAddRole(mindId, new SubvertedSiliconRoleComponent { PrototypeId = component.AntagonistRole }); + } + public SiliconLawset GetLaws(EntityUid uid, SiliconLawBoundComponent? component = null) { if (!Resolve(uid, ref component)) diff --cc Resources/Prototypes/GameRules/events.yml index 763557e6c9,08218acced..6718c576a6 --- a/Resources/Prototypes/GameRules/events.yml +++ b/Resources/Prototypes/GameRules/events.yml @@@ -35,7 -35,7 +35,8 @@@ - id: RevenantSpawn - id: SleeperAgents - id: ZombieOutbreak + - id: DerelictCyborgSpawn + - id: LoneOpsSpawn - type: entity id: BaseStationEvent