Ejemplo n.º 1
0
        public async Task ProgressInteractiveReactions(IUserMessage message, ISocketMessageChannel channel, SocketReaction reaction, IUser user)
        {
            if (!ProgressTrackerInfo.IsProgressTrackerMessage(message))
            {
                return;
            }

            if (reaction.Emote.IsSameAs(DecreaseEmoji))
            {
                DecreaseProgress(message);
                await message.RemoveReactionAsync(reaction.Emote, user).ConfigureAwait(false);
            }
            if (reaction.Emote.IsSameAs(IncreaseEmoji))
            {
                IncreaseProgress(message);
                await message.RemoveReactionAsync(reaction.Emote, user).ConfigureAwait(false);
            }
            if (reaction.Emote.IsSameAs(oldFullEmoji) || reaction.Emote.IsSameAs(FullEmoji))
            {
                IncreaseProgressFullCheck(message);
                await message.RemoveReactionAsync(reaction.Emote, user).ConfigureAwait(false);
            }
            if (reaction.Emote.IsSameAs(RollEmoji))
            {
                var tracker = new ProgressTrackerInfo().PopulateFromMessage(message);
                var roll    = new ActionRoll(0, tracker.ActionDie, $"{ProgressResources.ProgressRollFor}{tracker.Description}");
                await channel.SendMessageAsync(roll.ToString()).ConfigureAwait(false);

                await message.RemoveReactionAsync(reaction.Emote, user).ConfigureAwait(false);
            }

            return;
        }
Ejemplo n.º 2
0
        public void ActionRollTest1()
        {
            var roll = new ActionRoll(-10)
            {
                ActionDie = 6
            };

            Assert.AreEqual(-4, roll.ActionScore);
            Assert.IsTrue(roll.ToString() != string.Empty);
        }
Ejemplo n.º 3
0
        private async Task ReactionResolveScene(IUserMessage message, ISocketMessageChannel channel, SocketReaction reaction, IUser user)
        {
            if (!IsSceneChallengeMessage(message))
            {
                return;
            }

            SceneChallengeInfo scene = new SceneChallengeInfo().FromMessage(message);
            var roll = new ActionRoll(0, scene.ActionDie, String.Format(SceneChallengeResources.ResolveSceneRoll, scene.Description));
            await channel.SendMessageAsync(roll.ToString()).ConfigureAwait(false);

            await message.RemoveReactionAsync(reaction.Emote, user).ConfigureAwait(false);
        }
Ejemplo n.º 4
0
        private async Task ReactionLocateObjectiveEvent(IUserMessage message, ISocketMessageChannel channel, SocketReaction reaction, IUser user)
        {
            if (!IsDelveMessage(message))
            {
                return;
            }
            await message.RemoveReactionAsync(reaction.Emote, user).ConfigureAwait(false);

            DelveInfo delve = new DelveInfo().FromMessage(DelveService, message);
            var       roll  = new ActionRoll(0, delve.ActionDie, String.Format(DelveResources.LocateObjectiveRoll, delve.SiteName));
            await channel.SendMessageAsync(roll.ToString()).ConfigureAwait(false);

            await message.RemoveReactionAsync(reaction.Emote, user).ConfigureAwait(false);
        }
Ejemplo n.º 5
0
        public async Task Action([Summary("Modifier for the action roll")][Remainder] string ModiferAndFluff = "")
        {
            int mod = 0;

            var regex = Regex.Match(ModiferAndFluff, @"[\+-]?\d+");

            if (regex.Success)
            {
                Int32.TryParse(regex.Value, out mod);
            }

            var roll = new ActionRoll(mod);

            await ReplyAsync(roll.ToString());
        }