Example #1
0
        public async Task DoublerAsync(long wager = 0, int expectedTick = 1, TickWinMethod method = TickWinMethod.Below)
        {
            if (wager < 0)
            {
                await Context.Channel.SendMessageAsync($"> 👁️ You can't specify a **negative** value.\n> *\"I know what you were trying to do.\"*");

                return;
            }

            if (wager == 0)
            {
                // $"> ⚠️ You need to specify a positive amount of **Chips** to bet."
                await Context.Channel.SendMessageAsync(CommandDetailsViewer.WriteTick());

                return;
            }

            if (wager > Context.Account.ChipBalance)
            {
                await Context.Channel.SendMessageAsync($"> ⚠️ You don't have enough **Chips** to bet with.");

                return;
            }

            if (expectedTick <= 0)
            {
                await Context.Channel.SendMessageAsync($"> ⚠️ You have specified an invalid tick. Try something that's above **0**.");

                return;
            }

            var tick = new Tick(expectedTick, method);

            TickResult result  = tick.Next(wager, Context.Account.GetVar(TickStats.CurrentLossStreak));
            Message    message = result.ApplyAndDisplay(Context.Account);

            await Context.Channel.SendMessageAsync(Context.Account, message);
        }
Example #2
0
 public static float GetMultiplier(int ticks, TickWinMethod method)
 => (float)(Math.Pow(2, ticks) * (method == TickWinMethod.Exact ? 1.5 : 1));
Example #3
0
 public Tick(int expectedTick, TickWinMethod method = TickWinMethod.Below)
 {
     Method       = method;
     ExpectedTick = expectedTick;
     Chance       = BaseChance;
 }