Added Kill Tome (Death Note). (#39011)
Co-authored-by: ScarKy0 <scarky0@onet.eu>
This commit is contained in:
@@ -187,6 +187,7 @@ public sealed class PaperSystem : EntitySystem
|
||||
{
|
||||
var ev = new PaperWriteAttemptEvent(entity.Owner);
|
||||
RaiseLocalEvent(args.Actor, ref ev);
|
||||
|
||||
if (ev.Cancelled)
|
||||
return;
|
||||
|
||||
@@ -211,6 +212,9 @@ public sealed class PaperSystem : EntitySystem
|
||||
|
||||
entity.Comp.Mode = PaperAction.Read;
|
||||
UpdateUserInterface(entity);
|
||||
|
||||
var writeAfterEv = new PaperAfterWriteEvent(args.Actor);
|
||||
RaiseLocalEvent(entity.Owner, ref writeAfterEv);
|
||||
}
|
||||
|
||||
private void OnRandomPaperContentMapInit(Entity<RandomPaperContentComponent> ent, ref MapInitEvent args)
|
||||
@@ -319,6 +323,14 @@ public record struct PaperWriteEvent(EntityUid User, EntityUid Paper);
|
||||
/// <summary>
|
||||
/// Cancellable event for attempting to write on a piece of paper.
|
||||
/// </summary>
|
||||
/// <param name="paper">The paper that the writing will take place on.</param>
|
||||
/// <param name="Paper">The paper that the writing will take place on.</param>
|
||||
[ByRefEvent]
|
||||
public record struct PaperWriteAttemptEvent(EntityUid Paper, string? FailReason = null, bool Cancelled = false);
|
||||
|
||||
/// <summary>
|
||||
/// Event raised on paper after it was written on by someone.
|
||||
/// </summary>
|
||||
/// <param name="Actor">Entity that wrote something on the paper.</param>
|
||||
[ByRefEvent]
|
||||
public readonly record struct PaperAfterWriteEvent(EntityUid Actor);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user