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; }
public void ActionRollTest1() { var roll = new ActionRoll(-10) { ActionDie = 6 }; Assert.AreEqual(-4, roll.ActionScore); Assert.IsTrue(roll.ToString() != string.Empty); }
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); }
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); }
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()); }