mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-26 18:17:12 +03:00
Mime can no longer write on paper without breaking their vow (#35043)
Co-authored-by: Simon <63975668+Simyon264@users.noreply.github.com> (cherry picked from commit e86770f5a03231e3189920c5d7ad93542d48e922)
This commit is contained in:
committed by
Spatison
parent
0384fa5185
commit
69b65ec514
20
Content.Shared/Paper/BlockWritingSystem.cs
Normal file
20
Content.Shared/Paper/BlockWritingSystem.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user