From 72d29cff5f2477e281105773b0018cb9082f34ed Mon Sep 17 00:00:00 2001 From: milimoe Date: Mon, 7 Jul 2025 21:52:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86=E4=B8=80=E4=BA=9B=E9=9D=9E=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E5=8C=96=E7=9A=84=E5=B1=9E=E6=80=A7=E7=A7=BB=E5=87=BA?= =?UTF-8?q?=E8=A7=92=E8=89=B2=E5=A4=8D=E5=88=B6=E6=96=B9=E6=B3=95=EF=BC=9B?= =?UTF-8?q?OfferItems=20SQL=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Entity/Character/Character.cs | 40 ++++++++++++--------- Library/SQLScript/Entity/OfferItemsQuery.cs | 14 ++++++++ 2 files changed, 37 insertions(+), 17 deletions(-) diff --git a/Entity/Character/Character.cs b/Entity/Character/Character.cs index b1e1cde..9f40818 100644 --- a/Entity/Character/Character.cs +++ b/Entity/Character/Character.cs @@ -1939,7 +1939,7 @@ namespace Milimoe.FunGame.Core.Entity /// [ 推荐从模组中复制后使用对象 ] /// /// - public Character Copy(bool copyEx = false) + public Character Copy(bool copyEx = false, bool copyMagic = false, bool copyItem = false) { Character c = new() { @@ -1949,13 +1949,11 @@ namespace Milimoe.FunGame.Core.Entity FirstName = FirstName, NickName = NickName, Profile = Profile.Copy(), - MagicType = MagicType, FirstRoleType = FirstRoleType, SecondRoleType = SecondRoleType, ThirdRoleType = ThirdRoleType, Promotion = Promotion, PrimaryAttribute = PrimaryAttribute, - ImmuneType = ImmuneType, Level = Level, LevelBreak = LevelBreak, EXP = EXP, @@ -1964,9 +1962,6 @@ namespace Milimoe.FunGame.Core.Entity EP = EP, InitialATK = InitialATK, InitialDEF = InitialDEF, - MDF = MDF.Copy(), - PhysicalPenetration = PhysicalPenetration, - MagicalPenetration = MagicalPenetration, InitialHR = InitialHR, InitialMR = InitialMR, ER = ER, @@ -1976,10 +1971,7 @@ namespace Milimoe.FunGame.Core.Entity STRGrowth = STRGrowth, AGIGrowth = AGIGrowth, INTGrowth = INTGrowth, - InitialSPD = InitialSPD, - ATR = ATR, - Lifesteal = Lifesteal, - Shield = Shield.Copy() + InitialSPD = InitialSPD }; if (copyEx) { @@ -2006,18 +1998,32 @@ namespace Milimoe.FunGame.Core.Entity c.ExCritRate = ExCritRate; c.ExCritDMG = ExCritDMG; c.ExEvadeRate = ExEvadeRate; + c.PhysicalPenetration = PhysicalPenetration; + c.MagicalPenetration = MagicalPenetration; + c.MDF = MDF.Copy(); + c.Lifesteal = Lifesteal; + c.Shield = Shield.Copy(); + c.ATR = ATR; + c.MagicType = MagicType; + c.ImmuneType = ImmuneType; } foreach (Skill skill in Skills) { - Skill newskill = skill.Copy(); - newskill.Character = c; - c.Skills.Add(newskill); + if (skill.SkillType != SkillType.Magic || copyMagic) + { + Skill newskill = skill.Copy(); + newskill.Character = c; + c.Skills.Add(newskill); + } } - foreach (Item item in Items) + if (copyItem) { - Item newitem = item.Copy(); - newitem.Character = c; - c.Items.Add(newitem); + foreach (Item item in Items) + { + Item newitem = item.Copy(); + newitem.Character = c; + c.Items.Add(newitem); + } } c.Recovery(); return c; diff --git a/Library/SQLScript/Entity/OfferItemsQuery.cs b/Library/SQLScript/Entity/OfferItemsQuery.cs index 20193c5..7b9bd10 100644 --- a/Library/SQLScript/Entity/OfferItemsQuery.cs +++ b/Library/SQLScript/Entity/OfferItemsQuery.cs @@ -65,5 +65,19 @@ namespace Milimoe.FunGame.Core.Library.SQLScript.Entity SQLHelper.Parameters["@OfferId"] = OfferId; return $"{Command_Delete} {Command_From} {TableName_Backup} {Command_Where} {Column_OfferId} = @OfferId"; } + + public static string Delete_OfferItemsByOfferIdAndItemGuid(SQLHelper SQLHelper, long OfferId, Guid ItemGuid) + { + SQLHelper.Parameters["@OfferId"] = OfferId; + SQLHelper.Parameters["@ItemGuid"] = ItemGuid.ToString(); + return $"{Command_Delete} {Command_From} {TableName} {Command_Where} {Column_OfferId} = @OfferId {Command_And} {Column_ItemGuid} = @ItemGuid"; + } + + public static string Delete_OfferItemsBackupByOfferIdAndItemGuid(SQLHelper SQLHelper, long OfferId, Guid ItemGuid) + { + SQLHelper.Parameters["@OfferId"] = OfferId; + SQLHelper.Parameters["@ItemGuid"] = ItemGuid.ToString(); + return $"{Command_Delete} {Command_From} {TableName_Backup} {Command_Where} {Column_OfferId} = @OfferId {Command_And} {Column_ItemGuid} = @ItemGuid"; + } } }