Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Jabak
2024-06-15 19:29:46 +03:00
51 changed files with 640 additions and 77 deletions

View File

@@ -3,15 +3,12 @@ using Content.Server._Miracle.GulagSystem;
using Content.Server.Actions;
using Content.Server.Antag;
using Content.Server.Bible.Components;
using Content.Server.Chat.Managers;
using Content.Server.GameTicking;
using Content.Server.GameTicking.Rules;
using Content.Server.GameTicking.Rules.Components;
using Content.Server.NPC.Systems;
using Content.Server.Objectives.Components;
using Content.Server.Roles;
using Content.Server.Roles.Jobs;
using Content.Server.RoundEnd;
using Content.Server.Shuttles.Components;
using Content.Server.StationEvents.Components;
using Content.Server.Storage.EntitySystems;
using Content.Shared.Body.Systems;
@@ -29,6 +26,7 @@ using Content.Shared._White;
using Content.Shared._White.Cult.Components;
using Content.Shared._White.Cult.Systems;
using Content.Shared._White.Mood;
using Content.Shared.Cloning;
using Content.Shared.Mind;
using Content.Shared.NPC.Systems;
using Robust.Server.Player;
@@ -72,10 +70,16 @@ public sealed class CultRuleSystem : GameRuleSystem<CultRuleComponent>
SubscribeLocalEvent<CultistComponent, ComponentInit>(OnCultistComponentInit);
SubscribeLocalEvent<CultistComponent, ComponentRemove>(OnCultistComponentRemoved);
SubscribeLocalEvent<CultistComponent, MobStateChangedEvent>(OnCultistsStateChanged);
SubscribeLocalEvent<CultistComponent, CloningEvent>(OnClone);
SubscribeLocalEvent<CultistRoleComponent, GetBriefingEvent>(OnGetBriefing);
}
private void OnClone(Entity<CultistComponent> ent, ref CloningEvent args)
{
RemoveObjectiveAndRole(ent);
}
protected override void Added(EntityUid uid, CultRuleComponent component, GameRuleComponent gameRule, GameRuleAddedEvent args)
{
base.Added(uid, component, gameRule, args);
@@ -178,6 +182,21 @@ public sealed class CultRuleSystem : GameRuleSystem<CultRuleComponent>
}
}
public void RemoveObjectiveAndRole(EntityUid uid)
{
if (!_mindSystem.TryGetMind(uid, out var mindId, out var mind))
return;
var objectives = mind.Objectives.FindAll(HasComp<PickCultTargetComponent>);
foreach (var obj in objectives)
{
_mindSystem.TryRemoveObjective(mindId, mind, mind.Objectives.IndexOf(obj));
}
if (_roleSystem.MindHasRole<CultistRoleComponent>(mindId))
_roleSystem.MindRemoveRole<CultistRoleComponent>(mindId);
}
private void OnCultistComponentRemoved(EntityUid uid, CultistComponent component, ComponentRemove args)
{
var query = QueryActiveRules();

View File

@@ -1,4 +1,5 @@
using System.Threading;
using Content.Server._White.Cult.GameRule;
using Content.Server.Objectives.Components;
using Content.Server.Popups;
using Content.Server.Roles;
@@ -8,6 +9,7 @@ using Content.Shared.IdentityManagement;
using Content.Shared.Inventory;
using Content.Shared._White.Cult.Components;
using Content.Shared._White.Mood;
using Content.Shared.Jittering;
using Content.Shared.Mind;
using JetBrains.Annotations;
using Robust.Server.Containers;
@@ -40,6 +42,8 @@ public sealed partial class DeconvertCultist : ReagentEffect
args.EntityManager.System<StunSystem>()
.TryParalyze(uid, TimeSpan.FromSeconds(component.HolyConvertTime + 5f), true);
args.EntityManager.System<SharedJitteringSystem>()
.DoJitter(uid, TimeSpan.FromSeconds(component.HolyConvertTime + 5f), true);
var target = Identity.Name(uid, args.EntityManager);
args.EntityManager.System<PopupSystem>()
.PopupEntity(Loc.GetString("holy-water-started-converting", ("target", target)), uid);
@@ -73,20 +77,8 @@ public sealed partial class DeconvertCultist : ReagentEffect
entityManager.RemoveComponent<CultistComponent>(uid);
entityManager.RemoveComponent<PentagramComponent>(uid);
var mindSystem = entityManager.System<SharedMindSystem>();
var roleSystem = entityManager.System<RoleSystem>();
if (!mindSystem.TryGetMind(uid, out var mindId, out var mind))
return;
var objectives = mind.Objectives.FindAll(entityManager.HasComponent<PickCultTargetComponent>);
foreach (var obj in objectives)
{
mindSystem.TryRemoveObjective(mindId, mind, mind.Objectives.IndexOf(obj));
}
if (roleSystem.MindHasRole<CultistRoleComponent>(mindId))
roleSystem.MindRemoveRole<CultistRoleComponent>(mindId);
var cultRuleSystem = entityManager.System<CultRuleSystem>();
cultRuleSystem.RemoveObjectiveAndRole(uid);
entityManager.EventBus.RaiseLocalEvent(uid, new MoodRemoveEffectEvent("CultFocused"));
}

View File

@@ -159,6 +159,7 @@ public sealed class WizardSpellsSystem : EntitySystem
_handsSystem.TryForcePickupAnyHand(msg.Performer, recallComponent.Item.Value);
msg.Handled = true;
Speak(msg);
return;
}

View File

@@ -50,7 +50,7 @@ public sealed partial class WizardRuleComponent : Component
[DataField]
public ProtoId<NpcFactionPrototype> Faction = "Wizard";
public RoundEndBehavior RoundEndBehavior = RoundEndBehavior.Nothing;
public RoundEndBehavior RoundEndBehavior = RoundEndBehavior.ShuttleCall;
[DataField]
public string RoundEndTextSender = "comms-console-announcement-title-centcom";