diff --git a/OshimaCore/Controllers/FunGameController.cs b/OshimaCore/Controllers/FunGameController.cs index 4f0e9ee..440c090 100644 --- a/OshimaCore/Controllers/FunGameController.cs +++ b/OshimaCore/Controllers/FunGameController.cs @@ -59,9 +59,14 @@ namespace Oshima.Core.Controllers builder.AppendLine($"总计冠军数:{stats.Wins}"); builder.AppendLine($"总计前三数:{stats.Top3s}"); builder.AppendLine($"总计败场数:{stats.Loses}"); - builder.AppendLine($"胜率:{stats.Winrates * 100:0.##}%"); + + List names = [.. FunGameSimulation.TeamCharacterStatistics.OrderByDescending(kv => kv.Value.Winrates).Select(kv => kv.Key.GetName())]; + builder.AppendLine($"胜率:{stats.Winrates * 100:0.##}%(#{names.IndexOf(character.GetName())})"); builder.AppendLine($"前三率:{stats.Top3rates * 100:0.##}%"); - builder.AppendLine($"技术得分:{stats.Rating:0.##}"); + + names = [.. FunGameSimulation.TeamCharacterStatistics.OrderByDescending(kv => kv.Value.Rating).Select(kv => kv.Key.GetName())]; + builder.AppendLine($"技术得分:{stats.Rating:0.##}(#{names.IndexOf(character.GetName())})"); + builder.AppendLine($"上次排名:{stats.LastRank} / 场均名次:{stats.AvgRank}"); return NetworkUtility.JsonSerialize(builder.ToString()); @@ -105,10 +110,11 @@ namespace Oshima.Core.Controllers builder.AppendLine($"总计冠军数:{stats.Wins}"); builder.AppendLine($"总计前三数:{stats.Top3s}"); builder.AppendLine($"总计败场数:{stats.Loses}"); - builder.AppendLine($"胜率:{stats.Winrates * 100:0.##}%"); - builder.AppendLine($"前三率:{stats.Top3rates * 100:0.##}%"); - builder.AppendLine($"技术得分:{stats.Rating:0.##}"); - builder.AppendLine($"上次排名:{stats.LastRank} / 场均名次:{stats.AvgRank}"); + + List names = [.. FunGameSimulation.TeamCharacterStatistics.OrderByDescending(kv => kv.Value.Winrates).Select(kv => kv.Key.GetName())]; + builder.AppendLine($"胜率:{stats.Winrates * 100:0.##}%(#{names.IndexOf(character.GetName())})"); + names = [.. FunGameSimulation.TeamCharacterStatistics.OrderByDescending(kv => kv.Value.Rating).Select(kv => kv.Key.GetName())]; + builder.AppendLine($"技术得分:{stats.Rating:0.##}(#{names.IndexOf(character.GetName())})"); return NetworkUtility.JsonSerialize(builder.ToString()); } @@ -116,6 +122,90 @@ namespace Oshima.Core.Controllers return NetworkUtility.JsonSerialize(""); } + [HttpGet("winraterank")] + public string GetWinrateRank([FromQuery] bool? isteam = null) + { + bool team = isteam ?? false; + if (team) + { + List strings = []; + IEnumerable ratings = FunGameSimulation.TeamCharacterStatistics.OrderByDescending(kv => kv.Value.Winrates).Select(kv => kv.Key); + foreach (Character character in ratings) + { + StringBuilder builder = new(); + CharacterStatistics stats = FunGameSimulation.TeamCharacterStatistics[character]; + builder.AppendLine(character.ToString()); + builder.AppendLine($"总计参赛数:{stats.Plays}"); + builder.AppendLine($"总计冠军数:{stats.Wins}"); + builder.AppendLine($"胜率:{stats.Winrates * 100:0.##}%"); + builder.AppendLine($"技术得分:{stats.Rating:0.##}"); + strings.Add(builder.ToString()); + } + return NetworkUtility.JsonSerialize(strings); + } + else + { + List strings = []; + IEnumerable ratings = FunGameSimulation.CharacterStatistics.OrderByDescending(kv => kv.Value.Winrates).Select(kv => kv.Key); + foreach (Character character in ratings) + { + StringBuilder builder = new(); + CharacterStatistics stats = FunGameSimulation.CharacterStatistics[character]; + builder.AppendLine(character.ToString()); + builder.AppendLine($"总计参赛数:{stats.Plays}"); + builder.AppendLine($"总计冠军数:{stats.Wins}"); + builder.AppendLine($"胜率:{stats.Winrates * 100:0.##}%"); + builder.AppendLine($"前三率:{stats.Top3rates * 100:0.##}%"); + builder.AppendLine($"技术得分:{stats.Rating:0.##}"); + builder.AppendLine($"上次排名:{stats.LastRank} / 场均名次:{stats.AvgRank}"); + strings.Add(builder.ToString()); + } + return NetworkUtility.JsonSerialize(strings); + } + } + + [HttpGet("ratingrank")] + public string GetRatingRank([FromQuery] bool? isteam = null) + { + bool team = isteam ?? false; + if (team) + { + List strings = []; + IEnumerable ratings = FunGameSimulation.TeamCharacterStatistics.OrderByDescending(kv => kv.Value.Rating).Select(kv => kv.Key); + foreach (Character character in ratings) + { + StringBuilder builder = new(); + CharacterStatistics stats = FunGameSimulation.TeamCharacterStatistics[character]; + builder.AppendLine(character.ToString()); + builder.AppendLine($"总计参赛数:{stats.Plays}"); + builder.AppendLine($"总计冠军数:{stats.Wins}"); + builder.AppendLine($"胜率:{stats.Winrates * 100:0.##}%"); + builder.AppendLine($"技术得分:{stats.Rating:0.##}"); + strings.Add(builder.ToString()); + } + return NetworkUtility.JsonSerialize(strings); + } + else + { + List strings = []; + IEnumerable ratings = FunGameSimulation.CharacterStatistics.OrderByDescending(kv => kv.Value.Rating).Select(kv => kv.Key); + foreach (Character character in ratings) + { + StringBuilder builder = new(); + CharacterStatistics stats = FunGameSimulation.CharacterStatistics[character]; + builder.AppendLine(character.ToString()); + builder.AppendLine($"总计参赛数:{stats.Plays}"); + builder.AppendLine($"总计冠军数:{stats.Wins}"); + builder.AppendLine($"胜率:{stats.Winrates * 100:0.##}%"); + builder.AppendLine($"前三率:{stats.Top3rates * 100:0.##}%"); + builder.AppendLine($"技术得分:{stats.Rating:0.##}"); + builder.AppendLine($"上次排名:{stats.LastRank} / 场均名次:{stats.AvgRank}"); + strings.Add(builder.ToString()); + } + return NetworkUtility.JsonSerialize(strings); + } + } + [HttpGet("cjs")] public string GetCharacterIntroduce([FromQuery] int? id = null) { diff --git a/OshimaCore/Utils/FunGameUtil.cs b/OshimaCore/Utils/FunGameUtil.cs index 671492e..cb102bf 100644 --- a/OshimaCore/Utils/FunGameUtil.cs +++ b/OshimaCore/Utils/FunGameUtil.cs @@ -482,7 +482,7 @@ namespace Oshima.Core.Utils } // 璧涘悗缁熻 - GetCharacterRating(actionQueue.CharacterStatistics, isTeam); + GetCharacterRating(actionQueue.CharacterStatistics, isTeam, actionQueue.EliminatedTeams); int top = isWeb ? actionQueue.CharacterStatistics.Count : 0; // 鍥炴墽澶氬皯涓鑹茬殑缁熻淇℃伅 int count = 1; if (isWeb) @@ -802,68 +802,59 @@ namespace Oshima.Core.Utils if (totalStats.LiveTime != 0) totalStats.DamagePerSecond = Calculation.Round2Digits(totalStats.TotalDamage / totalStats.LiveTime); } - public static void GetCharacterRating(Dictionary statistics, bool isTeam) + public static void GetCharacterRating(Dictionary statistics, bool isTeam, List teams) { - Dictionary ratings = statistics.ToDictionary(k => k.Key, v => CalculateRating(v.Value, isTeam)); - foreach (Character character in ratings.Keys) + foreach (Character character in statistics.Keys) { - statistics[character].Rating = ratings[character]; + Team? team = null; + if (isTeam) + { + team = teams.Where(t => t.IsOnThisTeam(character)).FirstOrDefault(); + } + statistics[character].Rating = CalculateRating(statistics[character], team); } } - public static double CalculateRating(CharacterStatistics stats, bool isTeam) + public static double CalculateRating(CharacterStatistics stats, Team? team = null) { - // 璁惧畾鍩哄噯鍊 - double avgKills = 4.0; - double avgAssists = 2.5; - double avgDeaths = 1.0; - double avgLiveTime = 90.0; - double avgTotalDamage = 7500.0; - double avgTotalTakenDamage = 5500.0; - double avgDamagePerSecond = 80.0; - - // 鍥㈤槦妯″紡浣跨敤鍏朵粬鍩哄噯 - if (isTeam) + // 鍩虹寰楀垎 + double baseScore = (stats.Kills + stats.Assists) / (stats.Kills + stats.Assists + stats.Deaths + 0.01); + if (team is null) { - avgKills = 2.0; - avgAssists = 3; - avgDeaths = 1.0; - avgLiveTime = 110.0; - avgTotalDamage = 6000.0; - avgTotalTakenDamage = 2000.0; - avgDamagePerSecond = 80.0; + baseScore += stats.Kills * 0.1; + if (stats.Deaths == 0) + { + baseScore += 0.5; + } + } + + // 浼ゅ璐$尞 + double logDamageContribution = Math.Log(1 + (stats.TotalDamage / (stats.TotalTakenDamage + 1e-6))); + + // 瀛樻椿鏃堕棿璐$尞 + double liveTimeContribution = Math.Log(1 + (stats.LiveTime / (stats.TotalTakenDamage + 0.01) * 100)); + + // 鍥㈤槦妯″紡鍙傚洟鐜囧姞鎴 + double teamContribution = 0; + if (team != null) + { + teamContribution = (stats.Kills + stats.Assists) / (team.Score + 0.01); + if (team.IsWinner) + { + teamContribution += 0.2; + } } - - // 褰掍竴鍖栬绠 - double normalizedKills = stats.Kills / avgKills; - double normalizedAssists = stats.Assists / avgAssists; - double normalizedDeaths = avgDeaths - stats.Deaths / avgDeaths; - double normalizedLiveTime = stats.LiveTime / avgLiveTime; - double normalizedTotalDamage = stats.TotalDamage / avgTotalDamage; - double normalizedTotalTakenDamage = stats.TotalTakenDamage / avgTotalTakenDamage; - double normalizedDamagePerSecond = stats.DamagePerSecond / avgDamagePerSecond; // 鏉冮噸璁剧疆 - double killWeight = 0.4; - double assistWeight = 0.15; - double deathWeight = -0.25; - double liveTimeWeight = 0.2; - double totalDamageWeight = 0.25; - double totalTakenDamageWeight = 0.15; - double damagePerSecondWeight = 0.05; + double k = stats.Deaths > 0 ? 0.2 : 0.075; // 浼ゅ璐$尞鏉冮噸 + double l = stats.Deaths > 0 ? 0.3 : 0.05; // 瀛樻椿鏃堕棿鏉冮噸 + double t = stats.Deaths > 0 ? 0.225 : 0.1; // 鍙傚洟鐜囨潈閲 - // 璁$畻褰掍竴鍖栧悗鐨凴ating - double rating = - killWeight * normalizedKills + - assistWeight * normalizedAssists + - deathWeight * normalizedDeaths + - liveTimeWeight * normalizedLiveTime + - totalDamageWeight * normalizedTotalDamage + - totalTakenDamageWeight * normalizedTotalTakenDamage + - damagePerSecondWeight * normalizedDamagePerSecond; + // 璁$畻鏈缁堣瘎鍒 + double rating = baseScore + k * logDamageContribution + l * liveTimeContribution + t * teamContribution; - // 闄愬埗Rating鍦 0 鍜 5 涔嬮棿 - return Math.Clamp(rating, 0, 5); + // 纭繚璇勫垎鍦ㄥ悎鐞嗚寖鍥村唴 + return Math.Max(0.01, rating); } } } diff --git a/OshimaModules/Skills/ColdBlue/鍡滆鏈兘.cs b/OshimaModules/Skills/ColdBlue/鍡滆鏈兘.cs index cfd0520..54d9213 100644 --- a/OshimaModules/Skills/ColdBlue/鍡滆鏈兘.cs +++ b/OshimaModules/Skills/ColdBlue/鍡滆鏈兘.cs @@ -50,7 +50,7 @@ namespace Oshima.FunGame.OshimaModules.Skills } } - public override void OnSkillCasted(Character caster, List enemys, List teammates, Dictionary others) + public override void OnSkillCasted(Character caster, List targets, Dictionary others) { RemainDuration = Duration; if (!caster.Effects.Contains(this)) diff --git a/OshimaModules/Skills/MagicalGirl/缁濆棰嗗煙.cs b/OshimaModules/Skills/MagicalGirl/缁濆棰嗗煙.cs index 71d6f0e..d38a955 100644 --- a/OshimaModules/Skills/MagicalGirl/缁濆棰嗗煙.cs +++ b/OshimaModules/Skills/MagicalGirl/缁濆棰嗗煙.cs @@ -59,7 +59,7 @@ namespace Oshima.FunGame.OshimaModules.Skills 閲婃斁鏃剁殑鑳介噺鍊 = caster.EP; } - public override void OnSkillCasted(Character caster, List enemys, List teammates, Dictionary others) + public override void OnSkillCasted(Character caster, List targets, Dictionary others) { RemainDuration = Duration; if (!caster.Effects.Contains(this)) diff --git a/OshimaModules/Skills/Mayor/绮惧噯鎵撳嚮.cs b/OshimaModules/Skills/Mayor/绮惧噯鎵撳嚮.cs index b8cf308..311db24 100644 --- a/OshimaModules/Skills/Mayor/绮惧噯鎵撳嚮.cs +++ b/OshimaModules/Skills/Mayor/绮惧噯鎵撳嚮.cs @@ -52,7 +52,7 @@ namespace Oshima.FunGame.OshimaModules.Skills character.PhysicalPenetration -= 瀹為檯鐗╃悊绌块忔彁鍗; } - public override void OnSkillCasted(Character caster, List enemys, List teammates, Dictionary others) + public override void OnSkillCasted(Character caster, List targets, Dictionary others) { RemainDuration = Duration; if (!caster.Effects.Contains(this)) diff --git a/OshimaModules/Skills/NanGanyu/涓夐噸鍙犲姞.cs b/OshimaModules/Skills/NanGanyu/涓夐噸鍙犲姞.cs index 882456e..6886355 100644 --- a/OshimaModules/Skills/NanGanyu/涓夐噸鍙犲姞.cs +++ b/OshimaModules/Skills/NanGanyu/涓夐噸鍙犲姞.cs @@ -51,7 +51,7 @@ namespace Oshima.FunGame.OshimaModules.Skills } } - public override void OnSkillCasted(Character caster, List enemys, List teammates, Dictionary others) + public override void OnSkillCasted(Character caster, List targets, Dictionary others) { 鍓╀綑鎸佺画娆℃暟 = 鎶鑳芥寔缁鏁; if (!caster.Effects.Contains(this)) diff --git a/OshimaModules/Skills/NiuNan/鍙樺够涔嬪績.cs b/OshimaModules/Skills/NiuNan/鍙樺够涔嬪績.cs index eaed6c6..a783880 100644 --- a/OshimaModules/Skills/NiuNan/鍙樺够涔嬪績.cs +++ b/OshimaModules/Skills/NiuNan/鍙樺够涔嬪績.cs @@ -51,7 +51,7 @@ namespace Oshima.FunGame.OshimaModules.Skills } } - public override void OnSkillCasted(Character caster, List enemys, List teammates, Dictionary others) + public override void OnSkillCasted(Character caster, List targets, Dictionary others) { IEnumerable effects = caster.Effects.Where(e => e is 鏅烘収涓庡姏閲忕壒鏁); if (effects.Any()) diff --git a/OshimaModules/Skills/Oshima/鍔涢噺鐖嗗彂.cs b/OshimaModules/Skills/Oshima/鍔涢噺鐖嗗彂.cs index 1dc50b8..22f7234 100644 --- a/OshimaModules/Skills/Oshima/鍔涢噺鐖嗗彂.cs +++ b/OshimaModules/Skills/Oshima/鍔涢噺鐖嗗彂.cs @@ -54,7 +54,7 @@ namespace Oshima.FunGame.OshimaModules.Skills } } - public override void OnSkillCasted(Character caster, List enemys, List teammates, Dictionary others) + public override void OnSkillCasted(Character caster, List targets, Dictionary others) { RemainDuration = Duration; if (!caster.Effects.Contains(this)) diff --git a/OshimaModules/Skills/QWQAQW/杩呮嵎涔嬪娍.cs b/OshimaModules/Skills/QWQAQW/杩呮嵎涔嬪娍.cs index 62d3748..9d5f045 100644 --- a/OshimaModules/Skills/QWQAQW/杩呮嵎涔嬪娍.cs +++ b/OshimaModules/Skills/QWQAQW/杩呮嵎涔嬪娍.cs @@ -66,7 +66,7 @@ namespace Oshima.FunGame.OshimaModules.Skills baseHardnessTime *= 0.3; } - public override void OnSkillCasted(Character caster, List enemys, List teammates, Dictionary others) + public override void OnSkillCasted(Character caster, List targets, Dictionary others) { RemainDuration = Duration; if (!caster.Effects.Contains(this)) diff --git a/OshimaModules/Skills/QingXiang/鑳介噺姣佺伃.cs b/OshimaModules/Skills/QingXiang/鑳介噺姣佺伃.cs index 19df25d..5dfd8d6 100644 --- a/OshimaModules/Skills/QingXiang/鑳介噺姣佺伃.cs +++ b/OshimaModules/Skills/QingXiang/鑳介噺姣佺伃.cs @@ -32,9 +32,9 @@ namespace Oshima.FunGame.OshimaModules.Skills private double 鏅哄姏浼ゅ => 鏅哄姏绯绘暟 * Skill.Character?.INT ?? 0; private double 鑳介噺绯绘暟 => 1.05 * Level; - public override void OnSkillCasted(Character caster, List enemys, List teammates, Dictionary others) + public override void OnSkillCasted(Character caster, List targets, Dictionary others) { - foreach (Character c in enemys) + foreach (Character c in targets) { WriteLine($"[ {caster} ] 姝e湪姣佺伃 [ {c} ] 鐨勮兘閲忥紒锛"); double ep = c.EP; diff --git a/OshimaModules/Skills/QuDuoduo/琛涔嬬媯娆.cs b/OshimaModules/Skills/QuDuoduo/琛涔嬬媯娆.cs index a9eca39..90cb78f 100644 --- a/OshimaModules/Skills/QuDuoduo/琛涔嬬媯娆.cs +++ b/OshimaModules/Skills/QuDuoduo/琛涔嬬媯娆.cs @@ -37,7 +37,7 @@ namespace Oshima.FunGame.OshimaModules.Skills } } - public override void OnSkillCasted(Character caster, List enemys, List teammates, Dictionary others) + public override void OnSkillCasted(Character caster, List targets, Dictionary others) { RemainDuration = Duration; if (!caster.Effects.Contains(this)) diff --git a/OshimaModules/Skills/XinYin/澶╄祼涔嬪姏.cs b/OshimaModules/Skills/XinYin/澶╄祼涔嬪姏.cs index f753c87..bcca61a 100644 --- a/OshimaModules/Skills/XinYin/澶╄祼涔嬪姏.cs +++ b/OshimaModules/Skills/XinYin/澶╄祼涔嬪姏.cs @@ -76,7 +76,7 @@ namespace Oshima.FunGame.OshimaModules.Skills baseHardnessTime *= 0.8; } - public override void OnSkillCasted(Character caster, List enemys, List teammates, Dictionary others) + public override void OnSkillCasted(Character caster, List targets, Dictionary others) { RemainDuration = Duration; if (!caster.Effects.Contains(this)) diff --git a/OshimaModules/Skills/Yang/榄旀硶娑屾祦.cs b/OshimaModules/Skills/Yang/榄旀硶娑屾祦.cs index ccdcb63..c6c077d 100644 --- a/OshimaModules/Skills/Yang/榄旀硶娑屾祦.cs +++ b/OshimaModules/Skills/Yang/榄旀硶娑屾祦.cs @@ -50,7 +50,7 @@ namespace Oshima.FunGame.OshimaModules.Skills return false; } - public override void OnSkillCasted(Character caster, List enemys, List teammates, Dictionary others) + public override void OnSkillCasted(Character caster, List targets, Dictionary others) { RemainDuration = Duration; if (!caster.Effects.Contains(this)) diff --git a/OshimaModules/Skills/dddovo/骞宠 寮哄寲.cs b/OshimaModules/Skills/dddovo/骞宠 寮哄寲.cs index 286871a..3f65bf2 100644 --- a/OshimaModules/Skills/dddovo/骞宠 寮哄寲.cs +++ b/OshimaModules/Skills/dddovo/骞宠 寮哄寲.cs @@ -55,7 +55,7 @@ namespace Oshima.FunGame.OshimaModules.Skills character.Recovery(pastHP, pastMP, pastMaxHP, pastMaxMP); } - public override void OnSkillCasted(Character caster, List enemys, List teammates, Dictionary others) + public override void OnSkillCasted(Character caster, List targets, Dictionary others) { RemainDuration = Duration; if (!caster.Effects.Contains(this)) diff --git a/OshimaModules/Skills/鎴樻妧/鐤鹃姝.cs b/OshimaModules/Skills/鎴樻妧/鐤鹃姝.cs index 361091a..f783208 100644 --- a/OshimaModules/Skills/鎴樻妧/鐤鹃姝.cs +++ b/OshimaModules/Skills/鎴樻妧/鐤鹃姝.cs @@ -69,7 +69,7 @@ namespace Oshima.FunGame.OshimaModules.Skills return false; } - public override void OnSkillCasted(Character caster, List enemys, List teammates, Dictionary others) + public override void OnSkillCasted(Character caster, List targets, Dictionary others) { if (!caster.Effects.Contains(this)) { diff --git a/OshimaModules/Skills/榄旀硶/鍐伴湝鏀诲嚮.cs b/OshimaModules/Skills/榄旀硶/鍐伴湝鏀诲嚮.cs index ea1317b..1714de6 100644 --- a/OshimaModules/Skills/榄旀硶/鍐伴湝鏀诲嚮.cs +++ b/OshimaModules/Skills/榄旀硶/鍐伴湝鏀诲嚮.cs @@ -9,8 +9,8 @@ namespace Oshima.FunGame.OshimaModules.Skills public override string Name => "鍐伴湝鏀诲嚮"; public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; public override double MPCost => 30 + (50 * (Level - 1)); - public override double CD => 20; - public override double CastTime => 6; + public override double CD => 25; + public override double CastTime => 8; public override double HardnessTime { get; set; } = 3; public 鍐伴湝鏀诲嚮(Character? character = null) : base(SkillType.Magic, character) @@ -23,28 +23,19 @@ namespace Oshima.FunGame.OshimaModules.Skills { public override long Id => Skill.Id; public override string Name => Skill.Name; - public override string Description => $"瀵圭洰鏍囨晫浜洪犳垚 {90 + 60 * (Skill.Level - 1):0.##} + {(1.2 + 1.8 * (Skill.Level - 1)) * 100:0.##}% 鏅哄姏 [ {Damage:0.##} ] 鐐箋CharacterSet.GetMagicDamageName(MagicType)}銆"; + public override string Description => $"瀵圭洰鏍囨晫浜洪犳垚 {鍩虹浼ゅ:0.##} + {绯绘暟 * 100:0.##}% 鏅哄姏 [ {Damage:0.##} ] 鐐箋CharacterSet.GetMagicDamageName(MagicType)}銆"; public override bool TargetSelf => false; public override int TargetCount => 1; - private double Damage - { - get - { - double d = 0; - if (Skill.Character != null) - { - d = 90 + 60 * (Skill.Level - 1) + (1.2 + 1.8 * (Skill.Level - 1)) * Skill.Character.INT; - } - return d; - } - } + private double 鍩虹浼ゅ => 90 + 60 * (Skill.Level - 1); + private double 绯绘暟 => 0.35 + 0.4 * (Skill.Level - 1); + private double Damage => 鍩虹浼ゅ + 绯绘暟 * Skill.Character?.INT ?? 0; - public override void OnSkillCasted(Character caster, List enemys, List teammates, Dictionary others) + public override void OnSkillCasted(Character caster, List targets, Dictionary others) { - if (enemys.Count > 0) + if (targets.Count > 0) { - Character enemy = enemys[new Random().Next(enemys.Count)]; + Character enemy = targets[0]; DamageToEnemy(caster, enemy, true, MagicType, Damage); } } diff --git a/OshimaModules/Skills/榄旀硶/蹇冪伒涔嬮湠.cs b/OshimaModules/Skills/榄旀硶/蹇冪伒涔嬮湠.cs new file mode 100644 index 0000000..a5a3594 --- /dev/null +++ b/OshimaModules/Skills/榄旀硶/蹇冪伒涔嬮湠.cs @@ -0,0 +1,43 @@ +锘縰sing Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Oshima.FunGame.OshimaModules.Skills +{ + public class 蹇冪伒涔嬮湠 : Skill + { + public override long Id => (long)MagicID.蹇冪伒涔嬮湠; + public override string Name => "蹇冪伒涔嬮湠"; + public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; + public override double MPCost => 30 + (50 * (Level - 1)); + public override double CD => 25; + public override double CastTime => 6; + public override double HardnessTime { get; set; } = 3; + + public 蹇冪伒涔嬮湠(Character? character = null) : base(SkillType.Magic, character) + { + Effects.Add(new 蹇冪伒涔嬮湠鐗规晥(this)); + } + } + + public class 蹇冪伒涔嬮湠鐗规晥(Skill skill) : Effect(skill) + { + public override long Id => Skill.Id; + public override string Name => Skill.Name; + public override string Description => $"瀵圭洰鏍囨晫浜洪犳垚 {鍩虹浼ゅ:0.##} + {鏅哄姏绯绘暟 * 100:0.##}% 鏅哄姏 [ {Damage:0.##} ] 鐐箋CharacterSet.GetMagicDamageName(MagicType)}銆"; + public override bool TargetSelf => false; + public override int TargetCount => 1; + + private double 鍩虹浼ゅ => 90 + 60 * (Skill.Level - 1); + private double 鏅哄姏绯绘暟 => (0.5 + 0.6 * (Skill.Level - 1)); + private double Damage => 鍩虹浼ゅ + 鏅哄姏绯绘暟 * Skill.Character?.INT ?? 0; + + public override void OnSkillCasted(Character caster, List targets, Dictionary others) + { + if (targets.Count > 0) + { + Character enemy = targets[0]; + DamageToEnemy(caster, enemy, true, MagicType, Damage); + } + } + } +} diff --git a/OshimaModules/Skills/榄旀硶/鏆楃墿璐.cs b/OshimaModules/Skills/榄旀硶/鏆楃墿璐.cs new file mode 100644 index 0000000..011bba2 --- /dev/null +++ b/OshimaModules/Skills/榄旀硶/鏆楃墿璐.cs @@ -0,0 +1,43 @@ +锘縰sing Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Oshima.FunGame.OshimaModules.Skills +{ + public class 鏆楃墿璐 : Skill + { + public override long Id => (long)MagicID.鏆楃墿璐; + public override string Name => "鏆楃墿璐"; + public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; + public override double MPCost => 30 + (50 * (Level - 1)); + public override double CD => 25; + public override double CastTime => 6; + public override double HardnessTime { get; set; } = 3; + + public 鏆楃墿璐(Character? character = null) : base(SkillType.Magic, character) + { + Effects.Add(new 鏆楃墿璐ㄧ壒鏁(this)); + } + } + + public class 鏆楃墿璐ㄧ壒鏁(Skill skill) : Effect(skill) + { + public override long Id => Skill.Id; + public override string Name => Skill.Name; + public override string Description => $"瀵圭洰鏍囨晫浜洪犳垚 {鍩虹浼ゅ:0.##} + {鏅哄姏绯绘暟 * 100:0.##}% 鏅哄姏 [ {Damage:0.##} ] 鐐箋CharacterSet.GetMagicDamageName(MagicType)}銆"; + public override bool TargetSelf => false; + public override int TargetCount => 1; + + private double 鍩虹浼ゅ => 90 + 60 * (Skill.Level - 1); + private double 鏅哄姏绯绘暟 => (0.5 + 0.6 * (Skill.Level - 1)); + private double Damage => 鍩虹浼ゅ + 鏅哄姏绯绘暟 * Skill.Character?.INT ?? 0; + + public override void OnSkillCasted(Character caster, List targets, Dictionary others) + { + if (targets.Count > 0) + { + Character enemy = targets[0]; + DamageToEnemy(caster, enemy, true, MagicType, Damage); + } + } + } +} diff --git a/OshimaModules/Skills/榄旀硶/娆″厓涓婂崌.cs b/OshimaModules/Skills/榄旀硶/娆″厓涓婂崌.cs new file mode 100644 index 0000000..ae7ea78 --- /dev/null +++ b/OshimaModules/Skills/榄旀硶/娆″厓涓婂崌.cs @@ -0,0 +1,43 @@ +锘縰sing Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Oshima.FunGame.OshimaModules.Skills +{ + public class 娆″厓涓婂崌 : Skill + { + public override long Id => (long)MagicID.娆″厓涓婂崌; + public override string Name => "娆″厓涓婂崌"; + public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; + public override double MPCost => 30 + (50 * (Level - 1)); + public override double CD => 25; + public override double CastTime => 6; + public override double HardnessTime { get; set; } = 3; + + public 娆″厓涓婂崌(Character? character = null) : base(SkillType.Magic, character) + { + Effects.Add(new 娆″厓涓婂崌鐗规晥(this)); + } + } + + public class 娆″厓涓婂崌鐗规晥(Skill skill) : Effect(skill) + { + public override long Id => Skill.Id; + public override string Name => Skill.Name; + public override string Description => $"瀵圭洰鏍囨晫浜洪犳垚 {鍩虹浼ゅ:0.##} + {鏅哄姏绯绘暟 * 100:0.##}% 鏅哄姏 [ {Damage:0.##} ] 鐐箋CharacterSet.GetMagicDamageName(MagicType)}銆"; + public override bool TargetSelf => false; + public override int TargetCount => 1; + + private double 鍩虹浼ゅ => 90 + 60 * (Skill.Level - 1); + private double 鏅哄姏绯绘暟 => (0.5 + 0.6 * (Skill.Level - 1)); + private double Damage => 鍩虹浼ゅ + 鏅哄姏绯绘暟 * Skill.Character?.INT ?? 0; + + public override void OnSkillCasted(Character caster, List targets, Dictionary others) + { + if (targets.Count > 0) + { + Character enemy = targets[0]; + DamageToEnemy(caster, enemy, true, MagicType, Damage); + } + } + } +} diff --git a/OshimaModules/Skills/榄旀硶/姘翠箣鐭.cs b/OshimaModules/Skills/榄旀硶/姘翠箣鐭.cs new file mode 100644 index 0000000..f07cebd --- /dev/null +++ b/OshimaModules/Skills/榄旀硶/姘翠箣鐭.cs @@ -0,0 +1,43 @@ +锘縰sing Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Oshima.FunGame.OshimaModules.Skills +{ + public class 姘翠箣鐭 : Skill + { + public override long Id => (long)MagicID.姘翠箣鐭; + public override string Name => "姘翠箣鐭"; + public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; + public override double MPCost => 30 + (40 * (Level - 1)); + public override double CD => 20; + public override double CastTime => 6; + public override double HardnessTime { get; set; } = 3; + + public 姘翠箣鐭(Character? character = null) : base(SkillType.Magic, character) + { + Effects.Add(new 姘翠箣鐭㈢壒鏁(this)); + } + } + + public class 姘翠箣鐭㈢壒鏁(Skill skill) : Effect(skill) + { + public override long Id => Skill.Id; + public override string Name => Skill.Name; + public override string Description => $"瀵圭洰鏍囨晫浜洪犳垚 {鍩虹浼ゅ:0.##} + {绯绘暟 * 100:0.##}% {CharacterSet.GetPrimaryAttributeName(Skill.Character?.PrimaryAttribute ?? PrimaryAttribute.INT)} [ {Damage:0.##} ] 鐐箋CharacterSet.GetMagicDamageName(MagicType)}銆"; + public override bool TargetSelf => false; + public override int TargetCount => 1; + + private double 鍩虹浼ゅ => 85 + 65 * (Skill.Level - 1); + private double 绯绘暟 => 0.35 + 0.45 * (Skill.Level - 1); + private double Damage => 鍩虹浼ゅ + 绯绘暟 * Skill.Character?.PrimaryAttributeValue ?? 0; + + public override void OnSkillCasted(Character caster, List targets, Dictionary others) + { + if (targets.Count > 0) + { + Character enemy = targets[0]; + DamageToEnemy(caster, enemy, true, MagicType, Damage); + } + } + } +} diff --git a/OshimaModules/Skills/榄旀硶/鐏箣鐭.cs b/OshimaModules/Skills/榄旀硶/鐏箣鐭.cs new file mode 100644 index 0000000..f80c3cf --- /dev/null +++ b/OshimaModules/Skills/榄旀硶/鐏箣鐭.cs @@ -0,0 +1,43 @@ +锘縰sing Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Oshima.FunGame.OshimaModules.Skills +{ + public class 鐏箣鐭 : Skill + { + public override long Id => (long)MagicID.鐏箣鐭; + public override string Name => "鐏箣鐭"; + public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; + public override double MPCost => 30 + (40 * (Level - 1)); + public override double CD => 20; + public override double CastTime => 6; + public override double HardnessTime { get; set; } = 3; + + public 鐏箣鐭(Character? character = null) : base(SkillType.Magic, character) + { + Effects.Add(new 鐏箣鐭㈢壒鏁(this)); + } + } + + public class 鐏箣鐭㈢壒鏁(Skill skill) : Effect(skill) + { + public override long Id => Skill.Id; + public override string Name => Skill.Name; + public override string Description => $"瀵圭洰鏍囨晫浜洪犳垚 {鍩虹浼ゅ:0.##} + {绯绘暟 * 100:0.##}% {CharacterSet.GetPrimaryAttributeName(Skill.Character?.PrimaryAttribute ?? PrimaryAttribute.INT)} [ {Damage:0.##} ] 鐐箋CharacterSet.GetMagicDamageName(MagicType)}銆"; + public override bool TargetSelf => false; + public override int TargetCount => 1; + + private double 鍩虹浼ゅ => 80 + 65 * (Skill.Level - 1); + private double 绯绘暟 => 0.45 + 0.35 * (Skill.Level - 1); + private double Damage => 鍩虹浼ゅ + 绯绘暟 * Skill.Character?.PrimaryAttributeValue ?? 0; + + public override void OnSkillCasted(Character caster, List targets, Dictionary others) + { + if (targets.Count > 0) + { + Character enemy = targets[0]; + DamageToEnemy(caster, enemy, true, MagicType, Damage); + } + } + } +} diff --git a/OshimaModules/Skills/榄旀硶/鐭充箣閿.cs b/OshimaModules/Skills/榄旀硶/鐭充箣閿.cs new file mode 100644 index 0000000..220a9b3 --- /dev/null +++ b/OshimaModules/Skills/榄旀硶/鐭充箣閿.cs @@ -0,0 +1,43 @@ +锘縰sing Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Oshima.FunGame.OshimaModules.Skills +{ + public class 鐭充箣閿 : Skill + { + public override long Id => (long)MagicID.鐭充箣閿; + public override string Name => "鐭充箣閿"; + public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; + public override double MPCost => 30 + (30 * (Level - 1)); + public override double CD => 22; + public override double CastTime => 6; + public override double HardnessTime { get; set; } = 4; + + public 鐭充箣閿(Character? character = null) : base(SkillType.Magic, character) + { + Effects.Add(new 鐭充箣閿ょ壒鏁(this)); + } + } + + public class 鐭充箣閿ょ壒鏁(Skill skill) : Effect(skill) + { + public override long Id => Skill.Id; + public override string Name => Skill.Name; + public override string Description => $"瀵圭洰鏍囨晫浜洪犳垚 {鍩虹浼ゅ:0.##} + {绯绘暟 * 100:0.##}% 鍔涢噺 [ {Damage:0.##} ] 鐐箋CharacterSet.GetMagicDamageName(MagicType)}銆"; + public override bool TargetSelf => false; + public override int TargetCount => 1; + + private double 鍩虹浼ゅ => 100 + 50 * (Skill.Level - 1); + private double 绯绘暟 => 0.7 + 0.4 * (Skill.Level - 1); + private double Damage => 鍩虹浼ゅ + 绯绘暟 * Skill.Character?.STR ?? 0; + + public override void OnSkillCasted(Character caster, List targets, Dictionary others) + { + if (targets.Count > 0) + { + Character enemy = targets[0]; + DamageToEnemy(caster, enemy, true, MagicType, Damage); + } + } + } +} diff --git a/OshimaModules/Skills/榄旀硶/椋庝箣杞.cs b/OshimaModules/Skills/榄旀硶/椋庝箣杞.cs new file mode 100644 index 0000000..1396e66 --- /dev/null +++ b/OshimaModules/Skills/榄旀硶/椋庝箣杞.cs @@ -0,0 +1,43 @@ +锘縰sing Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Oshima.FunGame.OshimaModules.Skills +{ + public class 椋庝箣杞 : Skill + { + public override long Id => (long)MagicID.椋庝箣杞; + public override string Name => "椋庝箣杞"; + public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; + public override double MPCost => 50 + (60 * (Level - 1)); + public override double CD => 30; + public override double CastTime => 10; + public override double HardnessTime { get; set; } = 4; + + public 椋庝箣杞(Character? character = null) : base(SkillType.Magic, character) + { + Effects.Add(new 椋庝箣杞壒鏁(this)); + } + } + + public class 椋庝箣杞壒鏁(Skill skill) : Effect(skill) + { + public override long Id => Skill.Id; + public override string Name => Skill.Name; + public override string Description => $"瀵圭洰鏍囨晫浜洪犳垚 {鍩虹浼ゅ:0.##} + {绯绘暟 * 100:0.##}% 鏁忔嵎 [ {Damage:0.##} ] 鐐箋CharacterSet.GetMagicDamageName(MagicType)}銆"; + public override bool TargetSelf => false; + public override int TargetCount => 1; + + private double 鍩虹浼ゅ => 120 + 80 * (Skill.Level - 1); + private double 绯绘暟 => 0.4 + 0.4 * (Skill.Level - 1); + private double Damage => 鍩虹浼ゅ + 绯绘暟 * Skill.Character?.AGI ?? 0; + + public override void OnSkillCasted(Character caster, List targets, Dictionary others) + { + if (targets.Count > 0) + { + Character enemy = targets[0]; + DamageToEnemy(caster, enemy, true, MagicType, Damage); + } + } + } +}