QoE Update
## Added - **`CurseSkillPerPlayer`** (config.json) — limits how many curse skills (Darkness, JumpBan, PrimaryBan, Bankrupt and 14 others) can be stacked on a single player per round. `null` = unlimited (default), `1` = one curse per player, `2` = two. When the limit is reached the target is rejected and the curser gets a chat warning. Enforced centrally in `SkillAction`, so no per-skill code is needed. - **Tripwire cooldown mode** — replaces the fixed wire limit with a Replicator-style cooldown. Players can place as many wires as they want as long as the cooldown is up; remaining time is shown on the HUD. Configurable via `Cooldown` in skillsInfo.json (default 20s). - **Tripwire team colors** — T wires red (255, 64, 64), CT wires blue (64, 128, 255). ## Fixed - **ExpensiveAmmo** also charged money for knife swings and grenade throws. It now only charges when a bullet-firing weapon is fired. - **Knockback** also triggered on grenade throws; bound to the same allowlist. ## Removed - Dead code: `Earthquake.cs` and `HealingChicken.cs` (neither was registered in the `Skills` enum, so neither ever ran), `EntityManager.CreateTrackedEnvShake`, `EntityManager.CreateTrackedChicken`, `PlayerManager.UpdatePlayerSkill`. ## Changed - **Tripwire wires are now removed when the owner dies or loses the skill.** Previously they stayed on the map until the end of the round. - `PlayerEvents.cs` split into three partial files: player events in `PlayerEvents.cs`, round and skill dispatch in `RoundEvents.cs`, entity and weapon hooks in `EntityEvents.cs`. Behaviour is unchanged; all members stay in the same `Event` class. - 28 copy-pasted enemy-gathering LINQ chains reduced to the shared helper (Bankrupt, CarefulBullets, Darkness, Deactivator, Deaf, ExpensiveAmmo, Giant, Glitch, Jammer, JumpBan, JumpCurse, LifeSwap, Magnifier, MoneySwap, Nightmare, Poison, PrimaryBan, WildThrow).
This commit is contained in:
parent
98f6e65b01
commit
b0b50a224f
50 changed files with 1215 additions and 1279 deletions
|
|
@ -92,6 +92,23 @@ namespace src
|
|||
Debug.WriteToDebug($"Loaded: {skill.Skill}");
|
||||
}
|
||||
|
||||
private static bool TryClaimCurseTarget(object[]? param)
|
||||
{
|
||||
if (param == null || param.Length < 2) return true;
|
||||
if (param[0] is not CCSPlayerController curser || !curser.IsValid) return true;
|
||||
if (param[1] is not string[] commands || commands.Length < 1) return true;
|
||||
if (!uint.TryParse(commands[0], out uint victimIndex)) return true;
|
||||
|
||||
var victim = Utilities.GetPlayerFromIndex((int)victimIndex);
|
||||
if (victim == null || !victim.IsValid) return true;
|
||||
|
||||
if (SkillUtils.TryClaimCurse(curser.Index, victimIndex)) return true;
|
||||
|
||||
var curserEvent = PlayerManager.GetPlayerFromEvent(curser);
|
||||
curserEvent?.PrintToChat($" {ChatColors.Red}{curserEvent.GetTranslation("curse_limit_info", victim.PlayerName)}");
|
||||
return false;
|
||||
}
|
||||
|
||||
private static readonly ConcurrentDictionary<(string Skill, string Method), MethodInfo?> _skillMethodCache = new();
|
||||
|
||||
internal object? SkillAction(string skill, string methodName, object[]? param = null)
|
||||
|
|
@ -105,6 +122,15 @@ namespace src
|
|||
SkillsUsedThisMap.TryAdd(skill, 0);
|
||||
}
|
||||
|
||||
if (Enum.TryParse<Skills>(skill, out var parsedSkill) && SkillUtils.IsCurseSkill(parsedSkill))
|
||||
{
|
||||
if (methodName == "DisableSkill" && param?.Length > 0 && param[0] is CCSPlayerController curser && curser.IsValid)
|
||||
SkillUtils.ReleaseCurse(curser.Index);
|
||||
|
||||
if (methodName == "TypeSkill" && !TryClaimCurseTarget(param))
|
||||
return null;
|
||||
}
|
||||
|
||||
var method = _skillMethodCache.GetOrAdd((skill, methodName), key =>
|
||||
{
|
||||
string className = $"src.player.skills.{key.Skill}";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue