From 6a25cf9b3ff37b2ab1fb98973ee0e28327d5c6e7 Mon Sep 17 00:00:00 2001 From: milimoe Date: Thu, 22 Jan 2026 01:38:24 +0800 Subject: [PATCH] 2 --- OshimaModules/Skills/Ryuko/不息之流.cs | 2 +- OshimaModules/Skills/Ryuko/宿命之潮.cs | 6 ++-- OshimaModules/Skills/Yang/咒怨洪流.cs | 34 +++++++++++++++++-- OshimaModules/Skills/dddovo/银隼之赐.cs | 7 ++-- OshimaServers/Service/FunGameSimulation.cs | 4 +-- OshimaWebAPI/Controllers/FunGameController.cs | 7 ++++ OshimaWebAPI/Services/RainBOTService.cs | 23 +++++++++++++ 7 files changed, 72 insertions(+), 11 deletions(-) diff --git a/OshimaModules/Skills/Ryuko/不息之流.cs b/OshimaModules/Skills/Ryuko/不息之流.cs index 28942b8..2bbefbf 100644 --- a/OshimaModules/Skills/Ryuko/不息之流.cs +++ b/OshimaModules/Skills/Ryuko/不息之流.cs @@ -26,7 +26,7 @@ namespace Oshima.FunGame.OshimaModules.Skills public override string Name => Skill.Name; public override string Description => $"{Skill.SkillOwner()}处于正常态和吟唱态时,每秒回复 {回复系数 * 100:0.##}% 最大生命值 [ {Skill.Character?.MaxHP * 回复系数:0.##} ] 并获得 {能量获取:0.##} 点能量。"; - public double 回复系数 { get; set; } = 0.02; + public double 回复系数 { get; set; } = 0.01; public double 能量获取 { get; set; } = 1; public override void OnTimeElapsed(Character character, double elapsed) diff --git a/OshimaModules/Skills/Ryuko/宿命之潮.cs b/OshimaModules/Skills/Ryuko/宿命之潮.cs index 33b02f2..c196fc8 100644 --- a/OshimaModules/Skills/Ryuko/宿命之潮.cs +++ b/OshimaModules/Skills/Ryuko/宿命之潮.cs @@ -39,15 +39,15 @@ namespace Oshima.FunGame.OshimaModules.Skills public string 通用描述 => $"{Skill.SkillOwner()}可以选择获得哪一种力量:\r\n{熵核描述}\r\n{守护描述}"; private string 熵核描述 => $"【熵核】加速生命回复,每{GameplayEquilibriumConstant.InGameTime}额外回复 {熵核额外回复 * 100:0.##}% 当前生命值 [ {Skill.Character?.HP * 熵核额外回复:0.##} ],攻击力提升 {熵核攻击力提升 * 100:0.##}% [ {Skill.Character?.BaseATK * 熵核攻击力提升:0.##} ],但是受到的伤害提升 {熵核受到伤害提升 * 100:0.##}%。" + $"对敌人造成伤害会使其在 {熵核影响敌人时间:0.##} {GameplayEquilibriumConstant.InGameTime}内无法获得自然的生命和魔法回复的禁止治疗效果,施加该状态时,只有目标的敏捷高于{Skill.SkillOwner()}的角色才能进行豁免检定。持续 {熵核持续时间:0.##} {GameplayEquilibriumConstant.InGameTime}。"; - private static double 熵核额外回复 => 0.04; + private static double 熵核额外回复 => 0.02; private double 熵核攻击力提升 => 0.2 + 0.1 * (Skill.Level - 1); private double 熵核受到伤害提升 => 0.15 + 0.05 * (Skill.Level - 1); private static double 熵核影响敌人时间 => 10; private double 熵核持续时间 => 15 + 2 * (Skill.Level - 1); private string 守护描述 => $"【守护】极致地加速生命回复,每{GameplayEquilibriumConstant.InGameTime}额外回复 {守护额外回复 * 100:0.##}% 当前生命值 [ {Skill.Character?.HP * 守护额外回复:0.##} ],为全体友方角色提供每{GameplayEquilibriumConstant.InGameTime}额外 {守护友方回复 * 100:0.##}% 当前生命值的生命回复,并嘲讽全体敌方角色,被嘲讽的角色仅能将{Skill.SkillOwner()}作为攻击目标。" + $"施加嘲讽状态时,只有目标的敏捷高于{Skill.SkillOwner()}的角色才能进行豁免检定。持续 {守护持续时间:0.##} {GameplayEquilibriumConstant.InGameTime}。"; - private double 守护额外回复 => 0.06 + 0.005 * (Skill.Level - 1); - private double 守护友方回复 => 0.01 + 0.01 * (Skill.Level - 1); + private double 守护额外回复 => 0.01 + 0.003 * (Skill.Level - 1); + private double 守护友方回复 => 0.01 + 0.002 * (Skill.Level - 1); private double 守护持续时间 => 15 + 1 * (Skill.Level - 1); private bool 选择熵核 { get; set; } = false; diff --git a/OshimaModules/Skills/Yang/咒怨洪流.cs b/OshimaModules/Skills/Yang/咒怨洪流.cs index d9505e1..506f625 100644 --- a/OshimaModules/Skills/Yang/咒怨洪流.cs +++ b/OshimaModules/Skills/Yang/咒怨洪流.cs @@ -1,6 +1,8 @@ using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Interface.Entity; using Milimoe.FunGame.Core.Library.Common.Addon; using Milimoe.FunGame.Core.Library.Constant; +using Milimoe.FunGame.Core.Model; namespace Oshima.FunGame.OshimaModules.Skills { @@ -26,17 +28,19 @@ namespace Oshima.FunGame.OshimaModules.Skills { public override long Id => Skill.Id; public override string Name => "咒怨洪流"; - public override string Description => $"{Skill.SkillOwner()}将「熵核」的污染之力附着在武器之上。{Duration:0.##} {GameplayEquilibriumConstant.InGameTime}内,增加自身所有伤害的 {减伤比例 * 100:0.##}% 伤害减免;[ 蚀魂震击 ] 的冷却时间降低至 5 {GameplayEquilibriumConstant.InGameTime},并将普通攻击转为魔法伤害,允许普通攻击时选择至多 3 个目标。"; + public override string Description => $"{Skill.SkillOwner()}将「熵核」的污染之力附着在武器之上。{Duration:0.##} {GameplayEquilibriumConstant.InGameTime}内,增加自身所有伤害的 {减伤比例 * 100:0.##}% 伤害减免;[ 蚀魂震击 ] 的冷却时间降低至 5 {GameplayEquilibriumConstant.InGameTime},并将普通攻击转为魔法伤害;在一个回合里首次使用普通攻击后,附赠 {额外攻击次数} 次普通攻击决策点配额,但后续普通攻击必须选取不重复的目标。"; public override bool Durative => true; public override double Duration => 30; public override DispelledType DispelledType => DispelledType.CannotBeDispelled; private double 减伤比例 => 0.15 + 0.02 * (Level - 1); private double 实际比例 = 0; + private readonly List 本回合已攻击的目标 = []; + private bool 本回合可附赠动作 = true; + private readonly int 额外攻击次数 = 2; public override void OnEffectGained(Character character) { - character.NormalAttack.CanSelectTargetCount += 2; 实际比例 = 减伤比例; character.NormalAttack.SetMagicType(new(this, true, MagicType.None, 999), GamingQueue); if (character.Effects.Where(e => e is 蚀魂震击特效).FirstOrDefault() is 蚀魂震击特效 e) @@ -49,7 +53,6 @@ namespace Oshima.FunGame.OshimaModules.Skills public override void OnEffectLost(Character character) { 实际比例 = 0; - character.NormalAttack.CanSelectTargetCount -= 2; character.NormalAttack.UnsetMagicType(this, GamingQueue); if (character.Effects.Where(e => e is 蚀魂震击特效).FirstOrDefault() is 蚀魂震击特效 e) { @@ -57,6 +60,31 @@ namespace Oshima.FunGame.OshimaModules.Skills } } + public override void OnTurnStart(Character character, List enemys, List teammates, List skills, List items) + { + 本回合已攻击的目标.Clear(); + 本回合可附赠动作 = true; + } + + public override void AfterCharacterNormalAttack(Character character, NormalAttack normalAttack, List targets) + { + 本回合已攻击的目标.AddRange(targets); + if (本回合可附赠动作 && GamingQueue != null && GamingQueue.CharacterDecisionPoints.TryGetValue(character, out DecisionPoints? dp) && dp != null) + { + 本回合可附赠动作 = false; + dp.AddTempActionQuota(CharacterActionType.NormalAttack, 额外攻击次数); + WriteLine($"[ {character} ] 发动了{nameof(咒怨洪流)}!本回合可额外发动 {额外攻击次数} 次普通攻击!"); + } + } + + public override void AlterSelectListBeforeSelection(Character character, ISkill skill, List enemys, List teammates) + { + if (skill is NormalAttack && !本回合可附赠动作) + { + enemys.RemoveAll(本回合已攻击的目标.Contains); + } + } + public override double AlterActualDamageAfterCalculation(Character character, Character enemy, double damage, bool isNormalAttack, DamageType damageType, MagicType magicType, DamageResult damageResult, ref bool isEvaded, Dictionary totalDamageBonus) { if (enemy == Skill.Character) diff --git a/OshimaModules/Skills/dddovo/银隼之赐.cs b/OshimaModules/Skills/dddovo/银隼之赐.cs index 2caad5f..7c1602b 100644 --- a/OshimaModules/Skills/dddovo/银隼之赐.cs +++ b/OshimaModules/Skills/dddovo/银隼之赐.cs @@ -34,12 +34,15 @@ namespace Oshima.FunGame.OshimaModules.Skills public override void AfterDamageCalculation(Character character, Character enemy, double damage, double actualDamage, bool isNormalAttack, DamageType damageType, MagicType magicType, DamageResult damageResult) { - if (character == Skill.Character && isNormalAttack && (damageResult == DamageResult.Normal || damageResult == DamageResult.Critical) && !是否是嵌套伤害 && enemy.HP > 0) + if (Skill.CurrentCD == 0 && character == Skill.Character && isNormalAttack && (damageResult == DamageResult.Normal || damageResult == DamageResult.Critical) && !是否是嵌套伤害 && enemy.HP > 0) { Skill.CurrentCD = Skill.CD; WriteLine($"[ {character} ] 发动了银隼之赐!将造成额外伤害!"); 是否是嵌套伤害 = true; - DamageToEnemy(character, enemy, DamageType.Magical, magicType, 敏捷伤害); + DamageToEnemy(character, enemy, DamageType.Magical, magicType, 敏捷伤害, new(character) + { + TriggerEffects = false + }); } if (character == Skill.Character && 是否是嵌套伤害) diff --git a/OshimaServers/Service/FunGameSimulation.cs b/OshimaServers/Service/FunGameSimulation.cs index 17394bb..a8251fd 100644 --- a/OshimaServers/Service/FunGameSimulation.cs +++ b/OshimaServers/Service/FunGameSimulation.cs @@ -63,7 +63,7 @@ namespace Oshima.FunGame.OshimaServers.Service } } - public static async Task> StartSimulationGame(bool printout, bool isWeb = false, bool isTeam = false, bool deathMatchRoundDetail = false, int maxRespawnTimesMix = 1, bool useStore = false, bool hasMap = false) + public static async Task> StartSimulationGame(bool printout, bool isWeb = false, bool isTeam = false, bool deathMatchRoundDetail = false, int maxRespawnTimesMix = 1, bool useStore = false, bool hasMap = false, bool isDebug = false) { PrintOut = printout; IsWeb = isWeb; @@ -205,7 +205,7 @@ namespace Oshima.FunGame.OshimaServers.Service if (PrintOut) characters.ForEach(c => Console.WriteLine(c.GetInfo())); // 初始化队列,准备开始游戏 - actionQueue.IsDebug = IsDebug; + actionQueue.IsDebug = IsDebug || isDebug; actionQueue.InitActionQueue(); actionQueue.SetCharactersToAIControl(false, characters); if (PrintOut) Console.WriteLine(); diff --git a/OshimaWebAPI/Controllers/FunGameController.cs b/OshimaWebAPI/Controllers/FunGameController.cs index 59449c4..c70bd46 100644 --- a/OshimaWebAPI/Controllers/FunGameController.cs +++ b/OshimaWebAPI/Controllers/FunGameController.cs @@ -38,6 +38,13 @@ namespace Oshima.FunGame.WebAPI.Controllers return await FunGameSimulation.StartSimulationGame(false, isweb ?? true, isteam ?? false, showall ?? false, maxRespawnTimesMix ?? 1, false, hasMap ?? false); } + [AllowAnonymous] + [HttpGet("testdebug")] + public async Task> GetTestDebug([FromQuery] bool? isweb = null, [FromQuery] bool? isteam = null, [FromQuery] bool? showall = null, [FromQuery] int? maxRespawnTimesMix = null, [FromQuery] bool? hasMap = null) + { + return await FunGameSimulation.StartSimulationGame(false, isweb ?? true, isteam ?? false, showall ?? false, maxRespawnTimesMix ?? 1, false, hasMap ?? false, true); + } + [AllowAnonymous] [HttpGet("last")] public List GetLast([FromQuery] bool full = false) diff --git a/OshimaWebAPI/Services/RainBOTService.cs b/OshimaWebAPI/Services/RainBOTService.cs index 76609ed..b403c47 100644 --- a/OshimaWebAPI/Services/RainBOTService.cs +++ b/OshimaWebAPI/Services/RainBOTService.cs @@ -502,6 +502,29 @@ namespace Oshima.FunGame.WebAPI.Services return result; } + if (e.Detail.StartsWith("团队调试模拟", StringComparison.CurrentCultureIgnoreCase)) + { + e.UseNotice = false; + if (!FunGameSimulation) + { + FunGameSimulation = true; + List msgs = await Controller.GetTestDebug(false, true, hasMap: true); + List real = MergeMessages(msgs); + int count = 1; + foreach (string msg in real) + { + await SendAsync(e, "筽祀牻", msg.Trim(), msgSeq: count++); + if (count != real.Count) await Task.Delay(5500); + } + FunGameSimulation = false; + } + else + { + await SendAsync(e, "筽祀牻", "游戏正在模拟中,请勿重复请求!"); + } + return result; + } + if (e.Detail.StartsWith("查数据", StringComparison.CurrentCultureIgnoreCase)) { e.UseNotice = false;