diff --git a/OshimaCore/Controllers/FunGameController.cs b/OshimaCore/Controllers/FunGameController.cs index 5d13aaf..bd8bf88 100644 --- a/OshimaCore/Controllers/FunGameController.cs +++ b/OshimaCore/Controllers/FunGameController.cs @@ -1294,12 +1294,13 @@ namespace Oshima.Core.Controllers } [HttpPost("fightcustom")] - public List FightCustom([FromQuery] long? qq = null, [FromQuery] long? eqq = null) + public List FightCustom([FromQuery] long? qq = null, [FromQuery] long? eqq = null, [FromQuery] bool? all = null) { try { long userid = qq ?? Convert.ToInt64("10" + Verification.CreateVerifyCode(VerifyCodeType.NumberVerifyCode, 11)); long enemyid = eqq ?? Convert.ToInt64("10" + Verification.CreateVerifyCode(VerifyCodeType.NumberVerifyCode, 11)); + bool showAllRound = all ?? false; PluginConfig pc = new("saved", userid.ToString()); pc.LoadConfig(); @@ -1340,7 +1341,7 @@ namespace Oshima.Core.Controllers return [$"对方似乎还没有自建角色,请发送【生成自建角色】创建!"]; } - return FunGameActionQueue.StartGame([character1, character2], false, false, false, false, false); + return FunGameActionQueue.StartGame([character1, character2], false, false, false, false, false, showAllRound); } else { @@ -1354,7 +1355,7 @@ namespace Oshima.Core.Controllers } [HttpPost("fightcustom2")] - public List FightCustom2([FromQuery] long? qq = null, [FromQuery] string? name = null) + public List FightCustom2([FromQuery] long? qq = null, [FromQuery] string? name = null, [FromQuery] bool? all = null) { try { @@ -1365,7 +1366,7 @@ namespace Oshima.Core.Controllers { return [$"找不到此名称对应的玩家!"]; } - return FightCustom(qq, enemyid); + return FightCustom(qq, enemyid, all); } return [$"决斗发起失败!"]; } diff --git a/OshimaCore/Utils/FunGameActionQueue.cs b/OshimaCore/Utils/FunGameActionQueue.cs index 56725a3..257338c 100644 --- a/OshimaCore/Utils/FunGameActionQueue.cs +++ b/OshimaCore/Utils/FunGameActionQueue.cs @@ -561,7 +561,7 @@ namespace Oshima.Core.Utils } } - public static List StartGame(List characters, bool printout, bool isWeb = false, bool isTeam = false, bool deathMatchRoundDetail = false, bool showRoundEndDetail = false) + public static List StartGame(List characters, bool printout, bool isWeb = false, bool isTeam = false, bool deathMatchRoundDetail = false, bool showRoundEndDetail = false, bool showAllRound = false) { PrintOut = printout; IsWeb = isWeb; @@ -746,12 +746,19 @@ namespace Oshima.Core.Utils } string roundMsg = ""; - if (actionQueue.LastRound.HasKill) + if (actionQueue.LastRound.HasKill || showAllRound) { roundMsg = Msg; if (!deathMatchRoundDetail) { - roundMsg = actionQueue.LastRound.ToString().Trim() + $"\r\n{(isTeam ? $"姣斿垎锛歿string.Join(" / ", actionQueue.Teams.Values.Select(t => $"{t.Name}({t.Score})"))}锛屽嚮鏉鏉ヨ嚜{actionQueue.GetTeam(actionQueue.LastRound.Actor)}" : "")}\r\n"; + roundMsg = actionQueue.LastRound.ToString().Trim() + $"\r\n{(isTeam ? $"姣斿垎锛歿string.Join(" / ", actionQueue.Teams.Values.Select(t => $"{t.Name}({t.Score})"))}锛屽嚮鏉鏉ヨ嚜{actionQueue.GetTeam(actionQueue.LastRound.Actor)}" : "")}"; + if (showAllRound) + { + foreach (Character character in actionQueue.Queue) + { + roundMsg += $"[ {character} ] 鐢熷懡鍊硷細{character.HP:0.##}/{character.MaxHP:0.##} / 榄旀硶鍊硷細{character.MP:0.##}/{character.MaxMP:0.##}\r\n"; + } + } } Msg = ""; } diff --git a/OshimaCore/Utils/FunGameService.cs b/OshimaCore/Utils/FunGameService.cs index 93e4ad6..90dea69 100644 --- a/OshimaCore/Utils/FunGameService.cs +++ b/OshimaCore/Utils/FunGameService.cs @@ -6,6 +6,7 @@ using Oshima.FunGame.OshimaModules; using Oshima.FunGame.OshimaModules.Characters; using Oshima.FunGame.OshimaModules.Effects.OpenEffects; using Oshima.FunGame.OshimaModules.Items; +using Oshima.FunGame.OshimaModules.Items.Consumable; using Oshima.FunGame.OshimaModules.Skills; namespace Oshima.Core.Utils @@ -46,6 +47,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 澶х粡楠屼功()]); AllItems.AddRange(Equipment); AllItems.AddRange(Items); @@ -582,6 +584,13 @@ namespace Oshima.Core.Utils user.Inventory.Items.Add(mfk); msg += ItemSet.GetQualityTypeName(mfk.QualityType) + ItemSet.GetItemTypeName(mfk.ItemType) + "銆" + mfk.Name + "銆戯紒\r\n" + mfk.Description; break; + + case 7: + Item 鐗╁搧 = Items[Random.Shared.Next(Items.Count)].Copy(); + SetSellAndTradeTime(鐗╁搧); + user.Inventory.Items.Add(鐗╁搧); + msg += ItemSet.GetQualityTypeName(鐗╁搧.QualityType) + ItemSet.GetItemTypeName(鐗╁搧.ItemType) + "銆" + 鐗╁搧.Name + "銆戯紒\r\n" + 鐗╁搧.Description; + break; case 0: default: diff --git a/OshimaModules/Items/Consumable/缁忛獙涔.cs b/OshimaModules/Items/Consumable/缁忛獙涔.cs new file mode 100644 index 0000000..4d48363 --- /dev/null +++ b/OshimaModules/Items/Consumable/缁忛獙涔.cs @@ -0,0 +1,69 @@ +锘縰sing 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.Consumable +{ + public class 灏忕粡楠屼功 : Item + { + public override long Id => (long)ConsumableID.灏忕粡楠屼功; + public override string Name => "灏忕粡楠屼功"; + public override string Description => Skills.Active?.Description ?? ""; + public override QualityType QualityType => QualityType.White; + + public 灏忕粡楠屼功(User? user = null, int remainUseTimes = 1) : base(ItemType.Consumable) + { + User = user; + Skills.Active = new 缁忛獙涔︽妧鑳(this, 200); + RemainUseTimes = remainUseTimes; + } + } + + public class 涓粡楠屼功 : Item + { + public override long Id => (long)ConsumableID.涓粡楠屼功; + public override string Name => "涓粡楠屼功"; + public override string Description => Skills.Active?.Description ?? ""; + public override QualityType QualityType => QualityType.Green; + + public 涓粡楠屼功(User? user = null, int remainUseTimes = 1) : base(ItemType.Consumable) + { + User = user; + Skills.Active = new 缁忛獙涔︽妧鑳(this, 500); + RemainUseTimes = remainUseTimes; + } + } + + public class 澶х粡楠屼功 : Item + { + public override long Id => (long)ConsumableID.澶х粡楠屼功; + public override string Name => "澶х粡楠屼功"; + public override string Description => Skills.Active?.Description ?? ""; + public override QualityType QualityType => QualityType.Blue; + + public 澶х粡楠屼功(User? user = null, int remainUseTimes = 1) : base(ItemType.Consumable) + { + User = user; + Skills.Active = new 缁忛獙涔︽妧鑳(this, 1000); + RemainUseTimes = remainUseTimes; + } + } + + 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 exp = 0) : base(SkillType.Item) + { + Level = 1; + Item = item; + Effects.Add(new GetEXP(this, new() + { + { "exp", exp } + })); + } + } +} diff --git a/OshimaModules/Items/ItemID.cs b/OshimaModules/Items/ItemID.cs index 4382b04..ea1de79 100644 --- a/OshimaModules/Items/ItemID.cs +++ b/OshimaModules/Items/ItemID.cs @@ -7,4 +7,11 @@ 鏀诲嚮涔嬬埅25 = 14003, 鏀诲嚮涔嬬埅35 = 14004, } + + public enum ConsumableID : long + { + 灏忕粡楠屼功 = 15001, + 涓粡楠屼功 = 15002, + 澶х粡楠屼功 = 15003, + } } diff --git a/OshimaModules/Skills/SkillID.cs b/OshimaModules/Skills/SkillID.cs index 5fdf3bb..48e9f8a 100644 --- a/OshimaModules/Skills/SkillID.cs +++ b/OshimaModules/Skills/SkillID.cs @@ -104,6 +104,6 @@ public enum ItemActiveID : long { - + 缁忛獙涔 = 6001, } }