From 4e508261a3b3879bef6512b7b7f9afd1a039eb51 Mon Sep 17 00:00:00 2001
From: Yamato <66829532+louis1706@users.noreply.github.com>
Date: Tue, 6 Aug 2024 19:33:05 +0200
Subject: [PATCH] RecontainedEventArgs more feature (#20)
* RecontainedEventArgs more feature
* Fix Naming
* grammar
* Update RecontainedEventArgs.cs
---------
Co-authored-by: Misaka-ZeroTwo <45165615+Misaka-ZeroTwo@users.noreply.github.com>
---
.../EventArgs/Scp079/RecontainedEventArgs.cs | 25 +++++++++++++++++--
.../Patches/Events/Scp079/Recontain.cs | 3 ++-
2 files changed, 25 insertions(+), 3 deletions(-)
diff --git a/EXILED/Exiled.Events/EventArgs/Scp079/RecontainedEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp079/RecontainedEventArgs.cs
index 84a2e93ad..49b5dbebd 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp079/RecontainedEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp079/RecontainedEventArgs.cs
@@ -22,10 +22,16 @@ public class RecontainedEventArgs : IScp079Event
///
///
///
- public RecontainedEventArgs(Player player)
+ ///
+ ///
+ ///
+ public RecontainedEventArgs(Player player, PlayerRoles.PlayableScps.Scp079.Scp079Recontainer scp079Recontainer)
{
Player = player;
Scp079 = player.Role.As();
+ Recontainer = scp079Recontainer;
+ Attacker = Player.Get(scp079Recontainer._activatorGlass.LastAttacker);
+ IsAutomatic = scp079Recontainer._activatorGlass.LastAttacker.IsSet;
}
///
@@ -35,5 +41,20 @@ public RecontainedEventArgs(Player player)
///
public Scp079Role Scp079 { get; }
+
+ ///
+ /// Gets the instance that handle SCP-079 recontained proccess.
+ ///
+ public PlayerRoles.PlayableScps.Scp079.Scp079Recontainer Recontainer { get; }
+
+ ///
+ /// Gets the player who recontained SCP-079.
+ ///
+ public Player Attacker { get; }
+
+ ///
+ /// Gets a value indicating whether the recontainment has been made automatically or by triggering the process.
+ ///
+ public bool IsAutomatic { get; }
}
-}
\ No newline at end of file
+}
diff --git a/EXILED/Exiled.Events/Patches/Events/Scp079/Recontain.cs b/EXILED/Exiled.Events/Patches/Events/Scp079/Recontain.cs
index 991ffc47e..3338c84ab 100644
--- a/EXILED/Exiled.Events/Patches/Events/Scp079/Recontain.cs
+++ b/EXILED/Exiled.Events/Patches/Events/Scp079/Recontain.cs
@@ -37,9 +37,10 @@ private static IEnumerable Transpiler(IEnumerable