From 0310f9737bc9f20ac9bb0551aa6bbb0b5afab91a Mon Sep 17 00:00:00 2001 From: milimoe Date: Mon, 22 Dec 2025 01:49:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=97=A0=E6=B3=95=E8=8E=B7?= =?UTF-8?q?=E5=BE=97=E9=AD=94=E6=B3=95=E5=8D=A1=E7=A4=BC=E5=8C=85=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- OshimaServers/Service/FunGameService.cs | 27 +++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/OshimaServers/Service/FunGameService.cs b/OshimaServers/Service/FunGameService.cs index 2512ce2..dc12443 100644 --- a/OshimaServers/Service/FunGameService.cs +++ b/OshimaServers/Service/FunGameService.cs @@ -1343,17 +1343,40 @@ namespace Oshima.FunGame.OshimaServers.Service { user.Inventory.Credits += box.Gifts[name]; } - if (name == General.GameplayEquilibriumConstant.InGameMaterial) + else if (name == General.GameplayEquilibriumConstant.InGameMaterial) { user.Inventory.Materials += box.Gifts[name]; } - if (FunGameConstant.AllItems.FirstOrDefault(i => i.Name == name) is Item currentItem) + else if (FunGameConstant.AllItems.FirstOrDefault(i => i.Name == name) is Item currentItem) { for (int i = 0; i < box.Gifts[name]; i++) { AddItemToUserInventory(user, currentItem, copyLevel: item.ItemType == ItemType.MagicCard, toExploreCache: false, toActivitiesCache: false); } } + else if (name.Contains("魔法卡礼包")) + { + Dictionary magicCards = new() { + { "普通魔法卡礼包", QualityType.White }, + { "优秀魔法卡礼包", QualityType.Green }, + { "稀有魔法卡礼包", QualityType.Blue }, + { "史诗魔法卡礼包", QualityType.Purple }, + { "传说魔法卡礼包", QualityType.Orange }, + { "神话魔法卡礼包", QualityType.Red }, + { "不朽魔法卡礼包", QualityType.Gold } + }; + foreach (string key in magicCards.Keys) + { + if (name == key) + { + for (int i = 0; i < box.Gifts[name]; i++) + { + Item newItem = new 魔法卡礼包(magicCards[key], box.Gifts[name]); + AddItemToUserInventory(user, newItem, false, true); + } + } + } + } } msg = "打开礼包成功!获得了以下物品:\r\n" + string.Join(",", box.Gifts.Select(kv => $"{kv.Key} * {kv.Value}")); if (item.Name == nameof(年夜饭))