Refactor command system and add static skill support

This commit is contained in:
Juzlus 2025-09-05 04:40:53 +02:00
parent e33975fe8b
commit c73473f0ed
22 changed files with 509 additions and 156 deletions

View file

@ -10,9 +10,9 @@ namespace jRandomSkills
public class BunnyHop : ISkill
{
private const Skills skillName = Skills.BunnyHop;
private static float maxSpeed = Config.GetValue<float>(skillName, "maxSpeed");
private static float bunnyHopVelocity = Config.GetValue<float>(skillName, "jumpVelocity");
private static float jumpBoost = Config.GetValue<float>(skillName, "jumpBoost");
private static readonly float maxSpeed = Config.GetValue<float>(skillName, "maxSpeed");
private static readonly float bunnyHopVelocity = Config.GetValue<float>(skillName, "jumpVelocity");
private static readonly float jumpBoost = Config.GetValue<float>(skillName, "jumpBoost");
public static void LoadSkill()
{
@ -60,17 +60,11 @@ namespace jRandomSkills
}
}
public class SkillConfig : Config.DefaultSkillInfo
public class SkillConfig(Skills skill = skillName, bool active = true, string color = "#d1430a", CsTeam onlyTeam = CsTeam.None, bool needsTeammates = false, float maxSpeed = 500f, float jumpVelocity = 300f, float jumpBoost = 2f) : Config.DefaultSkillInfo(skill, active, color, onlyTeam, needsTeammates)
{
public float MaxSpeed { get; set; }
public float JumpVelocity { get; set; }
public float JumpBoost { get; set; }
public SkillConfig(Skills skill = skillName, bool active = true, string color = "#d1430a", CsTeam onlyTeam = CsTeam.None, bool needsTeammates = false, float maxSpeed = 500f, float jumpVelocity = 300f, float jumpBoost = 2f) : base(skill, active, color, onlyTeam, needsTeammates)
{
MaxSpeed = maxSpeed;
JumpVelocity = jumpVelocity;
JumpBoost = jumpBoost;
}
public float MaxSpeed { get; set; } = maxSpeed;
public float JumpVelocity { get; set; } = jumpVelocity;
public float JumpBoost { get; set; } = jumpBoost;
}
}
}