diff --git a/mod/Jailbreak.RTD/Jailbreak.RTD.csproj b/mod/Jailbreak.RTD/Jailbreak.RTD.csproj index a273b64a..ad80f8cd 100644 --- a/mod/Jailbreak.RTD/Jailbreak.RTD.csproj +++ b/mod/Jailbreak.RTD/Jailbreak.RTD.csproj @@ -12,4 +12,10 @@ + + + ..\..\public\Jailbreak.Public\Mixin\MAULActainShared.dll + + + diff --git a/mod/Jailbreak.RTD/RewardGenerator.cs b/mod/Jailbreak.RTD/RewardGenerator.cs index 37be80d2..13c90e46 100644 --- a/mod/Jailbreak.RTD/RewardGenerator.cs +++ b/mod/Jailbreak.RTD/RewardGenerator.cs @@ -52,7 +52,7 @@ public void Start(BasePlugin basePlugin) { PROB_MEDIUM), // Low - (new HPReward(1), PROB_LOW), + (new ChatSpyReward(basePlugin), PROB_LOW), (new HPReward(1), PROB_LOW), (new ColorReward(Color.FromArgb(0, 255, 0), true), PROB_LOW), (new ColorReward(Color.FromArgb(255, 0, 0), true), PROB_LOW), (new CannotPickupReward(basePlugin, WeaponType.GRENADE), PROB_LOW), diff --git a/mod/Jailbreak.RTD/Rewards/ChatSpyReward.cs b/mod/Jailbreak.RTD/Rewards/ChatSpyReward.cs new file mode 100644 index 00000000..a19791c0 --- /dev/null +++ b/mod/Jailbreak.RTD/Rewards/ChatSpyReward.cs @@ -0,0 +1,34 @@ +using CounterStrikeSharp.API; +using CounterStrikeSharp.API.Core; +using Jailbreak.Public; +using Jailbreak.Public.Mod.RTD; + +namespace Jailbreak.RTD.Rewards; + +public class ChatSpyReward : IRTDReward { + public ChatSpyReward(BasePlugin plugin) { + plugin.RegisterEventHandler(onRoundEnd); + } + + private HookResult onRoundEnd(EventRoundEnd @event, GameEventInfo info) { + foreach (var player in Utilities.GetPlayers()) { + if (API.Actain == null) return HookResult.Continue; + API.Actain.getSpyService().SetSpy(player.SteamID, false); + } + + return HookResult.Continue; + } + + public string Name => "Chat Spy"; + + public string? Description + => "You will be able to read all team chats next round."; + + public bool Enabled => API.Actain != null; + + public bool GrantReward(CCSPlayerController player) { + if (API.Actain == null) return false; + API.Actain.getSpyService().SetSpy(player.SteamID, true); + return true; + } +} \ No newline at end of file diff --git a/public/Jailbreak.Public/Mixin/MAULActainShared.dll b/public/Jailbreak.Public/Mixin/MAULActainShared.dll index 78158405..afaef79e 100644 Binary files a/public/Jailbreak.Public/Mixin/MAULActainShared.dll and b/public/Jailbreak.Public/Mixin/MAULActainShared.dll differ