diff --git a/Content.Server/GameTicking/Rules/ChangelingRuleSystem.cs b/Content.Server/GameTicking/Rules/ChangelingRuleSystem.cs index afd42c390c..dfb75ad59e 100644 --- a/Content.Server/GameTicking/Rules/ChangelingRuleSystem.cs +++ b/Content.Server/GameTicking/Rules/ChangelingRuleSystem.cs @@ -57,7 +57,12 @@ public sealed partial class ChangelingRuleSystem : GameRuleSystem(mindId, out var changelingRole); + if (changelingRole is not null) + { + AddComp(changelingRole.Value.Owner); + Comp(changelingRole.Value.Owner).Briefing = briefing; + } } // hivemind stuff _npcFaction.RemoveFaction(target, NanotrasenFactionId, false); diff --git a/Content.Server/Roles/ChangelingRoleComponent.cs b/Content.Server/Roles/ChangelingRoleComponent.cs index a1184c6795..12a5eb939f 100644 --- a/Content.Server/Roles/ChangelingRoleComponent.cs +++ b/Content.Server/Roles/ChangelingRoleComponent.cs @@ -2,7 +2,7 @@ using Content.Shared.Roles; namespace Content.Server.Roles; -[RegisterComponent, ExclusiveAntagonist] -public sealed partial class ChangelingRoleComponent : AntagonistRoleComponent +[RegisterComponent] +public sealed partial class ChangelingRoleComponent : BaseMindRoleComponent { } diff --git a/Content.Server/Roles/TerminatorRoleComponent.cs b/Content.Server/Roles/TerminatorRoleComponent.cs index 31deb9fb82..8e553b3e49 100644 --- a/Content.Server/Roles/TerminatorRoleComponent.cs +++ b/Content.Server/Roles/TerminatorRoleComponent.cs @@ -2,7 +2,7 @@ using Content.Shared.Roles; namespace Content.Server.Roles; -[RegisterComponent, ExclusiveAntagonist] -public sealed partial class TerminatorRoleComponent : AntagonistRoleComponent +[RegisterComponent] +public sealed partial class TerminatorRoleComponent : BaseMindRoleComponent { } diff --git a/Content.Server/Spawners/EntitySystems/SpawnPointSystem.cs b/Content.Server/Spawners/EntitySystems/SpawnPointSystem.cs index 31355921d4..2926d6b5ac 100644 --- a/Content.Server/Spawners/EntitySystems/SpawnPointSystem.cs +++ b/Content.Server/Spawners/EntitySystems/SpawnPointSystem.cs @@ -37,7 +37,7 @@ public sealed class SpawnPointSystem : EntitySystem if (args.DesiredSpawnPointType != SpawnPointType.Unset) { var isMatchingJob = spawnPoint.SpawnType == SpawnPointType.Job && - (args.Job == null || spawnPoint.Job == args.Job.Prototype); + (args.Job == null || spawnPoint.Job == args.Job); switch (args.DesiredSpawnPointType) { diff --git a/Content.Server/Terminator/Systems/TerminatorSystem.cs b/Content.Server/Terminator/Systems/TerminatorSystem.cs index b669935277..5a9825e9d1 100644 --- a/Content.Server/Terminator/Systems/TerminatorSystem.cs +++ b/Content.Server/Terminator/Systems/TerminatorSystem.cs @@ -38,13 +38,14 @@ public sealed class TerminatorSystem : EntitySystem private void OnCreated(EntityUid uid, TerminatorComponent comp, ref GenericAntagCreatedEvent args) { var mindId = args.MindId; - var mind = args.Mind; - _role.MindAddRole(mindId, new RoleBriefingComponent + _role.MindAddRole(mindId, "MindRoleTerminator"); + _role.MindHasRole(mindId, out var terminatorRole); + if (terminatorRole is not null) { - Briefing = Loc.GetString("terminator-role-briefing") - }, mind); - _role.MindAddRole(mindId, new TerminatorRoleComponent(), mind); + AddComp(terminatorRole.Value.Owner); + Comp(terminatorRole.Value.Owner).Briefing = Loc.GetString("terminator-role-briefing"); + } } /// diff --git a/Content.Server/_Sunrise/EvilTwin/EvilTwinRoleComponent.cs b/Content.Server/_Sunrise/EvilTwin/EvilTwinRoleComponent.cs index 6b5d6f85c3..9bcfc3d2d5 100644 --- a/Content.Server/_Sunrise/EvilTwin/EvilTwinRoleComponent.cs +++ b/Content.Server/_Sunrise/EvilTwin/EvilTwinRoleComponent.cs @@ -3,7 +3,7 @@ using Content.Shared.Roles; namespace Content.Server._Sunrise.EvilTwin; [RegisterComponent] -public sealed partial class EvilTwinRoleComponent : AntagonistRoleComponent +public sealed partial class EvilTwinRoleComponent : BaseMindRoleComponent { } diff --git a/Content.Server/_Sunrise/EvilTwin/EvilTwinSystem.cs b/Content.Server/_Sunrise/EvilTwin/EvilTwinSystem.cs index 68be76f38e..934b27eae6 100644 --- a/Content.Server/_Sunrise/EvilTwin/EvilTwinSystem.cs +++ b/Content.Server/_Sunrise/EvilTwin/EvilTwinSystem.cs @@ -119,11 +119,7 @@ public sealed class EvilTwinSystem : EntitySystem !_mindSystem.TryGetMind(uid, out var mindId, out var mind)) return; - var role = new EvilTwinRoleComponent - { - PrototypeId = EvilTwinRole, - }; - _roleSystem.MindAddRole(mindId, role, mind); + _roleSystem.MindAddRole(mindId, "MindRoleEvilTwin"); _mindSystem.TryAddObjective(mindId, mind, EscapeObjective); _mindSystem.TryAddObjective(mindId, mind, KillObjective); if (_mindSystem.TryGetObjectiveComp(uid, out var obj)) @@ -141,7 +137,7 @@ public sealed class EvilTwinSystem : EntitySystem if (!_mindSystem.TryGetMind(actor.PlayerSession, out var mindId, out var mind) || mind.OwnedEntity == null) continue; - if (!_jobSystem.MindTryGetJob(mindId, out _, out _)) + if (!_jobSystem.MindTryGetJob(mindId, out _)) continue; uid = mind.OwnedEntity; @@ -171,7 +167,7 @@ public sealed class EvilTwinSystem : EntitySystem detailCopy.Content = detail.Content; } - if (_jobSystem.MindTryGetJob(mindId, out _, out var jobProto) && jobProto.StartingGear != null) + if (_jobSystem.MindTryGetJob(mindId, out var jobProto) && jobProto.StartingGear != null) { var jobLoadout = LoadoutSystem.GetJobPrototype(jobProto.ID); diff --git a/Content.Server/_Sunrise/Fugitive/FugitiveRoleComponent.cs b/Content.Server/_Sunrise/Fugitive/FugitiveRoleComponent.cs index 80930a422c..767f56ad9a 100644 --- a/Content.Server/_Sunrise/Fugitive/FugitiveRoleComponent.cs +++ b/Content.Server/_Sunrise/Fugitive/FugitiveRoleComponent.cs @@ -3,7 +3,7 @@ using Content.Shared.Roles; namespace Content.Server._Sunrise.Fugitive; [RegisterComponent] -public sealed partial class FugitiveRoleComponent : AntagonistRoleComponent +public sealed partial class FugitiveRoleComponent : BaseMindRoleComponent { } diff --git a/Content.Server/_Sunrise/Fugitive/FugitiveSystem.cs b/Content.Server/_Sunrise/Fugitive/FugitiveSystem.cs index 104309359e..5477c43e22 100644 --- a/Content.Server/_Sunrise/Fugitive/FugitiveSystem.cs +++ b/Content.Server/_Sunrise/Fugitive/FugitiveSystem.cs @@ -138,10 +138,7 @@ namespace Content.Server._Sunrise.Fugitive _roleSystem.MindTryRemoveRole(mindId); } - _roleSystem.MindAddRole(mindId, new FugitiveRoleComponent - { - PrototypeId = AntagRole, - }); + _roleSystem.MindAddRole(mindId, "MindRoleFugitive"); _mindSystem.TryAddObjective(mindId, mind, EscapeObjective); diff --git a/Content.Server/_Sunrise/PlanetPrison/PlanetPrisonSystem.cs b/Content.Server/_Sunrise/PlanetPrison/PlanetPrisonSystem.cs index 90d414966d..134cf372bf 100644 --- a/Content.Server/_Sunrise/PlanetPrison/PlanetPrisonSystem.cs +++ b/Content.Server/_Sunrise/PlanetPrison/PlanetPrisonSystem.cs @@ -159,10 +159,7 @@ namespace Content.Server._Sunrise.PlanetPrison _roleSystem.MindTryRemoveRole(mindId); } - _roleSystem.MindAddRole(mindId, new PlanetPrisonerRoleComponent - { - PrototypeId = AntagRole, - }); + _roleSystem.MindAddRole(mindId, "MindRolePlanetPrisoner"); _mindSystem.TryAddObjective(mindId, mind, EscapeObjective); diff --git a/Content.Server/_Sunrise/PlanetPrison/PlanetPrisonerRoleComponent.cs b/Content.Server/_Sunrise/PlanetPrison/PlanetPrisonerRoleComponent.cs index 53a0cff496..6a00c84137 100644 --- a/Content.Server/_Sunrise/PlanetPrison/PlanetPrisonerRoleComponent.cs +++ b/Content.Server/_Sunrise/PlanetPrison/PlanetPrisonerRoleComponent.cs @@ -3,7 +3,7 @@ using Content.Shared.Roles; namespace Content.Server._Sunrise.PlanetPrison; [RegisterComponent] -public sealed partial class PlanetPrisonerRoleComponent : AntagonistRoleComponent +public sealed partial class PlanetPrisonerRoleComponent : BaseMindRoleComponent { } diff --git a/Resources/Prototypes/GameRules/midround.yml b/Resources/Prototypes/GameRules/midround.yml index a0d93d724a..73cbd6d480 100644 --- a/Resources/Prototypes/GameRules/midround.yml +++ b/Resources/Prototypes/GameRules/midround.yml @@ -40,8 +40,8 @@ agentName: changeling-roundend-name definitions: - prefRoles: [ Changeling ] - max: 5 - playerRatio: 10 + max: 4 + playerRatio: 30 lateJoinAdditional: true mindRoles: - MindRoleChangeling diff --git a/Resources/Prototypes/Roles/MindRoles/mind_roles.yml b/Resources/Prototypes/Roles/MindRoles/mind_roles.yml index eb92fa51ae..3a0c52acc4 100644 --- a/Resources/Prototypes/Roles/MindRoles/mind_roles.yml +++ b/Resources/Prototypes/Roles/MindRoles/mind_roles.yml @@ -178,3 +178,12 @@ antagPrototype: Zombie exclusiveAntag: true - type: ZombieRole + +- type: entity + parent: BaseMindRoleAntag + id: MindRoleChangeling + name: Changeling Role + components: + - type: MindRole + antagPrototype: Changeling + - type: ChangelingRole diff --git a/Resources/Prototypes/_Sunrise/Roles/MindRoles/mind_roles.yml b/Resources/Prototypes/_Sunrise/Roles/MindRoles/mind_roles.yml new file mode 100644 index 0000000000..c09cb2869b --- /dev/null +++ b/Resources/Prototypes/_Sunrise/Roles/MindRoles/mind_roles.yml @@ -0,0 +1,35 @@ +- type: entity + parent: BaseMindRoleAntag + id: MindRoleTerminator + name: Terminator Role + components: + - type: MindRole + antagPrototype: Changeling + - type: TerminatorRole + +- type: entity + parent: BaseMindRoleAntag + id: MindRoleEvilTwin + name: Evil Twin Role + components: + - type: MindRole + antagPrototype: Changeling + - type: EvilTwinRole + +- type: entity + parent: BaseMindRoleAntag + id: MindRoleFugitive + name: Fugitive Role + components: + - type: MindRole + antagPrototype: Changeling + - type: FugitiveRole + +- type: entity + parent: BaseMindRoleAntag + id: MindRolePlanetPrisoner + name: Planet Prisoner Role + components: + - type: MindRole + antagPrototype: Changeling + - type: PlanetPrisonerRole