v1.1.7
This commit is contained in:
parent
04a4fdce0d
commit
ac53655184
129 changed files with 1087 additions and 978 deletions
|
|
@ -2,15 +2,16 @@
|
|||
using CounterStrikeSharp.API.Core;
|
||||
using CounterStrikeSharp.API.Modules.Entities.Constants;
|
||||
using CounterStrikeSharp.API.Modules.Utils;
|
||||
using jRandomSkills.src.player;
|
||||
using static jRandomSkills.jRandomSkills;
|
||||
using src.utils;
|
||||
using System.Collections.Concurrent;
|
||||
using static src.jRandomSkills;
|
||||
|
||||
namespace jRandomSkills
|
||||
namespace src.player.skills
|
||||
{
|
||||
public class ToxicSmoke : ISkill
|
||||
{
|
||||
private const Skills skillName = Skills.ToxicSmoke;
|
||||
private static readonly List<Vector> smokes = [];
|
||||
private static readonly ConcurrentDictionary<Vector, byte> smokes = [];
|
||||
|
||||
public static void LoadSkill()
|
||||
{
|
||||
|
|
@ -59,7 +60,7 @@ namespace jRandomSkills
|
|||
if (player == null || !player.IsValid) return;
|
||||
var playerInfo = Instance.SkillPlayer.FirstOrDefault(p => p.SteamID == player.SteamID);
|
||||
if (playerInfo?.Skill != skillName) return;
|
||||
smokes.Add(new Vector(@event.X, @event.Y, @event.Z));
|
||||
smokes.TryAdd(new Vector(@event.X, @event.Y, @event.Z), 0);
|
||||
}
|
||||
|
||||
public static void SmokegrenadeExpired(EventSmokegrenadeExpired @event)
|
||||
|
|
@ -68,7 +69,8 @@ namespace jRandomSkills
|
|||
if (player == null || !player.IsValid) return;
|
||||
var playerInfo = Instance.SkillPlayer.FirstOrDefault(p => p.SteamID == player.SteamID);
|
||||
if (playerInfo?.Skill != skillName) return;
|
||||
smokes.RemoveAll(v => v.X == @event.X && v.Y == @event.Y && v.Z == @event.Z);
|
||||
foreach (var smoke in smokes.Keys.Where(v => v.X == @event.X && v.Y == @event.Y && v.Z == @event.Z))
|
||||
smokes.TryRemove(smoke, out _);
|
||||
}
|
||||
|
||||
private static void AddHealth(CCSPlayerPawn player, int health)
|
||||
|
|
@ -86,7 +88,7 @@ namespace jRandomSkills
|
|||
|
||||
public static void OnTick()
|
||||
{
|
||||
foreach (Vector smokePos in smokes)
|
||||
foreach (Vector smokePos in smokes.Keys)
|
||||
foreach (var player in Utilities.GetPlayers())
|
||||
if (Server.TickCount % 17 == 0)
|
||||
if (player != null && player.IsValid && player.PlayerPawn.Value != null && player.PlayerPawn.Value.IsValid)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue