156 lines
5.4 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 Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
using Oshima.FunGame.OshimaModules.Skills;
namespace Oshima.FunGame.OshimaModules.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(Item item, 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(Dictionary<string, object> args)
{
return .OnItemUsed(this, 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(Dictionary<string, object> args)
{
return .OnItemUsed(this, 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(Dictionary<string, object> args)
{
return .OnItemUsed(this, 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;
}
}
}