This commit is contained in:
Juzlus 2025-09-13 01:00:31 +02:00
parent 6422436252
commit 714624d96a
45 changed files with 488 additions and 141 deletions

View file

@ -9,6 +9,7 @@
<ItemGroup> <ItemGroup>
<None Remove="src\command\Command.cs~RF4f34d1e7.TMP" /> <None Remove="src\command\Command.cs~RF4f34d1e7.TMP" />
<None Remove="src\player\PlayerOnTick.cs~RF38b6229.TMP" />
<None Remove="src\player\skills\RespWroga.cs~RF528d210.TMP" /> <None Remove="src\player\skills\RespWroga.cs~RF528d210.TMP" />
</ItemGroup> </ItemGroup>

View file

@ -66,13 +66,18 @@ namespace jRandomSkills
private static void Command_SetSkill(CCSPlayerController? player, CommandInfo command) private static void Command_SetSkill(CCSPlayerController? player, CommandInfo command)
{ {
Debug.WriteToDebug($"Player {player?.PlayerPawn} used the css_setskill {command.ArgString} 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 var targetPlayer = Utilities.GetPlayers().FirstOrDefault(p => !p.IsBot
&& (p.SteamID.ToString().Equals(command.GetArg(1), StringComparison.CurrentCultureIgnoreCase) && (p.SteamID.ToString().Equals(command.GetArg(1), StringComparison.CurrentCultureIgnoreCase)
|| p.PlayerName.Equals(command.GetArg(1), StringComparison.CurrentCultureIgnoreCase))); || p.PlayerName.Equals(command.GetArg(1), StringComparison.CurrentCultureIgnoreCase)));
if (command.ArgCount < 2) if (command.ArgCount < 2)
{ {
if (player == null)
{
Server.PrintToConsole(Localization.GetTranslation("correct_form_setskill"));
return;
}
player.PrintToChat($" {ChatColors.Green}―――――――――――{ChatColors.DarkRed}◥◣◆◢◤{ChatColors.Green}―――――――――――"); player.PrintToChat($" {ChatColors.Green}―――――――――――{ChatColors.DarkRed}◥◣◆◢◤{ChatColors.Green}―――――――――――");
SkillUtils.PrintToChat(player, Localization.GetTranslation("correct_form_setskill"), true); SkillUtils.PrintToChat(player, Localization.GetTranslation("correct_form_setskill"), true);
player.PrintToChat($" {ChatColors.Green}―――――――――――{ChatColors.DarkRed}◥◣◆◢◤{ChatColors.Green}―――――――――――"); player.PrintToChat($" {ChatColors.Green}―――――――――――{ChatColors.DarkRed}◥◣◆◢◤{ChatColors.Green}―――――――――――");
@ -81,6 +86,11 @@ namespace jRandomSkills
if (targetPlayer == null) if (targetPlayer == null)
{ {
if (player == null)
{
Server.PrintToConsole(Localization.GetTranslation("player_not_found_setskill"));
return;
}
player.PrintToChat($" {ChatColors.Green}―――――――――――{ChatColors.DarkRed}◥◣◆◢◤{ChatColors.Green}―――――――――――"); player.PrintToChat($" {ChatColors.Green}―――――――――――{ChatColors.DarkRed}◥◣◆◢◤{ChatColors.Green}―――――――――――");
SkillUtils.PrintToChat(player, Localization.GetTranslation("player_not_found_setskill"), true); SkillUtils.PrintToChat(player, Localization.GetTranslation("player_not_found_setskill"), true);
player.PrintToChat($" {ChatColors.Green}―――――――――――{ChatColors.DarkRed}◥◣◆◢◤{ChatColors.Green}―――――――――――"); player.PrintToChat($" {ChatColors.Green}―――――――――――{ChatColors.DarkRed}◥◣◆◢◤{ChatColors.Green}―――――――――――");
@ -92,6 +102,11 @@ namespace jRandomSkills
if (skill == null) if (skill == null)
{ {
if (player == null)
{
Server.PrintToConsole(Localization.GetTranslation("skill_not_found_setskill"));
return;
}
player.PrintToChat($" {ChatColors.Green}―――――――――――{ChatColors.DarkRed}◥◣◆◢◤{ChatColors.Green}―――――――――――"); player.PrintToChat($" {ChatColors.Green}―――――――――――{ChatColors.DarkRed}◥◣◆◢◤{ChatColors.Green}―――――――――――");
SkillUtils.PrintToChat(player, Localization.GetTranslation("skill_not_found_setskill"), true); SkillUtils.PrintToChat(player, Localization.GetTranslation("skill_not_found_setskill"), true);
player.PrintToChat($" {ChatColors.Green}―――――――――――{ChatColors.DarkRed}◥◣◆◢◤{ChatColors.Green}―――――――――――"); player.PrintToChat($" {ChatColors.Green}―――――――――――{ChatColors.DarkRed}◥◣◆◢◤{ChatColors.Green}―――――――――――");
@ -105,6 +120,13 @@ namespace jRandomSkills
skillPlayer.Skill = skill.Skill; skillPlayer.Skill = skill.Skill;
skillPlayer.SpecialSkill = src.player.Skills.None; skillPlayer.SpecialSkill = src.player.Skills.None;
Instance.SkillAction(skill.Skill.ToString(), "EnableSkill", [targetPlayer]); 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) if (skill.Display)
SkillUtils.PrintToChat(player, $"{ChatColors.DarkRed}{skill.Name}{ChatColors.Lime}: {skill.Description}", false); SkillUtils.PrintToChat(player, $"{ChatColors.DarkRed}{skill.Name}{ChatColors.Lime}: {skill.Description}", false);
@ -115,6 +137,12 @@ namespace jRandomSkills
} }
else else
{ {
if (player == null)
{
Server.PrintToConsole(Localization.GetTranslation("error_setskill"));
return;
}
player.PrintToChat($" {ChatColors.Green}―――――――――――{ChatColors.DarkRed}◥◣◆◢◤{ChatColors.Green}―――――――――――"); player.PrintToChat($" {ChatColors.Green}―――――――――――{ChatColors.DarkRed}◥◣◆◢◤{ChatColors.Green}―――――――――――");
SkillUtils.PrintToChat(player, Localization.GetTranslation("error_setskill"), true); SkillUtils.PrintToChat(player, Localization.GetTranslation("error_setskill"), true);
player.PrintToChat($" {ChatColors.Green}―――――――――――{ChatColors.DarkRed}◥◣◆◢◤{ChatColors.Green}―――――――――――"); player.PrintToChat($" {ChatColors.Green}―――――――――――{ChatColors.DarkRed}◥◣◆◢◤{ChatColors.Green}―――――――――――");
@ -310,13 +338,19 @@ namespace jRandomSkills
private static void Command_SetStaticSkill(CCSPlayerController? player, CommandInfo command) private static void Command_SetStaticSkill(CCSPlayerController? player, CommandInfo command)
{ {
Debug.WriteToDebug($"Player {player?.PlayerPawn} used the css_setstaticskill {command.ArgString} 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 var targetPlayer = Utilities.GetPlayers().FirstOrDefault(p => !p.IsBot
&& (p.SteamID.ToString().Equals(command.GetArg(1), StringComparison.CurrentCultureIgnoreCase) && (p.SteamID.ToString().Equals(command.GetArg(1), StringComparison.CurrentCultureIgnoreCase)
|| p.PlayerName.Equals(command.GetArg(1), StringComparison.CurrentCultureIgnoreCase))); || p.PlayerName.Equals(command.GetArg(1), StringComparison.CurrentCultureIgnoreCase)));
if (command.ArgCount < 2) if (command.ArgCount < 2)
{ {
if (player == null)
{
Server.PrintToConsole(Localization.GetTranslation("correct_form_setskill"));
return;
}
player.PrintToChat($" {ChatColors.Green}―――――――――――{ChatColors.DarkRed}◥◣◆◢◤{ChatColors.Green}―――――――――――"); player.PrintToChat($" {ChatColors.Green}―――――――――――{ChatColors.DarkRed}◥◣◆◢◤{ChatColors.Green}―――――――――――");
SkillUtils.PrintToChat(player, Localization.GetTranslation("correct_form_setskill"), true); SkillUtils.PrintToChat(player, Localization.GetTranslation("correct_form_setskill"), true);
player.PrintToChat($" {ChatColors.Green}―――――――――――{ChatColors.DarkRed}◥◣◆◢◤{ChatColors.Green}―――――――――――"); player.PrintToChat($" {ChatColors.Green}―――――――――――{ChatColors.DarkRed}◥◣◆◢◤{ChatColors.Green}―――――――――――");
@ -325,6 +359,12 @@ namespace jRandomSkills
if (targetPlayer == null) if (targetPlayer == null)
{ {
if (player == null)
{
Server.PrintToConsole(Localization.GetTranslation("player_not_found_setskill"));
return;
}
player.PrintToChat($" {ChatColors.Green}―――――――――――{ChatColors.DarkRed}◥◣◆◢◤{ChatColors.Green}―――――――――――"); player.PrintToChat($" {ChatColors.Green}―――――――――――{ChatColors.DarkRed}◥◣◆◢◤{ChatColors.Green}―――――――――――");
SkillUtils.PrintToChat(player, Localization.GetTranslation("player_not_found_setskill"), true); SkillUtils.PrintToChat(player, Localization.GetTranslation("player_not_found_setskill"), true);
player.PrintToChat($" {ChatColors.Green}―――――――――――{ChatColors.DarkRed}◥◣◆◢◤{ChatColors.Green}―――――――――――"); player.PrintToChat($" {ChatColors.Green}―――――――――――{ChatColors.DarkRed}◥◣◆◢◤{ChatColors.Green}―――――――――――");
@ -336,6 +376,12 @@ namespace jRandomSkills
if (skill == null) if (skill == null)
{ {
if (player == null)
{
Server.PrintToConsole(Localization.GetTranslation("skill_not_found_setskill"));
return;
}
player.PrintToChat($" {ChatColors.Green}―――――――――――{ChatColors.DarkRed}◥◣◆◢◤{ChatColors.Green}―――――――――――"); player.PrintToChat($" {ChatColors.Green}―――――――――――{ChatColors.DarkRed}◥◣◆◢◤{ChatColors.Green}―――――――――――");
SkillUtils.PrintToChat(player, Localization.GetTranslation("skill_not_found_setskill"), true); SkillUtils.PrintToChat(player, Localization.GetTranslation("skill_not_found_setskill"), true);
player.PrintToChat($" {ChatColors.Green}―――――――――――{ChatColors.DarkRed}◥◣◆◢◤{ChatColors.Green}―――――――――――"); player.PrintToChat($" {ChatColors.Green}―――――――――――{ChatColors.DarkRed}◥◣◆◢◤{ChatColors.Green}―――――――――――");
@ -348,6 +394,7 @@ namespace jRandomSkills
Instance.SkillAction(skillPlayer.Skill.ToString(), "DisableSkill", [targetPlayer]); Instance.SkillAction(skillPlayer.Skill.ToString(), "DisableSkill", [targetPlayer]);
skillPlayer.Skill = skill.Skill; skillPlayer.Skill = skill.Skill;
skillPlayer.SpecialSkill = src.player.Skills.None; skillPlayer.SpecialSkill = src.player.Skills.None;
skillPlayer.SkillDescriptionHudExpired = DateTime.Now.AddSeconds(Config.LoadedConfig.Settings.SkillDescriptionDuration);
if (skill.Skill == src.player.Skills.None) if (skill.Skill == src.player.Skills.None)
Event.staticSkills.Remove(targetPlayer.SteamID); Event.staticSkills.Remove(targetPlayer.SteamID);
@ -355,6 +402,12 @@ namespace jRandomSkills
Event.staticSkills.Add(targetPlayer.SteamID, skill); Event.staticSkills.Add(targetPlayer.SteamID, skill);
Instance.SkillAction(skill.Skill.ToString(), "EnableSkill", [targetPlayer]); Instance.SkillAction(skill.Skill.ToString(), "EnableSkill", [targetPlayer]);
if (player == null)
{
Server.PrintToConsole(Localization.GetTranslation("done_setskill"));
return;
}
if (skill.Display) if (skill.Display)
SkillUtils.PrintToChat(player, $"{ChatColors.DarkRed}{skill.Name}{ChatColors.Lime}: {skill.Description}", false); SkillUtils.PrintToChat(player, $"{ChatColors.DarkRed}{skill.Name}{ChatColors.Lime}: {skill.Description}", false);
@ -364,6 +417,12 @@ namespace jRandomSkills
} }
else else
{ {
if (player == null)
{
Server.PrintToConsole(Localization.GetTranslation("error_setskill"));
return;
}
player.PrintToChat($" {ChatColors.Green}―――――――――――{ChatColors.DarkRed}◥◣◆◢◤{ChatColors.Green}―――――――――――"); player.PrintToChat($" {ChatColors.Green}―――――――――――{ChatColors.DarkRed}◥◣◆◢◤{ChatColors.Green}―――――――――――");
SkillUtils.PrintToChat(player, Localization.GetTranslation("error_setskill"), true); SkillUtils.PrintToChat(player, Localization.GetTranslation("error_setskill"), true);
player.PrintToChat($" {ChatColors.Green}―――――――――――{ChatColors.DarkRed}◥◣◆◢◤{ChatColors.Green}―――――――――――"); player.PrintToChat($" {ChatColors.Green}―――――――――――{ChatColors.DarkRed}◥◣◆◢◤{ChatColors.Green}―――――――――――");

View file

@ -107,6 +107,7 @@ namespace jRandomSkills
public Skills SpecialSkill { get; set; } public Skills SpecialSkill { get; set; }
public float? SkillChance { get; set; } public float? SkillChance { get; set; }
public bool IsDrawing { get; set; } public bool IsDrawing { get; set; }
public DateTime SkillDescriptionHudExpired { get; set; }
} }
#pragma warning disable IDE1006 #pragma warning disable IDE1006

View file

@ -33,6 +33,12 @@
"astronaut_desc": "You receive a random gravity value at the start of the round", "astronaut_desc": "You receive a random gravity value at the start of the round",
"astronaut_desc2": "Your random gravity is: {0}x", "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": "Baseball Player",
"baseball_desc": "Your decoy bounces off walls and instantly kills an enemy on impact", "baseball_desc": "Your decoy bounces off walls and instantly kills an enemy on impact",
@ -217,11 +223,11 @@
"medic": "Medic", "medic": "Medic",
"medic_desc": "Click [css_useSkill] to use a healing charge that restores 50 health", "medic_desc": "Click [css_useSkill] to use a healing charge that restores 50 health",
"moneyswap": "Taxman", "bankrupt": "Bankrupt",
"moneyswap_desc": "Choose a player to swap money with", "bankrupt_desc": "Choose the player who will lose all their money",
"moneyswap_enemy_info": "The tax office got you.", "bankrupt_enemy_info": "You have gone bankrupt.",
"moneyswap_player_info": "You swapped money with player '{0}'.", "bankrupt_player_info": "Player '{0}' has gone bankrupt.",
"moneyswap_select_info": "Swap money with player:", "bankrupt_select_info": "Pick a player to go bankrupt:",
"muhammed": "Muhammed", "muhammed": "Muhammed",
"muhammed_desc": "You explode upon death, killing nearby players", "muhammed_desc": "You explode upon death, killing nearby players",
@ -259,7 +265,7 @@
"pilot": "Pilot", "pilot": "Pilot",
"pilot_desc": "Fly for a limited time. Hold [USE - E] to fly", "pilot_desc": "Fly for a limited time. Hold [USE - E] to fly",
"pilot_hud_info": "Recharging", "pilot_hud_info": "Fuel",
"planter": "Free Planter", "planter": "Free Planter",
"planter_desc": "You can plant the bomb anywhere, with a detonation time of 60 seconds.", "planter_desc": "You can plant the bomb anywhere, with a detonation time of 60 seconds.",

View file

@ -33,6 +33,12 @@
"astronaut_desc": "Na początku rundy otrzymujesz losową wartość grawitacji", "astronaut_desc": "Na początku rundy otrzymujesz losową wartość grawitacji",
"astronaut_desc2": "Twoja losowa grawitacja wynosi: {0}x", "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": "Bejsbolista",
"baseball_desc": "Twój wabik odbija się od ścian i natychmiastowo zabija wroga po trafieniu", "baseball_desc": "Twój wabik odbija się od ścian i natychmiastowo zabija wroga po trafieniu",
@ -259,7 +265,7 @@
"pilot": "Pilot", "pilot": "Pilot",
"pilot_desc": "Latanie przez określony czas. Przytrzymaj [USE - E], aby latać", "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": "Samowolka",
"planter_desc": "Bombę można podłożyć w dowolnym miejscu, a czas detonacji wynosi 60 sekund.", "planter_desc": "Bombę można podłożyć w dowolnym miejscu, a czas detonacji wynosi 60 sekund.",

View file

@ -33,6 +33,12 @@
"astronaut_desc": "Você recebe um valor de gravidade aleatório no início da rodada", "astronaut_desc": "Você recebe um valor de gravidade aleatório no início da rodada",
"astronaut_desc2": "Sua gravidade aleatória é: {0}x", "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": "Jogador de Beisebol",
"baseball_desc": "Seu chamariz ricocheteia nas paredes e mata instantaneamente um inimigo ao acertar", "baseball_desc": "Seu chamariz ricocheteia nas paredes e mata instantaneamente um inimigo ao acertar",
@ -259,7 +265,7 @@
"pilot": "Piloto", "pilot": "Piloto",
"pilot_desc": "Voe por um tempo limitado. Segure [USE - E] para voar", "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": "Plantador Livre",
"planter_desc": "Você pode plantar a bomba em qualquer lugar, com um tempo de detonação de 60 segundos.", "planter_desc": "Você pode plantar a bomba em qualquer lugar, com um tempo de detonação de 60 segundos.",

View file

@ -33,6 +33,12 @@
"astronaut_desc": "回合开始时你会获得随机重力值", "astronaut_desc": "回合开始时你会获得随机重力值",
"astronaut_desc2": "你的随机重力是:{0}x", "astronaut_desc2": "你的随机重力是:{0}x",
"bankrupt": "破产",
"bankrupt_desc": "选择一个会失去所有金钱的玩家",
"bankrupt_enemy_info": "你破产了。",
"bankrupt_player_info": "玩家“{0}”已破产。",
"bankrupt_select_info": "选择玩家破产:",
"baseball": "棒球手", "baseball": "棒球手",
"baseball_desc": "你的诱饵弹会在墙壁上反弹并在击中敌人时立即杀死", "baseball_desc": "你的诱饵弹会在墙壁上反弹并在击中敌人时立即杀死",
@ -259,7 +265,7 @@
"pilot": "飞行员", "pilot": "飞行员",
"pilot_desc": "在有限时间内飞行。按住 [USE - E] 飞行", "pilot_desc": "在有限时间内飞行。按住 [USE - E] 飞行",
"pilot_hud_info": "正在充能", "pilot_hud_info": "燃料",
"planter": "自由种植者", "planter": "自由种植者",
"planter_desc": "你可以在任何地方放置炸弹,引爆时间为60秒。", "planter_desc": "你可以在任何地方放置炸弹,引爆时间为60秒。",

View file

@ -55,6 +55,7 @@ public enum Skills
Armored, Armored,
Assassin, Assassin,
Astronaut, Astronaut,
Bankrupt,
Baseball, Baseball,
Behind, Behind,
BladeMaster, BladeMaster,

View file

@ -208,6 +208,13 @@ namespace jRandomSkills
foreach (var playerSkill in Instance.SkillPlayer) foreach (var playerSkill in Instance.SkillPlayer)
if (!playerSkill.IsDrawing) if (!playerSkill.IsDrawing)
Instance.SkillAction(playerSkill.Skill.ToString(), "OnTick"); 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) private static HookResult PlayerConnectFull(EventPlayerConnectFull @event, GameEventInfo info)
@ -267,7 +274,7 @@ namespace jRandomSkills
Instance.RemoveListener<CheckTransmit>(CheckTransmit); Instance.RemoveListener<CheckTransmit>(CheckTransmit);
int freezetime = ConVar.Find("mp_freezetime")?.GetPrimitiveValue<Int32>() ?? 0; int freezetime = ConVar.Find("mp_freezetime")?.GetPrimitiveValue<Int32>() ?? 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; return HookResult.Continue;
} }
@ -477,10 +484,11 @@ namespace jRandomSkills
skillPlayer.SpecialSkill = Skills.None; skillPlayer.SpecialSkill = Skills.None;
Instance?.SkillAction(randomSkill.Skill.ToString(), "EnableSkill", new [] { player }); Instance?.SkillAction(randomSkill.Skill.ToString(), "EnableSkill", new [] { player });
Debug.WriteToDebug($"Player {skillPlayer.PlayerName} has got the skill \"{randomSkill.Name}\"."); 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) if (Config.LoadedConfig.Settings.TeamMateSkillInfo)
{ {
Instance?.AddTimer(0.5f, () => Instance?.AddTimer(.5f, () =>
{ {
foreach (var teammate in teammates) foreach (var teammate in teammates)
{ {
@ -513,6 +521,31 @@ namespace jRandomSkills
Instance.SkillAction(playerSkill.Skill.ToString(), "CheckTransmit", [infoList]); 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 = $"<font class='fontSize-l' class='fontWeight-Bold' color='#FFFFFF'>{Localization.GetTranslation("your_skill")}:</font> <br>";
string skillLine = $"<font class='fontSize-l' class='fontWeight-Bold' color='{skillData.Color}'>{skillData.Name}</font> <br>";
string remainingLine = $"<font size='0.2' color='#999999'>{skilLDescription} <br>";
var hudContent = infoLine + skillLine + remainingLine;
player.PrintToCenterHtml(hudContent);
}
[GeneratedRegex(@"\{AUTHOR1\}", RegexOptions.IgnoreCase, "pl-PL")] [GeneratedRegex(@"\{AUTHOR1\}", RegexOptions.IgnoreCase, "pl-PL")]
private static partial Regex MyRegex(); private static partial Regex MyRegex();
[GeneratedRegex(@"\{AUTHOR2\}", RegexOptions.IgnoreCase, "pl-PL")] [GeneratedRegex(@"\{AUTHOR2\}", RegexOptions.IgnoreCase, "pl-PL")]

View file

@ -93,7 +93,7 @@ namespace jRandomSkills
string pName = observeredPlayerSkill.PlayerName; string pName = observeredPlayerSkill.PlayerName;
if (pName.Length > 18) if (pName.Length > 18)
pName = $"{pName.Substring(0, 17)}..."; pName = $"{pName[..17]}...";
infoLine = $"<font class='fontSize-l' class='fontWeight-Bold' color='#FFFFFF'>{Localization.GetTranslation("observer_skill")} {pName}:</font> <br>"; infoLine = $"<font class='fontSize-l' class='fontWeight-Bold' color='#FFFFFF'>{Localization.GetTranslation("observer_skill")} {pName}:</font> <br>";
skillLine = $"<font class='fontSize-l' class='fontWeight-Bold' color='{observeredPlayerSkillInfo.Color}'>{(observeredPlayerSkill.SpecialSkill == Skills.None ? observeredPlayerSkillInfo.Name : $"{observeredPlayerSpecialSkillInfo.Name}({observeredPlayerSkillInfo.Name})")}</font> <br>"; skillLine = $"<font class='fontSize-l' class='fontWeight-Bold' color='{observeredPlayerSkillInfo.Color}'>{(observeredPlayerSkill.SpecialSkill == Skills.None ? observeredPlayerSkillInfo.Name : $"{observeredPlayerSpecialSkillInfo.Name}({observeredPlayerSkillInfo.Name})")}</font> <br>";
} }

View file

@ -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<string>(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)
{
}
}
}

View file

@ -64,7 +64,7 @@ namespace jRandomSkills
var decoy = decoys.FirstOrDefault(d => d.Index == @event.Entityid); var decoy = decoys.FirstOrDefault(d => d.Index == @event.Entityid);
if (decoy != null && decoy.IsValid) if (decoy != null && decoy.IsValid)
decoy.Remove(); decoy.AcceptInput("Kill");
} }
public static void OnTick() public static void OnTick()

View file

@ -66,9 +66,7 @@ namespace jRandomSkills
playerPawn.Health = 50; playerPawn.Health = 50;
Utilities.SetStateChanged(playerPawn, "CBaseEntity", "m_iHealth"); Utilities.SetStateChanged(playerPawn, "CBaseEntity", "m_iHealth");
if (playerPawn.CBodyComponent == null || playerPawn.CBodyComponent.SceneNode == null) return; SkillUtils.ChangePlayerScale(player, .2f);
playerPawn.CBodyComponent.SceneNode.Scale = 0.2f;
Utilities.SetStateChanged(playerPawn, "CBaseEntity", "m_CBodyComponent");
playerPawn.Render = Color.FromArgb(0, 255, 255, 255); playerPawn.Render = Color.FromArgb(0, 255, 255, 255);
playerPawn.ShadowStrength = 0.0f; playerPawn.ShadowStrength = 0.0f;
@ -89,9 +87,7 @@ namespace jRandomSkills
playerPawn.Health += 50; playerPawn.Health += 50;
Utilities.SetStateChanged(playerPawn, "CBaseEntity", "m_iHealth"); Utilities.SetStateChanged(playerPawn, "CBaseEntity", "m_iHealth");
if (playerPawn.CBodyComponent == null || playerPawn.CBodyComponent.SceneNode == null) return; SkillUtils.ChangePlayerScale(player, 1);
playerPawn.CBodyComponent.SceneNode.Scale = 1f;
Utilities.SetStateChanged(playerPawn, "CBaseEntity", "m_CBodyComponent");
playerPawn.Render = Color.FromArgb(255, 255, 255, 255); playerPawn.Render = Color.FromArgb(255, 255, 255, 255);
playerPawn.ShadowStrength = 1.0f; playerPawn.ShadowStrength = 1.0f;
@ -103,7 +99,7 @@ namespace jRandomSkills
if (chickens.TryGetValue(player, out var chicken)) if (chickens.TryGetValue(player, out var chicken))
{ {
if (chicken != null && chicken.IsValid) if (chicken != null && chicken.IsValid)
chicken.Remove(); chicken.AcceptInput("Kill");
chickens.Remove(player); chickens.Remove(player);
} }
} }
@ -154,7 +150,7 @@ namespace jRandomSkills
if (player == null || !player.IsValid) continue; if (player == null || !player.IsValid) continue;
if (chicken == null || !chicken.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; if (pawn == null || !pawn.IsValid || pawn.AbsOrigin == null || chicken.AbsOrigin == null) continue;
float X = (float)Math.Round(pawn.AbsOrigin.X, 2); float X = (float)Math.Round(pawn.AbsOrigin.X, 2);
@ -163,6 +159,7 @@ namespace jRandomSkills
Vector pos = new(X, Y, Z); Vector pos = new(X, Y, Z);
if (chicken.AbsOrigin.X != pos.X || chicken.AbsOrigin.Y != pos.Y || chicken.AbsOrigin.Z != pos.Z) if (chicken.AbsOrigin.X != pos.X || chicken.AbsOrigin.Y != pos.Y || chicken.AbsOrigin.Z != pos.Z)
chicken.Teleport(pos, pawn.AbsRotation, null); chicken.Teleport(pos, pawn.AbsRotation, null);
pawn.VelocityModifier = 1.1f;
UpdateHUD(player); UpdateHUD(player);
} }
} }

View file

@ -16,7 +16,7 @@ namespace jRandomSkills
public static void LoadSkill() public static void LoadSkill()
{ {
SkillUtils.RegisterSkill(skillName, Config.GetValue<string>(skillName, "color"), false); SkillUtils.RegisterSkill(skillName, Config.GetValue<string>(skillName, "color"));
} }
public static void NewRound() public static void NewRound()
@ -24,12 +24,20 @@ namespace jRandomSkills
foreach (var player in defaultPostProcessings.Keys) foreach (var player in defaultPostProcessings.Keys)
DisableSkill(player); DisableSkill(player);
foreach (var postProcessing in newPostProcessing) foreach (var postProcessing in newPostProcessing)
postProcessing.Remove(); if (postProcessing != null && postProcessing.IsValid)
postProcessing.AcceptInput("Kill");
newPostProcessing.Clear(); newPostProcessing.Clear();
foreach (var player in Utilities.GetPlayers()) foreach (var player in Utilities.GetPlayers())
SkillUtils.CloseMenu(player); SkillUtils.CloseMenu(player);
} }
public static void PlayerDeath(EventPlayerDeath @event)
{
var player = @event.Userid;
if (player == null) return;
DisableSkill(player);
}
public static void OnTick() public static void OnTick()
{ {
if (Server.TickCount % 32 != 0) return; if (Server.TickCount % 32 != 0) return;

View file

@ -27,29 +27,31 @@ namespace jRandomSkills
public static unsafe void EnableSkill(CCSPlayerController player) 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; var playerPawn = player.PlayerPawn?.Value;
if (playerPawn != null && player.IsValid) if (playerPawn != null && player.IsValid)
{ {
float newSize = (float)Instance.Random.NextDouble() * (Config.GetValue<float>(skillName, "maxScale") - Config.GetValue<float>(skillName, "minScale")) + Config.GetValue<float>(skillName, "minScale"); float newSize = (float)Instance.Random.NextDouble() * (Config.GetValue<float>(skillName, "maxScale") - Config.GetValue<float>(skillName, "minScale")) + Config.GetValue<float>(skillName, "minScale");
newSize = (float)Math.Round(newSize, 2); newSize = (float)Math.Round(newSize, 2);
playerInfo.SkillChance = newSize;
// playerPawn.CBodyComponent.SceneNode.GetSkeletonInstance().Scale = newSize; SkillUtils.ChangePlayerScale(player, newSize);
if (playerPawn.CBodyComponent == null || playerPawn.CBodyComponent.SceneNode == null) return;
playerPawn.CBodyComponent.SceneNode.Scale = newSize;
Utilities.SetStateChanged(playerPawn, "CBaseEntity", "m_CBodyComponent");
SkillUtils.PrintToChat(player, $"{ChatColors.DarkRed}{Localization.GetTranslation("dwarf")}{ChatColors.Lime}: " + Localization.GetTranslation("dwarf_desc2", newSize), false); SkillUtils.PrintToChat(player, $"{ChatColors.DarkRed}{Localization.GetTranslation("dwarf")}{ChatColors.Lime}: " + Localization.GetTranslation("dwarf_desc2", newSize), false);
} }
} }
public static void DisableSkill(CCSPlayerController player) 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; var playerPawn = player.PlayerPawn?.Value;
if (playerPawn != null && playerPawn?.CBodyComponent != null) if (playerPawn != null && playerPawn?.CBodyComponent != null)
{ {
// playerPawn.CBodyComponent.SceneNode.GetSkeletonInstance().Scale = 1; playerInfo.SkillChance = 1;
if (playerPawn.CBodyComponent == null || playerPawn.CBodyComponent.SceneNode == null) return; SkillUtils.ChangePlayerScale(player, 1);
playerPawn.CBodyComponent.SceneNode.Scale = 1;
Utilities.SetStateChanged(playerPawn, "CBaseEntity", "m_CBodyComponent"); Utilities.SetStateChanged(playerPawn, "CBaseEntity", "m_CBodyComponent");
} }
} }

View file

@ -69,7 +69,7 @@ namespace jRandomSkills
SpawnExplosion(param2.DamagePosition); 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 Damage { get; set; } = damage;
public float DamageRadius { get; set; } = damageRadius; public float DamageRadius { get; set; } = damageRadius;

View file

@ -21,7 +21,8 @@ namespace jRandomSkills
public static void NewRound() public static void NewRound()
{ {
foreach (var camera in cameras) 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(); cameras.Clear();
} }

View file

@ -11,12 +11,18 @@ namespace jRandomSkills
public class Flash : ISkill public class Flash : ISkill
{ {
private const Skills skillName = Skills.Flash; private const Skills skillName = Skills.Flash;
public static readonly Dictionary<ulong, int> jumpedPlayers = [];
public static void LoadSkill() public static void LoadSkill()
{ {
SkillUtils.RegisterSkill(skillName, Config.GetValue<string>(skillName, "color"), false); SkillUtils.RegisterSkill(skillName, Config.GetValue<string>(skillName, "color"), false);
} }
public static void NewRound()
{
jumpedPlayers.Clear();
}
public static void PlayerMakeSound(UserMessage um) public static void PlayerMakeSound(UserMessage um)
{ {
var soundevent = um.ReadUInt("soundevent_hash"); var soundevent = um.ReadUInt("soundevent_hash");
@ -35,6 +41,14 @@ namespace jRandomSkills
um.Recipients.Clear(); 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) public static void EnableSkill(CCSPlayerController player)
{ {
var playerPawn = player.PlayerPawn.Value; var playerPawn = player.PlayerPawn.Value;
@ -48,6 +62,7 @@ namespace jRandomSkills
newSpeed = (float)Math.Round(newSpeed, 2); newSpeed = (float)Math.Round(newSpeed, 2);
playerInfo.SkillChance = newSpeed; playerInfo.SkillChance = newSpeed;
jumpedPlayers.TryAdd(player.SteamID, 0);
playerPawn.VelocityModifier = newSpeed; playerPawn.VelocityModifier = newSpeed;
SkillUtils.PrintToChat(player, $"{ChatColors.DarkRed}{Localization.GetTranslation("flash")}{ChatColors.Lime}: " + Localization.GetTranslation("flash_desc2", newSpeed), false); 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; var playerPawn = player.PlayerPawn.Value;
if (playerPawn == null) return; if (playerPawn == null) return;
playerPawn.VelocityModifier = 1; playerPawn.VelocityModifier = 1;
jumpedPlayers.Remove(player.SteamID);
} }
public static void OnTick() public static void OnTick()
@ -69,8 +85,18 @@ namespace jRandomSkills
if (playerInfo?.Skill != skillName) continue; if (playerInfo?.Skill != skillName) continue;
var playerPawn = player.PlayerPawn?.Value; var playerPawn = player.PlayerPawn?.Value;
if (playerPawn != null && playerPawn.VelocityModifier != 0) if (playerPawn == null || playerPawn.VelocityModifier == 0) continue;
playerPawn.VelocityModifier = Math.Max((float)(playerInfo?.SkillChance ?? 1), 1);
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);
} }
} }

View file

@ -138,9 +138,9 @@ namespace jRandomSkills
{ {
health -= (int)param2.Damage; health -= (int)param2.Damage;
barricades[box.Index] = health; 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 public class PlayerSkillInfo

View file

@ -71,9 +71,9 @@ namespace jRandomSkills
private static void RemoveBomb() private static void RemoveBomb()
{ {
if (plantedC4 != null && plantedC4.IsValid) if (plantedC4 != null && plantedC4.IsValid)
plantedC4.Remove(); plantedC4.AcceptInput("Kill");
if (triggerC4 != null && triggerC4.IsValid) if (triggerC4 != null && triggerC4.IsValid)
triggerC4.Remove(); triggerC4.AcceptInput("Kill");
SkillUtils.TerminateRound(CsTeam.CounterTerrorist); SkillUtils.TerminateRound(CsTeam.CounterTerrorist);
} }

View file

@ -21,9 +21,18 @@ namespace jRandomSkills
{ {
glitchedPlayers.Clear(); glitchedPlayers.Clear();
foreach (var player in Utilities.GetPlayers()) foreach (var player in Utilities.GetPlayers())
{
DisableSkill(player);
SkillUtils.CloseMenu(player); SkillUtils.CloseMenu(player);
} }
}
public static void PlayerDeath(EventPlayerDeath @event)
{
var player = @event.Userid;
if (player == null) return;
DisableSkill(player);
}
public static void OnTick() public static void OnTick()
{ {
if (Server.TickCount % 32 != 0) return; if (Server.TickCount % 32 != 0) return;

View file

@ -25,7 +25,7 @@ namespace jRandomSkills
foreach (var beams in stepBeams.Values) foreach (var beams in stepBeams.Values)
foreach (var beam in beams) foreach (var beam in beams)
if (beam != null && beam.IsValid) if (beam != null && beam.IsValid)
beam.Remove(); beam.AcceptInput("Kill");
stepBeams.Clear(); stepBeams.Clear();
Instance.RemoveListener<Listeners.CheckTransmit>(CheckTransmit); Instance.RemoveListener<Listeners.CheckTransmit>(CheckTransmit);
exists = false; exists = false;
@ -57,7 +57,7 @@ namespace jRandomSkills
if (beams.Count >= maxStepBeam) if (beams.Count >= maxStepBeam)
{ {
beams[0].Remove(); beams[0].AcceptInput("Kill");
beams.RemoveAt(0); beams.RemoveAt(0);
} }
} }

View file

@ -20,11 +20,20 @@ namespace jRandomSkills
public static void NewRound() public static void NewRound()
{ {
foreach (var player in playersFOV.Keys)
DisableSkill(player);
playersFOV.Clear(); playersFOV.Clear();
foreach (var player in Utilities.GetPlayers()) foreach (var player in Utilities.GetPlayers())
SkillUtils.CloseMenu(player); SkillUtils.CloseMenu(player);
} }
public static void PlayerDeath(EventPlayerDeath @event)
{
var player = @event.Userid;
if (player == null) return;
DisableSkill(player);
}
public static void OnTick() public static void OnTick()
{ {
if (Server.TickCount % 32 != 0) return; if (Server.TickCount % 32 != 0) return;
@ -64,7 +73,6 @@ namespace jRandomSkills
if (!playersFOV.ContainsKey(enemy)) if (!playersFOV.ContainsKey(enemy))
playersFOV.Add(enemy, enemy.DesiredFOV); playersFOV.Add(enemy, enemy.DesiredFOV);
Server.PrintToChatAll($"FOV: {enemy.DesiredFOV}");
enemy.DesiredFOV = customFOV; enemy.DesiredFOV = customFOV;
Utilities.SetStateChanged(enemy, "CBasePlayerController", "m_iDesiredFOV"); Utilities.SetStateChanged(enemy, "CBasePlayerController", "m_iDesiredFOV");

View file

@ -55,7 +55,7 @@ namespace jRandomSkills
Instance.AddTimer(5f, () => Instance.AddTimer(5f, () =>
{ {
if (@event != null && @event.IsValid) if (@event != null && @event.IsValid)
@event.Remove(); @event.AcceptInput("Kill");
}); });
}); });
}); });

View file

@ -23,8 +23,8 @@ namespace jRandomSkills
if (param == null || param.Entity == null || param2 == null || param2.Attacker == null || param2.Attacker.Value == null) if (param == null || param.Entity == null || param2 == null || param2.Attacker == null || param2.Attacker.Value == null)
return; return;
CCSPlayerPawn attackerPawn = new CCSPlayerPawn(param2.Attacker.Value.Handle); CCSPlayerPawn attackerPawn = new(param2.Attacker.Value.Handle);
CCSPlayerPawn victimPawn = new CCSPlayerPawn(param.Handle); CCSPlayerPawn victimPawn = new(param.Handle);
if (attackerPawn.DesignerName != "player" || victimPawn.DesignerName != "player") if (attackerPawn.DesignerName != "player" || victimPawn.DesignerName != "player")
return; return;
@ -42,11 +42,8 @@ namespace jRandomSkills
param2.Damage = 1000f; 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)
{
}
} }
} }
} }

View file

@ -11,6 +11,8 @@ namespace jRandomSkills
{ {
private const Skills skillName = Skills.Pilot; private const Skills skillName = Skills.Pilot;
private static readonly float maximumFuel = Config.GetValue<float>(skillName, "maximumFuel"); private static readonly float maximumFuel = Config.GetValue<float>(skillName, "maximumFuel");
private static readonly float fuelConsumption = Config.GetValue<float>(skillName, "fuelConsumption");
private static readonly float refuelling = Config.GetValue<float>(skillName, "refuelling");
private static readonly Dictionary<ulong, Pilot_PlayerInfo> PlayerPilotInfo = []; private static readonly Dictionary<ulong, Pilot_PlayerInfo> PlayerPilotInfo = [];
public static void LoadSkill() public static void LoadSkill()
@ -38,9 +40,7 @@ namespace jRandomSkills
PlayerPilotInfo[player.SteamID] = new Pilot_PlayerInfo PlayerPilotInfo[player.SteamID] = new Pilot_PlayerInfo
{ {
SteamID = player.SteamID, SteamID = player.SteamID,
PressedUse = false, Fuel = maximumFuel,
CanUsePilot = true,
PilotStartTime = DateTime.MinValue
}; };
} }
@ -54,22 +54,10 @@ namespace jRandomSkills
var buttons = player.Buttons; var buttons = player.Buttons;
if (PlayerPilotInfo.TryGetValue(player.SteamID, out var pilotInfo)) 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 (buttons.HasFlag(PlayerButtons.Use))
{ if (pilotInfo.Fuel > 0 && player.PlayerPawn.Value != null && player.PlayerPawn.Value.IsValid && !player.PlayerPawn.Value.IsDefusing)
if (!pilotInfo.PressedUse)
{
pilotInfo.CanUsePilot = true;
pilotInfo.PressedUse = true;
pilotInfo.PilotStartTime = DateTime.Now;
Instance.AddTimer(4.0f, () => ChangeUsePlayerPilot(player));
}
if (pilotInfo.CanUsePilot)
{
ApplyPilotEffect(player); ApplyPilotEffect(player);
}
}
UpdateHUD(player, pilotInfo); UpdateHUD(player, pilotInfo);
} }
} }
@ -79,23 +67,17 @@ namespace jRandomSkills
var buttons = player.Buttons; var buttons = player.Buttons;
float fuelPercentage = maximumFuel; float fuelPercentage = maximumFuel;
if (pilotInfo.PressedUse && pilotInfo.CanUsePilot) var skillData = SkillData.Skills.FirstOrDefault(s => s.Skill == skillName);
{ if (skillData == null) return;
float elapsedTime = (float)(DateTime.Now - pilotInfo.PilotStartTime).TotalSeconds;
fuelPercentage = Math.Max(0, maximumFuel * (4.0f - elapsedTime) / 4.0f);
}
string fuelColor = GetFuelColor(fuelPercentage); string fuelColor = GetFuelColor(pilotInfo.Fuel);
string infoLine = buttons.HasFlag(PlayerButtons.Use) ? $"<font color='#FFFFFF'>{Localization.GetTranslation("pilot")}:</font> <br>" : ""; string infoLine = $"<font class='fontSize-l' class='fontWeight-Bold' color='#FFFFFF'>{Localization.GetTranslation("your_skill")}:</font> <br>";
string remainingLine = buttons.HasFlag(PlayerButtons.Use) ? string skillLine = $"<font class='fontSize-l' class='fontWeight-Bold' color='{skillData.Color}'>{skillData.Name}</font> <br>";
(pilotInfo.CanUsePilot ? $"<font color='{fuelColor}'>{fuelPercentage:F0}%</font> <br>" : $"<font color='#FF0000'>{Localization.GetTranslation("pilot_hud_info")}</font> <br>") : ""; string remainingLine = $"<font class='fontSize-m' color='#ffffff'>{Localization.GetTranslation("pilot_hud_info")}:</font> <font color='{fuelColor}'>{(pilotInfo.Fuel/maximumFuel)*100:F0}%</font> <br>";
if (buttons.HasFlag(PlayerButtons.Use)) var hudContent = infoLine + skillLine + remainingLine;
{
var hudContent = infoLine + remainingLine;
player.PrintToCenterHtml(hudContent); player.PrintToCenterHtml(hudContent);
} }
}
private static string GetFuelColor(float fuelPercentage) private static string GetFuelColor(float fuelPercentage)
{ {
@ -104,21 +86,6 @@ namespace jRandomSkills
return "#FF0000"; 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) private static void ApplyPilotEffect(CCSPlayerController player)
{ {
var playerPawn = player.PlayerPawn.Value; var playerPawn = player.PlayerPawn.Value;
@ -150,14 +117,14 @@ namespace jRandomSkills
public class Pilot_PlayerInfo public class Pilot_PlayerInfo
{ {
public ulong SteamID { get; set; } public ulong SteamID { get; set; }
public bool CanUsePilot { get; set; } public float Fuel { get; set; }
public bool PressedUse { get; set; }
public DateTime PilotStartTime { 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 MaximumFuel { get; set; } = maximumFuel;
public float FuelConsumption { get; set; } = fuelConsumption;
public float Refuelling { get; set; } = refuelling;
} }
} }
} }

View file

@ -72,7 +72,7 @@ namespace jRandomSkills
var plantedBomb = Utilities.FindAllEntitiesByDesignerName<CPlantedC4>("planted_c4").FirstOrDefault(); var plantedBomb = Utilities.FindAllEntitiesByDesignerName<CPlantedC4>("planted_c4").FirstOrDefault();
if (plantedBomb != null) if (plantedBomb != null)
{ {
plantedBomb.Remove(); plantedBomb.AcceptInput("Kill");
SkillUtils.TerminateRound(CsTeam.CounterTerrorist); SkillUtils.TerminateRound(CsTeam.CounterTerrorist);
} }

View file

@ -128,7 +128,7 @@ namespace jRandomSkills
foreach (var item in pawn.WeaponServices.MyWeapons) foreach (var item in pawn.WeaponServices.MyWeapons)
{ {
if (item != null && item.IsValid && item.Value != null && item.Value.IsValid && item.Value.DesignerName == weaponToRemove) if (item != null && item.IsValid && item.Value != null && item.Value.IsValid && item.Value.DesignerName == weaponToRemove)
item.Value.Remove(); item.Value.AcceptInput("Kill");
} }
} }

View file

@ -132,7 +132,7 @@ namespace jRandomSkills
var attackerTeam = attackerPawn.TeamNum; var attackerTeam = attackerPawn.TeamNum;
var replicaTeam = replica.Globalname.EndsWith("CT") ? 3 : 2; var replicaTeam = replica.Globalname.EndsWith("CT") ? 3 : 2;
SkillUtils.TakeHealth(attackerPawn, attackerTeam != replicaTeam ? 15 : 5); SkillUtils.TakeHealth(attackerPawn, attackerTeam != replicaTeam ? 15 : 5);
replica.Remove(); replica.AcceptInput("Kill");
} }
public class PlayerSkillInfo public class PlayerSkillInfo

View file

@ -21,7 +21,8 @@ namespace jRandomSkills
public static void NewRound() public static void NewRound()
{ {
foreach (var camera in cameras) 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(); cameras.Clear();
} }
@ -75,10 +76,10 @@ namespace jRandomSkills
var pawn = player.PlayerPawn.Value; var pawn = player.PlayerPawn.Value;
if (pawn == null || !pawn.IsValid || pawn.CameraServices == null) return; 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; orginalCameraRaw = cameraInfo.Item1;
cameraInfo.Item2.Remove(); cameraInfo.Item2.AcceptInput("Kill");
newCameraRaw = CreateCamera(player); newCameraRaw = CreateCamera(player);
} else } else
{ {

View file

@ -68,7 +68,7 @@ namespace jRandomSkills
return; return;
} }
DeacitvateSkill(player, enemy); StealSkill(player, enemy);
} }
public static void EnableSkill(CCSPlayerController player) public static void EnableSkill(CCSPlayerController player)
@ -99,29 +99,33 @@ namespace jRandomSkills
SkillUtils.CloseMenu(player); 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 playerInfo = Instance.SkillPlayer.FirstOrDefault(p => p.SteamID == player.SteamID);
var enemyInfo = Instance.SkillPlayer.FirstOrDefault(p => p.SteamID == enemy.SteamID); var enemyInfo = Instance.SkillPlayer.FirstOrDefault(p => p.SteamID == enemy.SteamID);
if (playerInfo == null || enemyInfo == null) return; if (playerInfo == null || enemyInfo == null) return;
var enemySkill = enemyInfo.Skill;
if (playerInfo != null) if (playerInfo != null)
{ {
Instance.AddTimer(.1f, () => Instance.AddTimer(.1f, () =>
{ {
playerInfo.Skill = enemyInfo.Skill; playerInfo.Skill = enemySkill;
playerInfo.SpecialSkill = skillName; 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) if (enemyInfo != null)
{ {
Instance.SkillAction(enemyInfo.Skill.ToString(), "DisableSkill", [enemy]); Instance.AddTimer(.1f, () =>
enemyInfo.SpecialSkill = enemyInfo.Skill; {
Instance.SkillAction(enemySkill.ToString(), "DisableSkill", [enemy]);
enemyInfo.SpecialSkill = enemySkill;
enemyInfo.Skill = Skills.None; enemyInfo.Skill = Skills.None;
enemy.PrintToChat($" {ChatColors.Red}" + Localization.GetTranslation("thief_enemy_info")); enemy.PrintToChat($" {ChatColors.Red}" + Localization.GetTranslation("thief_enemy_info"));
});
} }
} }

View file

@ -20,7 +20,8 @@ namespace jRandomSkills
public static void NewRound() public static void NewRound()
{ {
foreach (var camera in cameras) 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(); cameras.Clear();
} }

View file

@ -43,8 +43,10 @@ namespace jRandomSkills
{ {
foreach (var glow in glows) foreach (var glow in glows)
{ {
glow.Item1.Remove(); if (glow.Item1 != null && glow.Item1.IsValid)
glow.Item2.Remove(); glow.Item1.AcceptInput("Kill");
if (glow.Item2 != null && glow.Item2.IsValid)
glow.Item2.AcceptInput("Kill");
} }
glows.Clear(); glows.Clear();
} }

View file

@ -162,7 +162,7 @@ namespace jRandomSkills
private static CCSPlayerController? GetRandomEnemy(CCSPlayerController player) 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; if (enemies.Length == 0) return null;
return enemies[Instance.Random.Next(enemies.Length)]; return enemies[Instance.Random.Next(enemies.Length)];
} }

View file

@ -142,6 +142,7 @@ namespace jRandomSkills
public bool DebugMode { get; set; } public bool DebugMode { get; set; }
public string? AlternativeSkillButton { get; set; } public string? AlternativeSkillButton { get; set; }
public float SkillTimeBeforeStart { get; set; } public float SkillTimeBeforeStart { get; set; }
public float SkillDescriptionDuration { get; set; }
public NormalCommand SetSkillCommands { get; set; } public NormalCommand SetSkillCommands { get; set; }
public NormalCommand SkillsListCommands { get; set; } public NormalCommand SkillsListCommands { get; set; }
public NormalCommand UseSkillCommands { get; set; } public NormalCommand UseSkillCommands { get; set; }
@ -165,6 +166,7 @@ namespace jRandomSkills
DebugMode = true; DebugMode = true;
AlternativeSkillButton = null; AlternativeSkillButton = null;
SkillTimeBeforeStart = 7; SkillTimeBeforeStart = 7;
SkillDescriptionDuration = 7;
SetSkillCommands = new NormalCommand("ustawskill, ustaw_skill, setskill, set_skill, definirhabilidade, configurarhabilidade, 设置技能, 配置技能", "@jRandmosSkills/admin"); 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"); SkillsListCommands = new NormalCommand("supermoc, skille, listamocy, supermoce, skills, listaHabilidades, habilidades, 技能列表, 超能力列表", "@jRandmosSkills/admin");

View file

@ -1,4 +1,5 @@
using CounterStrikeSharp.API.Modules.Utils; using CounterStrikeSharp.API.Modules.Utils;
using Newtonsoft.Json;
using System.Text.Json; using System.Text.Json;
namespace jRandomSkills.src.utils namespace jRandomSkills.src.utils
@ -37,7 +38,7 @@ namespace jRandomSkills.src.utils
var code = Path.GetFileNameWithoutExtension(langPath); var code = Path.GetFileNameWithoutExtension(langPath);
var jsonText = File.ReadAllText(langPath); var jsonText = File.ReadAllText(langPath);
var translations = JsonSerializer.Deserialize<Dictionary<string, string>>(jsonText); var translations = JsonConvert.DeserializeObject<Dictionary<string, string>>(jsonText);
if (translations != null) if (translations != null)
_translations[code] = translations; _translations[code] = translations;

View file

@ -1,6 +1,7 @@
using CounterStrikeSharp.API; using CounterStrikeSharp.API;
using CounterStrikeSharp.API.Core; using CounterStrikeSharp.API.Core;
using CounterStrikeSharp.API.Modules.Cvars; using CounterStrikeSharp.API.Modules.Cvars;
using CounterStrikeSharp.API.Modules.Entities;
using CounterStrikeSharp.API.Modules.Entities.Constants; using CounterStrikeSharp.API.Modules.Entities.Constants;
using CounterStrikeSharp.API.Modules.Memory; using CounterStrikeSharp.API.Modules.Memory;
using CounterStrikeSharp.API.Modules.Memory.DynamicFunctions; using CounterStrikeSharp.API.Modules.Memory.DynamicFunctions;
@ -69,6 +70,18 @@ namespace jRandomSkills
return new Vector(x, y, z); 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) public static void TakeHealth(CCSPlayerPawn? pawn, int damage)
{ {
if (pawn == null || !pawn.IsValid || pawn.LifeState != (byte)LifeState_t.LIFE_ALIVE) if (pawn == null || !pawn.IsValid || pawn.LifeState != (byte)LifeState_t.LIFE_ALIVE)

View file

@ -8,6 +8,7 @@
"DebugMode": true, "DebugMode": true,
"AlternativeSkillButton": null, "AlternativeSkillButton": null,
"SkillTimeBeforeStart": 7.0, "SkillTimeBeforeStart": 7.0,
"SkillDescriptionDuration": 7.0,
"SetSkillCommands": { "SetSkillCommands": {
"Alias": "ustawskill, ustaw_skill, setskill, set_skill, definirhabilidade, configurarhabilidade, 设置技能, 配置技能", "Alias": "ustawskill, ustaw_skill, setskill, set_skill, definirhabilidade, configurarhabilidade, 设置技能, 配置技能",
"Permissions": "@jRandmosSkills/admin" "Permissions": "@jRandmosSkills/admin"
@ -158,6 +159,13 @@
"Active": true, "Active": true,
"Name": "Astronaut" "Name": "Astronaut"
}, },
{
"NeedsTeammates": false,
"OnlyTeam": 0,
"Color": "#abab33",
"Active": true,
"Name": "Bankrupt"
},
{ {
"SpeedMultipier": 2.0, "SpeedMultipier": 2.0,
"MaxSpeed": 900.0, "MaxSpeed": 900.0,
@ -305,8 +313,8 @@
"Name": "EnemySpawn" "Name": "EnemySpawn"
}, },
{ {
"Damage": 10.0, "Damage": 25.0,
"DamageRadius": 190.0, "DamageRadius": 210.0,
"ChanceFrom": 0.15, "ChanceFrom": 0.15,
"ChanceTo": 0.3, "ChanceTo": 0.3,
"NeedsTeammates": false, "NeedsTeammates": false,
@ -636,7 +644,9 @@
"Name": "Phoenix" "Name": "Phoenix"
}, },
{ {
"MaximumFuel": 100.0, "MaximumFuel": 150.0,
"FuelConsumption": 0.64,
"Refuelling": 0.1,
"NeedsTeammates": false, "NeedsTeammates": false,
"OnlyTeam": 0, "OnlyTeam": 0,
"Color": "#1466F5", "Color": "#1466F5",

View file

@ -33,6 +33,12 @@
"astronaut_desc": "You receive a random gravity value at the start of the round", "astronaut_desc": "You receive a random gravity value at the start of the round",
"astronaut_desc2": "Your random gravity is: {0}x", "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": "Baseball Player",
"baseball_desc": "Your decoy bounces off walls and instantly kills an enemy on impact", "baseball_desc": "Your decoy bounces off walls and instantly kills an enemy on impact",
@ -217,11 +223,11 @@
"medic": "Medic", "medic": "Medic",
"medic_desc": "Click [css_useSkill] to use a healing charge that restores 50 health", "medic_desc": "Click [css_useSkill] to use a healing charge that restores 50 health",
"moneyswap": "Taxman", "bankrupt": "Bankrupt",
"moneyswap_desc": "Choose a player to swap money with", "bankrupt_desc": "Choose the player who will lose all their money",
"moneyswap_enemy_info": "The tax office got you.", "bankrupt_enemy_info": "You have gone bankrupt.",
"moneyswap_player_info": "You swapped money with player '{0}'.", "bankrupt_player_info": "Player '{0}' has gone bankrupt.",
"moneyswap_select_info": "Swap money with player:", "bankrupt_select_info": "Pick a player to go bankrupt:",
"muhammed": "Muhammed", "muhammed": "Muhammed",
"muhammed_desc": "You explode upon death, killing nearby players", "muhammed_desc": "You explode upon death, killing nearby players",
@ -259,7 +265,7 @@
"pilot": "Pilot", "pilot": "Pilot",
"pilot_desc": "Fly for a limited time. Hold [USE - E] to fly", "pilot_desc": "Fly for a limited time. Hold [USE - E] to fly",
"pilot_hud_info": "Recharging", "pilot_hud_info": "Fuel",
"planter": "Free Planter", "planter": "Free Planter",
"planter_desc": "You can plant the bomb anywhere, with a detonation time of 60 seconds.", "planter_desc": "You can plant the bomb anywhere, with a detonation time of 60 seconds.",

View file

@ -33,6 +33,12 @@
"astronaut_desc": "Na początku rundy otrzymujesz losową wartość grawitacji", "astronaut_desc": "Na początku rundy otrzymujesz losową wartość grawitacji",
"astronaut_desc2": "Twoja losowa grawitacja wynosi: {0}x", "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": "Bejsbolista",
"baseball_desc": "Twój wabik odbija się od ścian i natychmiastowo zabija wroga po trafieniu", "baseball_desc": "Twój wabik odbija się od ścian i natychmiastowo zabija wroga po trafieniu",
@ -259,7 +265,7 @@
"pilot": "Pilot", "pilot": "Pilot",
"pilot_desc": "Latanie przez określony czas. Przytrzymaj [USE - E], aby latać", "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": "Samowolka",
"planter_desc": "Bombę można podłożyć w dowolnym miejscu, a czas detonacji wynosi 60 sekund.", "planter_desc": "Bombę można podłożyć w dowolnym miejscu, a czas detonacji wynosi 60 sekund.",

View file

@ -33,6 +33,12 @@
"astronaut_desc": "Você recebe um valor de gravidade aleatório no início da rodada", "astronaut_desc": "Você recebe um valor de gravidade aleatório no início da rodada",
"astronaut_desc2": "Sua gravidade aleatória é: {0}x", "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": "Jogador de Beisebol",
"baseball_desc": "Seu chamariz ricocheteia nas paredes e mata instantaneamente um inimigo ao acertar", "baseball_desc": "Seu chamariz ricocheteia nas paredes e mata instantaneamente um inimigo ao acertar",
@ -259,7 +265,7 @@
"pilot": "Piloto", "pilot": "Piloto",
"pilot_desc": "Voe por um tempo limitado. Segure [USE - E] para voar", "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": "Plantador Livre",
"planter_desc": "Você pode plantar a bomba em qualquer lugar, com um tempo de detonação de 60 segundos.", "planter_desc": "Você pode plantar a bomba em qualquer lugar, com um tempo de detonação de 60 segundos.",

View file

@ -33,6 +33,12 @@
"astronaut_desc": "回合开始时你会获得随机重力值", "astronaut_desc": "回合开始时你会获得随机重力值",
"astronaut_desc2": "你的随机重力是:{0}x", "astronaut_desc2": "你的随机重力是:{0}x",
"bankrupt": "破产",
"bankrupt_desc": "选择一个会失去所有金钱的玩家",
"bankrupt_enemy_info": "你破产了。",
"bankrupt_player_info": "玩家“{0}”已破产。",
"bankrupt_select_info": "选择玩家破产:",
"baseball": "棒球手", "baseball": "棒球手",
"baseball_desc": "你的诱饵弹会在墙壁上反弹并在击中敌人时立即杀死", "baseball_desc": "你的诱饵弹会在墙壁上反弹并在击中敌人时立即杀死",
@ -259,7 +265,7 @@
"pilot": "飞行员", "pilot": "飞行员",
"pilot_desc": "在有限时间内飞行。按住 [USE - E] 飞行", "pilot_desc": "在有限时间内飞行。按住 [USE - E] 飞行",
"pilot_hud_info": "正在充能", "pilot_hud_info": "燃料",
"planter": "自由种植者", "planter": "自由种植者",
"planter_desc": "你可以在任何地方放置炸弹,引爆时间为60秒。", "planter_desc": "你可以在任何地方放置炸弹,引爆时间为60秒。",

View file

@ -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). Kupujesz serwer na pukawce? Skorzystaj z mojego [kodu polecającego](https://pukawka.pl/pp,juzlus.html).
## ✨ Aktualne Supermoce (106) ## ✨ Aktualne Supermoce (107)
<details> <details>
<summary>Poniższa tabela przedstawia wszystkie dostępne supermoce w grze, wraz z ich opisami.</summary> <summary>Poniższa tabela przedstawia wszystkie dostępne supermoce w grze, wraz z ich opisami.</summary>
@ -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 | | Gruby | Masz losowy mnożnik otrzymywanych obrażeń | (0.65 - 0.85)x |
| Skrytobójca | Zadajesz podwójne obrażenia przeciwnikowi od tyłu | - | | 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 | | 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 | - | | 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)% | | 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 | - | | 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 "SummaryAfterTheRound": true, // Pokazuj podsumowanie z ostatniej rundy
"DebugMode": true, // Zapisuj aktywność do folderu 'Debug' "DebugMode": true, // Zapisuj aktywność do folderu 'Debug'
"AlternativeSkillButton": null, // Możliwe przyciski: "AlternativeSkillButton": null, // Możliwe przyciski:
// "Attack", "Jump", "Duck", "Forward", "Back", // null, "Attack", "Jump", "Duck", "Forward", "Back",
// "Use", "Cancel", "Left", "Right", "Moveleft", // "Use", "Cancel", "Left", "Right", "Moveleft",
// "Moveright", "Attack2", "Run", "Reload", "Alt1", // "Moveright", "Attack2", "Run", "Reload", "Alt1",
// "Alt2", "Speed", "Walk", "Zoom", "Weapon1", // "Alt2", "Speed", "Walk", "Zoom", "Weapon1",
@ -244,6 +245,7 @@ Wszystkie sypermoce można dostosować w pliku **`Config.cfg`** znajdującym si
// "Attack3", "Scoreboard", "Inspect" // "Attack3", "Scoreboard", "Inspect"
"SkillTimeBeforeStart": 7.0, // Ile sekund przed końcem freeze time należy zakończyć "SkillTimeBeforeStart": 7.0, // Ile sekund przed końcem freeze time należy zakończyć
// losowanie umiejętności? (freezetime - SkillTimeBeforeStart) // losowanie umiejętności? (freezetime - SkillTimeBeforeStart)
"SkillDescriptionDuration": 7.0,// Jak długo opis umiejętności powinien być widoczny?
... ...
}, },
"SkillsInfo": [ "SkillsInfo": [
@ -277,19 +279,43 @@ Plugin korzysta z zawartości następujących projektów:
- #### Ogólne: - #### 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ę `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. - ###### 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. - ###### Zbyt długie pseudonimy są skracane podczas oglądania graczy.
- ###### Wybór gracza został zmieniony z Chat Menu na WSAD Menu. - ###### 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: - #### Poprawki mocy:
- ##### Beznogi - ##### Beznogi:
- ###### Umiejętność Beznogi całkowicie wyłącza umiejętność Królik. - ###### 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: - #### Nowe moce:
- ##### Błazen: - ##### Błazen:
- ###### W trybie błazna nie możesz zadawać ani otrzymywać obrażeń. Tryb zmienia się co kilka sekund. - ###### W trybie błazna nie możesz zadawać ani otrzymywać obrażeń. Tryb zmienia się co kilka sekund.
- ##### Hazardzista: - ##### Hazardzista:
- ###### Wybierz umiejętność z podanej listy. - ###### Wybierz umiejętność z podanej listy.
- ##### Bankrut:
- ###### Wybierz gracza, który straci wszystkie swoje pieniądze.
</details> </details>
<details> <details>

View file

@ -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). Buying a server on pukawka? Use my [referral code](https://pukawka.pl/pp,juzlus.html).
## ✨ Current Skills (106) ## ✨ Current Skills (107)
<details> <details>
<summary>The table below lists all available skills in the game, along with their descriptions.</summary> <summary>The table below lists all available skills in the game, along with their descriptions.</summary>
@ -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 | | Armored | You have a random damage taken multiplier | (0.65 - 0.85)x |
| Assassin | You deal increased damage to enemies from behind | - | | 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 | | 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 | - | | 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)% | | 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 | - | | 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 "SummaryAfterTheRound": true, // Show summary of the last round
"DebugMode": true, // Write activity to the ‘Debug’ folder "DebugMode": true, // Write activity to the ‘Debug’ folder
"AlternativeSkillButton": null, // Possible buttons: "AlternativeSkillButton": null, // Possible buttons:
// "Attack", "Jump", "Duck", "Forward", "Back", // null, "Attack", "Jump", "Duck", "Forward", "Back",
// "Use", "Cancel", "Left", "Right", "Moveleft", // "Use", "Cancel", "Left", "Right", "Moveleft",
// "Moveright", "Attack2", "Run", "Reload", "Alt1", // "Moveright", "Attack2", "Run", "Reload", "Alt1",
// "Alt2", "Speed", "Walk", "Zoom", "Weapon1", // "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" // "Attack3", "Scoreboard", "Inspect"
"SkillTimeBeforeStart": 7.0, // How many seconds before freeze time ends should skills "SkillTimeBeforeStart": 7.0, // How many seconds before freeze time ends should skills
// drawing be completed? (freezetime - SkillTimeBeforeStart) // drawing be completed? (freezetime - SkillTimeBeforeStart)
"SkillDescriptionDuration": 7.0,// How long should the skill description be visible for?
... ...
}, },
"SkillsInfo": [ "SkillsInfo": [
@ -277,19 +279,43 @@ This plugin uses content from the following projects:
- #### General: - #### 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 `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. - ###### Skills are no longer disabled at the end of the round.
- ###### The logic for granting skills has been changed. - ###### The logic for granting skills has been changed.
- ###### Nicknames that are too long are shortened when spectating players. - ###### Nicknames that are too long are shortened when spectating players.
- ###### The player selection has been changed via the Chat Menu to the WSAD Menu. - ###### 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. - ###### 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: - #### Skill improvements:
- ##### Legless - ##### Legless:
- ###### Legless's skill completely disables Bunny's skill. - ###### 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: - #### New skills:
- ##### Jester: - ##### Jester:
- ###### In jester mode, you cannot get or take any damage. This mode changes every few seconds. - ###### In jester mode, you cannot get or take any damage. This mode changes every few seconds.
- ##### Gambler: - ##### Gambler:
- ###### Select a skill from the list provided. - ###### Select a skill from the list provided.
- ##### Bankrupt:
- ###### Choose the player who will lose all their money.
</details> </details>
<details> <details>