diff --git a/OshimaModules/Effects/PassiveEffects/愤怒.cs b/OshimaModules/Effects/PassiveEffects/愤怒.cs index 9471000..87afa7c 100644 --- a/OshimaModules/Effects/PassiveEffects/愤怒.cs +++ b/OshimaModules/Effects/PassiveEffects/愤怒.cs @@ -56,7 +56,10 @@ namespace Oshima.FunGame.OshimaModules.Effects.PassiveEffects forceAction = true; if (_targetCharacter.HP > 0) { - return CharacterActionType.NormalAttack; + pNormalAttack = 1; + canUseItem = false; + canCastSkill = false; + return CharacterActionType.None; } // 如果目标已死亡,则放弃本回合行动,并在回合结束后自动移除愤怒状态 RemainDuration = 0; diff --git a/OshimaModules/Skills/Ryuko/宿命之潮.cs b/OshimaModules/Skills/Ryuko/宿命之潮.cs index c196fc8..52a892c 100644 --- a/OshimaModules/Skills/Ryuko/宿命之潮.cs +++ b/OshimaModules/Skills/Ryuko/宿命之潮.cs @@ -125,7 +125,8 @@ namespace Oshima.FunGame.OshimaModules.Skills { "熵核", 熵核描述 }, { "守护", 守护描述 } }, - DefaultChoice = Random.Shared.Next() % 2 == 0 ? "熵核" : "守护" + DefaultChoice = Random.Shared.Next() % 2 == 0 ? "熵核" : "守护", + CanCancel = false }); if (response.Choices.Count > 0) { diff --git a/OshimaServers/Service/FunGameService.cs b/OshimaServers/Service/FunGameService.cs index a4b1cce..6a46eb8 100644 --- a/OshimaServers/Service/FunGameService.cs +++ b/OshimaServers/Service/FunGameService.cs @@ -1,3 +1,4 @@ +using System.Collections.Concurrent; using System.Text; using Milimoe.FunGame.Core.Api.Transmittal; using Milimoe.FunGame.Core.Api.Utility; @@ -18,15 +19,15 @@ namespace Oshima.FunGame.OshimaServers.Service { public class FunGameService { - public static Dictionary> UserExploreCharacterCache { get; } = []; - public static Dictionary> UserExploreItemCache { get; } = []; - public static Dictionary> UserExploreEventCache { get; } = []; + public static ConcurrentDictionary> UserExploreCharacterCache { get; } = []; + public static ConcurrentDictionary> UserExploreItemCache { get; } = []; + public static ConcurrentDictionary> UserExploreEventCache { get; } = []; public static HashSet Activities { get; } = []; public static List ActivitiesCharacterCache { get; } = []; public static List ActivitiesItemCache { get; } = []; public static List ActivitiesEventCache { get; } = []; - public static Dictionary> UserNotice { get; } = []; - public static Dictionary Bosses { get; } = []; + public static ConcurrentDictionary> UserNotice { get; } = []; + public static ConcurrentDictionary Bosses { get; } = []; public static ServerPluginLoader? ServerPluginLoader { get; set; } = null; public static WebAPIPluginLoader? WebAPIPluginLoader { get; set; } = null; public static EntityModuleConfig Notices { get; } = new("notices", "notice"); diff --git a/OshimaWebAPI/Controllers/FunGameController.cs b/OshimaWebAPI/Controllers/FunGameController.cs index c70bd46..4a210fe 100644 --- a/OshimaWebAPI/Controllers/FunGameController.cs +++ b/OshimaWebAPI/Controllers/FunGameController.cs @@ -4131,7 +4131,7 @@ namespace Oshima.FunGame.WebAPI.Controllers if (boss2.HP <= 0) { - FunGameService.Bosses.Remove(bossIndex); + FunGameService.Bosses.Remove(bossIndex, out _); double gained = boss.Level; user.Inventory.Materials += gained; msgs.Add($"恭喜你击败了 Boss,获得 {gained:0.##} {General.GameplayEquilibriumConstant.InGameMaterial}奖励!"); @@ -4401,7 +4401,7 @@ namespace Oshima.FunGame.WebAPI.Controllers if (boss2.HP <= 0) { - FunGameService.Bosses.Remove(bossIndex); + FunGameService.Bosses.Remove(bossIndex, out _); double gained = boss.Level; user.Inventory.Materials += gained; msgs.Add($"恭喜你击败了 Boss,获得 {gained:0.##} {General.GameplayEquilibriumConstant.InGameMaterial}奖励!"); diff --git a/OshimaWebAPI/Services/RainBOTService.cs b/OshimaWebAPI/Services/RainBOTService.cs index b403c47..f78923a 100644 --- a/OshimaWebAPI/Services/RainBOTService.cs +++ b/OshimaWebAPI/Services/RainBOTService.cs @@ -47,7 +47,7 @@ namespace Oshima.FunGame.WebAPI.Services } if (msg.UseNotice && msg.FunGameUID > 0 && FunGameService.UserNotice.TryGetValue(msg.FunGameUID, out HashSet? msgs) && msgs != null) { - FunGameService.UserNotice.Remove(msg.FunGameUID); + FunGameService.UserNotice.Remove(msg.FunGameUID, out _); await SendAsync(msg, "离线未读信箱", $"☆--- 离线未读信箱 ---☆\r\n{string.Join("\r\n", msgs)}", msgType, null, 5); } }