Files
OshimaBot/OshimaBot.Content/Items/GiftBox/礼包.cs
T

364 lines
14 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using FunGame.Core.Entity;
using FunGame.Core.Library.Constant;
using OshimaBot.Content.Skills;
namespace OshimaBot.Content.Items
{
public class 礼包
{
public interface GiftBox
{
public Dictionary<string, int> Gifts { get; set; }
}
public static void Init(Item item, Dictionary<string, int> gifts, int remainUseTimes = 1)
{
if (item is GiftBox box)
{
box.Gifts = gifts;
}
item.Skills.Active = new 礼包技能(item);
item.RemainUseTimes = remainUseTimes;
item.IsInGameItem = false;
item.IsReduceTimesAfterUse = true;
item.IsRemoveAfterUse = true;
}
public static bool OnItemUsed(User user, Item item, int times, Dictionary<string, object> args)
{
string msg = "";
if (item is GiftBox box)
{
}
args["msg"] = msg;
return msg.Trim() != "";
}
}
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, 100000 },
{ General.GameplayEquilibriumConstant.InGameMaterial, 2000 },
{ new 技能卷轴().Name, 20 },
{ new 升华之印().Name, 20 },
{ new 流光之印().Name, 10 },
{ new 大经验书().Name, 20 },
{ new 大回复药().Name, 5 },
{ new 魔力填充剂3().Name, 5 },
{ new 能量饮料3().Name, 5 }
}, 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, 88888 },
{ General.GameplayEquilibriumConstant.InGameMaterial, 888 },
{ new 技能卷轴().Name, 20 },
{ new 智慧之果().Name, 10 },
{ new 奥术符文().Name, 5 },
{ new 混沌之核().Name, 3 },
{ new 升华之印().Name, 20 },
{ new 流光之印().Name, 10 },
{ new 永恒之印().Name, 3 },
{ new 大经验书().Name, 20 }
}, 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, 100000 },
{ General.GameplayEquilibriumConstant.InGameMaterial, 2000 },
{ new 技能卷轴().Name, 20 },
{ new 升华之印().Name, 20 },
{ new 流光之印().Name, 10 },
{ new 大经验书().Name, 20 },
{ new 大回复药().Name, 5 },
{ new 魔力填充剂3().Name, 5 },
{ new 能量饮料3().Name, 5 }
}, 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.Gold;
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, 667000 },
{ General.GameplayEquilibriumConstant.InGameMaterial, 6450 },
{ new 升华之印().Name, 126 },
{ new 流光之印().Name, 62 },
{ new 永恒之印().Name, 45 },
{ new 原初之印().Name, 35 },
{ new 创生之印().Name, 15 },
{ new 技能卷轴().Name, 190 },
{ new 智慧之果().Name, 94 },
{ new 奥术符文().Name, 68 },
{ new 混沌之核().Name, 42 },
{ new 法则精粹().Name, 22 },
{ new 大经验书().Name, 164 }
}, remainUseTimes);
}
}
public class 魔法卡礼包 : Item, 礼包.GiftBox
{
public override long Id => (long)GiftBoxID.魔法卡礼包;
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; } = [];
private const string GiftName = "与礼包同品质、随机属性、随机魔法技能的魔法卡";
public 魔法卡礼包(QualityType type = QualityType.White, int count = 1, User? user = null, int remainUseTimes = 1) : base(ItemType.GiftBox)
{
QualityType = type;
Others.Add("QualityType", (int)type);
Count = count;
Others.Add("Count", count);
User = user;
礼包.Init(this, new()
{
{ GiftName, count }
}, remainUseTimes);
}
protected override void AfterCopy()
{
if (Others.TryGetValue("QualityType", out object? value) && int.TryParse(value.ToString(), out int qualityType))
{
QualityType = (QualityType)qualityType;
}
if (Others.TryGetValue("Count", out value) && int.TryParse(value.ToString(), out int count))
{
Count = count;
Gifts[GiftName] = count;
}
}
}
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, 20000 },
{ General.GameplayEquilibriumConstant.InGameMaterial, 50 },
{ new 升华之印().Name, 20 },
{ new 技能卷轴().Name, 20 },
}, 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)
{
Price = 0;
IsSellable = false;
IsTradable = false;
IsLock = true;
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.Gold;
public Dictionary<string, int> Gifts { get; set; } = [];
public 一周年纪念套装(User? user = null, int remainUseTimes = 1) : base(ItemType.GiftBox)
{
Price = 0;
IsSellable = false;
IsTradable = false;
IsLock = true;
User = user;
礼包.Init(this, new()
{
{ new 糖糖一周年纪念武器().Name, 1 },
{ new 糖糖一周年纪念防具().Name, 1 },
{ new 糖糖一周年纪念鞋子().Name, 1 },
{ new 糖糖一周年纪念饰品1().Name, 1 },
{ new 糖糖一周年纪念饰品2().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, 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 },
{ "YukiのCalfSocks-圣诞限定", 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.礼包;
public override string Name => "礼包";
public override string Description
{
get
{
if (Item is 礼包.GiftBox box && box.Gifts.Count > 0)
{
return "打开后可立即获得:" + string.Join(",", box.Gifts.Select(kv => $"{kv.Key} * {kv.Value}"));
}
return "";
}
}
public 礼包技能(Item? item = null) : base(SkillType.Item)
{
Level = 1;
Item = item;
}
}
}