Search in sources :

Example 16 with WarningMessage

use of io.github.spugn.Sargo.Objects.WarningMessage in project S-argo by Expugn.

the class CommandManager method resetCommand.

private void resetCommand() {
    if (COMMAND_LINE.getArgumentCount() >= 3) {
        String arg3 = COMMAND_LINE.getArgument(3);
        String arg2 = COMMAND_LINE.getArgument(2);
        int bannerID;
        try {
            bannerID = Integer.parseInt(COMMAND_LINE.getArgument(1));
        } catch (NumberFormatException e) {
            return;
        }
        boolean yes = (arg3.equalsIgnoreCase("y") || arg3.equalsIgnoreCase("yes"));
        if (arg2.equalsIgnoreCase("c") || arg2.equalsIgnoreCase("w") || arg2.equalsIgnoreCase("a")) {
            new Reset(CHANNEL, DISCORD_ID, bannerID, arg2, yes);
        } else {
            CHANNEL.sendMessage(new WarningMessage("COMMAND ERROR", "Use '" + commandPrefix + "**reset** [BannerID] [c/w/a]'").get().build());
        }
    } else if (COMMAND_LINE.getArgumentCount() >= 2) {
        String arg2 = COMMAND_LINE.getArgument(2);
        int bannerID;
        try {
            bannerID = Integer.parseInt(COMMAND_LINE.getArgument(1));
        } catch (NumberFormatException e) {
            return;
        }
        if (arg2.equalsIgnoreCase("c") || arg2.equalsIgnoreCase("w") || arg2.equalsIgnoreCase("a")) {
            new Reset(CHANNEL, DISCORD_ID, bannerID, arg2, false);
        } else {
            CHANNEL.sendMessage(new WarningMessage("COMMAND ERROR", "Use '" + commandPrefix + "**reset** [BannerID] [c/w/a]'").get().build());
        }
    } else if (COMMAND_LINE.getArgumentCount() >= 1) {
        String arg1 = COMMAND_LINE.getArgument(1);
        if (arg1.equalsIgnoreCase("y") || arg1.equalsIgnoreCase("yes")) {
            new Reset(CHANNEL, DISCORD_ID);
        }
    } else {
        new Reset(CHANNEL);
    }
}
Also used : WarningMessage(io.github.spugn.Sargo.Objects.WarningMessage)

Example 17 with WarningMessage

use of io.github.spugn.Sargo.Objects.WarningMessage in project S-argo by Expugn.

the class Memorial method run.

@Override
protected void run() {
    switch(CHOICE.toLowerCase()) {
        case "s":
        case "si":
            if (userMemoryDiamonds < singleScoutPrice) {
                CHANNEL.sendMessage(new WarningMessage("NOT ENOUGH MEMORY DIAMONDS", "You need **" + singleScoutPrice + "** Memory Diamonds to scout.\nUse '" + CommandManager.getCommandPrefix() + "**shop**' to get more Memory Diamonds.").get().build());
                return;
            }
            if (CHOICE.equalsIgnoreCase("si") && !IMAGE_DISABLED) {
                generateImage = true;
            }
            userMemoryDiamonds -= singleScoutPrice;
            USER.setMemoryDiamonds(userMemoryDiamonds);
            doSinglePull();
            break;
        default:
            CHANNEL.sendMessage(new WarningMessage("UNKNOWN/UNAVAILABLE SCOUT TYPE", "Only `single` scouts are available.").get().build());
            return;
    }
    if (stopScout)
        return;
    displayAndSave();
}
Also used : WarningMessage(io.github.spugn.Sargo.Objects.WarningMessage)

Example 18 with WarningMessage

use of io.github.spugn.Sargo.Objects.WarningMessage in project S-argo by Expugn.

the class RecordCrystal method run.

@Override
protected void run() {
    switch(CHOICE.toLowerCase()) {
        case "s":
        case "si":
            if (userMemoryDiamonds < singleScoutPrice) {
                CHANNEL.sendMessage(new WarningMessage("NOT ENOUGH MEMORY DIAMONDS", "You need **" + singleScoutPrice + "** Memory Diamonds to scout.\nUse '" + CommandManager.getCommandPrefix() + "**shop**' to get more Memory Diamonds.").get().build());
                return;
            }
            if (CHOICE.equalsIgnoreCase("si") && !IMAGE_DISABLED) {
                generateImage = true;
            }
            userMemoryDiamonds -= singleScoutPrice;
            USER.setMemoryDiamonds(userMemoryDiamonds);
            doSinglePull();
            break;
        case "m":
        case "mi":
            if (userMemoryDiamonds < multiScoutPrice) {
                CHANNEL.sendMessage(new WarningMessage("NOT ENOUGH MEMORY DIAMONDS", "You need **" + multiScoutPrice + "** Memory Diamonds to scout.\nUse '" + CommandManager.getCommandPrefix() + "**shop**' to get more Memory Diamonds.").get().build());
                return;
            }
            if (CHOICE.equalsIgnoreCase("mi") && !IMAGE_DISABLED) {
                generateImage = true;
            }
            userMemoryDiamonds -= multiScoutPrice;
            USER.setMemoryDiamonds(userMemoryDiamonds);
            doMultiPull();
            updateBannerData();
            break;
        case "rc":
        case "rci":
            if (CHOICE.equalsIgnoreCase("rci") && !IMAGE_DISABLED) {
                generateImage = true;
            }
            userRecordCrystals = USER.getBannerData(SELECTED_BANNER.getBannerName());
            if (userRecordCrystals < 10) {
                CHANNEL.sendMessage(new WarningMessage("INSUFFICIENT RECORD CRYSTALS", "You need 10 record crystals to do a record crystal scout.").get().build());
                return;
            }
            userRecordCrystals -= 10;
            USER.changeValue(SELECTED_BANNER.getBannerName(), userRecordCrystals);
            guaranteedScout = true;
            doSinglePull();
            break;
        default:
            CHANNEL.sendMessage(new WarningMessage("UNKNOWN/UNAVAILABLE SCOUT TYPE", "Only `single`, `multi`, and `record crystal` scouts are available.").get().build());
            return;
    }
    if (stopScout)
        return;
    displayAndSave();
}
Also used : WarningMessage(io.github.spugn.Sargo.Objects.WarningMessage)

Example 19 with WarningMessage

use of io.github.spugn.Sargo.Objects.WarningMessage in project S-argo by Expugn.

the class StepUpv3 method run.

@Override
protected void run() {
    switch(CHOICE.toLowerCase()) {
        case "s":
        case "si":
            if (userMemoryDiamonds < singleScoutPrice) {
                CHANNEL.sendMessage(new WarningMessage("NOT ENOUGH MEMORY DIAMONDS", "You need **" + singleScoutPrice + "** Memory Diamonds to scout.\nUse '" + CommandManager.getCommandPrefix() + "**shop**' to get more Memory Diamonds.").get().build());
                return;
            }
            if (CHOICE.equalsIgnoreCase("si") && !IMAGE_DISABLED) {
                generateImage = true;
            }
            userMemoryDiamonds -= singleScoutPrice;
            USER.setMemoryDiamonds(userMemoryDiamonds);
            doSinglePull();
            break;
        case "m":
        case "mi":
            if (userMemoryDiamonds < multiScoutPrice) {
                CHANNEL.sendMessage(new WarningMessage("NOT ENOUGH MEMORY DIAMONDS", "You need **" + multiScoutPrice + "** Memory Diamonds to scout.\nUse '" + CommandManager.getCommandPrefix() + "**shop**' to get more Memory Diamonds.").get().build());
                return;
            }
            if (CHOICE.equalsIgnoreCase("mi") && !IMAGE_DISABLED) {
                generateImage = true;
            }
            userMemoryDiamonds -= multiScoutPrice;
            USER.setMemoryDiamonds(userMemoryDiamonds);
            doMultiPull();
            updateBannerData();
            break;
        default:
            CHANNEL.sendMessage(new WarningMessage("UNKNOWN/UNAVAILABLE SCOUT TYPE", "Only `single` and `multi` scouts are available.").get().build());
            return;
    }
    if (stopScout)
        return;
    displayAndSave();
}
Also used : WarningMessage(io.github.spugn.Sargo.Objects.WarningMessage)

Aggregations

WarningMessage (io.github.spugn.Sargo.Objects.WarningMessage)19 GitHubImage (io.github.spugn.Sargo.Utilities.GitHubImage)1 File (java.io.File)1 FileNotFoundException (java.io.FileNotFoundException)1 IMessage (sx.blah.discord.handle.obj.IMessage)1 EmbedBuilder (sx.blah.discord.util.EmbedBuilder)1 RateLimitException (sx.blah.discord.util.RateLimitException)1