Thief pacifist (#22932)

* pac

* to settings

* ensuuure me princess

* Update Content.Server/GameTicking/Rules/Components/ThiefRuleComponent.cs

Co-authored-by: faint <46868845+ficcialfaint@users.noreply.github.com>

* Update Content.Server/GameTicking/Rules/ThiefRuleSystem.cs

Co-authored-by: faint <46868845+ficcialfaint@users.noreply.github.com>

---------

Co-authored-by: faint <46868845+ficcialfaint@users.noreply.github.com>
This commit is contained in:
Ed
2023-12-25 06:42:48 +03:00
committed by GitHub
parent 52532e4075
commit 78354052ea
3 changed files with 13 additions and 3 deletions

View File

@@ -132,7 +132,7 @@ public sealed partial class AdminVerbSystem
if (!_minds.TryGetSession(targetMindComp.Mind, out var session))
return;
_thief.MakeThief(session);
_thief.MakeThief(session, false); //Midround add pacific is bad
},
Impact = LogImpact.High,
Message = Loc.GetString("admin-verb-make-thief"),

View File

@@ -12,6 +12,11 @@ namespace Content.Server.GameTicking.Rules.Components;
[RegisterComponent, Access(typeof(ThiefRuleSystem))]
public sealed partial class ThiefRuleComponent : Component
{
/// <summary>
/// Add a Pacified comp to thieves
/// </summary>
public bool PacifistThieves = true;
/// <summary>
/// A chance for this mode to be added to the game.
/// </summary>

View File

@@ -16,6 +16,7 @@ using System.Linq;
using Content.Shared.Humanoid;
using Content.Server.Antag;
using Robust.Server.Audio;
using Content.Shared.CombatMode.Pacification;
namespace Content.Server.GameTicking.Rules;
@@ -87,11 +88,11 @@ public sealed class ThiefRuleSystem : GameRuleSystem<ThiefRuleComponent>
foreach(var thief in selectedThieves)
{
MakeThief(thief);
MakeThief(thief, component.PacifistThieves);
}
}
public bool MakeThief(ICommonSession thief)
public bool MakeThief(ICommonSession thief, bool AddPacified)
{
var thiefRule = EntityQuery<ThiefRuleComponent>().FirstOrDefault();
if (thiefRule == null)
@@ -123,6 +124,10 @@ public sealed class ThiefRuleSystem : GameRuleSystem<ThiefRuleComponent>
PrototypeId = thiefRule.ThiefPrototypeId
});
//Add Pacified
if (AddPacified)
EnsureComp<PacifiedComponent>(mind.OwnedEntity.Value);
// Notificate player about new role assignment
if (_mindSystem.TryGetSession(mindId, out var session))
{