QoE Update — 2

## Added

- **`Spectator` use cooldown** (`UseCooldown` in skillsInfo.json, default 0.5s) — every press destroyed and recreated the camera prop, with no rate limit.
- **`SkillUtils.ClearCursesFor(playerIndex)`** — clears a leaving player's curse bookkeeping from both sides (as curser and as victim).
- **`SkillUtils.AnyCurseCapacity(player)`** — reports whether a player still has  any enemy left that is under the curse limit.
- **`Spectator.PlayerDisconnect`** handler.
- **`Thief`** added to the curse skill set.

## Changed

- **`CurseSkillPerPlayer` is ignored in GameMode 1 (TeamSkills), 2 (SameSkills) and 5 (Debug).**
- **Curse target menus no longer go empty.** When every living enemy is already at the limit, the menu falls back to the unfiltered list and the claim is forced through.
- `C4Camouflage` `MaxPerServer` -1 -> 1
This commit is contained in:
ByDexter 2026-07-31 01:38:50 +03:00
parent b0b50a224f
commit 7292ab1787
9 changed files with 101 additions and 35 deletions

View file

@ -21,6 +21,8 @@ namespace src.player.skills
private static readonly Color terroristWire = Color.FromArgb(255, 255, 64, 64);
private static readonly Color counterTerroristWire = Color.FromArgb(255, 64, 128, 255);
private const double attemptCooldown = .5;
public static void LoadSkill()
{
SkillUtils.RegisterSkill(skillName, SkillsInfo.GetValue<string>(skillName, "color"));
@ -125,6 +127,9 @@ namespace src.player.skills
if (!SkillPlayerInfo.TryGetValue(player.Index, out var skillInfo) || !skillInfo.CanUse) return;
if ((DateTime.Now - skillInfo.LastAttempt).TotalSeconds < attemptCooldown) return;
skillInfo.LastAttempt = DateTime.Now;
if (!TryPlaceWire(player))
{
playerEvent.PrintToChat($" {ChatColors.Red}" + playerEvent.GetTranslation("tripwire_no_wall_info"));
@ -306,6 +311,7 @@ namespace src.player.skills
{
public bool CanUse { get; set; }
public DateTime Cooldown { get; set; }
public DateTime LastAttempt { get; set; }
}
public class SkillConfig(Skills skill = skillName, bool active = true, string color = "#ff3b3b", CsTeam onlyTeam = CsTeam.None, bool disableOnFreezeTime = false, bool needsTeammates = false, string requiredPermission = "", float? hudDuration = null, float? descriptionHudDuration = null, int maxPerServer = -1, Rarity rarity = Rarity.Rare, float radarDuration = 5f, float triggerRadius = 24f, float wireHeight = 30f, float wireWidth = 1.5f, float maxWallDistance = 400f, float cooldown = 20f) : SkillsInfo.DefaultSkillInfo(skill, active, color, onlyTeam, disableOnFreezeTime, needsTeammates, requiredPermission, hudDuration, descriptionHudDuration, maxPerServer, rarity)