From 943c1dd85357009220b0ac27203c5ef6878a3536 Mon Sep 17 00:00:00 2001 From: MSWS Date: Sat, 31 Aug 2024 03:05:37 -0700 Subject: [PATCH 1/5] Unmute everyone on round start regardless of peace status --- mod/Jailbreak.Mute/MuteSystem.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/Jailbreak.Mute/MuteSystem.cs b/mod/Jailbreak.Mute/MuteSystem.cs index 89eb9de3..9775d933 100644 --- a/mod/Jailbreak.Mute/MuteSystem.cs +++ b/mod/Jailbreak.Mute/MuteSystem.cs @@ -61,7 +61,6 @@ public void PeaceMute(MuteReason reason) { public void UnPeaceMute() { if (guardTimer != null) unmuteGuards(); - if (prisonerTimer != null) unmutePrisoners(); } @@ -85,6 +84,7 @@ public void Dispose() { [GameEventHandler] public HookResult OnRoundStart(EventRoundStart @event, GameEventInfo info) { UnPeaceMute(); + foreach (var player in Utilities.GetPlayers()) unmute(player); return HookResult.Continue; } From f0e5824a6c4e7e67b4b4be6e7db424cb79a9b6a0 Mon Sep 17 00:00:00 2001 From: MSWS Date: Wed, 18 Sep 2024 20:24:01 -0700 Subject: [PATCH 2/5] Dont enable LR if already enabled --- mod/Jailbreak.LastRequest/LastRequestManager.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/mod/Jailbreak.LastRequest/LastRequestManager.cs b/mod/Jailbreak.LastRequest/LastRequestManager.cs index 29971e58..e30e0eec 100644 --- a/mod/Jailbreak.LastRequest/LastRequestManager.cs +++ b/mod/Jailbreak.LastRequest/LastRequestManager.cs @@ -253,6 +253,7 @@ public HookResult OnPlayerDisconnect(EventPlayerDisconnect @event, private void checkLR() { Server.RunOnTick(Server.TickCount + 32, () => { + if (IsLREnabled) return; if (Utilities.GetPlayers().All(p => p.Team != CsTeam.CounterTerrorist)) return; if (countAlivePrisoners() > CV_PRISONER_TO_LR.Value) return; From 889868f70e373896ce04da78cfe97f596bac973a Mon Sep 17 00:00:00 2001 From: MSWS Date: Thu, 19 Sep 2024 20:29:23 -0700 Subject: [PATCH 3/5] Fix warden breaking after guaranteed warden rtd --- mod/Jailbreak.LastRequest/LastRequestFactory.cs | 1 + mod/Jailbreak.LastRequest/LastRequestManager.cs | 6 +++++- mod/Jailbreak.LastRequest/LastRequests/BulletForBullet.cs | 1 + mod/Jailbreak.LastRequest/LastRequests/Coinflip.cs | 1 + mod/Jailbreak.LastRequest/LastRequests/KnifeFight.cs | 1 + mod/Jailbreak.LastRequest/LastRequests/NoScope.cs | 1 + mod/Jailbreak.LastRequest/LastRequests/RockPaperScissors.cs | 1 + mod/Jailbreak.LastRequest/LastRequests/WeaponizedRequest.cs | 1 + mod/Jailbreak.Warden/Selection/WardenSelectionBehavior.cs | 3 +-- 9 files changed, 13 insertions(+), 3 deletions(-) diff --git a/mod/Jailbreak.LastRequest/LastRequestFactory.cs b/mod/Jailbreak.LastRequest/LastRequestFactory.cs index af23fead..7135b305 100644 --- a/mod/Jailbreak.LastRequest/LastRequestFactory.cs +++ b/mod/Jailbreak.LastRequest/LastRequestFactory.cs @@ -1,3 +1,4 @@ +using System; using CounterStrikeSharp.API.Core; using Jailbreak.Formatting.Views.LastRequest; using Jailbreak.LastRequest.LastRequests; diff --git a/mod/Jailbreak.LastRequest/LastRequestManager.cs b/mod/Jailbreak.LastRequest/LastRequestManager.cs index e30e0eec..ee87d645 100644 --- a/mod/Jailbreak.LastRequest/LastRequestManager.cs +++ b/mod/Jailbreak.LastRequest/LastRequestManager.cs @@ -1,4 +1,8 @@ -using CounterStrikeSharp.API; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using CounterStrikeSharp.API; using CounterStrikeSharp.API.Core; using CounterStrikeSharp.API.Core.Attributes.Registration; using CounterStrikeSharp.API.Modules.Cvars; diff --git a/mod/Jailbreak.LastRequest/LastRequests/BulletForBullet.cs b/mod/Jailbreak.LastRequest/LastRequests/BulletForBullet.cs index 06e9b3a7..5f627ed6 100644 --- a/mod/Jailbreak.LastRequest/LastRequests/BulletForBullet.cs +++ b/mod/Jailbreak.LastRequest/LastRequests/BulletForBullet.cs @@ -1,3 +1,4 @@ +using System; using CounterStrikeSharp.API; using CounterStrikeSharp.API.Core; using CounterStrikeSharp.API.Modules.Menu; diff --git a/mod/Jailbreak.LastRequest/LastRequests/Coinflip.cs b/mod/Jailbreak.LastRequest/LastRequests/Coinflip.cs index fa8bc3a6..aff1eef2 100644 --- a/mod/Jailbreak.LastRequest/LastRequests/Coinflip.cs +++ b/mod/Jailbreak.LastRequest/LastRequests/Coinflip.cs @@ -1,3 +1,4 @@ +using System; using CounterStrikeSharp.API.Core; using CounterStrikeSharp.API.Modules.Menu; using Jailbreak.Formatting.Extensions; diff --git a/mod/Jailbreak.LastRequest/LastRequests/KnifeFight.cs b/mod/Jailbreak.LastRequest/LastRequests/KnifeFight.cs index 4b1e38a2..5b025256 100644 --- a/mod/Jailbreak.LastRequest/LastRequests/KnifeFight.cs +++ b/mod/Jailbreak.LastRequest/LastRequests/KnifeFight.cs @@ -1,3 +1,4 @@ +using System; using CounterStrikeSharp.API.Core; using Jailbreak.Public.Mod.LastRequest.Enums; diff --git a/mod/Jailbreak.LastRequest/LastRequests/NoScope.cs b/mod/Jailbreak.LastRequest/LastRequests/NoScope.cs index 1d3a4654..bd498a39 100644 --- a/mod/Jailbreak.LastRequest/LastRequests/NoScope.cs +++ b/mod/Jailbreak.LastRequest/LastRequests/NoScope.cs @@ -1,3 +1,4 @@ +using System; using CounterStrikeSharp.API; using CounterStrikeSharp.API.Core; using CounterStrikeSharp.API.Modules.Timers; diff --git a/mod/Jailbreak.LastRequest/LastRequests/RockPaperScissors.cs b/mod/Jailbreak.LastRequest/LastRequests/RockPaperScissors.cs index a6759bec..dee5a6a4 100644 --- a/mod/Jailbreak.LastRequest/LastRequests/RockPaperScissors.cs +++ b/mod/Jailbreak.LastRequest/LastRequests/RockPaperScissors.cs @@ -1,3 +1,4 @@ +using System; using CounterStrikeSharp.API.Core; using CounterStrikeSharp.API.Modules.Menu; using CounterStrikeSharp.API.Modules.Timers; diff --git a/mod/Jailbreak.LastRequest/LastRequests/WeaponizedRequest.cs b/mod/Jailbreak.LastRequest/LastRequests/WeaponizedRequest.cs index b0d13682..fb228a23 100644 --- a/mod/Jailbreak.LastRequest/LastRequests/WeaponizedRequest.cs +++ b/mod/Jailbreak.LastRequest/LastRequests/WeaponizedRequest.cs @@ -1,3 +1,4 @@ +using System; using CounterStrikeSharp.API.Core; using Jailbreak.Formatting.Extensions; using Jailbreak.Formatting.Views.LastRequest; diff --git a/mod/Jailbreak.Warden/Selection/WardenSelectionBehavior.cs b/mod/Jailbreak.Warden/Selection/WardenSelectionBehavior.cs index a2a70ce2..dbbe15ff 100644 --- a/mod/Jailbreak.Warden/Selection/WardenSelectionBehavior.cs +++ b/mod/Jailbreak.Warden/Selection/WardenSelectionBehavior.cs @@ -112,6 +112,7 @@ public void ScheduleChooseWarden(float time = 7.0f) { /// protected void OnChooseWarden() { guaranteedWarden.Clear(); + queueInactive = true; if (warden.HasWarden) return; var eligible = Utilities.GetPlayers() .Where(player => player.PawnIsAlive) @@ -124,7 +125,6 @@ protected void OnChooseWarden() { if (eligible.Count == 0) { locale.NoWardens.ToAllChat(); - queueInactive = true; return; } @@ -154,7 +154,6 @@ protected void OnChooseWarden() { // Disable the warden raffle for future wardens // (eg in the event of warden death) - queueInactive = true; } private bool canEnterQueue(CCSPlayerController player) { From dab8864f9d437f8ba8f424fd25a1e4a53331329d Mon Sep 17 00:00:00 2001 From: MSWS Date: Fri, 11 Oct 2024 21:39:56 -0700 Subject: [PATCH 4/5] Add count command --- .../Warden/WardenCmdCountLocale.cs | 32 +++++++++++++ .../Commands/CountCommandsBehavior.cs | 46 +++++++++++++++++++ .../Markers/WardenMarkerBehavior.cs | 20 ++++---- .../WardenServiceExtension.cs | 3 +- .../Views/Warden/IWardenCmdCountLocale.cs | 9 ++++ .../Mod/Warden/IMarkerService.cs | 22 +++++++++ 6 files changed, 123 insertions(+), 9 deletions(-) create mode 100644 lang/Jailbreak.English/Warden/WardenCmdCountLocale.cs create mode 100644 mod/Jailbreak.Warden/Commands/CountCommandsBehavior.cs create mode 100644 public/Jailbreak.Formatting/Views/Warden/IWardenCmdCountLocale.cs create mode 100644 public/Jailbreak.Public/Mod/Warden/IMarkerService.cs diff --git a/lang/Jailbreak.English/Warden/WardenCmdCountLocale.cs b/lang/Jailbreak.English/Warden/WardenCmdCountLocale.cs new file mode 100644 index 00000000..8515b935 --- /dev/null +++ b/lang/Jailbreak.English/Warden/WardenCmdCountLocale.cs @@ -0,0 +1,32 @@ +using CounterStrikeSharp.API.Core; +using CounterStrikeSharp.API.Modules.Utils; +using Jailbreak.Formatting.Base; +using Jailbreak.Formatting.Logistics; +using Jailbreak.Formatting.Views.Warden; + +namespace Jailbreak.English.Warden; + +public class WardenCmdCountLocale : IWardenCmdCountLocale, + ILanguage { + public IView PrisonersInMarker(int prisoners) { + return new SimpleView { + WardenLocale.PREFIX, + ChatColors.Grey + "There " + (prisoners == 1 ? "is" : " are"), + prisoners, + ChatColors.Grey + "prisoner" + (prisoners == 1 ? "" : "s") + + " in the marker." + }; + } + + public IView CannotCountYet(int seconds) { + return new SimpleView { + WardenLocale.PREFIX, + "You must wait", + seconds, + "seconds before counting prisoners." + }; + } + + public IView NoMarkerSet + => new SimpleView { WardenLocale.PREFIX, "No marker set." }; +} \ No newline at end of file diff --git a/mod/Jailbreak.Warden/Commands/CountCommandsBehavior.cs b/mod/Jailbreak.Warden/Commands/CountCommandsBehavior.cs new file mode 100644 index 00000000..ad9af894 --- /dev/null +++ b/mod/Jailbreak.Warden/Commands/CountCommandsBehavior.cs @@ -0,0 +1,46 @@ +using CounterStrikeSharp.API.Core; +using CounterStrikeSharp.API.Core.Attributes.Registration; +using CounterStrikeSharp.API.Modules.Commands; +using CounterStrikeSharp.API.Modules.Cvars; +using CounterStrikeSharp.API.Modules.Cvars.Validators; +using CounterStrikeSharp.API.Modules.Utils; +using Jailbreak.Formatting.Extensions; +using Jailbreak.Formatting.Views.Warden; +using Jailbreak.Public.Behaviors; +using Jailbreak.Public.Mod.Warden; +using Jailbreak.Public.Utils; +using Microsoft.VisualBasic; + +namespace Jailbreak.Warden.Commands; + +public class CountCommandsBehavior(IWardenService warden, IWardenLocale msg, + IWardenCmdCountLocale locale, IMarkerService markers) : IPluginBehavior { + public static readonly FakeConVar CV_COUNT_COMMAND_COOLDOWN = new( + "css_jb_warden_count_cooldown", + "Minimum seconds warden must wait before being able to count perisoners in marker.", + 30, customValidators: new RangeValidator(0, 300)); + + [ConsoleCommand("css_count", "Counts the prisoners in marker")] + public void Command_Count(CCSPlayerController? executor, CommandInfo info) { + if (executor == null) return; + if (!warden.IsWarden(executor)) { + msg.NotWarden.ToChat(executor); + return; + } + + if (RoundUtil.GetTimeElapsed() < CV_COUNT_COMMAND_COOLDOWN.Value) { + locale.CannotCountYet(CV_COUNT_COMMAND_COOLDOWN.Value).ToChat(executor); + return; + } + + if (markers.MarkerPosition == null) { + locale.NoMarkerSet.ToChat(executor); + return; + } + + var prisoners = PlayerUtil.FromTeam(CsTeam.Terrorist) + .Count(markers.InMarker); + + locale.PrisonersInMarker(prisoners); + } +} \ No newline at end of file diff --git a/mod/Jailbreak.Warden/Markers/WardenMarkerBehavior.cs b/mod/Jailbreak.Warden/Markers/WardenMarkerBehavior.cs index 3880eb1d..a982c208 100644 --- a/mod/Jailbreak.Warden/Markers/WardenMarkerBehavior.cs +++ b/mod/Jailbreak.Warden/Markers/WardenMarkerBehavior.cs @@ -12,7 +12,8 @@ namespace Jailbreak.Warden.Markers; -public class WardenMarkerBehavior(IWardenService warden) : IPluginBehavior { +public class WardenMarkerBehavior(IWardenService warden) + : IPluginBehavior, IMarkerService { public static readonly FakeConVar CV_MAX_RADIUS = new( "css_jb_warden_marker_max_radius", "Maximum radius for warden marker", 360); @@ -23,11 +24,14 @@ public class WardenMarkerBehavior(IWardenService warden) : IPluginBehavior { "css_jb_warden_resize_time", "Milliseconds to wait for resizing marker", 800); - private Vector? currentPos; + public Vector? MarkerPosition { get; private set; } + public float radius { get; private set; } + + // private Vector? MarkerPosition; private BeamCircle? marker; private long placementTime; - private float radius; + // private float radius; public void Start(BasePlugin basePlugin) { marker = new BeamCircle(basePlugin, new Vector(), CV_MIN_RADIUS.Value, @@ -42,8 +46,8 @@ public HookResult OnPing(EventPlayerPing @event, GameEventInfo info) { if (!warden.IsWarden(player)) return HookResult.Handled; var vec = new Vector(@event.X, @event.Y, @event.Z); - if (currentPos != null) { - var distance = currentPos.Distance(vec); + if (MarkerPosition != null) { + var distance = MarkerPosition.Distance(vec); var timeElapsed = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() - placementTime; if (timeElapsed < CV_RESIZE_TIME.Value) { @@ -61,9 +65,9 @@ public HookResult OnPing(EventPlayerPing @event, GameEventInfo info) { } } - radius = CV_MIN_RADIUS.Value; - currentPos = vec; - placementTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(); + radius = CV_MIN_RADIUS.Value; + MarkerPosition = vec; + placementTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(); API.Stats?.PushStat(new ServerStat("JB_MARKER", $"{vec.X:F2} {vec.Y:F2} {vec.Z:F2}")); diff --git a/mod/Jailbreak.Warden/WardenServiceExtension.cs b/mod/Jailbreak.Warden/WardenServiceExtension.cs index 78165ffa..86816e8e 100644 --- a/mod/Jailbreak.Warden/WardenServiceExtension.cs +++ b/mod/Jailbreak.Warden/WardenServiceExtension.cs @@ -20,6 +20,7 @@ public static void AddJailbreakWarden( .AddPluginBehavior(); serviceCollection .AddPluginBehavior(); + serviceCollection.AddPluginBehavior(); serviceCollection.AddPluginBehavior(); @@ -28,7 +29,7 @@ public static void AddJailbreakWarden( serviceCollection.AddPluginBehavior(); serviceCollection.AddPluginBehavior(); - serviceCollection.AddPluginBehavior(); + serviceCollection.AddPluginBehavior(); serviceCollection.AddPluginBehavior(); } } \ No newline at end of file diff --git a/public/Jailbreak.Formatting/Views/Warden/IWardenCmdCountLocale.cs b/public/Jailbreak.Formatting/Views/Warden/IWardenCmdCountLocale.cs new file mode 100644 index 00000000..d1da9d4b --- /dev/null +++ b/public/Jailbreak.Formatting/Views/Warden/IWardenCmdCountLocale.cs @@ -0,0 +1,9 @@ +using Jailbreak.Formatting.Base; + +namespace Jailbreak.Formatting.Views.Warden; + +public interface IWardenCmdCountLocale { + public IView PrisonersInMarker(int prisoners); + public IView CannotCountYet(int seconds); + public IView NoMarkerSet { get; } +} \ No newline at end of file diff --git a/public/Jailbreak.Public/Mod/Warden/IMarkerService.cs b/public/Jailbreak.Public/Mod/Warden/IMarkerService.cs new file mode 100644 index 00000000..024ae232 --- /dev/null +++ b/public/Jailbreak.Public/Mod/Warden/IMarkerService.cs @@ -0,0 +1,22 @@ +using CounterStrikeSharp.API.Core; +using CounterStrikeSharp.API.Modules.Utils; +using Jailbreak.Public.Extensions; + +namespace Jailbreak.Public.Mod.Warden; + +public interface IMarkerService { + Vector? MarkerPosition { get; } + float radius { get; } + + public bool InMarker(Vector pos) { + if (MarkerPosition == null) return false; + var widenedRadius = radius + 32; + return MarkerPosition.DistanceSquared(pos) <= widenedRadius * widenedRadius; + } + + public bool InMarker(CCSPlayerController player) { + if (MarkerPosition == null) return false; + var pos = player.PlayerPawn.Value?.AbsOrigin; + return pos != null && InMarker(pos); + } +} \ No newline at end of file From 20091189c1006b92d3717c443a36c6887b883d53 Mon Sep 17 00:00:00 2001 From: MSWS Date: Fri, 11 Oct 2024 21:42:46 -0700 Subject: [PATCH 5/5] Cleanup --- .../Warden/WardenCmdCountLocale.cs | 1 - mod/Gangs.Boostrap/Gangs.Boostrap.csproj | 2 +- .../Gangs.SpecialDayColorPerk.csproj | 12 ++++++------ mod/Gangs.SpecialDayColorPerk/SDColorPerk.cs | 9 +++++---- mod/Jailbreak.LastRequest/LastRequestFactory.cs | 1 - mod/Jailbreak.LastRequest/LastRequestManager.cs | 16 ++++++---------- .../LastRequests/BulletForBullet.cs | 4 +--- .../LastRequests/Coinflip.cs | 1 - .../LastRequests/KnifeFight.cs | 1 - .../LastRequests/NoScope.cs | 1 - .../LastRequests/RockPaperScissors.cs | 1 - .../LastRequests/WeaponizedRequest.cs | 1 - mod/Jailbreak.RTD/Rewards/WeaponReward.cs | 5 ++--- .../Jailbreak.SpecialDay.csproj | 4 ++-- mod/Jailbreak.SpecialDay/SpecialDayManager.cs | 5 +---- .../Commands/CountCommandsBehavior.cs | 1 - .../Markers/WardenMarkerBehavior.cs | 7 ++++--- mod/Jailbreak.Warden/WardenServiceExtension.cs | 2 +- .../Views/Warden/IWardenCmdCountLocale.cs | 2 +- 19 files changed, 30 insertions(+), 46 deletions(-) diff --git a/lang/Jailbreak.English/Warden/WardenCmdCountLocale.cs b/lang/Jailbreak.English/Warden/WardenCmdCountLocale.cs index 8515b935..8a3885f2 100644 --- a/lang/Jailbreak.English/Warden/WardenCmdCountLocale.cs +++ b/lang/Jailbreak.English/Warden/WardenCmdCountLocale.cs @@ -1,4 +1,3 @@ -using CounterStrikeSharp.API.Core; using CounterStrikeSharp.API.Modules.Utils; using Jailbreak.Formatting.Base; using Jailbreak.Formatting.Logistics; diff --git a/mod/Gangs.Boostrap/Gangs.Boostrap.csproj b/mod/Gangs.Boostrap/Gangs.Boostrap.csproj index d38ef7b3..c9c1b0f6 100644 --- a/mod/Gangs.Boostrap/Gangs.Boostrap.csproj +++ b/mod/Gangs.Boostrap/Gangs.Boostrap.csproj @@ -8,7 +8,7 @@ - + diff --git a/mod/Gangs.SpecialDayColorPerk/Gangs.SpecialDayColorPerk.csproj b/mod/Gangs.SpecialDayColorPerk/Gangs.SpecialDayColorPerk.csproj index 00f19816..3502e553 100644 --- a/mod/Gangs.SpecialDayColorPerk/Gangs.SpecialDayColorPerk.csproj +++ b/mod/Gangs.SpecialDayColorPerk/Gangs.SpecialDayColorPerk.csproj @@ -7,18 +7,18 @@ - + - - ..\..\public\Jailbreak.Public\Mixin\GangsAPI.dll - + + ..\..\public\Jailbreak.Public\Mixin\GangsAPI.dll + - - + + diff --git a/mod/Gangs.SpecialDayColorPerk/SDColorPerk.cs b/mod/Gangs.SpecialDayColorPerk/SDColorPerk.cs index 274f5f33..7d6b56fb 100644 --- a/mod/Gangs.SpecialDayColorPerk/SDColorPerk.cs +++ b/mod/Gangs.SpecialDayColorPerk/SDColorPerk.cs @@ -10,16 +10,19 @@ namespace Gangs.SpecialDayColorPerk; public class SDColorPerk(IServiceProvider provider) : BasePerk(provider) { - public override string StatId => STAT_ID; - public override string Name => "Special Day Color"; public const string STAT_ID = "jb_sd_color"; private readonly IGangStatManager gangStats = provider.GetRequiredService(); + public override string StatId => STAT_ID; + public override string Name => "Special Day Color"; + public override string? Description => "Change the color of your gang during special days!"; + public override SDColorData Value { get; set; } = new(); + public override Task GetCost(IGangPlayer player) { return Task.FromResult(null); } @@ -35,8 +38,6 @@ public override string? Description public override Task OnPurchase(IGangPlayer player) { return Task.CompletedTask; } - - public override SDColorData Value { get; set; } = new(); } public class SDColorData { diff --git a/mod/Jailbreak.LastRequest/LastRequestFactory.cs b/mod/Jailbreak.LastRequest/LastRequestFactory.cs index 7135b305..af23fead 100644 --- a/mod/Jailbreak.LastRequest/LastRequestFactory.cs +++ b/mod/Jailbreak.LastRequest/LastRequestFactory.cs @@ -1,4 +1,3 @@ -using System; using CounterStrikeSharp.API.Core; using Jailbreak.Formatting.Views.LastRequest; using Jailbreak.LastRequest.LastRequests; diff --git a/mod/Jailbreak.LastRequest/LastRequestManager.cs b/mod/Jailbreak.LastRequest/LastRequestManager.cs index 680be557..ce638cbc 100644 --- a/mod/Jailbreak.LastRequest/LastRequestManager.cs +++ b/mod/Jailbreak.LastRequest/LastRequestManager.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using CounterStrikeSharp.API; +using CounterStrikeSharp.API; using CounterStrikeSharp.API.Core; using CounterStrikeSharp.API.Core.Attributes.Registration; using CounterStrikeSharp.API.Modules.Cvars; @@ -95,11 +91,6 @@ public void DisableLRForRound() { IsLREnabledForRound = false; } - private static bool shouldGrantCredits() { - if (API.Gangs == null) return false; - return Utilities.GetPlayers().Count >= CV_MIN_PLAYERS_FOR_CREDITS.Value; - } - public void EnableLR(CCSPlayerController? died = null) { messages.LastRequestEnabled().ToAllChat(); IsLREnabled = true; @@ -187,6 +178,11 @@ public bool EndLastRequest(AbstractLastRequest lr, LRResult result) { return true; } + private static bool shouldGrantCredits() { + if (API.Gangs == null) return false; + return Utilities.GetPlayers().Count >= CV_MIN_PLAYERS_FOR_CREDITS.Value; + } + [GameEventHandler(HookMode.Pre)] public HookResult OnTakeDamage(EventPlayerHurt @event, GameEventInfo info) { IDamageBlocker damageBlockerHandler = this; diff --git a/mod/Jailbreak.LastRequest/LastRequests/BulletForBullet.cs b/mod/Jailbreak.LastRequest/LastRequests/BulletForBullet.cs index 87df0841..4931cac6 100644 --- a/mod/Jailbreak.LastRequest/LastRequests/BulletForBullet.cs +++ b/mod/Jailbreak.LastRequest/LastRequests/BulletForBullet.cs @@ -1,4 +1,3 @@ -using System; using CounterStrikeSharp.API; using CounterStrikeSharp.API.Core; using CounterStrikeSharp.API.Modules.Menu; @@ -13,6 +12,7 @@ namespace Jailbreak.LastRequest.LastRequests; public class BulletForBullet : TeleportingRequest { + private const string weaponName = "weapon_deagle"; private readonly ChatMenu chatMenu; private readonly bool magForMag; private readonly ILRB4BLocale msg; @@ -42,8 +42,6 @@ public override void Setup() { Execute(); } - private const string weaponName = "weapon_deagle"; - public override void Execute() { State = LRState.PENDING; MenuManager.OpenChatMenu(Prisoner, chatMenu); diff --git a/mod/Jailbreak.LastRequest/LastRequests/Coinflip.cs b/mod/Jailbreak.LastRequest/LastRequests/Coinflip.cs index aff1eef2..fa8bc3a6 100644 --- a/mod/Jailbreak.LastRequest/LastRequests/Coinflip.cs +++ b/mod/Jailbreak.LastRequest/LastRequests/Coinflip.cs @@ -1,4 +1,3 @@ -using System; using CounterStrikeSharp.API.Core; using CounterStrikeSharp.API.Modules.Menu; using Jailbreak.Formatting.Extensions; diff --git a/mod/Jailbreak.LastRequest/LastRequests/KnifeFight.cs b/mod/Jailbreak.LastRequest/LastRequests/KnifeFight.cs index 5b025256..4b1e38a2 100644 --- a/mod/Jailbreak.LastRequest/LastRequests/KnifeFight.cs +++ b/mod/Jailbreak.LastRequest/LastRequests/KnifeFight.cs @@ -1,4 +1,3 @@ -using System; using CounterStrikeSharp.API.Core; using Jailbreak.Public.Mod.LastRequest.Enums; diff --git a/mod/Jailbreak.LastRequest/LastRequests/NoScope.cs b/mod/Jailbreak.LastRequest/LastRequests/NoScope.cs index bd498a39..1d3a4654 100644 --- a/mod/Jailbreak.LastRequest/LastRequests/NoScope.cs +++ b/mod/Jailbreak.LastRequest/LastRequests/NoScope.cs @@ -1,4 +1,3 @@ -using System; using CounterStrikeSharp.API; using CounterStrikeSharp.API.Core; using CounterStrikeSharp.API.Modules.Timers; diff --git a/mod/Jailbreak.LastRequest/LastRequests/RockPaperScissors.cs b/mod/Jailbreak.LastRequest/LastRequests/RockPaperScissors.cs index dee5a6a4..a6759bec 100644 --- a/mod/Jailbreak.LastRequest/LastRequests/RockPaperScissors.cs +++ b/mod/Jailbreak.LastRequest/LastRequests/RockPaperScissors.cs @@ -1,4 +1,3 @@ -using System; using CounterStrikeSharp.API.Core; using CounterStrikeSharp.API.Modules.Menu; using CounterStrikeSharp.API.Modules.Timers; diff --git a/mod/Jailbreak.LastRequest/LastRequests/WeaponizedRequest.cs b/mod/Jailbreak.LastRequest/LastRequests/WeaponizedRequest.cs index fb228a23..b0d13682 100644 --- a/mod/Jailbreak.LastRequest/LastRequests/WeaponizedRequest.cs +++ b/mod/Jailbreak.LastRequest/LastRequests/WeaponizedRequest.cs @@ -1,4 +1,3 @@ -using System; using CounterStrikeSharp.API.Core; using Jailbreak.Formatting.Extensions; using Jailbreak.Formatting.Views.LastRequest; diff --git a/mod/Jailbreak.RTD/Rewards/WeaponReward.cs b/mod/Jailbreak.RTD/Rewards/WeaponReward.cs index 23d459d2..cef94276 100644 --- a/mod/Jailbreak.RTD/Rewards/WeaponReward.cs +++ b/mod/Jailbreak.RTD/Rewards/WeaponReward.cs @@ -20,9 +20,8 @@ public WeaponReward(string weapon, CsTeam? requiredTeam = CsTeam.Terrorist) { public virtual string Name => weapon.GetFriendlyWeaponName(); public virtual string Description - => "You won a" - + (weapon.GetFriendlyWeaponName()[0].IsVowel() ? "n" : "") + " " - + weapon.GetFriendlyWeaponName() + " next round."; + => "You won a" + (weapon.GetFriendlyWeaponName()[0].IsVowel() ? "n" : "") + + " " + weapon.GetFriendlyWeaponName() + " next round."; public bool CanGrantReward(CCSPlayerController player) { if (requiredTeam == null) return true; diff --git a/mod/Jailbreak.SpecialDay/Jailbreak.SpecialDay.csproj b/mod/Jailbreak.SpecialDay/Jailbreak.SpecialDay.csproj index 78f28541..6d20f6ef 100644 --- a/mod/Jailbreak.SpecialDay/Jailbreak.SpecialDay.csproj +++ b/mod/Jailbreak.SpecialDay/Jailbreak.SpecialDay.csproj @@ -10,14 +10,14 @@ - + - ..\..\public\Jailbreak.Public\Mixin\GangsAPI.dll + ..\..\public\Jailbreak.Public\Mixin\GangsAPI.dll ..\..\public\Jailbreak.Public\Mixin\MStatsShared.dll diff --git a/mod/Jailbreak.SpecialDay/SpecialDayManager.cs b/mod/Jailbreak.SpecialDay/SpecialDayManager.cs index dc85cb93..3b83278c 100644 --- a/mod/Jailbreak.SpecialDay/SpecialDayManager.cs +++ b/mod/Jailbreak.SpecialDay/SpecialDayManager.cs @@ -1,12 +1,9 @@ -using System.Drawing; -using System.Net; -using CounterStrikeSharp.API; +using CounterStrikeSharp.API; using CounterStrikeSharp.API.Core; using CounterStrikeSharp.API.Core.Attributes.Registration; using CounterStrikeSharp.API.Modules.Utils; using Gangs.SpecialDayColorPerk; using GangsAPI.Data; -using GangsAPI.Perks; using GangsAPI.Services.Gang; using GangsAPI.Services.Player; using Jailbreak.Formatting.Extensions; diff --git a/mod/Jailbreak.Warden/Commands/CountCommandsBehavior.cs b/mod/Jailbreak.Warden/Commands/CountCommandsBehavior.cs index ad9af894..964bb157 100644 --- a/mod/Jailbreak.Warden/Commands/CountCommandsBehavior.cs +++ b/mod/Jailbreak.Warden/Commands/CountCommandsBehavior.cs @@ -9,7 +9,6 @@ using Jailbreak.Public.Behaviors; using Jailbreak.Public.Mod.Warden; using Jailbreak.Public.Utils; -using Microsoft.VisualBasic; namespace Jailbreak.Warden.Commands; diff --git a/mod/Jailbreak.Warden/Markers/WardenMarkerBehavior.cs b/mod/Jailbreak.Warden/Markers/WardenMarkerBehavior.cs index a982c208..3063243d 100644 --- a/mod/Jailbreak.Warden/Markers/WardenMarkerBehavior.cs +++ b/mod/Jailbreak.Warden/Markers/WardenMarkerBehavior.cs @@ -24,13 +24,14 @@ public class WardenMarkerBehavior(IWardenService warden) "css_jb_warden_resize_time", "Milliseconds to wait for resizing marker", 800); - public Vector? MarkerPosition { get; private set; } - public float radius { get; private set; } - // private Vector? MarkerPosition; private BeamCircle? marker; private long placementTime; + + public Vector? MarkerPosition { get; private set; } + + public float radius { get; private set; } // private float radius; public void Start(BasePlugin basePlugin) { diff --git a/mod/Jailbreak.Warden/WardenServiceExtension.cs b/mod/Jailbreak.Warden/WardenServiceExtension.cs index 86816e8e..51442958 100644 --- a/mod/Jailbreak.Warden/WardenServiceExtension.cs +++ b/mod/Jailbreak.Warden/WardenServiceExtension.cs @@ -20,7 +20,7 @@ public static void AddJailbreakWarden( .AddPluginBehavior(); serviceCollection .AddPluginBehavior(); - + serviceCollection.AddPluginBehavior(); serviceCollection.AddPluginBehavior(); diff --git a/public/Jailbreak.Formatting/Views/Warden/IWardenCmdCountLocale.cs b/public/Jailbreak.Formatting/Views/Warden/IWardenCmdCountLocale.cs index d1da9d4b..bde4b7c4 100644 --- a/public/Jailbreak.Formatting/Views/Warden/IWardenCmdCountLocale.cs +++ b/public/Jailbreak.Formatting/Views/Warden/IWardenCmdCountLocale.cs @@ -3,7 +3,7 @@ namespace Jailbreak.Formatting.Views.Warden; public interface IWardenCmdCountLocale { + public IView NoMarkerSet { get; } public IView PrisonersInMarker(int prisoners); public IView CannotCountYet(int seconds); - public IView NoMarkerSet { get; } } \ No newline at end of file