Search in sources :

Example 1 with DetailedActionReaction

use of gartham.c10ver.response.actions.DetailedActionReaction in project c10ver by Gartham.

the class PlayerController method info.

private DetailedActionReaction info(DetailedMenuMessage<DetailedActionReaction, DetailedActionButton> source) {
    return new DetailedActionReaction("\u2139", "Info", "Check battle queue or enemy stats.", t -> {
        var dam = new DetailedMenuMessage<>(new ActionMessage<>());
        DetailedActionReaction battleQueue = new DetailedActionReaction("Battle Queue", "Check the time until each creature's turn.", DetailedActionReaction.actionMessageAction(dam, t1 -> channel.sendMessage("Battle Queue:").setEmbeds(GarmonUtils.printBattleQueue(battle).build()).queue()));
        DetailedActionReaction back = new DetailedActionReaction("\u2B05", "Back", "Go back to attack menu.", DetailedActionReaction.actionMessageAction(source));
        dam.getReactions().add(battleQueue);
        dam.getReactions().add(back);
        dam.send(clover, channel, player);
    });
}
Also used : WebhookMessageBuilder(club.minnced.discord.webhook.send.WebhookMessageBuilder) Random(java.util.Random) TextChannel(net.dv8tion.jda.api.entities.TextChannel) Controller(gartham.c10ver.games.rpg.fighting.battles.api.Controller) User(net.dv8tion.jda.api.entities.User) List(java.util.List) DetailedActionReaction(gartham.c10ver.response.actions.DetailedActionReaction) GarmonUtils(gartham.c10ver.games.rpg.GarmonUtils) DetailedMenuMessage(gartham.c10ver.response.menus.DetailedMenuMessage) BigInteger(java.math.BigInteger) ActionMessage(gartham.c10ver.response.actions.ActionMessage) Clover(gartham.c10ver.Clover) DetailedActionButton(gartham.c10ver.response.actions.DetailedActionButton) DetailedMenuMessage(gartham.c10ver.response.menus.DetailedMenuMessage) DetailedActionReaction(gartham.c10ver.response.actions.DetailedActionReaction)

Example 2 with DetailedActionReaction

use of gartham.c10ver.response.actions.DetailedActionReaction in project c10ver by Gartham.

the class PlayerController method attack.

private DetailedActionReaction attack(DetailedMenuMessage<DetailedActionReaction, DetailedActionButton> source, GarmonFighter fighter) {
    return new DetailedActionReaction("\u2694", "Attack", "Pow pow pow!\nTakes: \uD83D\uDD50\uFE0F 50", t -> {
        synchronized (this) {
            List<GarmonFighter> opps = battle.getRemainingOpponents(battle.getTeam(fighter));
            if (opps.size() == 1) {
                attack(fighter, opps.get(0));
                notify();
            } else {
                var dam = new DetailedMenuMessage<>(new ActionMessage<>());
                for (var v : opps) dam.getReactions().add(new DetailedActionReaction(v.getName(), "\uD83D\uDD50\uFE0F " + battle.getTicksTillTurn().get(fighter), t1 -> {
                    attack(fighter, v);
                    notify();
                }));
                dam.getReactions().add(new DetailedActionReaction("Back", "Return to the previous menu.", DetailedActionReaction.actionMessageAction(source)));
                dam.send(t.getReactionProcessor(), t.getButtonClickProcessor(), t.getEvent().getChannel(), t.getEvent().getUser());
            }
        }
    });
}
Also used : DetailedMenuMessage(gartham.c10ver.response.menus.DetailedMenuMessage) DetailedActionReaction(gartham.c10ver.response.actions.DetailedActionReaction)

Aggregations

DetailedActionReaction (gartham.c10ver.response.actions.DetailedActionReaction)2 DetailedMenuMessage (gartham.c10ver.response.menus.DetailedMenuMessage)2 WebhookMessageBuilder (club.minnced.discord.webhook.send.WebhookMessageBuilder)1 Clover (gartham.c10ver.Clover)1 GarmonUtils (gartham.c10ver.games.rpg.GarmonUtils)1 Controller (gartham.c10ver.games.rpg.fighting.battles.api.Controller)1 ActionMessage (gartham.c10ver.response.actions.ActionMessage)1 DetailedActionButton (gartham.c10ver.response.actions.DetailedActionButton)1 BigInteger (java.math.BigInteger)1 List (java.util.List)1 Random (java.util.Random)1 TextChannel (net.dv8tion.jda.api.entities.TextChannel)1 User (net.dv8tion.jda.api.entities.User)1