diff --git a/jRandomSkills - SRC Files/jRandomSkills.csproj b/jRandomSkills - SRC Files/jRandomSkills.csproj index 725b60b..da7be41 100644 --- a/jRandomSkills - SRC Files/jRandomSkills.csproj +++ b/jRandomSkills - SRC Files/jRandomSkills.csproj @@ -9,6 +9,7 @@ + diff --git a/jRandomSkills - SRC Files/src/command/Command.cs b/jRandomSkills - SRC Files/src/command/Command.cs index cc35b03..a5299b3 100644 --- a/jRandomSkills - SRC Files/src/command/Command.cs +++ b/jRandomSkills - SRC Files/src/command/Command.cs @@ -66,13 +66,18 @@ namespace jRandomSkills private static void Command_SetSkill(CCSPlayerController? player, CommandInfo command) { Debug.WriteToDebug($"Player {player?.PlayerPawn} used the css_setskill {command.ArgString} command."); - if (player == null || !AdminManager.PlayerHasPermissions(player, config.SetSkillCommands.Permissions)) return; + if (!AdminManager.PlayerHasPermissions(player, config.SetSkillCommands.Permissions)) return; var targetPlayer = Utilities.GetPlayers().FirstOrDefault(p => !p.IsBot && (p.SteamID.ToString().Equals(command.GetArg(1), StringComparison.CurrentCultureIgnoreCase) || p.PlayerName.Equals(command.GetArg(1), StringComparison.CurrentCultureIgnoreCase))); if (command.ArgCount < 2) { + if (player == null) + { + Server.PrintToConsole(Localization.GetTranslation("correct_form_setskill")); + return; + } player.PrintToChat($" {ChatColors.Green}―――――――――――{ChatColors.DarkRed}◥◣◆◢◤{ChatColors.Green}―――――――――――"); SkillUtils.PrintToChat(player, Localization.GetTranslation("correct_form_setskill"), true); player.PrintToChat($" {ChatColors.Green}―――――――――――{ChatColors.DarkRed}◥◣◆◢◤{ChatColors.Green}―――――――――――"); @@ -81,6 +86,11 @@ namespace jRandomSkills if (targetPlayer == null) { + if (player == null) + { + Server.PrintToConsole(Localization.GetTranslation("player_not_found_setskill")); + return; + } player.PrintToChat($" {ChatColors.Green}―――――――――――{ChatColors.DarkRed}◥◣◆◢◤{ChatColors.Green}―――――――――――"); SkillUtils.PrintToChat(player, Localization.GetTranslation("player_not_found_setskill"), true); player.PrintToChat($" {ChatColors.Green}―――――――――――{ChatColors.DarkRed}◥◣◆◢◤{ChatColors.Green}―――――――――――"); @@ -92,6 +102,11 @@ namespace jRandomSkills if (skill == null) { + if (player == null) + { + Server.PrintToConsole(Localization.GetTranslation("skill_not_found_setskill")); + return; + } player.PrintToChat($" {ChatColors.Green}―――――――――――{ChatColors.DarkRed}◥◣◆◢◤{ChatColors.Green}―――――――――――"); SkillUtils.PrintToChat(player, Localization.GetTranslation("skill_not_found_setskill"), true); player.PrintToChat($" {ChatColors.Green}―――――――――――{ChatColors.DarkRed}◥◣◆◢◤{ChatColors.Green}―――――――――――"); @@ -105,6 +120,13 @@ namespace jRandomSkills skillPlayer.Skill = skill.Skill; skillPlayer.SpecialSkill = src.player.Skills.None; Instance.SkillAction(skill.Skill.ToString(), "EnableSkill", [targetPlayer]); + skillPlayer.SkillDescriptionHudExpired = DateTime.Now.AddSeconds(Config.LoadedConfig.Settings.SkillDescriptionDuration); + + if (player == null) + { + Server.PrintToConsole(Localization.GetTranslation("done_setskill")); + return; + } if (skill.Display) SkillUtils.PrintToChat(player, $"{ChatColors.DarkRed}{skill.Name}{ChatColors.Lime}: {skill.Description}", false); @@ -115,6 +137,12 @@ namespace jRandomSkills } else { + if (player == null) + { + Server.PrintToConsole(Localization.GetTranslation("error_setskill")); + return; + } + player.PrintToChat($" {ChatColors.Green}―――――――――――{ChatColors.DarkRed}◥◣◆◢◤{ChatColors.Green}―――――――――――"); SkillUtils.PrintToChat(player, Localization.GetTranslation("error_setskill"), true); player.PrintToChat($" {ChatColors.Green}―――――――――――{ChatColors.DarkRed}◥◣◆◢◤{ChatColors.Green}―――――――――――"); @@ -310,13 +338,19 @@ namespace jRandomSkills private static void Command_SetStaticSkill(CCSPlayerController? player, CommandInfo command) { Debug.WriteToDebug($"Player {player?.PlayerPawn} used the css_setstaticskill {command.ArgString} command."); - if (player == null || !AdminManager.PlayerHasPermissions(player, config.SetStaticSkillCommands.Permissions)) return; + if (!AdminManager.PlayerHasPermissions(player, config.SetStaticSkillCommands.Permissions)) return; var targetPlayer = Utilities.GetPlayers().FirstOrDefault(p => !p.IsBot && (p.SteamID.ToString().Equals(command.GetArg(1), StringComparison.CurrentCultureIgnoreCase) || p.PlayerName.Equals(command.GetArg(1), StringComparison.CurrentCultureIgnoreCase))); if (command.ArgCount < 2) { + if (player == null) + { + Server.PrintToConsole(Localization.GetTranslation("correct_form_setskill")); + return; + } + player.PrintToChat($" {ChatColors.Green}―――――――――――{ChatColors.DarkRed}◥◣◆◢◤{ChatColors.Green}―――――――――――"); SkillUtils.PrintToChat(player, Localization.GetTranslation("correct_form_setskill"), true); player.PrintToChat($" {ChatColors.Green}―――――――――――{ChatColors.DarkRed}◥◣◆◢◤{ChatColors.Green}―――――――――――"); @@ -325,6 +359,12 @@ namespace jRandomSkills if (targetPlayer == null) { + if (player == null) + { + Server.PrintToConsole(Localization.GetTranslation("player_not_found_setskill")); + return; + } + player.PrintToChat($" {ChatColors.Green}―――――――――――{ChatColors.DarkRed}◥◣◆◢◤{ChatColors.Green}―――――――――――"); SkillUtils.PrintToChat(player, Localization.GetTranslation("player_not_found_setskill"), true); player.PrintToChat($" {ChatColors.Green}―――――――――――{ChatColors.DarkRed}◥◣◆◢◤{ChatColors.Green}―――――――――――"); @@ -336,6 +376,12 @@ namespace jRandomSkills if (skill == null) { + if (player == null) + { + Server.PrintToConsole(Localization.GetTranslation("skill_not_found_setskill")); + return; + } + player.PrintToChat($" {ChatColors.Green}―――――――――――{ChatColors.DarkRed}◥◣◆◢◤{ChatColors.Green}―――――――――――"); SkillUtils.PrintToChat(player, Localization.GetTranslation("skill_not_found_setskill"), true); player.PrintToChat($" {ChatColors.Green}―――――――――――{ChatColors.DarkRed}◥◣◆◢◤{ChatColors.Green}―――――――――――"); @@ -348,6 +394,7 @@ namespace jRandomSkills Instance.SkillAction(skillPlayer.Skill.ToString(), "DisableSkill", [targetPlayer]); skillPlayer.Skill = skill.Skill; skillPlayer.SpecialSkill = src.player.Skills.None; + skillPlayer.SkillDescriptionHudExpired = DateTime.Now.AddSeconds(Config.LoadedConfig.Settings.SkillDescriptionDuration); if (skill.Skill == src.player.Skills.None) Event.staticSkills.Remove(targetPlayer.SteamID); @@ -355,6 +402,12 @@ namespace jRandomSkills Event.staticSkills.Add(targetPlayer.SteamID, skill); Instance.SkillAction(skill.Skill.ToString(), "EnableSkill", [targetPlayer]); + if (player == null) + { + Server.PrintToConsole(Localization.GetTranslation("done_setskill")); + return; + } + if (skill.Display) SkillUtils.PrintToChat(player, $"{ChatColors.DarkRed}{skill.Name}{ChatColors.Lime}: {skill.Description}", false); @@ -364,6 +417,12 @@ namespace jRandomSkills } else { + if (player == null) + { + Server.PrintToConsole(Localization.GetTranslation("error_setskill")); + return; + } + player.PrintToChat($" {ChatColors.Green}―――――――――――{ChatColors.DarkRed}◥◣◆◢◤{ChatColors.Green}―――――――――――"); SkillUtils.PrintToChat(player, Localization.GetTranslation("error_setskill"), true); player.PrintToChat($" {ChatColors.Green}―――――――――――{ChatColors.DarkRed}◥◣◆◢◤{ChatColors.Green}―――――――――――"); diff --git a/jRandomSkills - SRC Files/src/jRandomSkills.cs b/jRandomSkills - SRC Files/src/jRandomSkills.cs index 52a3654..7c4ce34 100644 --- a/jRandomSkills - SRC Files/src/jRandomSkills.cs +++ b/jRandomSkills - SRC Files/src/jRandomSkills.cs @@ -107,6 +107,7 @@ namespace jRandomSkills public Skills SpecialSkill { get; set; } public float? SkillChance { get; set; } public bool IsDrawing { get; set; } + public DateTime SkillDescriptionHudExpired { get; set; } } #pragma warning disable IDE1006 diff --git a/jRandomSkills - SRC Files/src/lang/en.json b/jRandomSkills - SRC Files/src/lang/en.json index 14edce5..5668b6a 100644 --- a/jRandomSkills - SRC Files/src/lang/en.json +++ b/jRandomSkills - SRC Files/src/lang/en.json @@ -33,6 +33,12 @@ "astronaut_desc": "You receive a random gravity value at the start of the round", "astronaut_desc2": "Your random gravity is: {0}x", + "moneyswap": "Taxman", + "moneyswap_desc": "Choose a player to swap money with", + "moneyswap_enemy_info": "The tax office got you.", + "moneyswap_player_info": "You swapped money with player '{0}'.", + "moneyswap_select_info": "Swap money with player:", + "baseball": "Baseball Player", "baseball_desc": "Your decoy bounces off walls and instantly kills an enemy on impact", @@ -217,11 +223,11 @@ "medic": "Medic", "medic_desc": "Click [css_useSkill] to use a healing charge that restores 50 health", - "moneyswap": "Taxman", - "moneyswap_desc": "Choose a player to swap money with", - "moneyswap_enemy_info": "The tax office got you.", - "moneyswap_player_info": "You swapped money with player '{0}'.", - "moneyswap_select_info": "Swap money with player:", + "bankrupt": "Bankrupt", + "bankrupt_desc": "Choose the player who will lose all their money", + "bankrupt_enemy_info": "You have gone bankrupt.", + "bankrupt_player_info": "Player '{0}' has gone bankrupt.", + "bankrupt_select_info": "Pick a player to go bankrupt:", "muhammed": "Muhammed", "muhammed_desc": "You explode upon death, killing nearby players", @@ -259,7 +265,7 @@ "pilot": "Pilot", "pilot_desc": "Fly for a limited time. Hold [USE - E] to fly", - "pilot_hud_info": "Recharging", + "pilot_hud_info": "Fuel", "planter": "Free Planter", "planter_desc": "You can plant the bomb anywhere, with a detonation time of 60 seconds.", diff --git a/jRandomSkills - SRC Files/src/lang/pl.json b/jRandomSkills - SRC Files/src/lang/pl.json index 3541787..2c6a712 100644 --- a/jRandomSkills - SRC Files/src/lang/pl.json +++ b/jRandomSkills - SRC Files/src/lang/pl.json @@ -33,6 +33,12 @@ "astronaut_desc": "Na początku rundy otrzymujesz losową wartość grawitacji", "astronaut_desc2": "Twoja losowa grawitacja wynosi: {0}x", + "bankrupt": "Bankrut", + "bankrupt_desc": "Wybierz gracza, który straci wszystkie swoje pieniądze", + "bankrupt_enemy_info": "Stałeś się bankrutem.", + "bankrupt_player_info": "Gracz '{0}' zbankrutował.", + "bankrupt_select_info": "Wybierz gracza do bankrucji:", + "baseball": "Bejsbolista", "baseball_desc": "Twój wabik odbija się od ścian i natychmiastowo zabija wroga po trafieniu", @@ -259,7 +265,7 @@ "pilot": "Pilot", "pilot_desc": "Latanie przez określony czas. Przytrzymaj [USE - E], aby latać", - "pilot_hud_info": "W trakcie odnawiania", + "pilot_hud_info": "Paliwo", "planter": "Samowolka", "planter_desc": "Bombę można podłożyć w dowolnym miejscu, a czas detonacji wynosi 60 sekund.", diff --git a/jRandomSkills - SRC Files/src/lang/pt-br.json b/jRandomSkills - SRC Files/src/lang/pt-br.json index 8a0425e..c13f007 100644 --- a/jRandomSkills - SRC Files/src/lang/pt-br.json +++ b/jRandomSkills - SRC Files/src/lang/pt-br.json @@ -33,6 +33,12 @@ "astronaut_desc": "Você recebe um valor de gravidade aleatório no início da rodada", "astronaut_desc2": "Sua gravidade aleatória é: {0}x", + "bankrupt": "Falido", + "bankrupt_desc": "Escolha o jogador que perderá todo o dinheiro", + "bankrupt_enemy_info": "Você faliu.", + "bankrupt_player_info": "O jogador '{0}' faliu.", + "bankrupt_select_info": "Escolha jogador p/ falir:", + "baseball": "Jogador de Beisebol", "baseball_desc": "Seu chamariz ricocheteia nas paredes e mata instantaneamente um inimigo ao acertar", @@ -259,7 +265,7 @@ "pilot": "Piloto", "pilot_desc": "Voe por um tempo limitado. Segure [USE - E] para voar", - "pilot_hud_info": "Recarregando", + "pilot_hud_info": "Combustível", "planter": "Plantador Livre", "planter_desc": "Você pode plantar a bomba em qualquer lugar, com um tempo de detonação de 60 segundos.", diff --git a/jRandomSkills - SRC Files/src/lang/zh.json b/jRandomSkills - SRC Files/src/lang/zh.json index a53a57c..2b23aaa 100644 --- a/jRandomSkills - SRC Files/src/lang/zh.json +++ b/jRandomSkills - SRC Files/src/lang/zh.json @@ -33,6 +33,12 @@ "astronaut_desc": "回合开始时你会获得随机重力值", "astronaut_desc2": "你的随机重力是:{0}x", + "bankrupt": "破产", + "bankrupt_desc": "选择一个会失去所有金钱的玩家", + "bankrupt_enemy_info": "你破产了。", + "bankrupt_player_info": "玩家“{0}”已破产。", + "bankrupt_select_info": "选择玩家破产:", + "baseball": "棒球手", "baseball_desc": "你的诱饵弹会在墙壁上反弹并在击中敌人时立即杀死", @@ -259,7 +265,7 @@ "pilot": "飞行员", "pilot_desc": "在有限时间内飞行。按住 [USE - E] 飞行", - "pilot_hud_info": "正在充能", + "pilot_hud_info": "燃料", "planter": "自由种植者", "planter_desc": "你可以在任何地方放置炸弹,引爆时间为60秒。", diff --git a/jRandomSkills - SRC Files/src/player/ISkill.cs b/jRandomSkills - SRC Files/src/player/ISkill.cs index c699e10..893767f 100644 --- a/jRandomSkills - SRC Files/src/player/ISkill.cs +++ b/jRandomSkills - SRC Files/src/player/ISkill.cs @@ -55,6 +55,7 @@ public enum Skills Armored, Assassin, Astronaut, + Bankrupt, Baseball, Behind, BladeMaster, diff --git a/jRandomSkills - SRC Files/src/player/PlayerEvents.cs b/jRandomSkills - SRC Files/src/player/PlayerEvents.cs index e1a3c58..b7733c7 100644 --- a/jRandomSkills - SRC Files/src/player/PlayerEvents.cs +++ b/jRandomSkills - SRC Files/src/player/PlayerEvents.cs @@ -208,6 +208,13 @@ namespace jRandomSkills foreach (var playerSkill in Instance.SkillPlayer) if (!playerSkill.IsDrawing) Instance.SkillAction(playerSkill.Skill.ToString(), "OnTick"); + + foreach (var playerSkill in Instance.SkillPlayer) + { + if (playerSkill.SkillDescriptionHudExpired >= DateTime.Now) + if (playerSkill.Skill != Skills.None) + ShowSkillDescription(Utilities.GetPlayerFromSteamId(playerSkill.SteamID)); + } } private static HookResult PlayerConnectFull(EventPlayerConnectFull @event, GameEventInfo info) @@ -267,7 +274,7 @@ namespace jRandomSkills Instance.RemoveListener(CheckTransmit); int freezetime = ConVar.Find("mp_freezetime")?.GetPrimitiveValue() ?? 0; - Instance.AddTimer(Math.Max(freezetime - Config.LoadedConfig.Settings.SkillTimeBeforeStart, 0) + .3f, SetSkill); + Instance.AddTimer((Instance?.GameRules?.TeamIntroPeriod == true ? 7 : 0) + Math.Max(freezetime - Config.LoadedConfig.Settings.SkillTimeBeforeStart, 0) + .3f, SetSkill); return HookResult.Continue; } @@ -477,10 +484,11 @@ namespace jRandomSkills skillPlayer.SpecialSkill = Skills.None; Instance?.SkillAction(randomSkill.Skill.ToString(), "EnableSkill", new [] { player }); Debug.WriteToDebug($"Player {skillPlayer.PlayerName} has got the skill \"{randomSkill.Name}\"."); + skillPlayer.SkillDescriptionHudExpired = DateTime.Now.AddSeconds(Config.LoadedConfig.Settings.SkillDescriptionDuration); if (Config.LoadedConfig.Settings.TeamMateSkillInfo) { - Instance?.AddTimer(0.5f, () => + Instance?.AddTimer(.5f, () => { foreach (var teammate in teammates) { @@ -513,6 +521,31 @@ namespace jRandomSkills Instance.SkillAction(playerSkill.Skill.ToString(), "CheckTransmit", [infoList]); } + private static void ShowSkillDescription(CCSPlayerController? player) + { + if (player == null || !player.IsValid) return; + + var playerInfo = Instance.SkillPlayer.FirstOrDefault(p => p.SteamID == player.SteamID); + if (playerInfo == null) return; + + var skillData = SkillData.Skills.FirstOrDefault(s => s.Skill == playerInfo.Skill); + if (skillData == null) return; + + var skillName = playerInfo.Skill.ToString().ToLower(); + var value = Math.Round((double)(playerInfo.SkillChance ?? 1), 2); + var desc2 = Localization.GetTranslation($"{skillName}_desc2", value); + var skilLDescription = desc2 == $"{skillName}_desc2" + ? Localization.GetTranslation($"{skillName}_desc") + : (desc2.Contains('%') ? desc2.Replace(value.ToString(), (value * 100).ToString()) : desc2); + + string infoLine = $"{Localization.GetTranslation("your_skill")}:
"; + string skillLine = $"{skillData.Name}
"; + string remainingLine = $"{skilLDescription}
"; + + var hudContent = infoLine + skillLine + remainingLine; + player.PrintToCenterHtml(hudContent); + } + [GeneratedRegex(@"\{AUTHOR1\}", RegexOptions.IgnoreCase, "pl-PL")] private static partial Regex MyRegex(); [GeneratedRegex(@"\{AUTHOR2\}", RegexOptions.IgnoreCase, "pl-PL")] diff --git a/jRandomSkills - SRC Files/src/player/PlayerOnTick.cs b/jRandomSkills - SRC Files/src/player/PlayerOnTick.cs index eb32f6c..10a61eb 100644 --- a/jRandomSkills - SRC Files/src/player/PlayerOnTick.cs +++ b/jRandomSkills - SRC Files/src/player/PlayerOnTick.cs @@ -93,7 +93,7 @@ namespace jRandomSkills string pName = observeredPlayerSkill.PlayerName; if (pName.Length > 18) - pName = $"{pName.Substring(0, 17)}..."; + pName = $"{pName[..17]}..."; infoLine = $"{Localization.GetTranslation("observer_skill")} {pName}:
"; skillLine = $"{(observeredPlayerSkill.SpecialSkill == Skills.None ? observeredPlayerSkillInfo.Name : $"{observeredPlayerSpecialSkillInfo.Name}({observeredPlayerSkillInfo.Name})")}
"; } diff --git a/jRandomSkills - SRC Files/src/player/skills/Bankrupt.cs b/jRandomSkills - SRC Files/src/player/skills/Bankrupt.cs new file mode 100644 index 0000000..9588ace --- /dev/null +++ b/jRandomSkills - SRC Files/src/player/skills/Bankrupt.cs @@ -0,0 +1,103 @@ +using CounterStrikeSharp.API; +using CounterStrikeSharp.API.Core; +using CounterStrikeSharp.API.Modules.Utils; +using jRandomSkills.src.player; +using jRandomSkills.src.utils; +using static jRandomSkills.jRandomSkills; + +namespace jRandomSkills +{ + public class Bankrupt : ISkill + { + private const Skills skillName = Skills.Bankrupt; + + public static void LoadSkill() + { + SkillUtils.RegisterSkill(skillName, Config.GetValue(skillName, "color")); + } + + public static void NewRound() + { + foreach (var player in Utilities.GetPlayers()) + SkillUtils.CloseMenu(player); + } + + public static void OnTick() + { + if (Server.TickCount % 32 != 0) return; + foreach (var player in Utilities.GetPlayers()) + { + if (!SkillUtils.HasMenu(player)) continue; + var playerInfo = Instance.SkillPlayer.FirstOrDefault(p => p.SteamID == player.SteamID); + + if (playerInfo == null || playerInfo.Skill != skillName) continue; + var enemies = Utilities.GetPlayers().Where(p => p.PawnIsAlive && p.Team != player.Team && p.IsValid && !p.IsBot && !p.IsHLTV && p.Team != CsTeam.Spectator && p.Team != CsTeam.None).ToArray(); + + HashSet<(string, string)> menuItems = enemies.Select(e => ($"{e.PlayerName} : {(e.InGameMoneyServices == null ? 0 : e.InGameMoneyServices.Account)}$", e.Index.ToString())).ToHashSet(); + SkillUtils.UpdateMenu(player, menuItems); + } + } + + public static void TypeSkill(CCSPlayerController player, string[] commands) + { + if (player == null || !player.IsValid || !player.PawnIsAlive) return; + var playerInfo = Instance.SkillPlayer.FirstOrDefault(p => p.SteamID == player.SteamID); + if (playerInfo?.Skill != skillName) return; + + if (playerInfo.SkillChance == 1) + { + player.PrintToChat($" {ChatColors.Red}{Localization.GetTranslation("areareaper_used_info")}"); + return; + } + + string enemyId = commands[0]; + var enemy = Utilities.GetPlayers().FirstOrDefault(p => p.Team != player.Team && p.Index.ToString() == enemyId); + + if (enemy == null) + { + player.PrintToChat($" {ChatColors.Red}" + Localization.GetTranslation("selectplayerskill_incorrect_enemy_index")); + return; + } + + ResetMoney(enemy); + playerInfo.SkillChance = 1; + player.PrintToChat($" {ChatColors.Green}" + Localization.GetTranslation("bankrupt_player_info", enemy.PlayerName)); + enemy.PrintToChat($" {ChatColors.Red}" + Localization.GetTranslation("bankrupt_enemy_info")); + } + + public static void EnableSkill(CCSPlayerController player) + { + var playerInfo = Instance.SkillPlayer.FirstOrDefault(p => p.SteamID == player.SteamID); + if (playerInfo == null) return; + playerInfo.SkillChance = 0; + + var enemies = Utilities.GetPlayers().Where(p => p.PawnIsAlive && p.Team != player.Team && p.IsValid && !p.IsBot && !p.IsHLTV && p.Team != CsTeam.Spectator && p.Team != CsTeam.None).ToArray(); + if (enemies.Length > 0) + { + HashSet<(string, string)> menuItems = enemies.Select(e => ($"{e.PlayerName} : {(e.InGameMoneyServices == null ? 0 : e.InGameMoneyServices.Account)}$", e.Index.ToString())).ToHashSet(); + SkillUtils.CreateMenu(player, menuItems); + } + else + player.PrintToChat($" {ChatColors.Red}{Localization.GetTranslation("selectplayerskill_incorrect_enemy_index")}"); + } + + private static void ResetMoney(CCSPlayerController enemy) + { + if (enemy == null || !enemy.IsValid) return; + var enemyMoneyServices = enemy.InGameMoneyServices; + if (enemyMoneyServices == null) return; + + enemyMoneyServices.Account = 0; + Utilities.SetStateChanged(enemy, "CCSPlayerController", "m_pInGameMoneyServices"); + } + + public static void DisableSkill(CCSPlayerController player) + { + SkillUtils.CloseMenu(player); + } + + public class SkillConfig(Skills skill = skillName, bool active = true, string color = "#abab33", CsTeam onlyTeam = CsTeam.None, bool needsTeammates = false) : Config.DefaultSkillInfo(skill, active, color, onlyTeam, needsTeammates) + { + } + } +} \ No newline at end of file diff --git a/jRandomSkills - SRC Files/src/player/skills/Baseball.cs b/jRandomSkills - SRC Files/src/player/skills/Baseball.cs index 0131df0..26dfbf9 100644 --- a/jRandomSkills - SRC Files/src/player/skills/Baseball.cs +++ b/jRandomSkills - SRC Files/src/player/skills/Baseball.cs @@ -64,7 +64,7 @@ namespace jRandomSkills var decoy = decoys.FirstOrDefault(d => d.Index == @event.Entityid); if (decoy != null && decoy.IsValid) - decoy.Remove(); + decoy.AcceptInput("Kill"); } public static void OnTick() diff --git a/jRandomSkills - SRC Files/src/player/skills/Chicken.cs b/jRandomSkills - SRC Files/src/player/skills/Chicken.cs index a0485bf..ecdc7da 100644 --- a/jRandomSkills - SRC Files/src/player/skills/Chicken.cs +++ b/jRandomSkills - SRC Files/src/player/skills/Chicken.cs @@ -66,9 +66,7 @@ namespace jRandomSkills playerPawn.Health = 50; Utilities.SetStateChanged(playerPawn, "CBaseEntity", "m_iHealth"); - if (playerPawn.CBodyComponent == null || playerPawn.CBodyComponent.SceneNode == null) return; - playerPawn.CBodyComponent.SceneNode.Scale = 0.2f; - Utilities.SetStateChanged(playerPawn, "CBaseEntity", "m_CBodyComponent"); + SkillUtils.ChangePlayerScale(player, .2f); playerPawn.Render = Color.FromArgb(0, 255, 255, 255); playerPawn.ShadowStrength = 0.0f; @@ -89,9 +87,7 @@ namespace jRandomSkills playerPawn.Health += 50; Utilities.SetStateChanged(playerPawn, "CBaseEntity", "m_iHealth"); - if (playerPawn.CBodyComponent == null || playerPawn.CBodyComponent.SceneNode == null) return; - playerPawn.CBodyComponent.SceneNode.Scale = 1f; - Utilities.SetStateChanged(playerPawn, "CBaseEntity", "m_CBodyComponent"); + SkillUtils.ChangePlayerScale(player, 1); playerPawn.Render = Color.FromArgb(255, 255, 255, 255); playerPawn.ShadowStrength = 1.0f; @@ -103,7 +99,7 @@ namespace jRandomSkills if (chickens.TryGetValue(player, out var chicken)) { if (chicken != null && chicken.IsValid) - chicken.Remove(); + chicken.AcceptInput("Kill"); chickens.Remove(player); } } @@ -154,7 +150,7 @@ namespace jRandomSkills if (player == null || !player.IsValid) continue; if (chicken == null || !chicken.IsValid) continue; - var pawn = player.Pawn.Value; + var pawn = player.PlayerPawn.Value; if (pawn == null || !pawn.IsValid || pawn.AbsOrigin == null || chicken.AbsOrigin == null) continue; float X = (float)Math.Round(pawn.AbsOrigin.X, 2); @@ -163,6 +159,7 @@ namespace jRandomSkills Vector pos = new(X, Y, Z); if (chicken.AbsOrigin.X != pos.X || chicken.AbsOrigin.Y != pos.Y || chicken.AbsOrigin.Z != pos.Z) chicken.Teleport(pos, pawn.AbsRotation, null); + pawn.VelocityModifier = 1.1f; UpdateHUD(player); } } diff --git a/jRandomSkills - SRC Files/src/player/skills/Darkness.cs b/jRandomSkills - SRC Files/src/player/skills/Darkness.cs index 12258c2..afbaee3 100644 --- a/jRandomSkills - SRC Files/src/player/skills/Darkness.cs +++ b/jRandomSkills - SRC Files/src/player/skills/Darkness.cs @@ -16,7 +16,7 @@ namespace jRandomSkills public static void LoadSkill() { - SkillUtils.RegisterSkill(skillName, Config.GetValue(skillName, "color"), false); + SkillUtils.RegisterSkill(skillName, Config.GetValue(skillName, "color")); } public static void NewRound() @@ -24,12 +24,20 @@ namespace jRandomSkills foreach (var player in defaultPostProcessings.Keys) DisableSkill(player); foreach (var postProcessing in newPostProcessing) - postProcessing.Remove(); + if (postProcessing != null && postProcessing.IsValid) + postProcessing.AcceptInput("Kill"); newPostProcessing.Clear(); foreach (var player in Utilities.GetPlayers()) SkillUtils.CloseMenu(player); } + public static void PlayerDeath(EventPlayerDeath @event) + { + var player = @event.Userid; + if (player == null) return; + DisableSkill(player); + } + public static void OnTick() { if (Server.TickCount % 32 != 0) return; diff --git a/jRandomSkills - SRC Files/src/player/skills/Dwarf.cs b/jRandomSkills - SRC Files/src/player/skills/Dwarf.cs index 0faca5c..ce5d1b1 100644 --- a/jRandomSkills - SRC Files/src/player/skills/Dwarf.cs +++ b/jRandomSkills - SRC Files/src/player/skills/Dwarf.cs @@ -27,29 +27,31 @@ namespace jRandomSkills public static unsafe void EnableSkill(CCSPlayerController player) { + var playerInfo = Instance.SkillPlayer.FirstOrDefault(p => p.SteamID == player.SteamID); + if (playerInfo == null) return; + var playerPawn = player.PlayerPawn?.Value; if (playerPawn != null && player.IsValid) { float newSize = (float)Instance.Random.NextDouble() * (Config.GetValue(skillName, "maxScale") - Config.GetValue(skillName, "minScale")) + Config.GetValue(skillName, "minScale"); newSize = (float)Math.Round(newSize, 2); + playerInfo.SkillChance = newSize; - // playerPawn.CBodyComponent.SceneNode.GetSkeletonInstance().Scale = newSize; - if (playerPawn.CBodyComponent == null || playerPawn.CBodyComponent.SceneNode == null) return; - playerPawn.CBodyComponent.SceneNode.Scale = newSize; - - Utilities.SetStateChanged(playerPawn, "CBaseEntity", "m_CBodyComponent"); + SkillUtils.ChangePlayerScale(player, newSize); SkillUtils.PrintToChat(player, $"{ChatColors.DarkRed}{Localization.GetTranslation("dwarf")}{ChatColors.Lime}: " + Localization.GetTranslation("dwarf_desc2", newSize), false); } } public static void DisableSkill(CCSPlayerController player) { + var playerInfo = Instance.SkillPlayer.FirstOrDefault(p => p.SteamID == player.SteamID); + if (playerInfo == null) return; + var playerPawn = player.PlayerPawn?.Value; if (playerPawn != null && playerPawn?.CBodyComponent != null) { - // playerPawn.CBodyComponent.SceneNode.GetSkeletonInstance().Scale = 1; - if (playerPawn.CBodyComponent == null || playerPawn.CBodyComponent.SceneNode == null) return; - playerPawn.CBodyComponent.SceneNode.Scale = 1; + playerInfo.SkillChance = 1; + SkillUtils.ChangePlayerScale(player, 1); Utilities.SetStateChanged(playerPawn, "CBaseEntity", "m_CBodyComponent"); } } diff --git a/jRandomSkills - SRC Files/src/player/skills/ExplosiveShot.cs b/jRandomSkills - SRC Files/src/player/skills/ExplosiveShot.cs index d6c0ead..249bf80 100644 --- a/jRandomSkills - SRC Files/src/player/skills/ExplosiveShot.cs +++ b/jRandomSkills - SRC Files/src/player/skills/ExplosiveShot.cs @@ -69,7 +69,7 @@ namespace jRandomSkills SpawnExplosion(param2.DamagePosition); } - public class SkillConfig(Skills skill = skillName, bool active = true, string color = "#9c0000", CsTeam onlyTeam = CsTeam.None, bool needsTeammates = false, float damage = 10f, float damageRadius = 190f, float chanceFrom = .15f, float chanceTo = .3f) : Config.DefaultSkillInfo(skill, active, color, onlyTeam, needsTeammates) + public class SkillConfig(Skills skill = skillName, bool active = true, string color = "#9c0000", CsTeam onlyTeam = CsTeam.None, bool needsTeammates = false, float damage = 25f, float damageRadius = 210f, float chanceFrom = .15f, float chanceTo = .3f) : Config.DefaultSkillInfo(skill, active, color, onlyTeam, needsTeammates) { public float Damage { get; set; } = damage; public float DamageRadius { get; set; } = damageRadius; diff --git a/jRandomSkills - SRC Files/src/player/skills/FalconEye.cs b/jRandomSkills - SRC Files/src/player/skills/FalconEye.cs index f611b06..bebd74b 100644 --- a/jRandomSkills - SRC Files/src/player/skills/FalconEye.cs +++ b/jRandomSkills - SRC Files/src/player/skills/FalconEye.cs @@ -21,7 +21,8 @@ namespace jRandomSkills public static void NewRound() { foreach (var camera in cameras) - camera.Value.Item2.Remove(); + if (camera.Value.Item2 != null && camera.Value.Item2.IsValid) + camera.Value.Item2.AcceptInput("Kill"); cameras.Clear(); } diff --git a/jRandomSkills - SRC Files/src/player/skills/Flash.cs b/jRandomSkills - SRC Files/src/player/skills/Flash.cs index 66f3b60..06bc787 100644 --- a/jRandomSkills - SRC Files/src/player/skills/Flash.cs +++ b/jRandomSkills - SRC Files/src/player/skills/Flash.cs @@ -11,12 +11,18 @@ namespace jRandomSkills public class Flash : ISkill { private const Skills skillName = Skills.Flash; + public static readonly Dictionary jumpedPlayers = []; public static void LoadSkill() { SkillUtils.RegisterSkill(skillName, Config.GetValue(skillName, "color"), false); } + public static void NewRound() + { + jumpedPlayers.Clear(); + } + public static void PlayerMakeSound(UserMessage um) { var soundevent = um.ReadUInt("soundevent_hash"); @@ -35,6 +41,14 @@ namespace jRandomSkills um.Recipients.Clear(); } + public static void PlayerJump(EventPlayerJump @event) + { + var player = @event.Userid; + if (player == null || !player.IsValid) return; + if (!jumpedPlayers.TryGetValue(player.SteamID, out _)) return; + jumpedPlayers[player.SteamID] = Server.TickCount + 20; + } + public static void EnableSkill(CCSPlayerController player) { var playerPawn = player.PlayerPawn.Value; @@ -48,6 +62,7 @@ namespace jRandomSkills newSpeed = (float)Math.Round(newSpeed, 2); playerInfo.SkillChance = newSpeed; + jumpedPlayers.TryAdd(player.SteamID, 0); playerPawn.VelocityModifier = newSpeed; SkillUtils.PrintToChat(player, $"{ChatColors.DarkRed}{Localization.GetTranslation("flash")}{ChatColors.Lime}: " + Localization.GetTranslation("flash_desc2", newSpeed), false); } @@ -57,6 +72,7 @@ namespace jRandomSkills var playerPawn = player.PlayerPawn.Value; if (playerPawn == null) return; playerPawn.VelocityModifier = 1; + jumpedPlayers.Remove(player.SteamID); } public static void OnTick() @@ -69,8 +85,18 @@ namespace jRandomSkills if (playerInfo?.Skill != skillName) continue; var playerPawn = player.PlayerPawn?.Value; - if (playerPawn != null && playerPawn.VelocityModifier != 0) - playerPawn.VelocityModifier = Math.Max((float)(playerInfo?.SkillChance ?? 1), 1); + if (playerPawn == null || playerPawn.VelocityModifier == 0) continue; + + var buttons = player.Buttons; + float newVelocity = Math.Max((float)(playerInfo?.SkillChance ?? 1), 1); + if (buttons.HasFlag(PlayerButtons.Moveleft) || buttons.HasFlag(PlayerButtons.Moveright) || buttons.HasFlag(PlayerButtons.Forward) || buttons.HasFlag(PlayerButtons.Back)) + playerPawn.VelocityModifier = newVelocity; + + if (jumpedPlayers.TryGetValue(player.SteamID, out var time) && time > Server.TickCount) + continue; + + if (!((PlayerFlags)player.Flags).HasFlag(PlayerFlags.FL_ONGROUND)) + playerPawn.AbsVelocity.Z = Math.Min(playerPawn.AbsVelocity.Z, 10); } } diff --git a/jRandomSkills - SRC Files/src/player/skills/Fortnite.cs b/jRandomSkills - SRC Files/src/player/skills/Fortnite.cs index 3046bea..6f663f7 100644 --- a/jRandomSkills - SRC Files/src/player/skills/Fortnite.cs +++ b/jRandomSkills - SRC Files/src/player/skills/Fortnite.cs @@ -138,9 +138,9 @@ namespace jRandomSkills { health -= (int)param2.Damage; barricades[box.Index] = health; - if (health <= 0) box.Remove(); + if (health <= 0) box.AcceptInput("Kill"); } - else box.Remove(); + else box.AcceptInput("Kill"); } public class PlayerSkillInfo diff --git a/jRandomSkills - SRC Files/src/player/skills/FragileBomb.cs b/jRandomSkills - SRC Files/src/player/skills/FragileBomb.cs index 335f414..329a190 100644 --- a/jRandomSkills - SRC Files/src/player/skills/FragileBomb.cs +++ b/jRandomSkills - SRC Files/src/player/skills/FragileBomb.cs @@ -71,9 +71,9 @@ namespace jRandomSkills private static void RemoveBomb() { if (plantedC4 != null && plantedC4.IsValid) - plantedC4.Remove(); + plantedC4.AcceptInput("Kill"); if (triggerC4 != null && triggerC4.IsValid) - triggerC4.Remove(); + triggerC4.AcceptInput("Kill"); SkillUtils.TerminateRound(CsTeam.CounterTerrorist); } diff --git a/jRandomSkills - SRC Files/src/player/skills/Glitch.cs b/jRandomSkills - SRC Files/src/player/skills/Glitch.cs index a0b5a91..85131e4 100644 --- a/jRandomSkills - SRC Files/src/player/skills/Glitch.cs +++ b/jRandomSkills - SRC Files/src/player/skills/Glitch.cs @@ -21,9 +21,18 @@ namespace jRandomSkills { glitchedPlayers.Clear(); foreach (var player in Utilities.GetPlayers()) + { + DisableSkill(player); SkillUtils.CloseMenu(player); + } } + public static void PlayerDeath(EventPlayerDeath @event) + { + var player = @event.Userid; + if (player == null) return; + DisableSkill(player); + } public static void OnTick() { if (Server.TickCount % 32 != 0) return; diff --git a/jRandomSkills - SRC Files/src/player/skills/Jackal.cs b/jRandomSkills - SRC Files/src/player/skills/Jackal.cs index 87c380e..f2344ea 100644 --- a/jRandomSkills - SRC Files/src/player/skills/Jackal.cs +++ b/jRandomSkills - SRC Files/src/player/skills/Jackal.cs @@ -25,7 +25,7 @@ namespace jRandomSkills foreach (var beams in stepBeams.Values) foreach (var beam in beams) if (beam != null && beam.IsValid) - beam.Remove(); + beam.AcceptInput("Kill"); stepBeams.Clear(); Instance.RemoveListener(CheckTransmit); exists = false; @@ -57,7 +57,7 @@ namespace jRandomSkills if (beams.Count >= maxStepBeam) { - beams[0].Remove(); + beams[0].AcceptInput("Kill"); beams.RemoveAt(0); } } diff --git a/jRandomSkills - SRC Files/src/player/skills/Magnifier.cs b/jRandomSkills - SRC Files/src/player/skills/Magnifier.cs index 89d344f..22d31f8 100644 --- a/jRandomSkills - SRC Files/src/player/skills/Magnifier.cs +++ b/jRandomSkills - SRC Files/src/player/skills/Magnifier.cs @@ -20,11 +20,20 @@ namespace jRandomSkills public static void NewRound() { + foreach (var player in playersFOV.Keys) + DisableSkill(player); playersFOV.Clear(); foreach (var player in Utilities.GetPlayers()) SkillUtils.CloseMenu(player); } + public static void PlayerDeath(EventPlayerDeath @event) + { + var player = @event.Userid; + if (player == null) return; + DisableSkill(player); + } + public static void OnTick() { if (Server.TickCount % 32 != 0) return; @@ -64,7 +73,6 @@ namespace jRandomSkills if (!playersFOV.ContainsKey(enemy)) playersFOV.Add(enemy, enemy.DesiredFOV); - Server.PrintToChatAll($"FOV: {enemy.DesiredFOV}"); enemy.DesiredFOV = customFOV; Utilities.SetStateChanged(enemy, "CBasePlayerController", "m_iDesiredFOV"); diff --git a/jRandomSkills - SRC Files/src/player/skills/Mute.cs b/jRandomSkills - SRC Files/src/player/skills/Mute.cs index 2af9f17..f6ea989 100644 --- a/jRandomSkills - SRC Files/src/player/skills/Mute.cs +++ b/jRandomSkills - SRC Files/src/player/skills/Mute.cs @@ -55,7 +55,7 @@ namespace jRandomSkills Instance.AddTimer(5f, () => { if (@event != null && @event.IsValid) - @event.Remove(); + @event.AcceptInput("Kill"); }); }); }); diff --git a/jRandomSkills - SRC Files/src/player/skills/OneShot.cs b/jRandomSkills - SRC Files/src/player/skills/OneShot.cs index a8c39b4..5c57689 100644 --- a/jRandomSkills - SRC Files/src/player/skills/OneShot.cs +++ b/jRandomSkills - SRC Files/src/player/skills/OneShot.cs @@ -23,8 +23,8 @@ namespace jRandomSkills if (param == null || param.Entity == null || param2 == null || param2.Attacker == null || param2.Attacker.Value == null) return; - CCSPlayerPawn attackerPawn = new CCSPlayerPawn(param2.Attacker.Value.Handle); - CCSPlayerPawn victimPawn = new CCSPlayerPawn(param.Handle); + CCSPlayerPawn attackerPawn = new(param2.Attacker.Value.Handle); + CCSPlayerPawn victimPawn = new(param.Handle); if (attackerPawn.DesignerName != "player" || victimPawn.DesignerName != "player") return; @@ -42,11 +42,8 @@ namespace jRandomSkills param2.Damage = 1000f; } - public class SkillConfig : Config.DefaultSkillInfo + public class SkillConfig(Skills skill = skillName, bool active = true, string color = "#ff5CD9", CsTeam onlyTeam = CsTeam.None, bool needsTeammates = false) : Config.DefaultSkillInfo(skill, active, color, onlyTeam, needsTeammates) { - public SkillConfig(Skills skill = skillName, bool active = true, string color = "#ff5CD9", CsTeam onlyTeam = CsTeam.None, bool needsTeammates = false) : base(skill, active, color, onlyTeam, needsTeammates) - { - } } } } \ No newline at end of file diff --git a/jRandomSkills - SRC Files/src/player/skills/Pilot.cs b/jRandomSkills - SRC Files/src/player/skills/Pilot.cs index 3fc9159..e0061c7 100644 --- a/jRandomSkills - SRC Files/src/player/skills/Pilot.cs +++ b/jRandomSkills - SRC Files/src/player/skills/Pilot.cs @@ -11,6 +11,8 @@ namespace jRandomSkills { private const Skills skillName = Skills.Pilot; private static readonly float maximumFuel = Config.GetValue(skillName, "maximumFuel"); + private static readonly float fuelConsumption = Config.GetValue(skillName, "fuelConsumption"); + private static readonly float refuelling = Config.GetValue(skillName, "refuelling"); private static readonly Dictionary PlayerPilotInfo = []; public static void LoadSkill() @@ -38,9 +40,7 @@ namespace jRandomSkills PlayerPilotInfo[player.SteamID] = new Pilot_PlayerInfo { SteamID = player.SteamID, - PressedUse = false, - CanUsePilot = true, - PilotStartTime = DateTime.MinValue + Fuel = maximumFuel, }; } @@ -54,22 +54,10 @@ namespace jRandomSkills var buttons = player.Buttons; if (PlayerPilotInfo.TryGetValue(player.SteamID, out var pilotInfo)) { + pilotInfo.Fuel = Math.Min(Math.Max(0, pilotInfo.Fuel - (buttons.HasFlag(PlayerButtons.Use) ? fuelConsumption : -refuelling)), maximumFuel); if (buttons.HasFlag(PlayerButtons.Use)) - { - if (!pilotInfo.PressedUse) - { - pilotInfo.CanUsePilot = true; - pilotInfo.PressedUse = true; - pilotInfo.PilotStartTime = DateTime.Now; - Instance.AddTimer(4.0f, () => ChangeUsePlayerPilot(player)); - } - - if (pilotInfo.CanUsePilot) - { + if (pilotInfo.Fuel > 0 && player.PlayerPawn.Value != null && player.PlayerPawn.Value.IsValid && !player.PlayerPawn.Value.IsDefusing) ApplyPilotEffect(player); - } - } - UpdateHUD(player, pilotInfo); } } @@ -79,22 +67,16 @@ namespace jRandomSkills var buttons = player.Buttons; float fuelPercentage = maximumFuel; - if (pilotInfo.PressedUse && pilotInfo.CanUsePilot) - { - float elapsedTime = (float)(DateTime.Now - pilotInfo.PilotStartTime).TotalSeconds; - fuelPercentage = Math.Max(0, maximumFuel * (4.0f - elapsedTime) / 4.0f); - } + var skillData = SkillData.Skills.FirstOrDefault(s => s.Skill == skillName); + if (skillData == null) return; - string fuelColor = GetFuelColor(fuelPercentage); - string infoLine = buttons.HasFlag(PlayerButtons.Use) ? $"{Localization.GetTranslation("pilot")}:
" : ""; - string remainingLine = buttons.HasFlag(PlayerButtons.Use) ? - (pilotInfo.CanUsePilot ? $"{fuelPercentage:F0}%
" : $"{Localization.GetTranslation("pilot_hud_info")}
") : ""; + string fuelColor = GetFuelColor(pilotInfo.Fuel); + string infoLine = $"{Localization.GetTranslation("your_skill")}:
"; + string skillLine = $"{skillData.Name}
"; + string remainingLine = $"{Localization.GetTranslation("pilot_hud_info")}: {(pilotInfo.Fuel/maximumFuel)*100:F0}%
"; - if (buttons.HasFlag(PlayerButtons.Use)) - { - var hudContent = infoLine + remainingLine; - player.PrintToCenterHtml(hudContent); - } + var hudContent = infoLine + skillLine + remainingLine; + player.PrintToCenterHtml(hudContent); } private static string GetFuelColor(float fuelPercentage) @@ -104,21 +86,6 @@ namespace jRandomSkills return "#FF0000"; } - private static void ChangeUsePlayerPilot(CCSPlayerController player) - { - if (PlayerPilotInfo.TryGetValue(player.SteamID, out var pilotInfo)) - { - pilotInfo.CanUsePilot = false; - Instance.AddTimer(2.0f, () => - { - pilotInfo.PressedUse = false; - pilotInfo.CanUsePilot = true; - }); - - pilotInfo.PressedUse = true; - } - } - private static void ApplyPilotEffect(CCSPlayerController player) { var playerPawn = player.PlayerPawn.Value; @@ -150,14 +117,14 @@ namespace jRandomSkills public class Pilot_PlayerInfo { public ulong SteamID { get; set; } - public bool CanUsePilot { get; set; } - public bool PressedUse { get; set; } - public DateTime PilotStartTime { get; set; } + public float Fuel { get; set; } } - public class SkillConfig(Skills skill = skillName, bool active = true, string color = "#1466F5", CsTeam onlyTeam = CsTeam.None, bool needsTeammates = false, float maximumFuel = 100f) : Config.DefaultSkillInfo(skill, active, color, onlyTeam, needsTeammates) + public class SkillConfig(Skills skill = skillName, bool active = true, string color = "#1466F5", CsTeam onlyTeam = CsTeam.None, bool needsTeammates = false, float maximumFuel = 150f, float fuelConsumption = .64f, float refuelling = .1f) : Config.DefaultSkillInfo(skill, active, color, onlyTeam, needsTeammates) { public float MaximumFuel { get; set; } = maximumFuel; + public float FuelConsumption { get; set; } = fuelConsumption; + public float Refuelling { get; set; } = refuelling; } } } \ No newline at end of file diff --git a/jRandomSkills - SRC Files/src/player/skills/PsychicDefusing.cs b/jRandomSkills - SRC Files/src/player/skills/PsychicDefusing.cs index a5a11b2..b2938c6 100644 --- a/jRandomSkills - SRC Files/src/player/skills/PsychicDefusing.cs +++ b/jRandomSkills - SRC Files/src/player/skills/PsychicDefusing.cs @@ -72,7 +72,7 @@ namespace jRandomSkills var plantedBomb = Utilities.FindAllEntitiesByDesignerName("planted_c4").FirstOrDefault(); if (plantedBomb != null) { - plantedBomb.Remove(); + plantedBomb.AcceptInput("Kill"); SkillUtils.TerminateRound(CsTeam.CounterTerrorist); } diff --git a/jRandomSkills - SRC Files/src/player/skills/RandomWeapon.cs b/jRandomSkills - SRC Files/src/player/skills/RandomWeapon.cs index 99b797c..1fd9f68 100644 --- a/jRandomSkills - SRC Files/src/player/skills/RandomWeapon.cs +++ b/jRandomSkills - SRC Files/src/player/skills/RandomWeapon.cs @@ -128,7 +128,7 @@ namespace jRandomSkills foreach (var item in pawn.WeaponServices.MyWeapons) { if (item != null && item.IsValid && item.Value != null && item.Value.IsValid && item.Value.DesignerName == weaponToRemove) - item.Value.Remove(); + item.Value.AcceptInput("Kill"); } } diff --git a/jRandomSkills - SRC Files/src/player/skills/Replicator.cs b/jRandomSkills - SRC Files/src/player/skills/Replicator.cs index fa66000..cb2cc2b 100644 --- a/jRandomSkills - SRC Files/src/player/skills/Replicator.cs +++ b/jRandomSkills - SRC Files/src/player/skills/Replicator.cs @@ -132,7 +132,7 @@ namespace jRandomSkills var attackerTeam = attackerPawn.TeamNum; var replicaTeam = replica.Globalname.EndsWith("CT") ? 3 : 2; SkillUtils.TakeHealth(attackerPawn, attackerTeam != replicaTeam ? 15 : 5); - replica.Remove(); + replica.AcceptInput("Kill"); } public class PlayerSkillInfo diff --git a/jRandomSkills - SRC Files/src/player/skills/Spectator.cs b/jRandomSkills - SRC Files/src/player/skills/Spectator.cs index caf8cbf..7fa842d 100644 --- a/jRandomSkills - SRC Files/src/player/skills/Spectator.cs +++ b/jRandomSkills - SRC Files/src/player/skills/Spectator.cs @@ -21,7 +21,8 @@ namespace jRandomSkills public static void NewRound() { foreach (var camera in cameras) - camera.Value.Item2.Remove(); + if (camera.Value.Item2 != null && camera.Value.Item2.IsValid) + camera.Value.Item2.AcceptInput("Kill"); cameras.Clear(); } @@ -75,10 +76,10 @@ namespace jRandomSkills var pawn = player.PlayerPawn.Value; if (pawn == null || !pawn.IsValid || pawn.CameraServices == null) return; - if (cameras.TryGetValue(player.SteamID, out var cameraInfo) && cameraInfo.Item2.IsValid) + if (cameras.TryGetValue(player.SteamID, out var cameraInfo) && cameraInfo.Item2 != null && cameraInfo.Item2.IsValid) { orginalCameraRaw = cameraInfo.Item1; - cameraInfo.Item2.Remove(); + cameraInfo.Item2.AcceptInput("Kill"); newCameraRaw = CreateCamera(player); } else { diff --git a/jRandomSkills - SRC Files/src/player/skills/Thief.cs b/jRandomSkills - SRC Files/src/player/skills/Thief.cs index e758fe0..909e587 100644 --- a/jRandomSkills - SRC Files/src/player/skills/Thief.cs +++ b/jRandomSkills - SRC Files/src/player/skills/Thief.cs @@ -68,7 +68,7 @@ namespace jRandomSkills return; } - DeacitvateSkill(player, enemy); + StealSkill(player, enemy); } public static void EnableSkill(CCSPlayerController player) @@ -99,29 +99,33 @@ namespace jRandomSkills SkillUtils.CloseMenu(player); } - private static void DeacitvateSkill(CCSPlayerController player, CCSPlayerController enemy) + private static void StealSkill(CCSPlayerController player, CCSPlayerController enemy) { var playerInfo = Instance.SkillPlayer.FirstOrDefault(p => p.SteamID == player.SteamID); var enemyInfo = Instance.SkillPlayer.FirstOrDefault(p => p.SteamID == enemy.SteamID); if (playerInfo == null || enemyInfo == null) return; + var enemySkill = enemyInfo.Skill; if (playerInfo != null) { Instance.AddTimer(.1f, () => { - playerInfo.Skill = enemyInfo.Skill; + playerInfo.Skill = enemySkill; playerInfo.SpecialSkill = skillName; - Instance.SkillAction(enemyInfo.Skill.ToString(), "EnableSkill", [player]); + Instance.SkillAction(enemySkill.ToString(), "EnableSkill", [player]); + player.PrintToChat($" {ChatColors.Green}" + Localization.GetTranslation("thief_player_info", enemy.PlayerName)); }); - player.PrintToChat($" {ChatColors.Green}" + Localization.GetTranslation("thief_player_info", enemy.PlayerName)); } if (enemyInfo != null) { - Instance.SkillAction(enemyInfo.Skill.ToString(), "DisableSkill", [enemy]); - enemyInfo.SpecialSkill = enemyInfo.Skill; - enemyInfo.Skill = Skills.None; - enemy.PrintToChat($" {ChatColors.Red}" + Localization.GetTranslation("thief_enemy_info")); + Instance.AddTimer(.1f, () => + { + Instance.SkillAction(enemySkill.ToString(), "DisableSkill", [enemy]); + enemyInfo.SpecialSkill = enemySkill; + enemyInfo.Skill = Skills.None; + enemy.PrintToChat($" {ChatColors.Red}" + Localization.GetTranslation("thief_enemy_info")); + }); } } diff --git a/jRandomSkills - SRC Files/src/player/skills/ThirdEye.cs b/jRandomSkills - SRC Files/src/player/skills/ThirdEye.cs index f213201..190f8ba 100644 --- a/jRandomSkills - SRC Files/src/player/skills/ThirdEye.cs +++ b/jRandomSkills - SRC Files/src/player/skills/ThirdEye.cs @@ -20,7 +20,8 @@ namespace jRandomSkills public static void NewRound() { foreach (var camera in cameras) - camera.Value.Item2.Remove(); + if (camera.Value.Item2 != null && camera.Value.Item2.IsValid) + camera.Value.Item2.AcceptInput("Kill"); cameras.Clear(); } diff --git a/jRandomSkills - SRC Files/src/player/skills/Wallhack.cs b/jRandomSkills - SRC Files/src/player/skills/Wallhack.cs index 873a5fd..7c2c481 100644 --- a/jRandomSkills - SRC Files/src/player/skills/Wallhack.cs +++ b/jRandomSkills - SRC Files/src/player/skills/Wallhack.cs @@ -43,8 +43,10 @@ namespace jRandomSkills { foreach (var glow in glows) { - glow.Item1.Remove(); - glow.Item2.Remove(); + if (glow.Item1 != null && glow.Item1.IsValid) + glow.Item1.AcceptInput("Kill"); + if (glow.Item2 != null && glow.Item2.IsValid) + glow.Item2.AcceptInput("Kill"); } glows.Clear(); } diff --git a/jRandomSkills - SRC Files/src/player/skills/WeaponsSwap.cs b/jRandomSkills - SRC Files/src/player/skills/WeaponsSwap.cs index 32f9e44..48738b2 100644 --- a/jRandomSkills - SRC Files/src/player/skills/WeaponsSwap.cs +++ b/jRandomSkills - SRC Files/src/player/skills/WeaponsSwap.cs @@ -162,7 +162,7 @@ namespace jRandomSkills private static CCSPlayerController? GetRandomEnemy(CCSPlayerController player) { - CCSPlayerController[] enemies = [.. Utilities.GetPlayers().FindAll(e => e.Team != player.Team)]; + CCSPlayerController[] enemies = [.. Utilities.GetPlayers().FindAll(e => e.Team != player.Team && e.PawnIsAlive)]; if (enemies.Length == 0) return null; return enemies[Instance.Random.Next(enemies.Length)]; } diff --git a/jRandomSkills - SRC Files/src/utils/Config.cs b/jRandomSkills - SRC Files/src/utils/Config.cs index 5b8984c..4aa22b1 100644 --- a/jRandomSkills - SRC Files/src/utils/Config.cs +++ b/jRandomSkills - SRC Files/src/utils/Config.cs @@ -142,6 +142,7 @@ namespace jRandomSkills public bool DebugMode { get; set; } public string? AlternativeSkillButton { get; set; } public float SkillTimeBeforeStart { get; set; } + public float SkillDescriptionDuration { get; set; } public NormalCommand SetSkillCommands { get; set; } public NormalCommand SkillsListCommands { get; set; } public NormalCommand UseSkillCommands { get; set; } @@ -165,6 +166,7 @@ namespace jRandomSkills DebugMode = true; AlternativeSkillButton = null; SkillTimeBeforeStart = 7; + SkillDescriptionDuration = 7; SetSkillCommands = new NormalCommand("ustawskill, ustaw_skill, setskill, set_skill, definirhabilidade, configurarhabilidade, 设置技能, 配置技能", "@jRandmosSkills/admin"); SkillsListCommands = new NormalCommand("supermoc, skille, listamocy, supermoce, skills, listaHabilidades, habilidades, 技能列表, 超能力列表", "@jRandmosSkills/admin"); diff --git a/jRandomSkills - SRC Files/src/utils/Localization.cs b/jRandomSkills - SRC Files/src/utils/Localization.cs index 54e764b..38eb951 100644 --- a/jRandomSkills - SRC Files/src/utils/Localization.cs +++ b/jRandomSkills - SRC Files/src/utils/Localization.cs @@ -1,4 +1,5 @@ using CounterStrikeSharp.API.Modules.Utils; +using Newtonsoft.Json; using System.Text.Json; namespace jRandomSkills.src.utils @@ -37,7 +38,7 @@ namespace jRandomSkills.src.utils var code = Path.GetFileNameWithoutExtension(langPath); var jsonText = File.ReadAllText(langPath); - var translations = JsonSerializer.Deserialize>(jsonText); + var translations = JsonConvert.DeserializeObject>(jsonText); if (translations != null) _translations[code] = translations; diff --git a/jRandomSkills - SRC Files/src/utils/SkillUtils.cs b/jRandomSkills - SRC Files/src/utils/SkillUtils.cs index 76940fd..e21050c 100644 --- a/jRandomSkills - SRC Files/src/utils/SkillUtils.cs +++ b/jRandomSkills - SRC Files/src/utils/SkillUtils.cs @@ -1,6 +1,7 @@ using CounterStrikeSharp.API; using CounterStrikeSharp.API.Core; using CounterStrikeSharp.API.Modules.Cvars; +using CounterStrikeSharp.API.Modules.Entities; using CounterStrikeSharp.API.Modules.Entities.Constants; using CounterStrikeSharp.API.Modules.Memory; using CounterStrikeSharp.API.Modules.Memory.DynamicFunctions; @@ -69,6 +70,18 @@ namespace jRandomSkills return new Vector(x, y, z); } + public static void ChangePlayerScale(CCSPlayerController? player, float scale) + { + if (player == null || !player.IsValid) return; + var playerPawn = player.PlayerPawn.Value; + if (playerPawn == null || !playerPawn.IsValid || playerPawn.CBodyComponent == null || playerPawn.CBodyComponent.SceneNode == null) return; + + playerPawn.CBodyComponent.SceneNode.Scale = scale; + playerPawn.CBodyComponent.SceneNode.GetSkeletonInstance().Scale = scale; + playerPawn.AcceptInput("SetScale", null, null, scale.ToString()); + Server.NextFrame(() => Utilities.SetStateChanged(playerPawn, "CBaseEntity", "m_CBodyComponent")); + } + public static void TakeHealth(CCSPlayerPawn? pawn, int damage) { if (pawn == null || !pawn.IsValid || pawn.LifeState != (byte)LifeState_t.LIFE_ALIVE) diff --git a/jRandomSkills - Server Files/plugins/jRandomSkills/Config.json b/jRandomSkills - Server Files/plugins/jRandomSkills/Config.json index 12d3754..f8ae2dd 100644 --- a/jRandomSkills - Server Files/plugins/jRandomSkills/Config.json +++ b/jRandomSkills - Server Files/plugins/jRandomSkills/Config.json @@ -8,6 +8,7 @@ "DebugMode": true, "AlternativeSkillButton": null, "SkillTimeBeforeStart": 7.0, + "SkillDescriptionDuration": 7.0, "SetSkillCommands": { "Alias": "ustawskill, ustaw_skill, setskill, set_skill, definirhabilidade, configurarhabilidade, 设置技能, 配置技能", "Permissions": "@jRandmosSkills/admin" @@ -158,6 +159,13 @@ "Active": true, "Name": "Astronaut" }, + { + "NeedsTeammates": false, + "OnlyTeam": 0, + "Color": "#abab33", + "Active": true, + "Name": "Bankrupt" + }, { "SpeedMultipier": 2.0, "MaxSpeed": 900.0, @@ -305,8 +313,8 @@ "Name": "EnemySpawn" }, { - "Damage": 10.0, - "DamageRadius": 190.0, + "Damage": 25.0, + "DamageRadius": 210.0, "ChanceFrom": 0.15, "ChanceTo": 0.3, "NeedsTeammates": false, @@ -636,7 +644,9 @@ "Name": "Phoenix" }, { - "MaximumFuel": 100.0, + "MaximumFuel": 150.0, + "FuelConsumption": 0.64, + "Refuelling": 0.1, "NeedsTeammates": false, "OnlyTeam": 0, "Color": "#1466F5", diff --git a/jRandomSkills - Server Files/plugins/jRandomSkills/jRandomSkills.dll b/jRandomSkills - Server Files/plugins/jRandomSkills/jRandomSkills.dll index 359755d..23c34df 100644 Binary files a/jRandomSkills - Server Files/plugins/jRandomSkills/jRandomSkills.dll and b/jRandomSkills - Server Files/plugins/jRandomSkills/jRandomSkills.dll differ diff --git a/jRandomSkills - Server Files/plugins/jRandomSkills/lang/en.json b/jRandomSkills - Server Files/plugins/jRandomSkills/lang/en.json index 14edce5..5668b6a 100644 --- a/jRandomSkills - Server Files/plugins/jRandomSkills/lang/en.json +++ b/jRandomSkills - Server Files/plugins/jRandomSkills/lang/en.json @@ -33,6 +33,12 @@ "astronaut_desc": "You receive a random gravity value at the start of the round", "astronaut_desc2": "Your random gravity is: {0}x", + "moneyswap": "Taxman", + "moneyswap_desc": "Choose a player to swap money with", + "moneyswap_enemy_info": "The tax office got you.", + "moneyswap_player_info": "You swapped money with player '{0}'.", + "moneyswap_select_info": "Swap money with player:", + "baseball": "Baseball Player", "baseball_desc": "Your decoy bounces off walls and instantly kills an enemy on impact", @@ -217,11 +223,11 @@ "medic": "Medic", "medic_desc": "Click [css_useSkill] to use a healing charge that restores 50 health", - "moneyswap": "Taxman", - "moneyswap_desc": "Choose a player to swap money with", - "moneyswap_enemy_info": "The tax office got you.", - "moneyswap_player_info": "You swapped money with player '{0}'.", - "moneyswap_select_info": "Swap money with player:", + "bankrupt": "Bankrupt", + "bankrupt_desc": "Choose the player who will lose all their money", + "bankrupt_enemy_info": "You have gone bankrupt.", + "bankrupt_player_info": "Player '{0}' has gone bankrupt.", + "bankrupt_select_info": "Pick a player to go bankrupt:", "muhammed": "Muhammed", "muhammed_desc": "You explode upon death, killing nearby players", @@ -259,7 +265,7 @@ "pilot": "Pilot", "pilot_desc": "Fly for a limited time. Hold [USE - E] to fly", - "pilot_hud_info": "Recharging", + "pilot_hud_info": "Fuel", "planter": "Free Planter", "planter_desc": "You can plant the bomb anywhere, with a detonation time of 60 seconds.", diff --git a/jRandomSkills - Server Files/plugins/jRandomSkills/lang/pl.json b/jRandomSkills - Server Files/plugins/jRandomSkills/lang/pl.json index 3541787..2c6a712 100644 --- a/jRandomSkills - Server Files/plugins/jRandomSkills/lang/pl.json +++ b/jRandomSkills - Server Files/plugins/jRandomSkills/lang/pl.json @@ -33,6 +33,12 @@ "astronaut_desc": "Na początku rundy otrzymujesz losową wartość grawitacji", "astronaut_desc2": "Twoja losowa grawitacja wynosi: {0}x", + "bankrupt": "Bankrut", + "bankrupt_desc": "Wybierz gracza, który straci wszystkie swoje pieniądze", + "bankrupt_enemy_info": "Stałeś się bankrutem.", + "bankrupt_player_info": "Gracz '{0}' zbankrutował.", + "bankrupt_select_info": "Wybierz gracza do bankrucji:", + "baseball": "Bejsbolista", "baseball_desc": "Twój wabik odbija się od ścian i natychmiastowo zabija wroga po trafieniu", @@ -259,7 +265,7 @@ "pilot": "Pilot", "pilot_desc": "Latanie przez określony czas. Przytrzymaj [USE - E], aby latać", - "pilot_hud_info": "W trakcie odnawiania", + "pilot_hud_info": "Paliwo", "planter": "Samowolka", "planter_desc": "Bombę można podłożyć w dowolnym miejscu, a czas detonacji wynosi 60 sekund.", diff --git a/jRandomSkills - Server Files/plugins/jRandomSkills/lang/pt-br.json b/jRandomSkills - Server Files/plugins/jRandomSkills/lang/pt-br.json index 8a0425e..c13f007 100644 --- a/jRandomSkills - Server Files/plugins/jRandomSkills/lang/pt-br.json +++ b/jRandomSkills - Server Files/plugins/jRandomSkills/lang/pt-br.json @@ -33,6 +33,12 @@ "astronaut_desc": "Você recebe um valor de gravidade aleatório no início da rodada", "astronaut_desc2": "Sua gravidade aleatória é: {0}x", + "bankrupt": "Falido", + "bankrupt_desc": "Escolha o jogador que perderá todo o dinheiro", + "bankrupt_enemy_info": "Você faliu.", + "bankrupt_player_info": "O jogador '{0}' faliu.", + "bankrupt_select_info": "Escolha jogador p/ falir:", + "baseball": "Jogador de Beisebol", "baseball_desc": "Seu chamariz ricocheteia nas paredes e mata instantaneamente um inimigo ao acertar", @@ -259,7 +265,7 @@ "pilot": "Piloto", "pilot_desc": "Voe por um tempo limitado. Segure [USE - E] para voar", - "pilot_hud_info": "Recarregando", + "pilot_hud_info": "Combustível", "planter": "Plantador Livre", "planter_desc": "Você pode plantar a bomba em qualquer lugar, com um tempo de detonação de 60 segundos.", diff --git a/jRandomSkills - Server Files/plugins/jRandomSkills/lang/zh.json b/jRandomSkills - Server Files/plugins/jRandomSkills/lang/zh.json index a53a57c..2b23aaa 100644 --- a/jRandomSkills - Server Files/plugins/jRandomSkills/lang/zh.json +++ b/jRandomSkills - Server Files/plugins/jRandomSkills/lang/zh.json @@ -33,6 +33,12 @@ "astronaut_desc": "回合开始时你会获得随机重力值", "astronaut_desc2": "你的随机重力是:{0}x", + "bankrupt": "破产", + "bankrupt_desc": "选择一个会失去所有金钱的玩家", + "bankrupt_enemy_info": "你破产了。", + "bankrupt_player_info": "玩家“{0}”已破产。", + "bankrupt_select_info": "选择玩家破产:", + "baseball": "棒球手", "baseball_desc": "你的诱饵弹会在墙壁上反弹并在击中敌人时立即杀死", @@ -259,7 +265,7 @@ "pilot": "飞行员", "pilot_desc": "在有限时间内飞行。按住 [USE - E] 飞行", - "pilot_hud_info": "正在充能", + "pilot_hud_info": "燃料", "planter": "自由种植者", "planter_desc": "你可以在任何地方放置炸弹,引爆时间为60秒。", diff --git a/readme-pl.md b/readme-pl.md index 1c0fb7b..c8191db 100644 --- a/readme-pl.md +++ b/readme-pl.md @@ -37,7 +37,7 @@ Dołącz do serwera testowego 3v3 i wypróbuj plugin jRandomSkills: Kupujesz serwer na pukawce? Skorzystaj z mojego [kodu polecającego](https://pukawka.pl/pp,juzlus.html). -## ✨ Aktualne Supermoce (106) +## ✨ Aktualne Supermoce (107)
Poniższa tabela przedstawia wszystkie dostępne supermoce w grze, wraz z ich opisami. @@ -51,6 +51,7 @@ Kupujesz serwer na pukawce? Skorzystaj z mojego [kodu polecającego](https://puk | Gruby | Masz losowy mnożnik otrzymywanych obrażeń | (0.65 - 0.85)x | | Skrytobójca | Zadajesz podwójne obrażenia przeciwnikowi od tyłu | - | | Astronauta | Na początku rundy otrzymujesz losową wartość grawitacji | (0.1 - 0.7)x | +| Bankrut | Wybierz gracza, który straci wszystkie swoje pieniądze | - | | Bejsbolista | Twój wabik odbija się od ścian i natychmiastowo zabija wroga po trafieniu | - | | Obrót Wroga | Masz losową szansę na obrócenie wroga o 180 stopni po trafieniu go | (20 - 40)% | | Mistrz Ostrza | Trzymając nóż, masz duże szanse na odparcie strzału | - | @@ -236,7 +237,7 @@ Wszystkie sypermoce można dostosować w pliku **`Config.cfg`** znajdującym si "SummaryAfterTheRound": true, // Pokazuj podsumowanie z ostatniej rundy "DebugMode": true, // Zapisuj aktywność do folderu 'Debug' "AlternativeSkillButton": null, // Możliwe przyciski: - // "Attack", "Jump", "Duck", "Forward", "Back", + // null, "Attack", "Jump", "Duck", "Forward", "Back", // "Use", "Cancel", "Left", "Right", "Moveleft", // "Moveright", "Attack2", "Run", "Reload", "Alt1", // "Alt2", "Speed", "Walk", "Zoom", "Weapon1", @@ -244,6 +245,7 @@ Wszystkie sypermoce można dostosować w pliku **`Config.cfg`** znajdującym si // "Attack3", "Scoreboard", "Inspect" "SkillTimeBeforeStart": 7.0, // Ile sekund przed końcem freeze time należy zakończyć // losowanie umiejętności? (freezetime - SkillTimeBeforeStart) + "SkillDescriptionDuration": 7.0,// Jak długo opis umiejętności powinien być widoczny? ... }, "SkillsInfo": [ @@ -277,19 +279,43 @@ Plugin korzysta z zawartości następujących projektów: - #### Ogólne: - ###### Do pliku konfiguracyjnego dodano opcję `SkillTimeBeforeStart`, która określa, na ile sekund przed końcem freezetime powinno się zakończyć losowanie umiejętności. + - ###### Do pliku konfiguracyjnego dodano opcję `SkillDescriptionDuration`, która określa, ile sekund opis umiejętności w wiadomości HTML powinien być widoczny. - ###### Umiejętności nie są już wyłączane pod koniec rundy. - - ###### Zmieniono logikę przyznawania umiejętności. + - ###### Zmieniono logikę przydzielania umiejętności. - ###### Zbyt długie pseudonimy są skracane podczas oglądania graczy. - ###### Wybór gracza został zmieniony z Chat Menu na WSAD Menu. - - ###### Opisy umiejętności z wyborem gracza zostały skrócone. + - ###### Na początku rundy dodano opisy umiejętności wyświetlane za pomocą PrintToCenterHtml. + - ###### Skrócono opisy umiejętności przy wyborze gracza. + - ###### Naprawiono problem, w którym komendy css_setskill i css_setstaticskill nie mogły być wykonywane z serwera. - #### Poprawki mocy: - - ##### Beznogi + - ##### Beznogi: - ###### Umiejętność Beznogi całkowicie wyłącza umiejętność Królik. + - ##### Bogacz: + - ###### Limit został ustawiony na $16,000. + - ##### Pilot: + - ###### Plecak odrzutowy został przeprojektowany. + - ###### Zwiększono ilość paliwa. + - ###### Od teraz ilość paliwa jest zawsze widoczna. + - ###### Nie można już używać plecaka odrzutowego podczas rozbrajania bomby. + - ##### Strzał Wybuchowy: + - ###### Obrażenia i zasięg ataku zostały nieznacznie zwiększone. + - ##### Flash: + - ###### Naprawiono błąd powodujący "wystrzelenie w górę" graczy na schodach/rampach. + - ##### Lupa: + - ###### Usunięto niepotrzebne wywołania Server.PrintToChatAll. + - ##### Zamiana Broni: + - ###### Naprawiono błąd z możliwością wymiany broni z martwym graczem. + - ##### Mini Majk: + - ###### Naprawiono błąd z niezmienionymi hitboxami. + - ##### Kurczak: + - ###### Naprawiono błąd z niezmienionymi hitboxami. - #### Nowe moce: - ##### Błazen: - ###### W trybie błazna nie możesz zadawać ani otrzymywać obrażeń. Tryb zmienia się co kilka sekund. - ##### Hazardzista: - ###### Wybierz umiejętność z podanej listy. + - ##### Bankrut: + - ###### Wybierz gracza, który straci wszystkie swoje pieniądze.
diff --git a/readme.md b/readme.md index 8e6791f..df0b3bc 100644 --- a/readme.md +++ b/readme.md @@ -38,7 +38,7 @@ Join the 3v3 test server and try out the jRandomSkills plugin: Buying a server on pukawka? Use my [referral code](https://pukawka.pl/pp,juzlus.html). -## ✨ Current Skills (106) +## ✨ Current Skills (107)
The table below lists all available skills in the game, along with their descriptions. @@ -52,6 +52,7 @@ Buying a server on pukawka? Use my [referral code](https://pukawka.pl/pp,juzlus. | Armored | You have a random damage taken multiplier | (0.65 - 0.85)x | | Assassin | You deal increased damage to enemies from behind | - | | Astronaut | You receive a random gravity value at the start of the round | (0.1 - 0.7)x | +| Bankrupt | Choose the player who will lose all their money | - | | Baseball Player | Your decoy bounces off walls and instantly kills an enemy on impact | - | | Enemy Spin | You have a random chance to turn an enemy 180° when hitting them | (20 - 40)% | | Blademaster | While holding a knife, you have a high chance to deflect a shot | - | @@ -236,7 +237,7 @@ All skills can be customized in the **`Config.cfg`** file located in the **`game "SummaryAfterTheRound": true, // Show summary of the last round "DebugMode": true, // Write activity to the ‘Debug’ folder "AlternativeSkillButton": null, // Possible buttons: - // "Attack", "Jump", "Duck", "Forward", "Back", + // null, "Attack", "Jump", "Duck", "Forward", "Back", // "Use", "Cancel", "Left", "Right", "Moveleft", // "Moveright", "Attack2", "Run", "Reload", "Alt1", // "Alt2", "Speed", "Walk", "Zoom", "Weapon1", @@ -244,6 +245,7 @@ All skills can be customized in the **`Config.cfg`** file located in the **`game // "Attack3", "Scoreboard", "Inspect" "SkillTimeBeforeStart": 7.0, // How many seconds before freeze time ends should skills // drawing be completed? (freezetime - SkillTimeBeforeStart) + "SkillDescriptionDuration": 7.0,// How long should the skill description be visible for? ... }, "SkillsInfo": [ @@ -277,19 +279,43 @@ This plugin uses content from the following projects: - #### General: - ###### The `SkillTimeBeforeStart` option has been added to the config file, which specifies how many seconds before the end of freeze time the skills drawing should stop. + - ###### The `SkillDescriptionDuration` option has been added to the config file, which specifies how many seconds the skill description HTML message should be visible. - ###### Skills are no longer disabled at the end of the round. - ###### The logic for granting skills has been changed. - ###### Nicknames that are too long are shortened when spectating players. - ###### The player selection has been changed via the Chat Menu to the WSAD Menu. + - ###### Skill descriptions added at the start of the round using PrintToCenterHtml. - ###### Skill descriptions with player selection have been shortened. + - ###### Fixed a problem where the css_setskill and css_setstaticskill commands could not be executed from the server. - #### Skill improvements: - - ##### Legless + - ##### Legless: - ###### Legless's skill completely disables Bunny's skill. + - ##### Rich Boy: + - ###### The cap has been set at $16,000. + - ##### Pilot: + - ###### The jetpack has been redesigned. + - ###### The amount of fuel has been increased. + - ###### From now on, the amount of fuel is always visible. + - ###### It is no longer possible to use a jetpack while defusing a bomb. + - ##### Explosive Shot: + - ###### The damage and range of attack have increased a little. + - ##### Flash: + - ###### Fixed a bug causing players to be launched upwards on stairs/ramps. + - ##### Magnifier: + - ###### Unnecessary Server.PrintToChatAll have been removed. + - ##### Weapon Swap: + - ###### Fixed a bug with the option to change weapons with a dead player. + - ##### Dwarf: + - ###### Fixed a bug with unchanged hitboxes. + - ##### Chicken: + - ###### Fixed a bug with unchanged hitboxes. - #### New skills: - ##### Jester: - ###### In jester mode, you cannot get or take any damage. This mode changes every few seconds. - ##### Gambler: - ###### Select a skill from the list provided. + - ##### Bankrupt: + - ###### Choose the player who will lose all their money.