v1.2.3.b6
New skills (9) - Bounty: put a cash price on an enemy's head, the killer collects it. - EmpGrenade: grenade victims lose radar and crosshair for a while. - GravityDecoy: the decoy alters gravity for everyone in its radius. - Heavyweight: immune to push and slow effects from other skills. - Nemesis: the marked player takes extra damage from everyone. - Punisher: banks part of the damage you take and releases it on your next hit. - Rewind: drop a marker and teleport back to it shortly after. - TrueArmor: armor absorbs part of incoming damage instead of health. - Voodoo: the marked enemy shares the damage you take. Shared systems - DecoyRing: reusable ground ring so decoy skills show their real area of effect. Adopted by FireRain, FrozenDecoy, GravityDecoy and MagneticDecoy. - WeaponPool: single cached weapon classification (rifle/pistol/grenade) with a normalizing lookup, backed by the new config Weapons section. Replaces the duplicated hardcoded arrays in Assassin, Chicken, Ghost, NoNades, PrimaryBan, RandomWeapon, SniperElite and WeaponsSwap. [because of compatibility with WeaponRestrict] - HUD suppression registry in SkillUtils: crosshair and radar hiding is now refcounted per owner, so overlapping skills (Glitch, Jammer, EmpGrenade) cannot restore each other's state early. - SkillUtils.ResolveHiddenPawns: shared invisible-pawn resolution for C4Camouflage, Ghost and Ninja. - Config gained a Weapons section with automatic migration for existing installs, plus a per-skill DisableOnPistolRound switch honoured by both the round draw and css_setskill. Sound - Volume rebalance - Add SkillUtils.EmitSoundToPlayer with a private RecipientFilter. A null filter had been broadcasting every skill sound to all clients. Migrated 16 call sites: Poison, DemonEye, ToxicSmoke, CarefulBullets, Thorns, HotBomb, LastGasp, LongKnife, Nightmare, Jester, Tripwire, Medic, HealingSmoke, Rewind, Watchmaker. - New effects: LongKnife knife-hit feedback (Weapon_Knife.Hit.Heavy/Light), Grapple hook impact, Fortnite barricade placement, Ricochet bounce, Nightmare cursed tone, Replicator/Illusionist spawn, PsychicDefusing defuse cue, TakeAmmo pickup, Tripwire and Jammer trigger tones. - 29 skills gained a configurable SoundVolume, LongKnife also HitSoundVolume. - Grapple: emit the hook impact at the hook entity instead of at the owner so the enemy team can locate it. - PawelJumper: the engine already plays the first jump, only extra jumps emit. Models and visuals - Grapple: real hook model with configurable hookScale and hookEmbed so the hook sits in the surface it hit. - Pilot: glowing exhaust trail parented to the pawn, active only while airborne. Performance - SkillsInfo.GetValue now resolves through a ConcurrentDictionary cache instead of reflecting on every call; invalidated on config reload. - HUD render cache keyed on player, config, description flag and the three source lines; identical frames skip the rebuild. - Glaz.CheckTransmit: hoist smoke index resolution out of the per-viewer loop and build the pawn-owner map lazily. - playersSkills switched from ConcurrentBag to HashSet<Skills>, turning the NoRepeat filter from an O(n) scan into a set lookup. Fixes - NoRepeat could hand a player two or three skills in one round because the history bag was never deduplicated; the HashSet rewrite closes it. - SniperElite: restore the saved weapon after the halftime team swap instead of dropping it on the pistol round. - Illiterate: the holder alert now reaches chat and is exempt from its own scrambler via PrintToChat(ignoreIlliterate). - EntityManager.DestroyBeam: zero out width and render colour before the kill so beams cannot linger visibly, with a next-frame Remove fallback. - Ricochet: drop all 18 diagnostic Trace calls and the Trace helper; the skill measured stable over 48h and the tracing dominated the debug log. Debug - Tag round start, round end and freeze-time-end lines with [WARMUP] so warmup load is separable from live rounds.
This commit is contained in:
parent
615c55b2da
commit
b2d2c5bf9a
93 changed files with 3414 additions and 329 deletions
|
|
@ -15,13 +15,29 @@ namespace src.player.skills
|
|||
public static void LoadSkill()
|
||||
{
|
||||
SkillUtils.RegisterSkill(skillName, SkillsInfo.GetValue<string>(skillName, "color"));
|
||||
Instance.AddToManifest(SkillsInfo.GetValue<string>(skillName, "particleName"));
|
||||
}
|
||||
|
||||
public static void NewRound()
|
||||
{
|
||||
foreach (var pilotInfo in PlayerPilotInfo.Values)
|
||||
ClearTrail(pilotInfo);
|
||||
|
||||
PlayerPilotInfo.Clear();
|
||||
}
|
||||
|
||||
public static void PlayerDeath(EventPlayerDeath @event)
|
||||
{
|
||||
var player = PlayerManager.GetPlayerEvent(@event.Userid);
|
||||
if (player == null || !player.IsValid) return;
|
||||
|
||||
if (PlayerPilotInfo.TryGetValue(player.Index, out var pilotInfo))
|
||||
{
|
||||
ClearTrail(pilotInfo);
|
||||
pilotInfo.IsFlying = false;
|
||||
}
|
||||
}
|
||||
|
||||
public static void OnTick()
|
||||
{
|
||||
foreach (var player in PlayerManager.GetTickPlayers())
|
||||
|
|
@ -39,7 +55,9 @@ namespace src.player.skills
|
|||
|
||||
public static void DisableSkill(CCSPlayerController player)
|
||||
{
|
||||
PlayerPilotInfo.TryRemove(player.Index, out _);
|
||||
if (PlayerPilotInfo.TryRemove(player.Index, out var pilotInfo))
|
||||
ClearTrail(pilotInfo);
|
||||
|
||||
SkillUtils.ResetPrintHTML(player);
|
||||
}
|
||||
|
||||
|
|
@ -96,9 +114,18 @@ namespace src.player.skills
|
|||
);
|
||||
|
||||
if (inUse)
|
||||
{
|
||||
ApplyPilotEffect(player);
|
||||
else if (pilotInfo.Fuel <= 0)
|
||||
pilotInfo.IsFlying = false;
|
||||
StartTrail(player, playerPawn, pilotInfo);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pilotInfo.TrailIndex != null)
|
||||
ClearTrail(pilotInfo);
|
||||
|
||||
if (pilotInfo.Fuel <= 0)
|
||||
pilotInfo.IsFlying = false;
|
||||
}
|
||||
|
||||
pilotInfo.LastButtons = buttons;
|
||||
UpdateHUD(player, pilotInfo);
|
||||
|
|
@ -132,6 +159,62 @@ namespace src.player.skills
|
|||
return "#FF0000";
|
||||
}
|
||||
|
||||
private static void StartTrail(CCSPlayerController player, CCSPlayerPawn pawn, Pilot_PlayerInfo pilotInfo)
|
||||
{
|
||||
if (pilotInfo.TrailIndex != null)
|
||||
{
|
||||
var existing = Utilities.GetEntityFromIndex<CParticleSystem>((int)pilotInfo.TrailIndex.Value);
|
||||
if (existing != null && existing.IsValid) return;
|
||||
pilotInfo.TrailIndex = null;
|
||||
}
|
||||
|
||||
if (pawn.AbsOrigin == null) return;
|
||||
|
||||
var particle = EntityManager.CreateTrackedParticleSystem(player.Index, SkillsInfo.GetValue<string>(skillName, "particleName"));
|
||||
if (particle == null || !particle.IsValid) return;
|
||||
|
||||
float offset = SkillsInfo.GetValue<float>(skillName, "particleOffset");
|
||||
particle.Teleport(new Vector(pawn.AbsOrigin.X, pawn.AbsOrigin.Y, pawn.AbsOrigin.Z + offset));
|
||||
particle.AcceptInput("SetParent", pawn, particle, "!activator");
|
||||
particle.AcceptInput("Start");
|
||||
|
||||
pilotInfo.TrailIndex = particle.Index;
|
||||
}
|
||||
|
||||
private static void StopTrail(Pilot_PlayerInfo pilotInfo)
|
||||
{
|
||||
if (pilotInfo.TrailIndex == null) return;
|
||||
|
||||
uint index = pilotInfo.TrailIndex.Value;
|
||||
pilotInfo.TrailIndex = null;
|
||||
|
||||
var particle = Utilities.GetEntityFromIndex<CParticleSystem>((int)index);
|
||||
if (particle != null && particle.IsValid)
|
||||
{
|
||||
particle.AcceptInput("Stop");
|
||||
particle.AcceptInput("DestroyImmediately");
|
||||
}
|
||||
|
||||
EntityManager.DestroyEntity(index);
|
||||
|
||||
if (EntityManager.SuppressKills) return;
|
||||
|
||||
Server.NextFrame(() =>
|
||||
{
|
||||
var leftover = Utilities.GetEntityFromIndex<CParticleSystem>((int)index);
|
||||
if (leftover != null && leftover.IsValid)
|
||||
leftover.Remove();
|
||||
});
|
||||
}
|
||||
|
||||
private static void ClearTrail(Pilot_PlayerInfo pilotInfo)
|
||||
{
|
||||
StopTrail(pilotInfo);
|
||||
|
||||
foreach (var leftover in EntityManager.GetPlayerEntities((uint)pilotInfo.SteamID, "particle_system"))
|
||||
EntityManager.DestroyEntity(leftover);
|
||||
}
|
||||
|
||||
private static void ApplyPilotEffect(CCSPlayerController player)
|
||||
{
|
||||
var playerPawn = player.PlayerPawn.Value;
|
||||
|
|
@ -168,10 +251,13 @@ namespace src.player.skills
|
|||
public int JumpCount { get; set; } = 0;
|
||||
public float LastJumpTime { get; set; } = 0;
|
||||
public bool IsFlying { get; set; } = false;
|
||||
public uint? TrailIndex { get; set; }
|
||||
}
|
||||
|
||||
public class SkillConfig(Skills skill = skillName, bool active = true, string color = "#1466F5", CsTeam onlyTeam = CsTeam.None, bool disableOnFreezeTime = true, bool needsTeammates = false, string requiredPermission = "", float? hudDuration = null, float? descriptionHudDuration = null, int maxPerServer = -1, Rarity rarity = Rarity.Common, float maximumFuel = 150f, float fuelConsumption = .64f, float refuelling = .1f) : SkillsInfo.DefaultSkillInfo(skill, active, color, onlyTeam, disableOnFreezeTime, needsTeammates, requiredPermission, hudDuration, descriptionHudDuration, maxPerServer, rarity)
|
||||
public class SkillConfig(Skills skill = skillName, bool active = true, string color = "#1466F5", CsTeam onlyTeam = CsTeam.None, bool disableOnFreezeTime = true, bool needsTeammates = false, string requiredPermission = "", float? hudDuration = null, float? descriptionHudDuration = null, int maxPerServer = -1, Rarity rarity = Rarity.Common, float maximumFuel = 150f, float fuelConsumption = .64f, float refuelling = .1f, string particleName = "particles/inferno_fx/incgrenade_thrown_trail.vpcf", float particleOffset = 0f) : SkillsInfo.DefaultSkillInfo(skill, active, color, onlyTeam, disableOnFreezeTime, needsTeammates, requiredPermission, hudDuration, descriptionHudDuration, maxPerServer, rarity)
|
||||
{
|
||||
public string ParticleName { get; set; } = particleName;
|
||||
public float ParticleOffset { get; set; } = particleOffset;
|
||||
public float MaximumFuel { get; set; } = maximumFuel;
|
||||
public float FuelConsumption { get; set; } = fuelConsumption;
|
||||
public float Refuelling { get; set; } = refuelling;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue