Skip to content

Commit 9153b43

Browse files
authored
Merge branch 'dev' into IScp330Event
2 parents e291111 + 4e50826 commit 9153b43

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

EXILED/Exiled.Events/EventArgs/Scp079/RecontainedEventArgs.cs

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,16 @@ public class RecontainedEventArgs : IScp079Event
2222
/// <param name="player">
2323
/// <inheritdoc cref="Player" />
2424
/// </param>
25-
public RecontainedEventArgs(Player player)
25+
/// <param name="scp079Recontainer">
26+
/// <inheritdoc cref="Recontainer" />
27+
/// </param>
28+
public RecontainedEventArgs(Player player, PlayerRoles.PlayableScps.Scp079.Scp079Recontainer scp079Recontainer)
2629
{
2730
Player = player;
2831
Scp079 = player.Role.As<Scp079Role>();
32+
Recontainer = scp079Recontainer;
33+
Attacker = Player.Get(scp079Recontainer._activatorGlass.LastAttacker);
34+
IsAutomatic = scp079Recontainer._activatorGlass.LastAttacker.IsSet;
2935
}
3036

3137
/// <summary>
@@ -35,5 +41,20 @@ public RecontainedEventArgs(Player player)
3541

3642
/// <inheritdoc/>
3743
public Scp079Role Scp079 { get; }
44+
45+
/// <summary>
46+
/// Gets the instance that handle SCP-079 recontained proccess.
47+
/// </summary>
48+
public PlayerRoles.PlayableScps.Scp079.Scp079Recontainer Recontainer { get; }
49+
50+
/// <summary>
51+
/// Gets the player who recontained SCP-079.
52+
/// </summary>
53+
public Player Attacker { get; }
54+
55+
/// <summary>
56+
/// Gets a value indicating whether the recontainment has been made automatically or by triggering the process.
57+
/// </summary>
58+
public bool IsAutomatic { get; }
3859
}
39-
}
60+
}

EXILED/Exiled.Events/Patches/Events/Scp079/Recontain.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@ private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstructi
3737

3838
CodeInstruction[] recontainedEvent = new CodeInstruction[]
3939
{
40-
// Handlers.Scp079.OnRecontained(new RecontainedEventArgs(Player.Get(referenceHub2)));
40+
// Handlers.Scp079.OnRecontained(new RecontainedEventArgs(Player.Get(referenceHub2), this));
4141
new(OpCodes.Ldloc, 5),
4242
new(OpCodes.Call, Method(typeof(Player), nameof(Player.Get), new[] { typeof(ReferenceHub) })),
43+
new(OpCodes.Ldarg_0),
4344
new(OpCodes.Newobj, GetDeclaredConstructors(typeof(RecontainedEventArgs))[0]),
4445
new(OpCodes.Call, Method(typeof(Scp079), nameof(Scp079.OnRecontained))),
4546
};

0 commit comments

Comments
 (0)