diff --git a/OshimaCore/Controllers/FunGameController.cs b/OshimaCore/Controllers/FunGameController.cs index 6b9c67d..ef1e092 100644 --- a/OshimaCore/Controllers/FunGameController.cs +++ b/OshimaCore/Controllers/FunGameController.cs @@ -17,11 +17,12 @@ namespace Oshima.Core.Controllers private readonly ILogger _logger = logger; [HttpGet("test")] - public List GetTest([FromQuery] bool? isweb = null, [FromQuery] bool? isteam = null) + public List GetTest([FromQuery] bool? isweb = null, [FromQuery] bool? isteam = null, [FromQuery] bool? showall = null) { bool web = isweb ?? true; bool team = isteam ?? false; - return FunGameSimulation.StartGame(false, web, team); + bool all = showall ?? false; + return FunGameSimulation.StartGame(false, web, team, all); } [HttpGet("stats")] @@ -103,12 +104,12 @@ namespace Oshima.Core.Controllers builder.AppendLine($"每秒伤害:{stats.DamagePerSecond:0.##}"); builder.AppendLine($"总计击杀数:{stats.Kills}" + (stats.Plays != 0 ? $" / 场均:{(double)stats.Kills / stats.Plays:0.##}" : "")); builder.AppendLine($"总计死亡数:{stats.Deaths}" + (stats.Plays != 0 ? $" / 场均:{(double)stats.Deaths / stats.Plays:0.##}" : "")); + builder.AppendLine($"击杀死亡比:{(stats.Deaths == 0 ? stats.Kills : (stats.Kills / stats.Deaths)):0.##}"); builder.AppendLine($"总计助攻数:{stats.Assists}" + (stats.Plays != 0 ? $" / 场均:{(double)stats.Assists / stats.Plays:0.##}" : "")); builder.AppendLine($"总计首杀数:{stats.FirstKills}" + (stats.Plays != 0 ? $" / 首杀率:{(double)stats.FirstKills / stats.Plays * 100:0.##}%" : "")); builder.AppendLine($"总计首死数:{stats.FirstDeaths}" + (stats.Plays != 0 ? $" / 首死率:{(double)stats.FirstDeaths / stats.Plays * 100:0.##}%" : "")); builder.AppendLine($"总计参赛数:{stats.Plays}"); builder.AppendLine($"总计冠军数:{stats.Wins}"); - builder.AppendLine($"总计前三数:{stats.Top3s}"); builder.AppendLine($"总计败场数:{stats.Loses}"); List names = [.. FunGameSimulation.TeamCharacterStatistics.OrderByDescending(kv => kv.Value.Winrates).Select(kv => kv.Key.GetName())]; diff --git a/OshimaCore/Utils/FunGameUtil.cs b/OshimaCore/Utils/FunGameUtil.cs index f84b764..b0f8af6 100644 --- a/OshimaCore/Utils/FunGameUtil.cs +++ b/OshimaCore/Utils/FunGameUtil.cs @@ -22,12 +22,14 @@ namespace Oshima.Core.Utils public static bool IsRuning { get; set; } = false; public static bool IsWeb { get; set; } = false; public static bool PrintOut { get; set; } = false; + public static bool DeathMatchRoundDetail { get; set; } = false; public static string Msg { get; set; } = ""; - public static List StartGame(bool printout, bool isWeb = false, bool isTeam = false) + public static List StartGame(bool printout, bool isWeb = false, bool isTeam = false, bool deathMatchRoundDetail = false) { PrintOut = printout; IsWeb = isWeb; + DeathMatchRoundDetail = deathMatchRoundDetail; try { if (IsRuning) return ["娓告垙姝e湪妯℃嫙涓紝璇峰嬁閲嶅璇锋眰锛"]; @@ -407,7 +409,7 @@ namespace Oshima.Core.Utils if (characterToAct != null) { WriteLine($"=== Round {i++} ==="); - WriteLine("鐜板湪鏄 [ " + characterToAct + " ] 鐨勫洖鍚堬紒"); + WriteLine("鐜板湪鏄 [ " + characterToAct + (isTeam ? "锛" + (actionQueue.GetTeam(characterToAct)?.Name ?? "") + "锛" : "") + " ] 鐨勫洖鍚堬紒"); bool isGameEnd = actionQueue.ProcessTurn(characterToAct); if (isGameEnd) @@ -450,11 +452,15 @@ namespace Oshima.Core.Utils } } - if (actionQueue.LastRound.Targets.Any(c => c.HP <= 0)) + if (actionQueue.LastRound.HasKill) { + string roundMsg = Msg; + if (!deathMatchRoundDetail) + { + roundMsg = actionQueue.LastRound.ToString(); + } if (!isWeb) { - string roundMsg = Msg; string[] strs = roundMsg.Split("==== 瑙掕壊鐘舵 ===="); if (strs.Length > 0) { @@ -462,7 +468,10 @@ namespace Oshima.Core.Utils } result.Add(roundMsg); } - else result.Add(Msg); + else + { + result.Add(roundMsg); + } } } @@ -824,7 +833,11 @@ namespace Oshima.Core.Utils baseScore += 0.5; } } - + else + { + baseScore = baseScore * 0.6 + 0.4 * (stats.Kills / (stats.Kills + stats.Deaths + 0.01)); + } + // 浼ゅ璐$尞 double logDamageContribution = Math.Log(1 + (stats.TotalDamage / (stats.TotalTakenDamage + 1e-6))); @@ -838,14 +851,14 @@ namespace Oshima.Core.Utils teamContribution = (stats.Kills + stats.Assists) / (team.Score + 0.01); if (team.IsWinner) { - teamContribution += 0.2; + teamContribution += 0.15; } } // 鏉冮噸璁剧疆 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; // 鍙傚洟鐜囨潈閲 + double l = stats.Deaths > 0 ? 0.2 : 0.05; // 瀛樻椿鏃堕棿鏉冮噸 + double t = stats.Deaths > 0 ? 0.2 : 0.075; // 鍙傚洟鐜囨潈閲 // 璁$畻鏈缁堣瘎鍒 double rating = baseScore + k * logDamageContribution + l * liveTimeContribution + t * teamContribution; diff --git a/OshimaModules/Skills/ColdBlue/绱Н涔嬪帇.cs b/OshimaModules/Skills/ColdBlue/绱Н涔嬪帇.cs index defc2f6..923ced8 100644 --- a/OshimaModules/Skills/ColdBlue/绱Н涔嬪帇.cs +++ b/OshimaModules/Skills/ColdBlue/绱Н涔嬪帇.cs @@ -33,7 +33,7 @@ namespace Oshima.FunGame.OshimaModules.Skills public override void AfterDamageCalculation(Character character, Character enemy, double damage, bool isNormalAttack, bool isMagicDamage, MagicType magicType, DamageResult damageResult) { - if (character == Skill.Character && damageResult != DamageResult.Evaded && !鏄惁鏄祵濂椾激瀹) + if (character == Skill.Character && damageResult != DamageResult.Evaded && !鏄惁鏄祵濂椾激瀹 && enemy.HP > 0) { // 鍙犳爣璁 IEnumerable effects = enemy.Effects.Where(e => e is 绱Н涔嬪帇鏍囪); diff --git a/OshimaModules/Skills/MagicalGirl/缁濆棰嗗煙.cs b/OshimaModules/Skills/MagicalGirl/缁濆棰嗗煙.cs index d38a955..645bc5b 100644 --- a/OshimaModules/Skills/MagicalGirl/缁濆棰嗗煙.cs +++ b/OshimaModules/Skills/MagicalGirl/缁濆棰嗗煙.cs @@ -54,7 +54,7 @@ namespace Oshima.FunGame.OshimaModules.Skills return false; } - public override void OnSkillCasting(Character caster) + public override void OnSkillCasting(Character caster, List targets) { 閲婃斁鏃剁殑鑳介噺鍊 = caster.EP; } diff --git a/OshimaModules/Skills/QingXiang/鏋鎵撳嚮.cs b/OshimaModules/Skills/QingXiang/鏋鎵撳嚮.cs index 3884354..99b32b3 100644 --- a/OshimaModules/Skills/QingXiang/鏋鎵撳嚮.cs +++ b/OshimaModules/Skills/QingXiang/鏋鎵撳嚮.cs @@ -31,7 +31,7 @@ namespace Oshima.FunGame.OshimaModules.Skills public override void AfterDamageCalculation(Character character, Character enemy, double damage, bool isNormalAttack, bool isMagicDamage, MagicType magicType, DamageResult damageResult) { - if (character == Skill.Character && damageResult != DamageResult.Evaded && !鏄惁鏄祵濂椾激瀹) + if (character == Skill.Character && damageResult != DamageResult.Evaded && !鏄惁鏄祵濂椾激瀹 && enemy.HP > 0) { // 鍑忓皯鑳介噺 double EP = Random.Shared.Next(7, 15); diff --git a/OshimaModules/Skills/XinYin/蹇冪伒涔嬬伀.cs b/OshimaModules/Skills/XinYin/蹇冪伒涔嬬伀.cs index 09a6976..52a65de 100644 --- a/OshimaModules/Skills/XinYin/蹇冪伒涔嬬伀.cs +++ b/OshimaModules/Skills/XinYin/蹇冪伒涔嬬伀.cs @@ -34,7 +34,7 @@ namespace Oshima.FunGame.OshimaModules.Skills public override void AfterDamageCalculation(Character character, Character enemy, double damage, bool isNormalAttack, bool isMagicDamage, MagicType magicType, DamageResult damageResult) { - if (character == Skill.Character && isNormalAttack && 鍐峰嵈鏃堕棿 == 0 && !鏄惁鏄祵濂楁櫘閫氭敾鍑 && GamingQueue != null) + if (character == Skill.Character && isNormalAttack && 鍐峰嵈鏃堕棿 == 0 && !鏄惁鏄祵濂楁櫘閫氭敾鍑 && GamingQueue != null && enemy.HP > 0) { WriteLine($"[ {character} ] 鍙戝姩浜嗗績鐏典箣鐏紒棰濆杩涜涓娆℃櫘閫氭敾鍑伙紒"); 鍐峰嵈鏃堕棿 = 鍩虹鍐峰嵈鏃堕棿; diff --git a/OshimaModules/Skills/dddovo/鏁忔嵎涔嬪垉.cs b/OshimaModules/Skills/dddovo/鏁忔嵎涔嬪垉.cs index 3379b7a..780df7e 100644 --- a/OshimaModules/Skills/dddovo/鏁忔嵎涔嬪垉.cs +++ b/OshimaModules/Skills/dddovo/鏁忔嵎涔嬪垉.cs @@ -33,7 +33,7 @@ namespace Oshima.FunGame.OshimaModules.Skills public override void AfterDamageCalculation(Character character, Character enemy, double damage, bool isNormalAttack, bool isMagicDamage, MagicType magicType, DamageResult damageResult) { - if (character == Skill.Character && isNormalAttack && damageResult != DamageResult.Evaded && !鏄惁鏄祵濂椾激瀹) + if (character == Skill.Character && isNormalAttack && damageResult != DamageResult.Evaded && !鏄惁鏄祵濂椾激瀹 && enemy.HP > 0) { WriteLine($"[ {character} ] 鍙戝姩浜嗘晱鎹蜂箣鍒冿紒灏嗛犳垚棰濆浼ゅ锛"); 鏄惁鏄祵濂椾激瀹 = true; diff --git a/OshimaModules/Skills/鎴樻妧/鐤鹃姝.cs b/OshimaModules/Skills/鎴樻妧/鐤鹃姝.cs index f783208..8547c8b 100644 --- a/OshimaModules/Skills/鎴樻妧/鐤鹃姝.cs +++ b/OshimaModules/Skills/鎴樻妧/鐤鹃姝.cs @@ -11,6 +11,7 @@ namespace Oshima.FunGame.OshimaModules.Skills public override double EPCost => 60; public override double CD => 35; public override double HardnessTime { get; set; } = 5; + public override bool CanSelectSelf => true; public 鐤鹃姝(Character? character = null) : base(SkillType.Skill, character) { @@ -73,6 +74,7 @@ namespace Oshima.FunGame.OshimaModules.Skills { if (!caster.Effects.Contains(this)) { + GamingQueue?.LastRound.Effects.Add(caster, EffectType.Unselectable); 棣栨浼ゅ = true; 鐮撮殣涓鍑 = false; RemainDuration = Duration;