v1.2.2.b3

## 📋 Changelog

- #### General:
    - ###### Updated Chinese language translation by [by: [@Ericzzrbb](hhttps://github.com/Ericzzrbb)].
    - ###### Fixed a bug where a player could be given multiple skills at once while the HUD displayed only one (the player list was never cleared on map change and had no duplicate protection on join). [by: [@ByDexterTR](https://github.com/ByDexterTR)]
    - ###### Fixed skill names and descriptions showing the raw translation key on Turkish servers (culture-sensitive lowercasing) - affected skills starting with "I" (e.g. Illiterate, Impostor, InfiniteAmmo, Iana). [by: [@ByDexterTR](https://github.com/ByDexterTR)]
    - ###### RayTrace-based skills and the skill-use button no longer throw when the RayTrace module is not installed - they now degrade gracefully instead of crashing. [by: [@ByDexterTR](https://github.com/ByDexterTR)]
    - ###### Fixed the skill-use button (when bound to Use/E) blocking option selection inside WSAD target menus. [by: [@ByDexterTR](https://github.com/ByDexterTR)]
    - ###### Performance: cached reflection lookups in `SkillAction` and `SkillsInfo.GetValue`, and de-duplicated the repeated event-dispatch logic on hot paths (OnTick, OnTakeDamage, etc.). [by: [@ByDexterTR](https://github.com/ByDexterTR)]
    - ###### Stability: removed dead methods that threw `NotImplementedException`, hardened team-score handling, and reset all skill state on round start / map change. [by: [@ByDexterTR](https://github.com/ByDexterTR)]
    - ###### Build: post-build copy paths now follow the active `$(Configuration)` and `$(TargetFramework)`. [by: [@ByDexterTR](https://github.com/ByDexterTR)]
    - ###### Added new Turkish translation strings for the skill notifications listed below. [by: [@ByDexterTR](https://github.com/ByDexterTR)]
    - ###### Fixed bot-related messages so they now display correctly in the chat of the controlling player.
    - ###### When a player takes control of a bot, all active skill effects affecting that bot are now correctly transferred to the controlling player.
    - ###### Prevented bots from automatically using skills while being controlled by a player.

- #### Skill improvements:
    - ###### Wallhack:
        - ###### Fixed enemy outlines briefly flashing for everyone when the skill holder dies. [by: [@ByDexterTR](https://github.com/ByDexterTR)]
    - ###### Area Reaper:
        - ###### Teammates (CT) are now notified which bombsite (A/B) was sealed. [by: [@ByDexterTR](https://github.com/ByDexterTR)]
    - ###### Wild Throw:
        - ###### Now notifies the targeted player, consistent with other targeted skills. [by: [@ByDexterTR](https://github.com/ByDexterTR)]
    - ###### Careful Bullets / Darkness / Deaf / Glitch / Jammer / Jump Ban / Magnifier / Poison / Primary Ban / Wild Throw:
        - ###### The targeted player is now notified when the effect ends after the skill holder dies. [by: [@ByDexterTR](https://github.com/ByDexterTR)]
    - ###### Careful Bullets:
        - ###### Added damage-taken sound effects when missing a shot
    - ###### C4 Camouflage / Ninja:
        - ###### Fixed a bug where dying with invisibility active and taking control of a bot would grant invisibility to the bot as well.
    - ###### Poison:
        - ###### Added damage-taken sound effects.
    - ###### Primary Ban:
        - ###### Changed mechanic to directly block shooting weapons instead of forcing a weapon switch to the knife.
    - ###### Hot Bomb:
        - ###### Replaced the bomb-burning sound effects.
        - ###### Added a notification when the burning effect ends and the bomb returns to its normal color.
This commit is contained in:
Juzlus 2026-06-29 06:12:53 +02:00
parent 425bbaa784
commit 2ae293d1aa
45 changed files with 831 additions and 173 deletions

View file

@ -1,5 +1,6 @@
using CounterStrikeSharp.API;
using CounterStrikeSharp.API.Core;
using CounterStrikeSharp.API.Modules.Commands.Targeting;
using CounterStrikeSharp.API.Modules.Utils;
using src.utils;
using System.Collections.Concurrent;
@ -19,25 +20,25 @@ namespace src.player.skills
public static void OnTick()
{
float cooldown = SkillsInfo.GetValue<float>(skillName, "cooldown");
if (Server.TickCount % (int)(cooldown * 64) != 0) return;
int cooldown = (int)(SkillsInfo.GetValue<float>(skillName, "cooldown") * 64);
if (Server.TickCount % cooldown != 0) return;
if (players.IsEmpty || jRandomSkills.Instance.GameRules?.FreezePeriod == true) return;
int damage = SkillsInfo.GetValue<int>(skillName, "damage");
foreach (var player in Utilities.GetPlayers().Where(p => p.IsValid && p.Team == CsTeam.Terrorist && p.PawnIsAlive))
foreach (var player in Utilities.GetPlayers().Where(p => p != null && p.IsValid && p.Team == CsTeam.Terrorist && p.PlayerPawn?.Value?.Health > 0))
{
var playerEvent = PlayerManager.GetPlayerEvent(player);
var playerEvent = PlayerManager.GetPlayerFromEvent(player);
if (playerEvent == null || !playerEvent.IsValid) continue;
var pawn = playerEvent.PlayerPawn.Value;
var pawn = player.PlayerPawn.Value;
if (pawn == null || !pawn.IsValid || pawn.WeaponServices == null) continue;
bool hasC4 = pawn.WeaponServices.MyWeapons.Any(w => w.Value?.DesignerName == "weapon_c4");
if (!hasC4) continue;
SkillUtils.TakeHealth(pawn, damage);
player.ExecuteClientCommand("play sounds/player/burn_damage1");
playerEvent?.ExecuteClientCommand($"play player/player_damagebody_0{jRandomSkills.Instance.Random.Next(4, 8)}");
}
}
@ -52,7 +53,7 @@ namespace src.player.skills
player.PrintToCenterAlert(player.GetTranslation("hotbomb_hint"));
}
private static void ChangeC4Color()
private static void ChangeC4Color(Color color)
{
Server.NextFrame(() =>
{
@ -62,7 +63,7 @@ namespace src.player.skills
var bomb = bombEntities.FirstOrDefault();
if (bomb == null) return;
bomb.Render = Color.Red;
bomb.Render = color;
Utilities.SetStateChanged(bomb, "CBaseModelEntity", "m_clrRender");
});
}
@ -83,8 +84,8 @@ namespace src.player.skills
{
if (players.IsEmpty)
{
ChangeC4Color();
foreach (var enemy in Utilities.GetPlayers().Where(p => p.IsValid && p.Team == CsTeam.Terrorist && p.PawnIsAlive))
ChangeC4Color(Color.Red);
foreach (var enemy in Utilities.GetPlayers().Where(p => p.IsValid && p.Team == CsTeam.Terrorist && p.PlayerPawn?.Value?.Health > 0))
enemy.PrintToCenterAlert(enemy.GetTranslation("hotbomb_hint"));
}
@ -94,6 +95,13 @@ namespace src.player.skills
public static void DisableSkill(CCSPlayerController player)
{
players.TryRemove(player.Index, out _);
if (players.IsEmpty && !SkillUtils.IsFreezeTime())
{
ChangeC4Color(Color.White);
foreach (var enemy in Utilities.GetPlayers().Where(p => p.IsValid && p.Team == CsTeam.Terrorist && p.PlayerPawn?.Value?.Health > 0))
enemy.PrintToCenterAlert(enemy.GetTranslation("hotbomb_disable"));
}
}
public class SkillConfig(Skills skill = skillName, bool active = true, string color = "#baf081", CsTeam onlyTeam = CsTeam.CounterTerrorist, bool disableOnFreezeTime = false, bool needsTeammates = false, string requiredPermission = "", int maxPerServer = 1, Rarity rarity = Rarity.Common, float cooldown = 1, int damage = 2) : SkillsInfo.DefaultSkillInfo(skill, active, color, onlyTeam, disableOnFreezeTime, needsTeammates, requiredPermission, maxPerServer, rarity)