diff --git a/OshimaCore/Controllers/FunGameController.cs b/OshimaCore/Controllers/FunGameController.cs index f1763d9..de59154 100644 --- a/OshimaCore/Controllers/FunGameController.cs +++ b/OshimaCore/Controllers/FunGameController.cs @@ -1484,7 +1484,7 @@ namespace Oshima.Core.Controllers if (items.Count() >= useCount) { - items = items.Reverse().Take(useCount); + items = items.TakeLast(useCount); List msgs = []; int successCount = 0; @@ -1529,7 +1529,7 @@ namespace Oshima.Core.Controllers pc.Add("user", user); pc.SaveConfig(); } - return NetworkUtility.JsonSerialize($"使用完毕!使用 {useCount} 件物品,成功 {successCount} 件!\r\n" + string.Join("\r\n", msgs)); + return NetworkUtility.JsonSerialize($"使用完毕!使用 {useCount} 件物品,成功 {successCount} 件!\r\n" + string.Join("\r\n", msgs.Count > 30 ? msgs.Take(30) : msgs)); } else { @@ -1584,7 +1584,7 @@ namespace Oshima.Core.Controllers string msg = $"升级完成!角色 [ {character} ] 共提升 {character.Level - originalLevel} 级,当前等级:{character.Level} 级。"; - if (General.GameplayEquilibriumConstant.EXPUpperLimit.TryGetValue(character.Level, out double need)) + if (character.Level != General.GameplayEquilibriumConstant.MaxLevel && General.GameplayEquilibriumConstant.EXPUpperLimit.TryGetValue(character.Level, out double need)) { if (character.EXP < need) { @@ -1595,6 +1595,10 @@ namespace Oshima.Core.Controllers msg += $"\r\n角色 [ {character} ] 目前突破进度:{character.LevelBreak + 1}/{General.GameplayEquilibriumConstant.LevelBreakList.Count},需要进行【角色突破】才能继续升级。"; } } + else if (character.Level == General.GameplayEquilibriumConstant.MaxLevel) + { + msg += $"\r\n该角色已升级至满级,恭喜!"; + } user.LastTime = DateTime.Now; pc.Add("user", user); @@ -1640,7 +1644,7 @@ namespace Oshima.Core.Controllers } return NetworkUtility.JsonSerialize($"角色 [ {character} ] 目前突破进度:{character.LevelBreak + 1}/{General.GameplayEquilibriumConstant.LevelBreakList.Count}" + - $"\r\n该角色下一个等级突破阶段在 {General.GameplayEquilibriumConstant.LevelBreakList.ToArray()[character.LevelBreak]} 级,所需材料:\r\n" + FunGameService.GetLevelBreakNeedy(character.LevelBreak + 1)); + $"\r\n该角色下一个等级突破阶段在 {General.GameplayEquilibriumConstant.LevelBreakList.ToArray()[character.LevelBreak + 1]} 级,所需材料:\r\n" + FunGameService.GetLevelBreakNeedy(character.LevelBreak + 1)); } else { @@ -1703,7 +1707,7 @@ namespace Oshima.Core.Controllers IEnumerable items = user.Inventory.Items.Where(i => i.Name == key); if (items.Count() >= needCount) { - items = items.Reverse().Take(needCount); + items = items.TakeLast(needCount); foreach (Item item in items) { user.Inventory.Items.Remove(item); @@ -1723,7 +1727,7 @@ namespace Oshima.Core.Controllers if (originalBreak == character.LevelBreak) { return NetworkUtility.JsonSerialize($"突破失败!角色 [ {character} ] 目前突破进度:{character.LevelBreak + 1}/{General.GameplayEquilibriumConstant.LevelBreakList.Count}。" + - $"\r\n该角色下一个等级突破阶段在 {General.GameplayEquilibriumConstant.LevelBreakList.ToArray()[character.LevelBreak]} 级,所需材料:\r\n" + FunGameService.GetLevelBreakNeedy(character.LevelBreak + 1)); + $"\r\n该角色下一个等级突破阶段在 {General.GameplayEquilibriumConstant.LevelBreakList.ToArray()[character.LevelBreak + 1]} 级,所需材料:\r\n" + FunGameService.GetLevelBreakNeedy(character.LevelBreak + 1)); } else { @@ -1733,7 +1737,7 @@ namespace Oshima.Core.Controllers return NetworkUtility.JsonSerialize($"突破成功!角色 [ {character} ] 目前突破进度:{character.LevelBreak + 1}/{General.GameplayEquilibriumConstant.LevelBreakList.Count}。" + $"{(character.LevelBreak + 1 == General.GameplayEquilibriumConstant.LevelBreakList.Count ? "\r\n该角色已完成全部的突破阶段,恭喜!" : - $"\r\n该角色下一个等级突破阶段在 {General.GameplayEquilibriumConstant.LevelBreakList.ToArray()[character.LevelBreak]} 级,所需材料:\r\n" + FunGameService.GetLevelBreakNeedy(character.LevelBreak + 1))}"); + $"\r\n该角色下一个等级突破阶段在 {General.GameplayEquilibriumConstant.LevelBreakList.ToArray()[character.LevelBreak + 1]} 级,所需材料:\r\n" + FunGameService.GetLevelBreakNeedy(character.LevelBreak + 1))}"); } } else @@ -1765,31 +1769,41 @@ namespace Oshima.Core.Controllers string msg = ""; if (user.IsAdmin) { - if (FunGameService.AllItems.FirstOrDefault(i => i.Name == itemName) is Item item) + PluginConfig pc2 = new("saved", targetid.ToString()); + pc2.LoadConfig(); + if (pc2.Count > 0) { - PluginConfig pc2 = new("saved", targetid.ToString()); - pc2.LoadConfig(); - if (pc2.Count > 0) + User user2 = FunGameService.GetUser(pc2); + if (itemName == General.GameplayEquilibriumConstant.InGameCurrency) + { + user2.Inventory.Credits += itemCount; + msg = $"已为 [ {user2} ] 生成 {itemCount} {General.GameplayEquilibriumConstant.InGameCurrency}"; + } + else if (itemName == General.GameplayEquilibriumConstant.InGameMaterial) + { + user2.Inventory.Materials += itemCount; + msg = $"已为 [ {user2} ] 生成 {itemCount} {General.GameplayEquilibriumConstant.InGameMaterial}"; + } + else if (FunGameService.AllItems.FirstOrDefault(i => i.Name == itemName) is Item item) { - User user2 = FunGameService.GetUser(pc2); for (int i = 0; i < itemCount; i++) { Item newItem = item.Copy(); newItem.User = user2; user2.Inventory.Items.Add(newItem); } - pc2.Add("user", user2); - pc2.SaveConfig(); msg = $"已为 [ {user2} ] 生成 {itemCount} 个 [{ItemSet.GetQualityTypeName(item.QualityType)}|{ItemSet.GetItemTypeName(item.ItemType)}] {item.Name}"; } else { - return NetworkUtility.JsonSerialize($"目标 UID 不存在!"); + return NetworkUtility.JsonSerialize($"此物品不存在!"); } + pc2.Add("user", user2); + pc2.SaveConfig(); } else { - return NetworkUtility.JsonSerialize($"此物品不存在!"); + return NetworkUtility.JsonSerialize($"目标 UID 不存在!"); } } else diff --git a/OshimaCore/Utils/FunGameService.cs b/OshimaCore/Utils/FunGameService.cs index 267be7a..f853127 100644 --- a/OshimaCore/Utils/FunGameService.cs +++ b/OshimaCore/Utils/FunGameService.cs @@ -38,35 +38,41 @@ namespace Oshima.Core.Utils 1, new() { { General.GameplayEquilibriumConstant.InGameMaterial, 400 }, - { nameof(鍗囧崕涔嬪嵃), 40 } + { nameof(鍗囧崕涔嬪嵃), 20 } } }, { 2, new() { - { General.GameplayEquilibriumConstant.InGameMaterial, 1040 }, - { nameof(鍗囧崕涔嬪嵃), 75 } + { General.GameplayEquilibriumConstant.InGameMaterial, 960 }, + { nameof(鍗囧崕涔嬪嵃), 30 }, + { nameof(娴佸厜涔嬪嵃), 10 } } }, { 3, new() { - { General.GameplayEquilibriumConstant.InGameMaterial, 2320 }, - { nameof(鍗囧崕涔嬪嵃), 115 } + { General.GameplayEquilibriumConstant.InGameMaterial, 1760 }, + { nameof(鍗囧崕涔嬪嵃), 40 }, + { nameof(娴佸厜涔嬪嵃), 20 } } }, { 4, new() { - { General.GameplayEquilibriumConstant.InGameMaterial, 4880 }, - { nameof(鍗囧崕涔嬪嵃), 160 } + { General.GameplayEquilibriumConstant.InGameMaterial, 2800 }, + { nameof(鍗囧崕涔嬪嵃), 50 }, + { nameof(娴佸厜涔嬪嵃), 30 }, + { nameof(姘告亽涔嬪嵃), 10 } } }, { 5, new() { - { General.GameplayEquilibriumConstant.InGameMaterial, 10000 }, - { nameof(鍗囧崕涔嬪嵃), 210 } + { General.GameplayEquilibriumConstant.InGameMaterial, 4080 }, + { nameof(鍗囧崕涔嬪嵃), 60 }, + { nameof(娴佸厜涔嬪嵃), 40 }, + { nameof(姘告亽涔嬪嵃), 20 } } }, }; @@ -98,7 +104,7 @@ namespace Oshima.Core.Utils Equipment.AddRange([new 鏀诲嚮涔嬬埅5(), new 鏀诲嚮涔嬬埅15(), new 鏀诲嚮涔嬬埅25(), new 鏀诲嚮涔嬬埅35()]); Items.AddRange(exItems.Values.Where(i => (int)i.ItemType > 4)); - Items.AddRange([new 灏忕粡楠屼功(), new 涓粡楠屼功(), new 澶х粡楠屼功(), new 鍗囧崕涔嬪嵃()]); + Items.AddRange([new 灏忕粡楠屼功(), new 涓粡楠屼功(), new 澶х粡楠屼功(), new 鍗囧崕涔嬪嵃(), new 娴佸厜涔嬪嵃(), new 姘告亽涔嬪嵃()]); AllItems.AddRange(Equipment); AllItems.AddRange(Items); diff --git a/OshimaModules/Effects/OpenEffects/AccelerationCoefficient.cs b/OshimaModules/Effects/OpenEffects/AccelerationCoefficient.cs index 4c968d5..e1e1e31 100644 --- a/OshimaModules/Effects/OpenEffects/AccelerationCoefficient.cs +++ b/OshimaModules/Effects/OpenEffects/AccelerationCoefficient.cs @@ -15,12 +15,12 @@ namespace Oshima.FunGame.OshimaModules.Effects.OpenEffects public override void OnEffectGained(Character character) { - character.AccelerationCoefficient += 瀹為檯鍔犳垚; + character.ExAccelerationCoefficient += 瀹為檯鍔犳垚; } public override void OnEffectLost(Character character) { - character.AccelerationCoefficient -= 瀹為檯鍔犳垚; + character.ExAccelerationCoefficient -= 瀹為檯鍔犳垚; } public AccelerationCoefficient(Skill skill, Dictionary args, Character? source = null) : base(skill, args) diff --git a/OshimaModules/Items/ItemID.cs b/OshimaModules/Items/ItemID.cs index dd66cf4..530d60b 100644 --- a/OshimaModules/Items/ItemID.cs +++ b/OshimaModules/Items/ItemID.cs @@ -18,5 +18,7 @@ public enum SpecialItemID : long { 鍗囧崕涔嬪嵃 = 18001, + 娴佸厜涔嬪嵃 = 18002, + 姘告亽涔嬪嵃 = 18003, } } diff --git a/OshimaModules/Items/SpecialItem/鍗囧崕涔嬪嵃.cs b/OshimaModules/Items/SpecialItem/鍗囧崕涔嬪嵃.cs index 4c790c2..ed84dde 100644 --- a/OshimaModules/Items/SpecialItem/鍗囧崕涔嬪嵃.cs +++ b/OshimaModules/Items/SpecialItem/鍗囧崕涔嬪嵃.cs @@ -7,6 +7,7 @@ namespace Oshima.FunGame.OshimaModules.Items { public override long Id => (long)SpecialItemID.鍗囧崕涔嬪嵃; public override string Name => "鍗囧崕涔嬪嵃"; - public override string Description => Skills.Passives.Count > 0 ? Skills.Passives.First().Description : ""; + public override string Description => "瑙掕壊绐佺牬绛夐樁蹇呭鐨勫垵绾ф潗鏂欍"; + public override QualityType QualityType => QualityType.White; } } diff --git a/OshimaModules/Items/SpecialItem/姘告亽涔嬪嵃.cs b/OshimaModules/Items/SpecialItem/姘告亽涔嬪嵃.cs new file mode 100644 index 0000000..83a87c5 --- /dev/null +++ b/OshimaModules/Items/SpecialItem/姘告亽涔嬪嵃.cs @@ -0,0 +1,13 @@ +锘縰sing Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Oshima.FunGame.OshimaModules.Items +{ + public class 姘告亽涔嬪嵃() : Item(ItemType.SpecialItem) + { + public override long Id => (long)SpecialItemID.姘告亽涔嬪嵃; + public override string Name => "姘告亽涔嬪嵃"; + public override string Description => "瑙掕壊绐佺牬绛夐樁蹇呭鐨勯珮绾ф潗鏂欍"; + public override QualityType QualityType => QualityType.Blue; + } +} diff --git a/OshimaModules/Items/SpecialItem/娴佸厜涔嬪嵃.cs b/OshimaModules/Items/SpecialItem/娴佸厜涔嬪嵃.cs new file mode 100644 index 0000000..066c928 --- /dev/null +++ b/OshimaModules/Items/SpecialItem/娴佸厜涔嬪嵃.cs @@ -0,0 +1,13 @@ +锘縰sing Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Oshima.FunGame.OshimaModules.Items +{ + public class 娴佸厜涔嬪嵃() : Item(ItemType.SpecialItem) + { + public override long Id => (long)SpecialItemID.娴佸厜涔嬪嵃; + public override string Name => "娴佸厜涔嬪嵃"; + public override string Description => "瑙掕壊绐佺牬绛夐樁蹇呭鐨勪腑绾ф潗鏂欍"; + public override QualityType QualityType => QualityType.Green; + } +} diff --git a/OshimaModules/Modules/ItemModule.cs b/OshimaModules/Modules/ItemModule.cs index 6327cc1..2e699f8 100644 --- a/OshimaModules/Modules/ItemModule.cs +++ b/OshimaModules/Modules/ItemModule.cs @@ -33,6 +33,8 @@ namespace Oshima.FunGame.OshimaModules (long)ConsumableID.涓粡楠屼功 => new 涓粡楠屼功(), (long)ConsumableID.澶х粡楠屼功 => new 澶х粡楠屼功(), (long)SpecialItemID.鍗囧崕涔嬪嵃 => new 鍗囧崕涔嬪嵃(), + (long)SpecialItemID.娴佸厜涔嬪嵃 => new 娴佸厜涔嬪嵃(), + (long)SpecialItemID.姘告亽涔嬪嵃 => new 姘告亽涔嬪嵃(), _ => null, }; };