From 64f8ff961ac210e5b712dd4eb9de700f624468d7 Mon Sep 17 00:00:00 2001 From: milimoe Date: Sat, 4 Jan 2025 02:53:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=96=B0=E7=9A=84=E7=89=A9?= =?UTF-8?q?=E5=93=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- OshimaCore/Controllers/FunGameController.cs | 52 ++++++- OshimaCore/Utils/FunGameService.cs | 15 +- OshimaModules/Items/Accessory/攻击之爪.cs | 48 +++--- OshimaModules/Items/Consumable/回复药.cs | 149 +++++++++++++++++++ OshimaModules/Items/Consumable/能量饮料.cs | 149 +++++++++++++++++++ OshimaModules/Items/Consumable/魔力填充剂.cs | 149 +++++++++++++++++++ OshimaModules/Items/ItemID.cs | 17 ++- OshimaModules/Modules/ItemModule.cs | 15 +- OshimaModules/Skills/SkillID.cs | 3 + 9 files changed, 561 insertions(+), 36 deletions(-) create mode 100644 OshimaModules/Items/Consumable/回复药.cs create mode 100644 OshimaModules/Items/Consumable/能量饮料.cs create mode 100644 OshimaModules/Items/Consumable/魔力填充剂.cs diff --git a/OshimaCore/Controllers/FunGameController.cs b/OshimaCore/Controllers/FunGameController.cs index dbe0af6..d604576 100644 --- a/OshimaCore/Controllers/FunGameController.cs +++ b/OshimaCore/Controllers/FunGameController.cs @@ -259,7 +259,7 @@ namespace Oshima.Core.Controllers character = FunGameService.Characters[1].Copy(); msg.Add($"技能展示的属性基于演示角色:[ {character} ]"); } - IEnumerable skills = FunGameService.Skills.Union(FunGameService.Magics); + IEnumerable skills = FunGameService.AllSkills; if (id != null && FunGameService.Characters.Count > 1) { Skill? skill = skills.Where(s => s.Id == id).FirstOrDefault()?.Copy(); @@ -279,6 +279,46 @@ namespace Oshima.Core.Controllers return NetworkUtility.JsonSerialize(""); } + + [HttpGet("skillinfoname")] + public string GetSkillInfo_Name([FromQuery] long? qq = null, [FromQuery] string? name = null) + { + long userid = qq ?? Convert.ToInt64("10" + Verification.CreateVerifyCode(VerifyCodeType.NumberVerifyCode, 11)); + PluginConfig pc = new("saved", userid.ToString()); + pc.LoadConfig(); + List msg = []; + Character? character = null; + if (pc.Count > 0) + { + User user = FunGameService.GetUser(pc); + character = user.Inventory.MainCharacter; + msg.Add($"技能展示的属性基于你的主战角色:[ {character} ]"); + } + else + { + character = FunGameService.Characters[1].Copy(); + msg.Add($"技能展示的属性基于演示角色:[ {character} ]"); + } + IEnumerable skills = FunGameService.AllSkills; + if (name != null && FunGameService.Characters.Count > 1) + { + Skill? skill = skills.Where(s => s.Name == name).FirstOrDefault()?.Copy(); + if (skill != null) + { + msg.Add(character.ToStringWithLevel() + "\r\n" + skill.ToString()); + skill.Character = character; + skill.Level++; ; + msg.Add(character.ToStringWithLevel() + "\r\n" + skill.ToString()); + character.Level = General.GameplayEquilibriumConstant.MaxLevel; + skill.Level = skill.IsMagic ? General.GameplayEquilibriumConstant.MaxMagicLevel : General.GameplayEquilibriumConstant.MaxSkillLevel; + msg.Add(character.ToStringWithLevel() + "\r\n" + skill.ToString()); + + return NetworkUtility.JsonSerialize(string.Join("\r\n", msg)); + } + } + + return NetworkUtility.JsonSerialize(""); + } [HttpGet("iteminfo")] public string GetItemInfo([FromQuery] long? qq = null, [FromQuery] long? id = null) @@ -1555,6 +1595,8 @@ namespace Oshima.Core.Controllers if (user1 != null && user2 != null) { + user1.Inventory.MainCharacter.Recovery(EP: 200); + user2.Inventory.MainCharacter.Recovery(EP: 200); return FunGameActionQueue.NewAndStartGame([user1.Inventory.MainCharacter, user2.Inventory.MainCharacter], false, false, false, false, showAllRound); } else @@ -1645,8 +1687,12 @@ namespace Oshima.Core.Controllers if (user1 != null && user2 != null) { - Character[] squad1 = [.. user1.Inventory.Characters.Where(c => user1.Inventory.Squad.Contains(c.Id)).Select(c => c.Copy())]; - Character[] squad2 = [.. user2.Inventory.Characters.Where(c => user2.Inventory.Squad.Contains(c.Id)).Select(c => c.Copy())]; + Character[] squad1 = [.. user1.Inventory.Characters.Where(c => user1.Inventory.Squad.Contains(c.Id)).Select(c => c)]; + Character[] squad2 = [.. user2.Inventory.Characters.Where(c => user2.Inventory.Squad.Contains(c.Id)).Select(c => c)]; + foreach (Character character in squad1.Union(squad2)) + { + character.Recovery(EP: 200); + } Team team1 = new($"{user1.Username}的小队", squad1); Team team2 = new($"{user2.Username}的小队", squad2); return FunGameActionQueue.NewAndStartTeamGame([team1, team2], 0, 0, false, false, false, false, showAllRound); diff --git a/OshimaCore/Utils/FunGameService.cs b/OshimaCore/Utils/FunGameService.cs index 16b74af..6c3d133 100644 --- a/OshimaCore/Utils/FunGameService.cs +++ b/OshimaCore/Utils/FunGameService.cs @@ -15,6 +15,8 @@ namespace Oshima.Core.Utils { public static List Characters { get; } = []; public static List Skills { get; } = []; + public static List PassiveSkills { get; } = []; + public static List SuperSkills { get; } = []; public static List Magics { get; } = []; public static List Equipment { get; } = []; public static List Items { get; } = []; @@ -41,15 +43,20 @@ namespace Oshima.Core.Utils Skills.AddRange([new 疾风步()]); + SuperSkills.AddRange([new 嗜血本能(), new 平衡强化(), new 绝对领域(), new 精准打击(), new 三重叠加(), new 变幻之心(), new 力量爆发(), new 能量毁灭(), new 血之狂欢(), new 迅捷之势(), new 天赐之力(), new 魔法涌流()]); + + PassiveSkills.AddRange([new META马(), new 心灵之火(), new 魔法震荡(), new 灵能反射(), new 智慧与力量(), new 致命打击(), new 毁灭之势(), new 枯竭打击(), new 破釜沉舟(), new 累积之压(), new 敏捷之刃(), new 弱者猎手()]); + Magics.AddRange([new 冰霜攻击(), new 火之矢(), new 水之矢(), new 风之轮(), new 石之锤(), new 心灵之霞(), new 次元上升(), new 暗物质(), new 回复术(), new 治愈术(), new 时间加速(), new 时间减速(), new 沉默十字(), new 反魔法领域()]); Dictionary exItems = Factory.GetGameModuleInstances(OshimaGameModuleConstant.General, OshimaGameModuleConstant.Item); Equipment.AddRange(exItems.Values.Where(i => (int)i.ItemType >= 0 && (int)i.ItemType < 5)); - Equipment.AddRange([new 攻击之爪5(), new 攻击之爪15(), new 攻击之爪25(), new 攻击之爪35()]); + Equipment.AddRange([new 攻击之爪8(), new 攻击之爪20(), new 攻击之爪35(), new 攻击之爪50()]); Items.AddRange(exItems.Values.Where(i => (int)i.ItemType > 4)); - Items.AddRange([new 小经验书(), new 中经验书(), new 大经验书(), new 升华之印(), new 流光之印(), new 永恒之印(), new 技能卷轴(), new 智慧之果(), new 奥术符文(), new 混沌之核()]); + Items.AddRange([new 小经验书(), new 中经验书(), new 大经验书(), new 升华之印(), new 流光之印(), new 永恒之印(), new 技能卷轴(), new 智慧之果(), new 奥术符文(), new 混沌之核(), + new 小回复药(), new 中回复药(), new 大回复药(), new 魔力填充剂1(), new 魔力填充剂2(), new 魔力填充剂3(), new 能量饮料1(), new 能量饮料2(), new 能量饮料3()]); AllItems.AddRange(Equipment); AllItems.AddRange(Items); @@ -65,7 +72,9 @@ namespace Oshima.Core.Utils ItemSkills.AddRange([.. Equipment.SelectMany(i => i.Skills.Passives), .. Items.SelectMany(i => i.Skills.Passives)]); AllSkills.AddRange(Skills); + AllSkills.AddRange(PassiveSkills); AllSkills.AddRange(ItemSkills); + AllSkills.AddRange(SuperSkills); } public static List GenerateMagicCards(int count, QualityType? qualityType = null) @@ -363,6 +372,8 @@ namespace Oshima.Core.Utils Characters.Clear(); Equipment.Clear(); Skills.Clear(); + SuperSkills.Clear(); + PassiveSkills.Clear(); Magics.Clear(); AllItems.Clear(); ItemSkills.Clear(); diff --git a/OshimaModules/Items/Accessory/攻击之爪.cs b/OshimaModules/Items/Accessory/攻击之爪.cs index 6c7e389..4953eff 100644 --- a/OshimaModules/Items/Accessory/攻击之爪.cs +++ b/OshimaModules/Items/Accessory/攻击之爪.cs @@ -5,42 +5,29 @@ using Oshima.FunGame.OshimaModules.Skills; namespace Oshima.FunGame.OshimaModules.Items { - public class 攻击之爪5 : Item + public class 攻击之爪8 : Item { - public override long Id => (long)AccessoryID.攻击之爪5; - public override string Name => "攻击之爪 +5"; + public override long Id => (long)AccessoryID.攻击之爪8; + public override string Name => "攻击之爪 +8"; public override string Description => Skills.Passives.Count > 0 ? Skills.Passives.First().Description : ""; public override QualityType QualityType => QualityType.White; - public 攻击之爪5(Character? character = null) : base(ItemType.Accessory) + public 攻击之爪8(Character? character = null) : base(ItemType.Accessory) { - Skills.Passives.Add(new 攻击之爪技能(character, this, 5)); + Skills.Passives.Add(new 攻击之爪技能(character, this, 8)); } } - public class 攻击之爪15 : Item + public class 攻击之爪20 : Item { - public override long Id => (long)AccessoryID.攻击之爪15; - public override string Name => "攻击之爪 +15"; + public override long Id => (long)AccessoryID.攻击之爪20; + public override string Name => "攻击之爪 +20"; public override string Description => Skills.Passives.Count > 0 ? Skills.Passives.First().Description : ""; public override QualityType QualityType => QualityType.Green; - public 攻击之爪15(Character? character = null) : base(ItemType.Accessory) + public 攻击之爪20(Character? character = null) : base(ItemType.Accessory) { - Skills.Passives.Add(new 攻击之爪技能(character, this, 15)); - } - } - - public class 攻击之爪25 : Item - { - public override long Id => (long)AccessoryID.攻击之爪25; - public override string Name => "攻击之爪 +25"; - public override string Description => Skills.Passives.Count > 0 ? Skills.Passives.First().Description : ""; - public override QualityType QualityType => QualityType.Blue; - - public 攻击之爪25(Character? character = null) : base(ItemType.Accessory) - { - Skills.Passives.Add(new 攻击之爪技能(character, this, 25)); + Skills.Passives.Add(new 攻击之爪技能(character, this, 20)); } } @@ -49,13 +36,26 @@ namespace Oshima.FunGame.OshimaModules.Items public override long Id => (long)AccessoryID.攻击之爪35; public override string Name => "攻击之爪 +35"; public override string Description => Skills.Passives.Count > 0 ? Skills.Passives.First().Description : ""; - public override QualityType QualityType => QualityType.Purple; + public override QualityType QualityType => QualityType.Blue; public 攻击之爪35(Character? character = null) : base(ItemType.Accessory) { Skills.Passives.Add(new 攻击之爪技能(character, this, 35)); } } + + public class 攻击之爪50 : Item + { + public override long Id => (long)AccessoryID.攻击之爪50; + public override string Name => "攻击之爪 +50"; + public override string Description => Skills.Passives.Count > 0 ? Skills.Passives.First().Description : ""; + public override QualityType QualityType => QualityType.Purple; + + public 攻击之爪50(Character? character = null) : base(ItemType.Accessory) + { + Skills.Passives.Add(new 攻击之爪技能(character, this, 50)); + } + } public class 攻击之爪技能 : Skill { diff --git a/OshimaModules/Items/Consumable/回复药.cs b/OshimaModules/Items/Consumable/回复药.cs new file mode 100644 index 0000000..3c643ff --- /dev/null +++ b/OshimaModules/Items/Consumable/回复药.cs @@ -0,0 +1,149 @@ +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; +using Oshima.FunGame.OshimaModules.Effects.ItemEffects; +using Oshima.FunGame.OshimaModules.Skills; + +namespace Oshima.FunGame.OshimaModules.Items +{ + public class 回复药 + { + public interface HPBook + { + public double HP { get; set; } + } + + public static void Init(Item item, double exp, int remainUseTimes = 1) + { + item.Skills.Active = new 回复药技能(item, exp); + item.RemainUseTimes = remainUseTimes; + item.IsInGameItem = false; + item.IsReduceTimesAfterUse = true; + item.IsRemoveAfterUse = true; + } + + public static string UseItem(Item item, Character character) + { + if (item.Skills.Active != null) + { + item.Skills.Active.OnSkillCasted([character]); + string msg = $"对角色 [ {character} ] 使用 [ {item.Name} ] 成功!"; + if (item is HPBook hpBook) + { + msg += $"回复了 {hpBook.HP} 点生命值!"; + } + return msg; + } + return "此物品没有主动技能,无法被使用!"; + } + + public static bool OnItemUsed(Item item, Dictionary args) + { + string msg = ""; + bool result = false; + Character[] targets = []; + string key = args.Keys.FirstOrDefault(s => s.Equals("targets", StringComparison.CurrentCultureIgnoreCase)) ?? ""; + if (key != "" && args.TryGetValue(key, out object? value) && value is Character[] temp) + { + if (temp.Length > 0) + { + targets = [temp[0]]; + msg = UseItem(item, temp[0]); + result = true; + } + else + { + msg = $"使用物品失败,没有作用目标!"; + } + } + args["msg"] = msg; + key = args.Keys.FirstOrDefault(s => s.Equals("useCount", StringComparison.CurrentCultureIgnoreCase)) ?? ""; + if (key != "" && args.TryGetValue(key, out value) && value is int count && targets.Length > 0) + { + string truemsg = $"对角色 [ {targets[0]} ] 使用 {count} 个 [ {item.Name} ] 成功!"; + if (item is HPBook expBook) + { + truemsg += $"回复了 {expBook.HP * count} 点生命值!"; + } + args["truemsg"] = truemsg; + } + return result; + } + } + + public class 小回复药 : Item, 回复药.HPBook + { + public override long Id => (long)ConsumableID.小回复药; + public override string Name => "小回复药"; + public override string Description => Skills.Active?.Description ?? ""; + public override QualityType QualityType => QualityType.White; + public double HP { get; set; } = 300; + + public 小回复药(User? user = null, int remainUseTimes = 1) : base(ItemType.Consumable) + { + User = user; + 回复药.Init(this, HP, remainUseTimes); + } + + protected override bool OnItemUsed(Dictionary args) + { + return 回复药.OnItemUsed(this, args); + } + } + + public class 中回复药 : Item, 回复药.HPBook + { + public override long Id => (long)ConsumableID.中回复药; + public override string Name => "中回复药"; + public override string Description => Skills.Active?.Description ?? ""; + public override QualityType QualityType => QualityType.Green; + public double HP { get; set; } = 700; + + public 中回复药(User? user = null, int remainUseTimes = 1) : base(ItemType.Consumable) + { + User = user; + 回复药.Init(this, HP, remainUseTimes); + } + + protected override bool OnItemUsed(Dictionary args) + { + return 回复药.OnItemUsed(this, args); + } + } + + public class 大回复药 : Item, 回复药.HPBook + { + public override long Id => (long)ConsumableID.大回复药; + public override string Name => "大回复药"; + public override string Description => Skills.Active?.Description ?? ""; + public override QualityType QualityType => QualityType.Blue; + public double HP { get; set; } = 1500; + + public 大回复药(User? user = null, int remainUseTimes = 1) : base(ItemType.Consumable) + { + User = user; + 回复药.Init(this, HP, remainUseTimes); + } + + protected override bool OnItemUsed(Dictionary args) + { + return 回复药.OnItemUsed(this, args); + } + } + + public class 回复药技能 : Skill + { + public override long Id => (long)ItemActiveID.回复药; + public override string Name => "回复药"; + public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; + + public 回复药技能(Item? item = null, double hp = 0) : base(SkillType.Item) + { + Level = 1; + Item = item; + Effects.Add(new RecoverHP(this, new() + { + { "hp", hp } + })); + } + } +} diff --git a/OshimaModules/Items/Consumable/能量饮料.cs b/OshimaModules/Items/Consumable/能量饮料.cs new file mode 100644 index 0000000..ebc1178 --- /dev/null +++ b/OshimaModules/Items/Consumable/能量饮料.cs @@ -0,0 +1,149 @@ +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; +using Oshima.FunGame.OshimaModules.Effects.ItemEffects; +using Oshima.FunGame.OshimaModules.Skills; + +namespace Oshima.FunGame.OshimaModules.Items +{ + public class 能量饮料 + { + public interface EPBook + { + public double EP { get; set; } + } + + public static void Init(Item item, double exp, int remainUseTimes = 1) + { + item.Skills.Active = new 能量饮料技能(item, exp); + item.RemainUseTimes = remainUseTimes; + item.IsInGameItem = false; + item.IsReduceTimesAfterUse = true; + item.IsRemoveAfterUse = true; + } + + public static string UseItem(Item item, Character character) + { + if (item.Skills.Active != null) + { + item.Skills.Active.OnSkillCasted([character]); + string msg = $"对角色 [ {character} ] 使用 [ {item.Name} ] 成功!"; + if (item is EPBook hpBook) + { + msg += $"回复了 {hpBook.EP} 点能量值!"; + } + return msg; + } + return "此物品没有主动技能,无法被使用!"; + } + + public static bool OnItemUsed(Item item, Dictionary args) + { + string msg = ""; + bool result = false; + Character[] targets = []; + string key = args.Keys.FirstOrDefault(s => s.Equals("targets", StringComparison.CurrentCultureIgnoreCase)) ?? ""; + if (key != "" && args.TryGetValue(key, out object? value) && value is Character[] temp) + { + if (temp.Length > 0) + { + targets = [temp[0]]; + msg = UseItem(item, temp[0]); + result = true; + } + else + { + msg = $"使用物品失败,没有作用目标!"; + } + } + args["msg"] = msg; + key = args.Keys.FirstOrDefault(s => s.Equals("useCount", StringComparison.CurrentCultureIgnoreCase)) ?? ""; + if (key != "" && args.TryGetValue(key, out value) && value is int count && targets.Length > 0) + { + string truemsg = $"对角色 [ {targets[0]} ] 使用 {count} 个 [ {item.Name} ] 成功!"; + if (item is EPBook expBook) + { + truemsg += $"回复了 {expBook.EP * count} 点能量值!"; + } + args["truemsg"] = truemsg; + } + return result; + } + } + + public class 能量饮料1 : Item, 能量饮料.EPBook + { + public override long Id => (long)ConsumableID.能量饮料1; + public override string Name => "能量饮料"; + public override string Description => Skills.Active?.Description ?? ""; + public override QualityType QualityType => QualityType.Green; + public double EP { get; set; } = 50; + + public 能量饮料1(User? user = null, int remainUseTimes = 1) : base(ItemType.Consumable) + { + User = user; + 能量饮料.Init(this, EP, remainUseTimes); + } + + protected override bool OnItemUsed(Dictionary args) + { + return 能量饮料.OnItemUsed(this, args); + } + } + + public class 能量饮料2 : Item, 能量饮料.EPBook + { + public override long Id => (long)ConsumableID.能量饮料2; + public override string Name => "能量饮料 Pro"; + public override string Description => Skills.Active?.Description ?? ""; + public override QualityType QualityType => QualityType.Blue; + public double EP { get; set; } = 100; + + public 能量饮料2(User? user = null, int remainUseTimes = 1) : base(ItemType.Consumable) + { + User = user; + 能量饮料.Init(this, EP, remainUseTimes); + } + + protected override bool OnItemUsed(Dictionary args) + { + return 能量饮料.OnItemUsed(this, args); + } + } + + public class 能量饮料3 : Item, 能量饮料.EPBook + { + public override long Id => (long)ConsumableID.能量饮料3; + public override string Name => "能量饮料 Pro Max"; + public override string Description => Skills.Active?.Description ?? ""; + public override QualityType QualityType => QualityType.Purple; + public double EP { get; set; } = 200; + + public 能量饮料3(User? user = null, int remainUseTimes = 1) : base(ItemType.Consumable) + { + User = user; + 能量饮料.Init(this, EP, remainUseTimes); + } + + protected override bool OnItemUsed(Dictionary args) + { + return 能量饮料.OnItemUsed(this, args); + } + } + + public class 能量饮料技能 : Skill + { + public override long Id => (long)ItemActiveID.能量饮料; + public override string Name => "能量饮料"; + public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; + + public 能量饮料技能(Item? item = null, double ep = 0) : base(SkillType.Item) + { + Level = 1; + Item = item; + Effects.Add(new GetEP(this, new() + { + { "ep", ep } + })); + } + } +} diff --git a/OshimaModules/Items/Consumable/魔力填充剂.cs b/OshimaModules/Items/Consumable/魔力填充剂.cs new file mode 100644 index 0000000..ae753ac --- /dev/null +++ b/OshimaModules/Items/Consumable/魔力填充剂.cs @@ -0,0 +1,149 @@ +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; +using Oshima.FunGame.OshimaModules.Effects.ItemEffects; +using Oshima.FunGame.OshimaModules.Skills; + +namespace Oshima.FunGame.OshimaModules.Items +{ + public class 魔力填充剂 + { + public interface MPBook + { + public double MP { get; set; } + } + + public static void Init(Item item, double exp, int remainUseTimes = 1) + { + item.Skills.Active = new 魔力填充剂技能(item, exp); + item.RemainUseTimes = remainUseTimes; + item.IsInGameItem = false; + item.IsReduceTimesAfterUse = true; + item.IsRemoveAfterUse = true; + } + + public static string UseItem(Item item, Character character) + { + if (item.Skills.Active != null) + { + item.Skills.Active.OnSkillCasted([character]); + string msg = $"对角色 [ {character} ] 使用 [ {item.Name} ] 成功!"; + if (item is MPBook hpBook) + { + msg += $"回复了 {hpBook.MP} 点魔法值!"; + } + return msg; + } + return "此物品没有主动技能,无法被使用!"; + } + + public static bool OnItemUsed(Item item, Dictionary args) + { + string msg = ""; + bool result = false; + Character[] targets = []; + string key = args.Keys.FirstOrDefault(s => s.Equals("targets", StringComparison.CurrentCultureIgnoreCase)) ?? ""; + if (key != "" && args.TryGetValue(key, out object? value) && value is Character[] temp) + { + if (temp.Length > 0) + { + targets = [temp[0]]; + msg = UseItem(item, temp[0]); + result = true; + } + else + { + msg = $"使用物品失败,没有作用目标!"; + } + } + args["msg"] = msg; + key = args.Keys.FirstOrDefault(s => s.Equals("useCount", StringComparison.CurrentCultureIgnoreCase)) ?? ""; + if (key != "" && args.TryGetValue(key, out value) && value is int count && targets.Length > 0) + { + string truemsg = $"对角色 [ {targets[0]} ] 使用 {count} 个 [ {item.Name} ] 成功!"; + if (item is MPBook expBook) + { + truemsg += $"回复了 {expBook.MP * count} 点魔法值!"; + } + args["truemsg"] = truemsg; + } + return result; + } + } + + public class 魔力填充剂1 : Item, 魔力填充剂.MPBook + { + public override long Id => (long)ConsumableID.魔力填充剂1; + public override string Name => "魔力填充剂Ⅰ型"; + public override string Description => Skills.Active?.Description ?? ""; + public override QualityType QualityType => QualityType.White; + public double MP { get; set; } = 300; + + public 魔力填充剂1(User? user = null, int remainUseTimes = 1) : base(ItemType.Consumable) + { + User = user; + 魔力填充剂.Init(this, MP, remainUseTimes); + } + + protected override bool OnItemUsed(Dictionary args) + { + return 魔力填充剂.OnItemUsed(this, args); + } + } + + public class 魔力填充剂2 : Item, 魔力填充剂.MPBook + { + public override long Id => (long)ConsumableID.魔力填充剂2; + public override string Name => "魔力填充剂Ⅱ型"; + public override string Description => Skills.Active?.Description ?? ""; + public override QualityType QualityType => QualityType.Green; + public double MP { get; set; } = 700; + + public 魔力填充剂2(User? user = null, int remainUseTimes = 1) : base(ItemType.Consumable) + { + User = user; + 魔力填充剂.Init(this, MP, remainUseTimes); + } + + protected override bool OnItemUsed(Dictionary args) + { + return 魔力填充剂.OnItemUsed(this, args); + } + } + + public class 魔力填充剂3 : Item, 魔力填充剂.MPBook + { + public override long Id => (long)ConsumableID.魔力填充剂3; + public override string Name => "魔力填充剂Ⅲ型"; + public override string Description => Skills.Active?.Description ?? ""; + public override QualityType QualityType => QualityType.Blue; + public double MP { get; set; } = 1500; + + public 魔力填充剂3(User? user = null, int remainUseTimes = 1) : base(ItemType.Consumable) + { + User = user; + 魔力填充剂.Init(this, MP, remainUseTimes); + } + + protected override bool OnItemUsed(Dictionary args) + { + return 魔力填充剂.OnItemUsed(this, args); + } + } + + public class 魔力填充剂技能 : Skill + { + public override long Id => (long)ItemActiveID.魔力填充剂; + public override string Name => "魔力填充剂"; + public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; + + public 魔力填充剂技能(Item? item = null, double mp = 0) : base(SkillType.Item) + { + Level = 1; + Item = item; + Effects.Add(new RecoverMP(this, new() + { + { "mp", mp } + })); + } + } +} diff --git a/OshimaModules/Items/ItemID.cs b/OshimaModules/Items/ItemID.cs index 1d08379..c2a94ab 100644 --- a/OshimaModules/Items/ItemID.cs +++ b/OshimaModules/Items/ItemID.cs @@ -2,10 +2,10 @@ { public enum AccessoryID : long { - 攻击之爪5 = 14001, - 攻击之爪15 = 14002, - 攻击之爪25 = 14003, - 攻击之爪35 = 14004, + 攻击之爪8 = 14001, + 攻击之爪20 = 14002, + 攻击之爪35 = 14003, + 攻击之爪50 = 14004, } public enum ConsumableID : long @@ -13,6 +13,15 @@ 小经验书 = 15001, 中经验书 = 15002, 大经验书 = 15003, + 小回复药 = 15004, + 中回复药 = 15005, + 大回复药 = 15006, + 魔力填充剂1 = 15007, + 魔力填充剂2 = 15008, + 魔力填充剂3 = 15009, + 能量饮料1 = 15010, + 能量饮料2 = 15011, + 能量饮料3 = 15012, } public enum SpecialItemID : long diff --git a/OshimaModules/Modules/ItemModule.cs b/OshimaModules/Modules/ItemModule.cs index 73010c9..2e16ccb 100644 --- a/OshimaModules/Modules/ItemModule.cs +++ b/OshimaModules/Modules/ItemModule.cs @@ -25,10 +25,10 @@ namespace Oshima.FunGame.OshimaModules { return id switch { - (long)AccessoryID.攻击之爪5 => new 攻击之爪5(), - (long)AccessoryID.攻击之爪15 => new 攻击之爪15(), - (long)AccessoryID.攻击之爪25 => new 攻击之爪25(), + (long)AccessoryID.攻击之爪8 => new 攻击之爪8(), + (long)AccessoryID.攻击之爪20 => new 攻击之爪20(), (long)AccessoryID.攻击之爪35 => new 攻击之爪35(), + (long)AccessoryID.攻击之爪50 => new 攻击之爪50(), (long)ConsumableID.小经验书 => new 小经验书(), (long)ConsumableID.中经验书 => new 中经验书(), (long)ConsumableID.大经验书 => new 大经验书(), @@ -39,6 +39,15 @@ namespace Oshima.FunGame.OshimaModules (long)SpecialItemID.智慧之果 => new 智慧之果(), (long)SpecialItemID.奥术符文 => new 奥术符文(), (long)SpecialItemID.混沌之核 => new 混沌之核(), + (long)ConsumableID.小回复药 => new 小回复药(), + (long)ConsumableID.中回复药 => new 中回复药(), + (long)ConsumableID.大回复药 => new 大回复药(), + (long)ConsumableID.魔力填充剂1 => new 魔力填充剂1(), + (long)ConsumableID.魔力填充剂2 => new 魔力填充剂2(), + (long)ConsumableID.魔力填充剂3 => new 魔力填充剂3(), + (long)ConsumableID.能量饮料1 => new 能量饮料1(), + (long)ConsumableID.能量饮料2 => new 能量饮料2(), + (long)ConsumableID.能量饮料3 => new 能量饮料3(), _ => null, }; }; diff --git a/OshimaModules/Skills/SkillID.cs b/OshimaModules/Skills/SkillID.cs index 48e9f8a..35034d8 100644 --- a/OshimaModules/Skills/SkillID.cs +++ b/OshimaModules/Skills/SkillID.cs @@ -105,5 +105,8 @@ public enum ItemActiveID : long { 经验书 = 6001, + 回复药 = 6002, + 魔力填充剂 = 6003, + 能量饮料 = 6004 } }