Christmas chest in gui

This commit is contained in:
Shaun Bennett 2015-12-10 19:19:20 -05:00
parent 72a8aaf556
commit 7b4f5d5b75

View File

@ -39,6 +39,7 @@ public class TreasurePage extends ShopPageBase<TreasureManager, TreasureShop>
int basicCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.OLD.getItemName());
int heroicCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.ANCIENT.getItemName());
int legendaryCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.MYTHICAL.getItemName());
int christmasCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.CHRISTMAS.getItemName());
List<String> basicLore = new ArrayList<String>();
basicLore.add(" ");
@ -97,17 +98,41 @@ public class TreasurePage extends ShopPageBase<TreasureManager, TreasureShop>
legendaryLore.add(ChatColor.RESET + "or Purchase at: " + C.cYellow + "www.mineplex.com/shop");
}
List<String> christmasLore = new ArrayList<String>();
christmasLore.add(" ");
christmasLore.add(F.value("Christmas Chests Owned", "" + christmasCount));
christmasLore.add(" ");
christmasLore.add(C.cGray + "All our previous adventurers have");
christmasLore.add(C.cGray + "perished in search of these chests.");
christmasLore.add(C.cGray + "However, legends of their existence");
christmasLore.add(C.cGray + "convinced Sterling, Chiss and Defek7");
christmasLore.add(C.cGray + "to venture out and discover the");
christmasLore.add(C.cGray + "location of these chests on their own.");
christmasLore.add(" ");
if (christmasCount > 0)
christmasLore.add(ChatColor.RESET + C.cGreen + "Click to Open!");
else
{
christmasLore.add(ChatColor.RESET + "Click to Purchase for " + C.cYellow + "10000 Coins");
christmasLore.add(" ");
christmasLore.add(ChatColor.RESET + "or Purchase at: " + C.cYellow + "www.mineplex.com/shop");
}
ShopItem basic = new ShopItem(Material.CHEST, C.cGreen + C.Bold + "Old Chest", basicLore.toArray(new String[0]), 0, false, false);
ShopItem heroic = new ShopItem(Material.TRAPPED_CHEST, C.cGold + C.Bold + "Ancient Chest", heroicLore.toArray(new String[0]), 0, false, false);
ShopItem legendary = new ShopItem(Material.ENDER_CHEST, C.cRed + C.Bold + "Mythical Chest", legendaryLore.toArray(new String[0]), 0, false, false);
ShopItem christmas = new ShopItem(Material.SNOW_BALL, C.cAqua + C.Bold + "Christmas Chest", christmasLore.toArray(new String[0]), 0, false, false);
if (basicCount > 0) addButton(2, basic, new OpenTreasureButton(getPlayer(), _treasureLocation, TreasureType.OLD));
else addButton(2, basic, new BuyChestButton(getPlayer(), _inventoryManager, this, "Old Chest", Material.CHEST, 1000));
if (basicCount > 0) addButton(1, basic, new OpenTreasureButton(getPlayer(), _treasureLocation, TreasureType.OLD));
else addButton(1, basic, new BuyChestButton(getPlayer(), _inventoryManager, this, "Old Chest", Material.CHEST, 1000));
if (heroicCount > 0) addButton(4, heroic, new OpenTreasureButton(getPlayer(), _treasureLocation, TreasureType.ANCIENT));
else addButton(4, heroic, new BuyChestButton(getPlayer(), _inventoryManager, this, "Ancient Chest", Material.CHEST, 5000));
if (heroicCount > 0) addButton(3, heroic, new OpenTreasureButton(getPlayer(), _treasureLocation, TreasureType.ANCIENT));
else addButton(3, heroic, new BuyChestButton(getPlayer(), _inventoryManager, this, "Ancient Chest", Material.CHEST, 5000));
if (legendaryCount > 0) addButton(6, legendary, new OpenTreasureButton(getPlayer(), _treasureLocation, TreasureType.MYTHICAL));
else addButton(6, legendary, new BuyChestButton(getPlayer(), _inventoryManager, this, "Mythical Chest", Material.ENDER_CHEST, 10000));
if (legendaryCount > 0) addButton(5, legendary, new OpenTreasureButton(getPlayer(), _treasureLocation, TreasureType.MYTHICAL));
else addButton(5, legendary, new BuyChestButton(getPlayer(), _inventoryManager, this, "Mythical Chest", Material.ENDER_CHEST, 10000));
if (christmasCount > 0) addButton(6, christmas, new OpenTreasureButton(getPlayer(), _treasureLocation, TreasureType.CHRISTMAS));
else addButton(6, christmas, new BuyChestButton(getPlayer(), _inventoryManager, this, "Christmas Chest", Material.SNOW_BALL, 10000));
}
}