mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 01:38:27 -04:00
added botcut setting to gambling.yml in which you can configure shopcut for now (how much money the bot takes when something is sold in the shop)
This commit is contained in:
@@ -42,6 +42,9 @@ public sealed partial class GamblingConfig : ICloneable<GamblingConfig>
|
||||
|
||||
[Comment("""How much will each user's owned currency decay over time.""")]
|
||||
public DecayConfig Decay { get; set; }
|
||||
|
||||
[Comment("""What is the bot's cut on some transactions""")]
|
||||
public BotCutConfig BotCuts { get; set; }
|
||||
|
||||
[Comment("""Settings for LuckyLadder command""")]
|
||||
public LuckyLadderSettings LuckyLadder { get; set; }
|
||||
@@ -75,6 +78,7 @@ public sealed partial class GamblingConfig : ICloneable<GamblingConfig>
|
||||
Decay = new();
|
||||
Slots = new();
|
||||
LuckyLadder = new();
|
||||
BotCuts = new();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -384,4 +388,17 @@ public sealed partial class BetRollPair
|
||||
{
|
||||
public int WhenAbove { get; set; }
|
||||
public float MultiplyBy { get; set; }
|
||||
}
|
||||
|
||||
[Cloneable]
|
||||
public sealed partial class BotCutConfig
|
||||
{
|
||||
[Comment("""
|
||||
Shop sale cut percentage.
|
||||
Whenever a user buys something from the shop, bot will take a cut equal to this percentage.
|
||||
The rest goes to the user who posted the item/role/whatever to the shop.
|
||||
This is a good way to reduce the amount of currency in circulation therefore keeping the inflation in check.
|
||||
Default 0.1 (10%).
|
||||
""")]
|
||||
public decimal ShopSaleCut { get; set; } = 0.1m;
|
||||
}
|
@@ -182,5 +182,13 @@ public sealed class GamblingConfigService : ConfigServiceBase<GamblingConfig>
|
||||
c.Version = 6;
|
||||
});
|
||||
}
|
||||
|
||||
if (data.Version < 7)
|
||||
{
|
||||
ModifyConfig(c =>
|
||||
{
|
||||
c.Version = 7;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
@@ -283,8 +283,8 @@ public partial class Gambling
|
||||
}
|
||||
}
|
||||
|
||||
private static long GetProfitAmount(int price)
|
||||
=> (int)Math.Ceiling(0.90 * price);
|
||||
private long GetProfitAmount(int price)
|
||||
=> (int)Math.Ceiling((1.0m - Config.BotCuts.ShopSaleCut) * price);
|
||||
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
|
Reference in New Issue
Block a user