Mime can no longer write on paper without breaking their vow (#35043)

Co-authored-by: Simon <63975668+Simyon264@users.noreply.github.com>
This commit is contained in:
SpeltIncorrectyl
2025-02-26 09:11:59 +00:00
committed by GitHub
parent 08a274dc28
commit e86770f5a0
10 changed files with 100 additions and 6 deletions

View File

@@ -0,0 +1,20 @@
namespace Content.Shared.Paper;
/// <summary>
/// A system that prevents those with the IlliterateComponent from writing on paper.
/// Has no effect on reading ability.
/// </summary>
public sealed class BlockWritingSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<BlockWritingComponent, PaperWriteAttemptEvent>(OnPaperWriteAttempt);
}
private void OnPaperWriteAttempt(Entity<BlockWritingComponent> entity, ref PaperWriteAttemptEvent args)
{
args.FailReason = entity.Comp.FailWriteMessage;
args.Cancelled = true;
}
}