v1.1.0
This commit is contained in:
parent
6b8988ade4
commit
26cb787b57
125 changed files with 9157 additions and 1940 deletions
|
|
@ -1,5 +1,6 @@
|
|||
using CounterStrikeSharp.API;
|
||||
using CounterStrikeSharp.API.Core;
|
||||
using CounterStrikeSharp.API.Modules.Utils;
|
||||
using jRandomSkills.src.player;
|
||||
using jRandomSkills.src.utils;
|
||||
using static CounterStrikeSharp.API.Core.Listeners;
|
||||
|
|
@ -9,8 +10,8 @@ namespace jRandomSkills
|
|||
{
|
||||
public class WeaponsSwap : ISkill
|
||||
{
|
||||
private static Skills skillName = Skills.WeaponsSwap;
|
||||
private static float timerCooldown = (float)(Config.config.SkillsInfo.FirstOrDefault(s => s.Name == skillName.ToString())?.Cooldown);
|
||||
private const Skills skillName = Skills.WeaponsSwap;
|
||||
private static float timerCooldown = Config.GetValue<float>(skillName, "cooldown");
|
||||
private static readonly Dictionary<ulong, PlayerSkillInfo> SkillPlayerInfo = new Dictionary<ulong, PlayerSkillInfo>();
|
||||
|
||||
private static string[] weapons = { "weapon_deagle", "weapon_revolver", "weapon_glock", "weapon_usp_silencer",
|
||||
|
|
@ -22,10 +23,7 @@ namespace jRandomSkills
|
|||
|
||||
public static void LoadSkill()
|
||||
{
|
||||
if (Config.config.SkillsInfo.FirstOrDefault(s => s.Name == skillName.ToString())?.Active != true)
|
||||
return;
|
||||
|
||||
SkillUtils.RegisterSkill(skillName, "#c7e03a");
|
||||
SkillUtils.RegisterSkill(skillName, Config.GetValue<string>(skillName, "color"));
|
||||
|
||||
Instance.RegisterEventHandler<EventRoundFreezeEnd>((@event, info) =>
|
||||
{
|
||||
|
|
@ -127,14 +125,6 @@ namespace jRandomSkills
|
|||
player.PrintToCenterHtml(hudContent);
|
||||
}
|
||||
|
||||
private static void ActiveUse(CCSPlayerController player)
|
||||
{
|
||||
if (SkillPlayerInfo.TryGetValue(player.SteamID, out var skillInfo))
|
||||
{
|
||||
skillInfo.CanUse = true;
|
||||
}
|
||||
}
|
||||
|
||||
public static void UseSkill(CCSPlayerController player)
|
||||
{
|
||||
var playerPawn = player.PlayerPawn.Value;
|
||||
|
|
@ -212,5 +202,14 @@ namespace jRandomSkills
|
|||
public bool FindedEnemy { get; set; }
|
||||
public bool HaveWeapon { get; set; }
|
||||
}
|
||||
|
||||
public class SkillConfig : Config.DefaultSkillInfo
|
||||
{
|
||||
public float Cooldown { get; set; }
|
||||
public SkillConfig(Skills skill = skillName, bool active = true, string color = "#c7e03a", CsTeam onlyTeam = CsTeam.None, bool needsTeammates = false, float cooldown = 30f) : base(skill, active, color, onlyTeam, needsTeammates)
|
||||
{
|
||||
Cooldown = cooldown;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue