// Path: src/main/java/io/github/spugn/Sargo/Objects/Item.java
// public class Item
// {
//     private String name;
//     private int quantity;
//     private int value;
//     private String imagePath;
// 
//     public Item()
//     {
//         name = "null";
//         quantity = 0;
//         value = -1;
//         imagePath = "";
//     }
// 
//     public Item(String name, int quantity, int value)
//     {
//         this.name = name;
//         this.quantity = quantity;
//         this.value = value;
//         imagePath = "";
//     }
// 
//     public void setName(String name)
//     {
//         this.name = name;
//     }
// 
//     public void setQuantity(int quantity)
//     {
//         this.quantity = quantity;
//     }
// 
//     public void setImagePath(String imagePath)
//     {
//         this.imagePath = imagePath;
//     }
// 
//     public String getName()
//     {
//         return name;
//     }
// 
//     public String getImagePath()
//     {
//         if (imagePath.isEmpty())
//         {
//             return "images/Items/" + name.replaceAll(" ", "_") + ".png";
//         }
//         return imagePath;
//     }
// 
//     public int getQuantity()
//     {
//         return quantity;
//     }
// 
//     public int getValue()
//     {
//         return value;
//     }
// 
//     @Override
//     public String toString()
//     {
//         return name + " x" + quantity;
//     }
// }
// 
// Path: src/main/java/io/github/spugn/Sargo/Utilities/GitHubImage.java
// public class GitHubImage
// {
//     private String filePath;
//     private final String GITHUB_IMAGE;
// 
//     public GitHubImage(String filePath)
//     {
//         GITHUB_IMAGE = LoginSettingsParser.getGitHubRepoURL();
//         this.filePath = filePath;
//     }
// 
//     public String getURL()
//     {
//         String url = GITHUB_IMAGE + filePath;
// 
//         /* REPLACE ALL SPACES WITH %20 */
//         url = url.replaceAll(" ", "%20");
// 
//         /* REPLACE ALL ★ WITH %E2%98%85 */
//         url = url.replaceAll("★", "%E2%98%85");
// 
//         return url;
//     }
// }


import discord4j.core.object.entity.Message;
import io.github.spugn.Sargo.Objects.Item;
import io.github.spugn.Sargo.Utilities.GitHubImage;
package io.github.spugn.Sargo.TicketScout;


public class Plusv2 extends TicketScout
{

    public Plusv2(Message message, String choice, String discordID)
    {
        super(message, choice, discordID);
        run();
    }

    @Override
    protected void initItems()
    {
        medallionsAndKeyList.add(new Item("Void Medallion", 3, 7500));
        medallionsAndKeyList.add(new Item("Fire Medallion", 3, 7500));
        medallionsAndKeyList.add(new Item("Water Medallion", 3, 7500));
        medallionsAndKeyList.add(new Item("Wind Medallion", 3, 7500));
        medallionsAndKeyList.add(new Item("Holy Medallion", 3, 7500));
        medallionsAndKeyList.add(new Item("Dark Medallion", 3, 7500));
        medallionsAndKeyList.add(new Item("Earth Medallion", 3, 7500));
    }

    @Override
    protected int scout()
    {
        double d;
        d = RNG.nextDouble() * 100;

        double exchangeSwordR3 = 8;
        double exchangeSwordR4 = 1;
        double medallions = 47.796;
        double stardust = 18.207;
        double upgradeCrystal = 15;
        double memoryFragment = 6;

        /* EXCHANGE SWORD R3 */
        if (d < exchangeSwordR3)
        {
            return 1;
        }
        /* EXCHANGE SWORD R4 */
        else if (d < exchangeSwordR3 + exchangeSwordR4)
        {
            return 2;
        }
        /* MEDALLIONS */
        else if (d < exchangeSwordR3 + exchangeSwordR4 + medallions)
        {
            return 3;
        }
        /* STARDUST */
        else if (d < exchangeSwordR3 + exchangeSwordR4 + medallions + stardust)
        {
            return 4;
        }
        /* UPGRADE CRYSTAL */
        else if (d < exchangeSwordR3 + exchangeSwordR4 + medallions + stardust + upgradeCrystal)
        {
            return 5;
        }
        /* MEMORY FRAGMENT */
        else if (d < exchangeSwordR3 + exchangeSwordR4 + medallions + stardust + upgradeCrystal + memoryFragment)
        {
            return 6;
        }
        /* RAINBOW ESSENCE */
        else
        {
            return 7;
        }
    }

    @Override
    protected Item getItem(int value)
    {
        Item item;

        /* EXCHANGE SWORD R3 */
        if (value == 1)
        {
            item = new Item("Exchange Sword R3", 1, -1);
        }
        /* EXCHANGE SWORD R4 */
        else if (value == 2)
        {
            item = new Item("Exchange Sword R4", 1, -1);
        }
        /* MEDALLIONS  */
        else if (value == 3)
        {
            item = medallionsAndKeyList.get(RNG.nextInt(medallionsAndKeyList.size()));
        }
        /* STARDUST */
        else if (value == 4)
        {
            item = new Item("Stardust (Medium)", 20, 1000);
        }
        /* UPGRADE CRYSTAL */
        else if (value == 5)
        {
            item = new Item("Upgrade Crystal", 1, -1);
        }
        /* MEMORY FRAGMENT */
        else if (value == 6)
        {
            item = new Item("Memory Fragment", 1, -1);
        }
        /* RAINBOW ESSENCE */
        else
        {
            item = new Item("Rainbow Essence", 1, -1);
        }

        giveCol(item);
        return item;
    }

    @Override
    protected void setupScoutMenu()
    {
        if (!SIMPLE_MESSAGE)
        {
// Path: src/main/java/io/github/spugn/Sargo/Objects/Item.java
// public class Item
// {
//     private String name;
//     private int quantity;
//     private int value;
//     private String imagePath;
// 
//     public Item()
//     {
//         name = "null";
//         quantity = 0;
//         value = -1;
//         imagePath = "";
//     }
// 
//     public Item(String name, int quantity, int value)
//     {
//         this.name = name;
//         this.quantity = quantity;
//         this.value = value;
//         imagePath = "";
//     }
// 
//     public void setName(String name)
//     {
//         this.name = name;
//     }
// 
//     public void setQuantity(int quantity)
//     {
//         this.quantity = quantity;
//     }
// 
//     public void setImagePath(String imagePath)
//     {
//         this.imagePath = imagePath;
//     }
// 
//     public String getName()
//     {
//         return name;
//     }
// 
//     public String getImagePath()
//     {
//         if (imagePath.isEmpty())
//         {
//             return "images/Items/" + name.replaceAll(" ", "_") + ".png";
//         }
//         return imagePath;
//     }
// 
//     public int getQuantity()
//     {
//         return quantity;
//     }
// 
//     public int getValue()
//     {
//         return value;
//     }
// 
//     @Override
//     public String toString()
//     {
//         return name + " x" + quantity;
//     }
// }
// 
// Path: src/main/java/io/github/spugn/Sargo/Utilities/GitHubImage.java
// public class GitHubImage
// {
//     private String filePath;
//     private final String GITHUB_IMAGE;
// 
//     public GitHubImage(String filePath)
//     {
//         GITHUB_IMAGE = LoginSettingsParser.getGitHubRepoURL();
//         this.filePath = filePath;
//     }
// 
//     public String getURL()
//     {
//         String url = GITHUB_IMAGE + filePath;
// 
//         /* REPLACE ALL SPACES WITH %20 */
//         url = url.replaceAll(" ", "%20");
// 
//         /* REPLACE ALL ★ WITH %E2%98%85 */
//         url = url.replaceAll("★", "%E2%98%85");
// 
//         return url;
//     }
// }


// Path: src/main/java/io/github/spugn/Sargo/TicketScout/Plusv2.java
import discord4j.core.object.entity.Message;
import io.github.spugn.Sargo.Objects.Item;
import io.github.spugn.Sargo.Utilities.GitHubImage;

package io.github.spugn.Sargo.TicketScout;


public class Plusv2 extends TicketScout
{

    public Plusv2(Message message, String choice, String discordID)
    {
        super(message, choice, discordID);
        run();
    }

    @Override
    protected void initItems()
    {
        medallionsAndKeyList.add(new Item("Void Medallion", 3, 7500));
        medallionsAndKeyList.add(new Item("Fire Medallion", 3, 7500));
        medallionsAndKeyList.add(new Item("Water Medallion", 3, 7500));
        medallionsAndKeyList.add(new Item("Wind Medallion", 3, 7500));
        medallionsAndKeyList.add(new Item("Holy Medallion", 3, 7500));
        medallionsAndKeyList.add(new Item("Dark Medallion", 3, 7500));
        medallionsAndKeyList.add(new Item("Earth Medallion", 3, 7500));
    }

    @Override
    protected int scout()
    {
        double d;
        d = RNG.nextDouble() * 100;

        double exchangeSwordR3 = 8;
        double exchangeSwordR4 = 1;
        double medallions = 47.796;
        double stardust = 18.207;
        double upgradeCrystal = 15;
        double memoryFragment = 6;

        /* EXCHANGE SWORD R3 */
        if (d < exchangeSwordR3)
        {
            return 1;
        }
        /* EXCHANGE SWORD R4 */
        else if (d < exchangeSwordR3 + exchangeSwordR4)
        {
            return 2;
        }
        /* MEDALLIONS */
        else if (d < exchangeSwordR3 + exchangeSwordR4 + medallions)
        {
            return 3;
        }
        /* STARDUST */
        else if (d < exchangeSwordR3 + exchangeSwordR4 + medallions + stardust)
        {
            return 4;
        }
        /* UPGRADE CRYSTAL */
        else if (d < exchangeSwordR3 + exchangeSwordR4 + medallions + stardust + upgradeCrystal)
        {
            return 5;
        }
        /* MEMORY FRAGMENT */
        else if (d < exchangeSwordR3 + exchangeSwordR4 + medallions + stardust + upgradeCrystal + memoryFragment)
        {
            return 6;
        }
        /* RAINBOW ESSENCE */
        else
        {
            return 7;
        }
    }

    @Override
    protected Item getItem(int value)
    {
        Item item;

        /* EXCHANGE SWORD R3 */
        if (value == 1)
        {
            item = new Item("Exchange Sword R3", 1, -1);
        }
        /* EXCHANGE SWORD R4 */
        else if (value == 2)
        {
            item = new Item("Exchange Sword R4", 1, -1);
        }
        /* MEDALLIONS  */
        else if (value == 3)
        {
            item = medallionsAndKeyList.get(RNG.nextInt(medallionsAndKeyList.size()));
        }
        /* STARDUST */
        else if (value == 4)
        {
            item = new Item("Stardust (Medium)", 20, 1000);
        }
        /* UPGRADE CRYSTAL */
        else if (value == 5)
        {
            item = new Item("Upgrade Crystal", 1, -1);
        }
        /* MEMORY FRAGMENT */
        else if (value == 6)
        {
            item = new Item("Memory Fragment", 1, -1);
        }
        /* RAINBOW ESSENCE */
        else
        {
            item = new Item("Rainbow Essence", 1, -1);
        }

        giveCol(item);
        return item;
    }

    @Override
    protected void setupScoutMenu()
    {
        if (!SIMPLE_MESSAGE)
        {
            sMenu = sMenu.andThen(s -> s.setAuthor("Plus Ticket v2 Scout", "", new GitHubImage("images/System/Scout_Icon.png").getURL())