mirror of
https://github.com/oshima-studios/OshimaGameModule.git
synced 2026-01-19 14:08:23 +00:00
添加更多礼包
This commit is contained in:
parent
26b46741e5
commit
9ec0b848de
@ -1,4 +1,5 @@
|
||||
using Milimoe.FunGame.Core.Entity;
|
||||
using Milimoe.FunGame.Core.Api.Utility;
|
||||
using Milimoe.FunGame.Core.Entity;
|
||||
using Milimoe.FunGame.Core.Library.Constant;
|
||||
using Oshima.FunGame.OshimaModules.Skills;
|
||||
|
||||
@ -163,7 +164,7 @@ namespace Oshima.FunGame.OshimaModules.Items
|
||||
public class 魔法卡礼包 : Item, 礼包.GiftBox
|
||||
{
|
||||
public override long Id => (long)GiftBoxID.魔法卡礼包;
|
||||
public override string Name => "魔法卡礼包";
|
||||
public override string Name => $"{ItemSet.GetQualityTypeName(QualityType)}魔法卡礼包";
|
||||
public override string Description => Skills.Active?.Description ?? "";
|
||||
public int Count { get; set; } = 1;
|
||||
public Dictionary<string, int> Gifts { get; set; } = [];
|
||||
@ -201,7 +202,7 @@ namespace Oshima.FunGame.OshimaModules.Items
|
||||
public override long Id => (long)GiftBoxID.探索助力礼包;
|
||||
public override string Name => "探索助力礼包";
|
||||
public override string Description => Skills.Active?.Description ?? "";
|
||||
public override QualityType QualityType => QualityType.Red;
|
||||
public override QualityType QualityType => QualityType.White;
|
||||
public Dictionary<string, int> Gifts { get; set; } = [];
|
||||
|
||||
public 探索助力礼包(User? user = null, int remainUseTimes = 1) : base(ItemType.GiftBox)
|
||||
@ -217,6 +218,115 @@ namespace Oshima.FunGame.OshimaModules.Items
|
||||
}
|
||||
}
|
||||
|
||||
public class 一周年纪念礼包 : Item, 礼包.GiftBox
|
||||
{
|
||||
public override long Id => (long)GiftBoxID.一周年纪念礼包;
|
||||
public override string Name => "一周年纪念礼包";
|
||||
public override string Description => Skills.Active?.Description ?? "";
|
||||
public override QualityType QualityType => QualityType.White;
|
||||
public Dictionary<string, int> Gifts { get; set; } = [];
|
||||
|
||||
public 一周年纪念礼包(User? user = null, int remainUseTimes = 1) : base(ItemType.GiftBox)
|
||||
{
|
||||
User = user;
|
||||
礼包.Init(this, new()
|
||||
{
|
||||
{ General.GameplayEquilibriumConstant.InGameCurrency, 50000 },
|
||||
{ General.GameplayEquilibriumConstant.InGameMaterial, 100 },
|
||||
{ new 一周年纪念套装().Name, 1 }
|
||||
}, remainUseTimes);
|
||||
}
|
||||
}
|
||||
|
||||
public class 一周年纪念套装 : Item, 礼包.GiftBox
|
||||
{
|
||||
public override long Id => (long)GiftBoxID.一周年纪念套装;
|
||||
public override string Name => "一周年纪念套装";
|
||||
public override string Description => Skills.Active?.Description ?? "";
|
||||
public override QualityType QualityType => QualityType.White;
|
||||
public Dictionary<string, int> Gifts { get; set; } = [];
|
||||
|
||||
public 一周年纪念套装(User? user = null, int remainUseTimes = 1) : base(ItemType.GiftBox)
|
||||
{
|
||||
User = user;
|
||||
礼包.Init(this, new()
|
||||
{
|
||||
{ General.GameplayEquilibriumConstant.InGameCurrency, 50000 }
|
||||
}, remainUseTimes);
|
||||
}
|
||||
}
|
||||
|
||||
public class 冬至快乐 : Item, 礼包.GiftBox
|
||||
{
|
||||
public override long Id => (long)GiftBoxID.冬至快乐;
|
||||
public override string Name => "冬至快乐";
|
||||
public override string Description => Skills.Active?.Description ?? "";
|
||||
public override QualityType QualityType => QualityType.White;
|
||||
public Dictionary<string, int> Gifts { get; set; } = [];
|
||||
|
||||
public 冬至快乐(User? user = null, int remainUseTimes = 1) : base(ItemType.GiftBox)
|
||||
{
|
||||
User = user;
|
||||
礼包.Init(this, new()
|
||||
{
|
||||
{ General.GameplayEquilibriumConstant.InGameCurrency, 40000 },
|
||||
{ General.GameplayEquilibriumConstant.InGameMaterial, 500 },
|
||||
{ new 魔法卡礼包(QualityType.Orange, 5).Name, 5 }
|
||||
}, remainUseTimes);
|
||||
}
|
||||
}
|
||||
|
||||
public class 圣诞礼包 : Item, 礼包.GiftBox
|
||||
{
|
||||
public override long Id => (long)GiftBoxID.圣诞礼包;
|
||||
public override string Name => "圣诞礼包";
|
||||
public override string Description => Skills.Active?.Description ?? "";
|
||||
public override QualityType QualityType => QualityType.White;
|
||||
public Dictionary<string, int> Gifts { get; set; } = [];
|
||||
|
||||
public 圣诞礼包(User? user = null, int remainUseTimes = 1) : base(ItemType.GiftBox)
|
||||
{
|
||||
User = user;
|
||||
礼包.Init(this, new()
|
||||
{
|
||||
{ General.GameplayEquilibriumConstant.InGameCurrency, 10000 },
|
||||
{ General.GameplayEquilibriumConstant.InGameMaterial, 100 },
|
||||
{ Factory.OpenFactory.GetInstance<Item>(14515, "", []).Name, 1 }
|
||||
}, remainUseTimes);
|
||||
}
|
||||
|
||||
protected override bool OnItemUsed(User user, int times, Dictionary<string, object> args)
|
||||
{
|
||||
return 礼包.OnItemUsed(user, this, times, args);
|
||||
}
|
||||
}
|
||||
|
||||
public class 元旦快乐 : Item, 礼包.GiftBox
|
||||
{
|
||||
public override long Id => (long)GiftBoxID.元旦快乐;
|
||||
public override string Name => "元旦快乐";
|
||||
public override string Description => Skills.Active?.Description ?? "";
|
||||
public override QualityType QualityType => QualityType.White;
|
||||
public Dictionary<string, int> Gifts { get; set; } = [];
|
||||
|
||||
public 元旦快乐(User? user = null, int remainUseTimes = 1) : base(ItemType.GiftBox)
|
||||
{
|
||||
User = user;
|
||||
礼包.Init(this, new()
|
||||
{
|
||||
{ General.GameplayEquilibriumConstant.InGameCurrency, 40000 },
|
||||
{ General.GameplayEquilibriumConstant.InGameMaterial, 500 },
|
||||
{ new 魔法卡礼包(QualityType.Orange, 5).Name, 5 },
|
||||
{ new 魔法卡礼包(QualityType.Red, 2).Name, 2 }
|
||||
}, remainUseTimes);
|
||||
}
|
||||
|
||||
protected override bool OnItemUsed(User user, int times, Dictionary<string, object> args)
|
||||
{
|
||||
return 礼包.OnItemUsed(user, this, times, args);
|
||||
}
|
||||
}
|
||||
|
||||
public class 礼包技能 : Skill
|
||||
{
|
||||
public override long Id => (long)ItemActiveID.礼包;
|
||||
|
||||
@ -105,6 +105,12 @@
|
||||
新春快乐 = 20003,
|
||||
毕业礼包 = 20004,
|
||||
魔法卡礼包 = 20005,
|
||||
探索助力礼包 = 20006
|
||||
探索助力礼包 = 20006,
|
||||
一周年纪念礼包 = 20007,
|
||||
一周年纪念套装 = 20008,
|
||||
冬至快乐 = 20009,
|
||||
圣诞礼包 = 20010,
|
||||
元旦快乐 = 20011,
|
||||
马年大吉 = 20012
|
||||
}
|
||||
}
|
||||
|
||||
@ -123,6 +123,11 @@ namespace Oshima.FunGame.OshimaModules
|
||||
(long)GiftBoxID.毕业礼包 => new 毕业礼包(),
|
||||
(long)GiftBoxID.魔法卡礼包 => new 魔法卡礼包(),
|
||||
(long)GiftBoxID.探索助力礼包 => new 探索助力礼包(),
|
||||
(long)GiftBoxID.一周年纪念礼包 => new 一周年纪念礼包(),
|
||||
(long)GiftBoxID.一周年纪念套装 => new 一周年纪念套装(),
|
||||
(long)GiftBoxID.冬至快乐 => new 冬至快乐(),
|
||||
(long)GiftBoxID.圣诞礼包 => new 圣诞礼包(),
|
||||
(long)GiftBoxID.元旦快乐 => new 元旦快乐(),
|
||||
_ => null,
|
||||
};
|
||||
};
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
using System.Text;
|
||||
using System.Xml.Linq;
|
||||
using Milimoe.FunGame.Core.Api.Transmittal;
|
||||
using Milimoe.FunGame.Core.Api.Utility;
|
||||
using Milimoe.FunGame.Core.Entity;
|
||||
using Milimoe.FunGame.Core.Interface.Entity;
|
||||
using Milimoe.FunGame.Core.Library.Constant;
|
||||
using Oshima.Core.Constant;
|
||||
using Oshima.FunGame.OshimaModules.Characters;
|
||||
@ -67,14 +69,15 @@ namespace Oshima.FunGame.OshimaServers.Service
|
||||
FunGameConstant.Items.AddRange(exItems.Values.Where(i => (int)i.ItemType > 4));
|
||||
FunGameConstant.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(), new 年夜饭(), new 蛇年大吉(), new 新春快乐(), new 毕业礼包(),
|
||||
new 复苏药1(), new 复苏药2(), new 复苏药3(), new 全回复药(), new 魔法卡礼包(), new 奖券(), new 十连奖券(), new 改名卡(), new 原初之印(), new 创生之印(), new 法则精粹(), new 大师锻造券()
|
||||
new 复苏药1(), new 复苏药2(), new 复苏药3(), new 全回复药(), new 魔法卡礼包(), new 奖券(), new 十连奖券(), new 改名卡(), new 原初之印(), new 创生之印(), new 法则精粹(), new 大师锻造券(),
|
||||
new 一周年纪念礼包(), new 一周年纪念套装(), new 冬至快乐(), new 圣诞礼包(), new 元旦快乐()
|
||||
]);
|
||||
|
||||
FunGameConstant.UserDailyItems.AddRange([new 青松(), new 流星石(), new 向日葵(), new 金铃花(), new 琉璃珠(), new 鸣草(), new 马尾(), new 鬼兜虫(), new 烈焰花花蕊(), new 堇瓜(), new 水晶球(), new 薰衣草(),
|
||||
new 青石(), new 莲花(), new 陶罐(), new 海灵芝(), new 四叶草(), new 露珠(), new 茉莉花(), new 绿萝(), new 檀木扇(), new 鸟蛋(), new 竹笋(), new 晶核(), new 手工围巾(), new 柳条篮(), new 风筝(), new 羽毛(), new 发光髓(),
|
||||
new 紫罗兰(), new 松果(), new 电气水晶(), new 薄荷(), new 竹节(), new 铁砧(), new 冰雾花(), new 海草(), new 磐石(), new 砂砾(), new 铁甲贝壳(), new 蜥蜴尾巴(), new 古老钟摆(), new 枯藤()]);
|
||||
|
||||
FunGameConstant.NotForSaleItems.AddRange([]);
|
||||
FunGameConstant.NotForSaleItems.AddRange([new 一周年纪念礼包(), new 一周年纪念套装(), new 毕业礼包()]);
|
||||
|
||||
FunGameConstant.AllItems.AddRange(FunGameConstant.Equipment);
|
||||
FunGameConstant.AllItems.AddRange(FunGameConstant.Items);
|
||||
@ -4271,8 +4274,7 @@ namespace Oshima.FunGame.OshimaServers.Service
|
||||
return msg;
|
||||
}
|
||||
|
||||
|
||||
private static string GetStoreString(Store? store, User? user = null, string activity = "")
|
||||
public static string GetStoreString(Store? store, User? user = null, string activity = "")
|
||||
{
|
||||
if (store is null) return "";
|
||||
|
||||
@ -4365,7 +4367,7 @@ namespace Oshima.FunGame.OshimaServers.Service
|
||||
return builder.ToString().Trim();
|
||||
}
|
||||
|
||||
private static string GetGoodsString(Goods goods, User? user = null, string activity = "")
|
||||
public static string GetGoodsString(Goods goods, User? user = null, string activity = "")
|
||||
{
|
||||
StringBuilder builder = new();
|
||||
builder.AppendLine($"{goods.Id}. {goods.Name}");
|
||||
@ -4418,6 +4420,135 @@ namespace Oshima.FunGame.OshimaServers.Service
|
||||
return builder.ToString().Trim();
|
||||
}
|
||||
|
||||
public static string GetItemString(Item item, bool isShowGeneralDescription, bool isShowInStore = false, string activity = "")
|
||||
{
|
||||
StringBuilder builder = new();
|
||||
|
||||
builder.AppendLine($"【{item.Name}】{(item.IsLock ? " [锁定]" : "")}");
|
||||
|
||||
string itemquality = ItemSet.GetQualityTypeName(item.QualityType);
|
||||
string itemtype = ItemSet.GetItemTypeName(item.ItemType) + (item.ItemType == ItemType.Weapon && item.WeaponType != WeaponType.None ? "-" + ItemSet.GetWeaponTypeName(item.WeaponType) : "");
|
||||
if (itemtype != "") itemtype = $" {itemtype}";
|
||||
|
||||
builder.AppendLine($"{itemquality + itemtype}");
|
||||
|
||||
if (isShowInStore && item.Price > 0)
|
||||
{
|
||||
if (activity != null)
|
||||
{
|
||||
builder.Append("售价:");
|
||||
switch (activity)
|
||||
{
|
||||
case "双旦活动":
|
||||
builder.AppendLine($"{item.Price / 2:0.##} {item.GameplayEquilibriumConstant.InGameCurrency}(-50%,原价:{item.Price:0.##} {item.GameplayEquilibriumConstant.InGameCurrency})");
|
||||
break;
|
||||
default:
|
||||
builder.AppendLine($"{item.Price:0.##} {item.GameplayEquilibriumConstant.InGameCurrency}");
|
||||
break;
|
||||
}
|
||||
}
|
||||
else builder.AppendLine($"售价:{item.Price:0.##} {item.GameplayEquilibriumConstant.InGameCurrency}");
|
||||
}
|
||||
else if (item.Price > 0)
|
||||
{
|
||||
builder.AppendLine($"回收价:{item.Price:0.##} {item.GameplayEquilibriumConstant.InGameCurrency}");
|
||||
}
|
||||
|
||||
if (item.RemainUseTimes > 0)
|
||||
{
|
||||
builder.AppendLine($"{(isShowInStore ? "" : "剩余")}可用次数:{item.RemainUseTimes}");
|
||||
}
|
||||
|
||||
if (isShowInStore)
|
||||
{
|
||||
if (item.IsSellable)
|
||||
{
|
||||
builder.AppendLine($"购买此物品后可立即出售");
|
||||
}
|
||||
if (item.IsTradable)
|
||||
{
|
||||
DateTime date = DateTimeUtility.GetTradableTime();
|
||||
builder.AppendLine($"购买此物品后将在 {date.ToString(General.GeneralDateTimeFormatChinese)} 后可交易");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
List<string> sellandtrade = [];
|
||||
bool useRN = false;
|
||||
|
||||
if (item.IsLock)
|
||||
{
|
||||
sellandtrade.Add("不可出售");
|
||||
sellandtrade.Add("不可交易");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (item.IsSellable)
|
||||
{
|
||||
sellandtrade.Add("可出售");
|
||||
}
|
||||
|
||||
if (!item.IsSellable && item.NextSellableTime != DateTime.MinValue)
|
||||
{
|
||||
useRN = true;
|
||||
sellandtrade.Add($"此物品将在 {item.NextSellableTime.ToString(General.GeneralDateTimeFormatChinese)} 后可出售");
|
||||
}
|
||||
else if (!item.IsSellable)
|
||||
{
|
||||
sellandtrade.Add("不可出售");
|
||||
}
|
||||
|
||||
if (item.IsTradable)
|
||||
{
|
||||
sellandtrade.Add("可交易");
|
||||
}
|
||||
|
||||
if (!item.IsTradable && item.NextTradableTime != DateTime.MinValue)
|
||||
{
|
||||
useRN = true;
|
||||
sellandtrade.Add($"此物品将在 {item.NextTradableTime.ToString(General.GeneralDateTimeFormatChinese)} 后可交易");
|
||||
}
|
||||
else if (!item.IsTradable)
|
||||
{
|
||||
sellandtrade.Add("不可交易");
|
||||
}
|
||||
}
|
||||
|
||||
if (sellandtrade.Count > 0) builder.AppendLine(string.Join(useRN ? "\r\n" : " ", sellandtrade).Trim());
|
||||
}
|
||||
|
||||
if (isShowGeneralDescription && item.GeneralDescription != "")
|
||||
{
|
||||
builder.AppendLine("物品描述:" + item.GeneralDescription);
|
||||
}
|
||||
else if (item.Description != "")
|
||||
{
|
||||
builder.AppendLine("物品描述:" + item.Description);
|
||||
}
|
||||
if (item.ItemType == ItemType.MagicCardPack && item.Skills.Magics.Count > 0)
|
||||
{
|
||||
builder.AppendLine("== 魔法卡 ==\r\n" + string.Join("\r\n", item.Skills.Magics.Select(m => m.ToString().Trim())));
|
||||
}
|
||||
|
||||
if (item.Skills.Active != null || item.Skills.Passives.Count > 0)
|
||||
{
|
||||
builder.AppendLine("== 物品技能 ==");
|
||||
|
||||
if (item.Skills.Active != null) builder.AppendLine($"{item.Skills.Active.ToString().Trim()}");
|
||||
foreach (Skill skill in item.Skills.Passives)
|
||||
{
|
||||
builder.AppendLine($"{skill.ToString().Trim()}");
|
||||
}
|
||||
}
|
||||
|
||||
if (item.BackgroundStory != "")
|
||||
{
|
||||
builder.AppendLine($"\"{item.BackgroundStory}\"");
|
||||
}
|
||||
|
||||
return builder.ToString();
|
||||
}
|
||||
|
||||
public static void GenerateForgeResult(User user, ForgeModel model, bool simulate = false)
|
||||
{
|
||||
if (model.ForgeMaterials.Count == 0)
|
||||
|
||||
@ -8034,15 +8034,20 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
{
|
||||
int count = 0;
|
||||
string itemMsg = "";
|
||||
string activityName = "";
|
||||
if (FunGameService.Activities.FirstOrDefault(a => a.Name == "双旦活动") is Activity activity && activity.Status == ActivityState.InProgress)
|
||||
{
|
||||
activityName = "双旦活动";
|
||||
}
|
||||
foreach (Item item in good.Items)
|
||||
{
|
||||
count++;
|
||||
Item newItem = item.Copy(true);
|
||||
newItem.Character = user.Inventory.MainCharacter;
|
||||
if (newItem.ItemType != ItemType.MagicCard) newItem.SetLevel(1);
|
||||
itemMsg += $"[ {count} ] {newItem.ToString(false, true)}".Trim();
|
||||
itemMsg += $"[ {count} ] {FunGameService.GetItemString(newItem, false, true, activityName)}".Trim();
|
||||
}
|
||||
msg = good.ToString(user).Split("包含物品:")[0].Trim();
|
||||
msg = FunGameService.GetGoodsString(good, user, activityName).Split("包含物品:")[0].Trim();
|
||||
int buyCount = 0;
|
||||
if (user != null)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user