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"; + } } }