diff --git a/OshimaCore/Controllers/FunGameController.cs b/OshimaCore/Controllers/FunGameController.cs index d604576..ab30103 100644 --- a/OshimaCore/Controllers/FunGameController.cs +++ b/OshimaCore/Controllers/FunGameController.cs @@ -1,4 +1,6 @@ +using System.Diagnostics.Metrics; using System.Text; +using System.Text.RegularExpressions; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; @@ -422,7 +424,7 @@ namespace Oshima.Core.Controllers User user = Factory.GetUser(userid, username, DateTime.Now, DateTime.Now, userid + "@qq.com", username); user.Inventory.Credits = 5000000; user.Inventory.Characters.Add(new CustomCharacter(userid, username)); - FunGameService.UserIdAndUsername[userid] = username; + FunGameService.UserIdAndUsername[userid] = user; pc.Add("user", user); pc.SaveConfig(); return NetworkUtility.JsonSerialize($"创建存档成功!你的用户名是【{username}】。"); @@ -488,7 +490,22 @@ namespace Oshima.Core.Controllers builder.AppendLine($"正在练级:{string.Join(" / ", user.Inventory.Characters.Where(c => user.Inventory.Training.ContainsKey(c.Id)).Select(c => c.ToStringWithLevelWithOutUser()))}"); } builder.AppendLine($"物品数量:{user.Inventory.Items.Count}"); - builder.AppendLine($"所属社团:无"); + long clubid = 0; + if (pc.TryGetValue("club", out object? value) && long.TryParse(value.ToString(), out long temp)) + { + clubid = temp; + } + EntityModuleConfig emc = new("clubs", clubid.ToString()); + emc.LoadConfig(); + Club? club = emc.Get("club"); + if (club != null) + { + builder.AppendLine($"所属社团:{club.Name} [{club.Prefix}]"); + } + else + { + builder.AppendLine($"所属社团:无"); + } builder.AppendLine($"注册时间:{user.RegTime.ToString(General.GeneralDateTimeFormatChinese)}"); builder.AppendLine($"最后访问:{user.LastTime.ToString(General.GeneralDateTimeFormatChinese)}"); @@ -534,7 +551,7 @@ namespace Oshima.Core.Controllers { user.Inventory.Name = user.Username + "的库存"; } - FunGameService.UserIdAndUsername[user.Id] = user.Username; + FunGameService.UserIdAndUsername[user.Id] = user; user.LastTime = DateTime.Now; pc.Add("user", user); pc.SaveConfig(); @@ -1617,7 +1634,7 @@ namespace Oshima.Core.Controllers { if (name != null) { - long enemyid = FunGameService.UserIdAndUsername.Where(kv => kv.Value == name).Select(kv => kv.Key).FirstOrDefault(); + long enemyid = FunGameService.UserIdAndUsername.Where(kv => kv.Value.Username == name).Select(kv => kv.Key).FirstOrDefault(); if (enemyid == 0) { return [$"找不到此名称对应的玩家!"]; @@ -1715,7 +1732,7 @@ namespace Oshima.Core.Controllers { if (name != null) { - long enemyid = FunGameService.UserIdAndUsername.Where(kv => kv.Value == name).Select(kv => kv.Key).FirstOrDefault(); + long enemyid = FunGameService.UserIdAndUsername.Where(kv => kv.Value.Username == name).Select(kv => kv.Key).FirstOrDefault(); if (enemyid == 0) { return [$"找不到此名称对应的玩家!"]; @@ -3677,20 +3694,35 @@ namespace Oshima.Core.Controllers { User user = FunGameService.GetUser(pc); bool sign = false; + int days = 0; + DateTime lastTime = DateTime.MinValue; + DateTime newLastTime = DateTime.Now; if (pc.TryGetValue("signed", out object? value) && value is bool temp && temp) { sign = true; } + if (pc.TryGetValue("days", out value) && int.TryParse(value.ToString(), out int temp2)) + { + days = temp2; + } + + if (pc.TryGetValue("lastTime", out value) && DateTime.TryParse(value.ToString(), out lastTime) && (newLastTime.Date - lastTime.Date).TotalDays > 1) + { + days = 0; + } if (sign) { - return NetworkUtility.JsonSerialize("你今天已经签过到了哦!"); + return NetworkUtility.JsonSerialize($"你今天已经签过到了哦!" + + (lastTime != DateTime.MinValue ? $"\r\n你上一次签到时间:{lastTime.ToString(General.GeneralDateTimeFormatChinese)},连续签到:{days} 天。" : "")); } - string msg = FunGameService.GetSignInResult(user); - user.LastTime = DateTime.Now; + string msg = FunGameService.GetSignInResult(user, days); + user.LastTime = newLastTime; pc.Add("user", user); pc.Add("signed", true); + pc.Add("days", days + 1); + pc.Add("lastTime", newLastTime); pc.SaveConfig(); return NetworkUtility.JsonSerialize(msg); } @@ -3699,6 +3731,415 @@ namespace Oshima.Core.Controllers return NetworkUtility.JsonSerialize(noSaved); } } + + [HttpPost("joinclub")] + public string JoinClub([FromQuery] long? qq = null, [FromQuery] long? id = null) + { + long userid = qq ?? Convert.ToInt64("10" + Verification.CreateVerifyCode(VerifyCodeType.NumberVerifyCode, 11)); + long clubid = id ?? 0; + + PluginConfig pc = new("saved", userid.ToString()); + pc.LoadConfig(); + + if (pc.Count > 0) + { + User user = FunGameService.GetUser(pc); + if (pc.TryGetValue("club", out object? value) && long.TryParse(value.ToString(), out long userClub) && userClub != 0) + { + return NetworkUtility.JsonSerialize($"你需要先退出当前社团才可以加入新社团。"); + } + + EntityModuleConfig emc = new("clubs", clubid.ToString()); + emc.LoadConfig(); + Club? club = emc.Get("club"); + if (club is null) + { + return NetworkUtility.JsonSerialize($"不存在编号为 {clubid} 的社团!"); + } + + if (!club.IsPublic) + { + return NetworkUtility.JsonSerialize($"社团 [ {club.Name} ] 未公开,只能通过邀请加入。"); + } + + string msg = ""; + + if (club.IsNeedApproval || club.Applicants.ContainsKey(userid)) + { + club.Applicants[userid] = user; + msg += $"已向社团 [ {club.Name} ] 提交加入申请!"; + } + else + { + club.Members[userid] = user; + msg += $"加入社团 [ {club.Name} ] 成功!"; + pc.Add("club", clubid); + } + emc.Add("club", club); + emc.SaveConfig(); + + user.LastTime = DateTime.Now; + pc.Add("user", user); + pc.SaveConfig(); + return NetworkUtility.JsonSerialize(msg); + } + else + { + return NetworkUtility.JsonSerialize(noSaved); + } + } + + [HttpPost("quitclub")] + public string QuitClub([FromQuery] long? qq = null) + { + long userid = qq ?? Convert.ToInt64("10" + Verification.CreateVerifyCode(VerifyCodeType.NumberVerifyCode, 11)); + + PluginConfig pc = new("saved", userid.ToString()); + pc.LoadConfig(); + + if (pc.Count > 0) + { + User user = FunGameService.GetUser(pc); + long clubid = 0; + if (pc.TryGetValue("club", out object? value) && long.TryParse(value.ToString(), out long temp)) + { + clubid = temp; + } + + if (clubid == 0) + { + return NetworkUtility.JsonSerialize($"你当前没有加入任何社团!"); + } + + EntityModuleConfig emc = new("clubs", clubid.ToString()); + emc.LoadConfig(); + Club? club = emc.Get("club"); + if (club is null) + { + return NetworkUtility.JsonSerialize($"不存在编号为 {clubid} 的社团!"); + } + + if (club.Master?.Id == userid) + { + return NetworkUtility.JsonSerialize($"你是社团的社长,不能退出社团,请转让社长或【解散社团】!"); + } + + if (!club.Members.Remove(userid)) + { + return NetworkUtility.JsonSerialize($"你不是此社团的成员,请联系管理员处理。"); + } + + emc.Add("club", club); + emc.SaveConfig(); + + string msg = $"退出社团 [ {club.Name} ] 成功!"; + user.LastTime = DateTime.Now; + pc.Add("user", user); + pc.Add("club", 0); + pc.SaveConfig(); + return NetworkUtility.JsonSerialize(msg); + } + else + { + return NetworkUtility.JsonSerialize(noSaved); + } + } + + [HttpPost("createclub")] + public string CreateClub([FromQuery] long? qq = null, [FromQuery] bool? @public = null, [FromQuery] string? prefix = null) + { + long userid = qq ?? Convert.ToInt64("10" + Verification.CreateVerifyCode(VerifyCodeType.NumberVerifyCode, 11)); + bool isPublic = @public ?? false; + string clubPrefix = prefix ?? ""; + + PluginConfig pc = new("saved", userid.ToString()); + pc.LoadConfig(); + + if (pc.Count > 0) + { + User user = FunGameService.GetUser(pc); + if (pc.TryGetValue("club", out object? value) && long.TryParse(value.ToString(), out long userClub) && userClub != 0) + { + return NetworkUtility.JsonSerialize($"你需要先退出当前社团才可以创建新社团。"); + } + + string pattern = @"^[a-zA-Z-_=+*%#^~.?!;:'"",]{3,4}$"; + if (!Regex.IsMatch(clubPrefix, pattern)) + { + return NetworkUtility.JsonSerialize($"社团的前缀只能包含总共3-4个英文字母和允许的特殊字符,此前缀不满足条件。"); + } + + HashSet clubids = []; + string directoryPath = $@"{AppDomain.CurrentDomain.BaseDirectory}configs/clubs"; + if (Directory.Exists(directoryPath)) + { + string[] filePaths = Directory.GetFiles(directoryPath); + foreach (string filePath in filePaths) + { + string fileName = Path.GetFileNameWithoutExtension(filePath); + if (long.TryParse(fileName, out long id)) + { + clubids.Add(id); + } + } + } + + long clubid = clubids.Count > 0 ? clubids.Max() + 1 : 1; + Club club = new() + { + Id = clubid, + Guid = Guid.NewGuid(), + Name = FunGameService.GenerateRandomChineseName(), + Master = user, + Prefix = clubPrefix, + Members = new() + { + { user.Id, user } + }, + IsPublic = isPublic, + IsNeedApproval = false + }; + + EntityModuleConfig emc = new("clubs", clubid.ToString()); + emc.LoadConfig(); + emc.Add("club", club); + emc.SaveConfig(); + + string msg = $"创建社团 [ {club.Name} ] (编号 {clubid})成功!"; + user.LastTime = DateTime.Now; + pc.Add("user", user); + pc.Add("club", clubid); + pc.SaveConfig(); + return NetworkUtility.JsonSerialize(msg); + } + else + { + return NetworkUtility.JsonSerialize(noSaved); + } + } + + [HttpPost("showclubinfo")] + public string ShowClubInfo([FromQuery] long? qq = null) + { + long userid = qq ?? Convert.ToInt64("10" + Verification.CreateVerifyCode(VerifyCodeType.NumberVerifyCode, 11)); + + PluginConfig pc = new("saved", userid.ToString()); + pc.LoadConfig(); + + if (pc.Count > 0) + { + User user = FunGameService.GetUser(pc); + + string msg; + long clubid = 0; + if (pc.TryGetValue("club", out object? value) && long.TryParse(value.ToString(), out long temp)) + { + clubid = temp; + } + EntityModuleConfig emc = new("clubs", clubid.ToString()); + emc.LoadConfig(); + Club? club = emc.Get("club"); + if (club != null) + { + string master = "无"; + if (FunGameService.UserIdAndUsername.TryGetValue(club.Master?.Id ?? 0, out User? user2) && user2 != null) + { + master = user2.Username; + } + + StringBuilder builer = new(); + builer.AppendLine($"☆--- {user.Username}的社团信息 ---☆"); + builer.AppendLine($"所属社团:{club.Name} [{club.Prefix}]"); + builer.AppendLine($"社团编号:{club.Id}"); + builer.AppendLine($"社团社长:{master}"); + builer.AppendLine($"是否公开:{(club.IsPublic ? "公开" : "私密")}"); + if (club.IsPublic) builer.AppendLine($"加入规则:{(club.IsNeedApproval ? "需要批准" : "直接加入")}"); + builer.AppendLine($"成员数量:{club.Members.Count}"); + if (club.Master?.Id == userid) + { + builer.AppendLine($"管理员数量:{club.Admins.Count}"); + builer.AppendLine($"待批准数量:{club.Applicants.Count}"); + builer.AppendLine($"社团基金:{club.ClubPoins}"); + } + msg = builer.ToString().Trim(); + } + else + { + msg = $"你目前还没有加入任何社团。"; + } + + return NetworkUtility.JsonSerialize(msg); + } + else + { + return NetworkUtility.JsonSerialize(noSaved); + } + } + + [HttpPost("showclubmemberlist")] + public string ShowClubMemberList([FromQuery] long? qq = null, [FromQuery] int? type = null) + { + long userid = qq ?? Convert.ToInt64("10" + Verification.CreateVerifyCode(VerifyCodeType.NumberVerifyCode, 11)); + int showType = type ?? 0; + + PluginConfig pc = new("saved", userid.ToString()); + pc.LoadConfig(); + + if (pc.Count > 0) + { + User user = FunGameService.GetUser(pc); + + string msg; + long clubid = 0; + if (pc.TryGetValue("club", out object? value) && long.TryParse(value.ToString(), out long temp)) + { + clubid = temp; + } + EntityModuleConfig emc = new("clubs", clubid.ToString()); + emc.LoadConfig(); + Club? club = emc.Get("club"); + if (club != null) + { + StringBuilder builer = new(); + int count; + switch (showType) + { + case 1: + builer.AppendLine($"☆--- 社团 [ {club.Name} ] 管理员列表 ---☆"); + count = 1; + foreach (long uid in club.Admins.Keys) + { + if (FunGameService.UserIdAndUsername.TryGetValue(club.Master?.Id ?? 0, out User? user2) && user2 != null) + { + builer.AppendLine($"{count}."); + builer.AppendLine($"UID:{user2.Id}"); + builer.AppendLine($"玩家昵称:{user2.Username}"); + } + count++; + } + break; + case 2: + if (club.Master?.Id == user.Id || club.Admins.ContainsKey(user.Id)) + { + builer.AppendLine($"☆--- 社团 [ {club.Name} ] 待批准列表 ---☆"); + count = 1; + foreach (long uid in club.Applicants.Keys) + { + if (FunGameService.UserIdAndUsername.TryGetValue(club.Master?.Id ?? 0, out User? user2) && user2 != null) + { + builer.AppendLine($"{count}."); + builer.AppendLine($"UID:{user2.Id}"); + builer.AppendLine($"玩家昵称:{user2.Username}"); + } + count++; + } + } + else + { + builer.Append("你没有权限查看这个列表!"); + } + break; + case 0: + default: + builer.AppendLine($"☆--- 社团 [ {club.Name} ] 成员列表 ---☆"); + count = 1; + foreach (long uid in club.Members.Keys) + { + if (FunGameService.UserIdAndUsername.TryGetValue(club.Master?.Id ?? 0, out User? user2) && user2 != null) + { + builer.AppendLine($"{count}."); + builer.AppendLine($"UID:{user2.Id}"); + builer.AppendLine($"玩家昵称:{user2.Username}"); + string userType = "社员"; + if (club.Master?.Id == user2.Id) + { + userType = "社长"; + } + else if (club.Admins.ContainsKey(user2.Id)) + { + userType = "管理员"; + } + builer.AppendLine($"社团身份:{userType}"); + } + count++; + } + break; + } + + msg = builer.ToString().Trim(); + } + else + { + msg = $"你目前还没有加入任何社团。"; + } + + return NetworkUtility.JsonSerialize(msg); + } + else + { + return NetworkUtility.JsonSerialize(noSaved); + } + } + + [HttpPost("disbandclub")] + public string DisbandClub([FromQuery] long? qq = null) + { + return NetworkUtility.JsonSerialize($"现在还不能解散社团!"); + + long userid = qq ?? Convert.ToInt64("10" + Verification.CreateVerifyCode(VerifyCodeType.NumberVerifyCode, 11)); + + PluginConfig pc = new("saved", userid.ToString()); + pc.LoadConfig(); + + if (pc.Count > 0) + { + User user = FunGameService.GetUser(pc); + long clubid = 0; + if (pc.TryGetValue("club", out object? value) && long.TryParse(value.ToString(), out long temp)) + { + clubid = temp; + } + + if (clubid == 0) + { + return NetworkUtility.JsonSerialize($"你当前没有加入任何社团!"); + } + + EntityModuleConfig emc = new("clubs", clubid.ToString()); + emc.LoadConfig(); + Club? club = emc.Get("club"); + if (club is null) + { + return NetworkUtility.JsonSerialize($"不存在编号为 {clubid} 的社团!"); + } + + if (club.Master?.Id != userid) + { + return NetworkUtility.JsonSerialize($"你不是社团的社长,没有权限使用此指令!"); + } + + string msg; + string path = $@"{AppDomain.CurrentDomain.BaseDirectory}configs/clubs/{clubid}.json"; + try + { + System.IO.File.Delete(path); + msg = $"解散社团 [ {club.Name} ] 成功!"; + user.LastTime = DateTime.Now; + pc.Add("user", user); + pc.Add("club", 0); + pc.SaveConfig(); + } + catch + { + msg = $"解散社团 [ {club.Name} ] 失败,请联系服务器管理员解决!"; + } + return NetworkUtility.JsonSerialize(msg); + } + else + { + return NetworkUtility.JsonSerialize(noSaved); + } + } [HttpGet("reload")] public string Relaod([FromQuery] long? master = null) diff --git a/OshimaCore/OshimaWebAPI.cs b/OshimaCore/OshimaWebAPI.cs index 0b5bc67..c32565d 100644 --- a/OshimaCore/OshimaWebAPI.cs +++ b/OshimaCore/OshimaWebAPI.cs @@ -77,8 +77,8 @@ namespace Oshima.Core.WebAPI if (pc.Count > 0) { User user = FunGameService.GetUser(pc); - // 将用户名存入缓存 - FunGameService.UserIdAndUsername[user.Id] = user.Username; + // 将用户存入缓存 + FunGameService.UserIdAndUsername[user.Id] = user; // 任务结算 EntityModuleConfig quests = new("quests", user.Id.ToString()); quests.LoadConfig(); diff --git a/OshimaCore/Utils/FunGameService.cs b/OshimaCore/Utils/FunGameService.cs index 6c3d133..9997cf3 100644 --- a/OshimaCore/Utils/FunGameService.cs +++ b/OshimaCore/Utils/FunGameService.cs @@ -23,7 +23,7 @@ namespace Oshima.Core.Utils public static List ItemSkills { get; } = []; public static List AllItems { get; } = []; public static List AllSkills { get; } = []; - public static Dictionary UserIdAndUsername { get; } = []; + public static Dictionary UserIdAndUsername { get; } = []; public static Dictionary Bosses { get; } = []; public static void InitFunGame() @@ -71,6 +71,7 @@ namespace Oshima.Core.Utils } ItemSkills.AddRange([.. Equipment.SelectMany(i => i.Skills.Passives), .. Items.SelectMany(i => i.Skills.Passives)]); + AllSkills.AddRange(Magics); AllSkills.AddRange(Skills); AllSkills.AddRange(PassiveSkills); AllSkills.AddRange(ItemSkills); @@ -677,27 +678,37 @@ namespace Oshima.Core.Utils return msg; } - public static string GetSignInResult(User user) + public static string GetSignInResult(User user, int days) { - string msg = "签到成功!本次签到获得:"; - int currency = Random.Shared.Next(1000, 3000); - msg += $"{currency} 金币和 "; - int material = Random.Shared.Next(5, 15); - msg += $"{material} 材料!额外获得:"; + string msg = $"签到成功,你已连续签到 {days +1} 天!\r\n本次签到获得:"; + int currency = Random.Shared.Next(1000, 3000) + 10 * days; + msg += $"{currency} {General.GameplayEquilibriumConstant.InGameCurrency} 和 "; + int material = Random.Shared.Next(5, 15) + days / 7; + msg += $"{material} {General.GameplayEquilibriumConstant.InGameMaterial}!额外获得:"; user.Inventory.Credits += currency; user.Inventory.Materials += material; int r = Random.Shared.Next(6); double q = Random.Shared.NextDouble() * 100; - QualityType type = q switch + + // 根据签到天数调整概率 + double daysFactor = Math.Min(days * 0.02, 30); + Dictionary adjustedProbabilities = new(DrawCardProbabilities); + foreach (QualityType typeTemp in adjustedProbabilities.Keys) { - <= 69.53 => QualityType.White, - > 69.53 and <= 69.53 + 15.35 => QualityType.Green, - > 69.53 + 15.35 and <= 69.53 + 15.35 + 9.48 => QualityType.Blue, - > 69.53 + 15.35 + 9.48 and <= 69.53 + 15.35 + 9.48 + 4.25 => QualityType.Purple, - > 69.53 + 15.35 + 9.48 + 4.25 and <= 69.53 + 15.35 + 9.48 + 4.25 + 1.33 => QualityType.Orange, - > 69.53 + 15.35 + 9.48 + 4.25 + 1.33 and <= 69.53 + 15.35 + 9.48 + 4.25 + 1.33 + 0.06 => QualityType.Red, - _ => QualityType.White - }; + adjustedProbabilities[typeTemp] += daysFactor; + } + + // 生成随机数并确定品质 + double randomValue = Random.Shared.NextDouble() * 100; + QualityType type = QualityType.White; + foreach (QualityType typeTemp in adjustedProbabilities.Keys.OrderByDescending(o => (int)o)) + { + if (randomValue <= adjustedProbabilities[typeTemp]) + { + type = typeTemp; + break; + } + } switch (r) { @@ -1815,6 +1826,22 @@ namespace Oshima.Core.Utils } } + public static Dictionary DrawCardProbabilities + { + get + { + return new() + { + { QualityType.White, 69.53 }, + { QualityType.Green, 15.35 }, + { QualityType.Blue, 9.48 }, + { QualityType.Purple, 4.25 }, + { QualityType.Orange, 1.33 }, + { QualityType.Red, 0.06 } + }; + } + } + public static Dictionary> GenerateRoundRewards(int maxRound) { Dictionary> roundRewards = []; diff --git a/OshimaModules/Effects/ItemEffects/GetEP.cs b/OshimaModules/Effects/ItemEffects/GetEP.cs index 1062abf..0caeb11 100644 --- a/OshimaModules/Effects/ItemEffects/GetEP.cs +++ b/OshimaModules/Effects/ItemEffects/GetEP.cs @@ -31,5 +31,13 @@ namespace Oshima.FunGame.OshimaModules.Effects.ItemEffects { caster.EP += 实际获得; } + + public override void OnSkillCasted(List targets, Dictionary others) + { + foreach (Character target in targets) + { + target.EP += 实际获得; + } + } } } diff --git a/OshimaModules/Effects/ItemEffects/RecoverHP.cs b/OshimaModules/Effects/ItemEffects/RecoverHP.cs index 7ddb163..f039672 100644 --- a/OshimaModules/Effects/ItemEffects/RecoverHP.cs +++ b/OshimaModules/Effects/ItemEffects/RecoverHP.cs @@ -31,5 +31,13 @@ namespace Oshima.FunGame.OshimaModules.Effects.ItemEffects { HealToTarget(caster, caster, 实际回复, false); } + + public override void OnSkillCasted(List targets, Dictionary others) + { + foreach (Character target in targets) + { + target.HP += 实际回复; + } + } } } diff --git a/OshimaModules/Effects/ItemEffects/RecoverHP2.cs b/OshimaModules/Effects/ItemEffects/RecoverHP2.cs index d7fa725..e563874 100644 --- a/OshimaModules/Effects/ItemEffects/RecoverHP2.cs +++ b/OshimaModules/Effects/ItemEffects/RecoverHP2.cs @@ -32,5 +32,13 @@ namespace Oshima.FunGame.OshimaModules.Effects.ItemEffects { HealToTarget(caster, caster, 实际回复, false); } + + public override void OnSkillCasted(List targets, Dictionary others) + { + foreach (Character target in targets) + { + target.HP += 实际回复; + } + } } } diff --git a/OshimaModules/Effects/ItemEffects/RecoverMP.cs b/OshimaModules/Effects/ItemEffects/RecoverMP.cs index 6423bfa..a8c98fd 100644 --- a/OshimaModules/Effects/ItemEffects/RecoverMP.cs +++ b/OshimaModules/Effects/ItemEffects/RecoverMP.cs @@ -31,5 +31,13 @@ namespace Oshima.FunGame.OshimaModules.Effects.ItemEffects { caster.MP += 实际回复; } + + public override void OnSkillCasted(List targets, Dictionary others) + { + foreach (Character target in targets) + { + target.MP += 实际回复; + } + } } } diff --git a/OshimaModules/Effects/ItemEffects/RecoverMP2.cs b/OshimaModules/Effects/ItemEffects/RecoverMP2.cs index 1e406b1..8155b4d 100644 --- a/OshimaModules/Effects/ItemEffects/RecoverMP2.cs +++ b/OshimaModules/Effects/ItemEffects/RecoverMP2.cs @@ -32,5 +32,13 @@ namespace Oshima.FunGame.OshimaModules.Effects.ItemEffects { caster.MP += 实际回复; } + + public override void OnSkillCasted(List targets, Dictionary others) + { + foreach (Character target in targets) + { + target.MP += 实际回复; + } + } } } diff --git a/OshimaModules/Items/Consumable/能量饮料.cs b/OshimaModules/Items/Consumable/能量饮料.cs index ebc1178..1e0af92 100644 --- a/OshimaModules/Items/Consumable/能量饮料.cs +++ b/OshimaModules/Items/Consumable/能量饮料.cs @@ -29,7 +29,7 @@ namespace Oshima.FunGame.OshimaModules.Items string msg = $"对角色 [ {character} ] 使用 [ {item.Name} ] 成功!"; if (item is EPBook hpBook) { - msg += $"回复了 {hpBook.EP} 点能量值!"; + msg += $"获得了 {hpBook.EP} 点能量值!"; } return msg; } @@ -62,7 +62,7 @@ namespace Oshima.FunGame.OshimaModules.Items string truemsg = $"对角色 [ {targets[0]} ] 使用 {count} 个 [ {item.Name} ] 成功!"; if (item is EPBook expBook) { - truemsg += $"回复了 {expBook.EP * count} 点能量值!"; + truemsg += $"获得了 {expBook.EP * count} 点能量值!"; } args["truemsg"] = truemsg; }