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);
});
}
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());
}
}
});
}
Aggregations