public async Task GamblingGames(SocketReaction reaction, IUserMessage msg) { switch (data) { case "Tavern": { string s = reaction.Emote.ToString(); int i = EUI.Dice(s); if (i > -1) { switch (i) { case 1: await GamblingCommands.DiceGame_EvenOdd(player, reaction.Channel); break; } } else { i = EUI.GetNum(s); string[] games = { "Blackjack", }; if (i > games.Length) { return; } await GamblingGame.SelectInitialBet(player, reaction.Channel, games[i]); break; } } break; } }
public async Task DiceGame(SocketReaction reaction, IUserMessage _) { string[] d = data.Split(';'); //$"{coins};{streak} int.TryParse(d[0], out int coins); int.TryParse(d[1], out int streak); int i = EUI.Dice(reaction.Emote.ToString()); if (i != -1) { await GamblingCommands.DiceGame_EvenOdd(player, reaction.Channel, i, coins, streak); } switch (reaction.Emote.ToString()) { case EUI.cancel: await GameCommands.ShortStatsDisplay(player, reaction.Channel); break; case EUI.prev: await GamblingCommands.DiceGame_EvenOdd(player, reaction.Channel, -1, Math.Max(coins - 10, 10), streak); break; case EUI.next: await GamblingCommands.DiceGame_EvenOdd(player, reaction.Channel, -1, coins + 10, streak); break; case EUI.two: await GamblingCommands.DiceGame_EvenOdd(player, reaction.Channel, -1, coins * 2, streak); break; case EUI.five: await GamblingCommands.DiceGame_EvenOdd(player, reaction.Channel, -1, coins * 5, streak); break; case EUI.zero: await GamblingCommands.DiceGame_EvenOdd(player, reaction.Channel, -1, coins * 10, streak); break; } }
public async Task Tavern(SocketReaction reaction, IUserMessage msg) { if (EUI.Dice(reaction.Emote.ToString()) == 1) { await GamblingCommands.TavernGames(player, reaction.Channel); return; } switch (reaction.Emote.ToString()) { case EUI.sideQuest: { var qt = User.DailyQuestBoard.Load(player._id); await qt.ShowBoard(player, reaction.Channel); } break; case EUI.bounties: { Areas.AreaPartials.Area tavern = player.Area; if (tavern.parent != null) { tavern = Areas.AreaPartials.Area.LoadArea(tavern.GeneratePath(false) + tavern.parent); } await TavernInteractive.GenerateBountyFile(player, tavern, -1, reaction.Channel); } break; } }
private static void InitO_Gambling() { OptionsLoad.Add(MsgType.GamblingGames, ui => { ui.options = new List <string>(); switch (ui.data) { case "Tavern": ui.options.Add(EUI.Dice(1)); ui.options.Add(EUI.GetNum(0)); break; } }); OptionsLoad.Add(MsgType.DiceGame, ui => ui.options = new List <string>() { EUI.prev, EUI.Dice(1), EUI.Dice(2), EUI.next, EUI.two, EUI.five, EUI.zero, EUI.cancel }); OptionsLoad.Add(MsgType.GameBet, ui => ui.options = new List <string>() { EUI.prev, EUI.next, EUI.two, EUI.five, EUI.zero, EUI.ok, }); OptionsLoad.Add(MsgType.CardGame, ui => { Type type = GamblingGame.GetGameType(ui.data); Dictionary <string, string> actions = Utils.GetVar <Dictionary <string, string> >(type, "Actions", true); ui.options = new List <string>(actions.Keys); }); }