Added love chest

This commit is contained in:
LCastr0 2017-01-16 21:06:24 -02:00
parent 819741d8ff
commit ccd490b41a
5 changed files with 85 additions and 14 deletions

View File

@ -64,6 +64,7 @@ public class RewardPool
THANKFUL(false),
GINGERBREAD(false, 1),
MINESTRIKE(true, 2),
LOVECHEST(false, 1),
CARL_SPINNER(true);
private boolean _useDuplicates;

View File

@ -19,6 +19,7 @@ public enum RewardType
THANKFUL_CHEST( 0.1, 2, 16, 0),
GINGERBREAD_CHEST( 0, 2, 16, 0),
MINESTRIKE_CHEST( 0, 2, 16, 0),
LOVE_CHEST( 0, 2, 16, 0),
VALENTINES_GIFT( 0, 7, 20, 20),
SPINNER_FILLER( 0.1, 1, 4, 20),

View File

@ -83,6 +83,13 @@ public enum TreasureStyle
ParticleType.INSTANT_SPELL,
Sound.EXPLODE,
Sound.EXPLODE
),
LOVECHEST(
ParticleType.HEART,
ParticleType.HEART,
ParticleType.HEART,
Sound.VILLAGER_YES,
Sound.VILLAGER_YES
);
private ParticleType _secondaryParticle;

View File

@ -30,7 +30,9 @@ public enum TreasureType
GINGERBREAD(C.cRed + "Gingerbread " + C.cGreen + "Treasure", "Gingerbread Chest", "Gingerbread", RewardType.GINGERBREAD_CHEST, Material.CHEST, TreasureStyle.GINGERBREAD, RewardPool.Type.GINGERBREAD, true, 20000),
MINESTRIKE(C.cGold + "Minestrike Treasure", "Minestrike Chest", "MinestrikeChest", RewardType.MINESTRIKE_CHEST, Material.CHEST, TreasureStyle.MINESTRIKE, RewardPool.Type.MINESTRIKE, true, 10000);
MINESTRIKE(C.cGold + "Minestrike Treasure", "Minestrike Chest", "MinestrikeChest", RewardType.MINESTRIKE_CHEST, Material.CHEST, TreasureStyle.MINESTRIKE, RewardPool.Type.MINESTRIKE, true, 10000),
LOVE_CHEST(C.cRed + "Love Treasure", "Love Chest", "LoveChest", RewardType.LOVE_CHEST, Material.CHEST, TreasureStyle.LOVECHEST, RewardPool.Type.LOVECHEST, true, 20000);
private final String _name;
private final RewardType _rewardType;

View File

@ -136,6 +136,15 @@ public class TreasurePage extends ShopPageBase<TreasureManager, TreasureShop>
int thankCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.THANKFUL.getItemName());
int gingerbreadCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.GINGERBREAD.getItemName());
int minestrikeCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.MINESTRIKE.getItemName());
int loveCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.LOVE_CHEST.getItemName());
boolean availableChristmas = false;
boolean availableFreedom = false;
boolean availableHaunted = false;
boolean availableTrick = false;
boolean availableThank = false;
boolean availableGingerbread = false;
boolean availableLove = new File("../../update/files/EnableLoveChest.dat").exists();
List<String> shardLore = new ArrayList<>();
shardLore.add(" ");
@ -296,8 +305,7 @@ public class TreasurePage extends ShopPageBase<TreasureManager, TreasureShop>
}
else
{
boolean available = new File("../../update/files/EnableTrickOrTreat.dat").exists();
if (!available)
if (!availableTrick)
{
trickLore.add(C.cRed + "This item is no longer available!");
}
@ -323,8 +331,7 @@ public class TreasurePage extends ShopPageBase<TreasureManager, TreasureShop>
}
else
{
boolean available = new File("../../update/files/EnableThankful.dat").exists();
if (!available)
if (!availableThank)
{
thankLore.add(C.cRed + "This item is no longer available!");
}
@ -351,9 +358,7 @@ public class TreasurePage extends ShopPageBase<TreasureManager, TreasureShop>
}
else
{
gingerbreadLore.add(ChatColor.RESET + "Click to craft for " + C.cAqua + "20000 Treasure Shards");
gingerbreadLore.add(" ");
gingerbreadLore.add(ChatColor.RESET + "or Purchase at: " + C.cYellow + "www.mineplex.com/shop");
gingerbreadLore.add(C.cRed + "This item is no longer available!");
}
List<String> minestrikeLore = Lists.newArrayList();
@ -378,6 +383,30 @@ public class TreasurePage extends ShopPageBase<TreasureManager, TreasureShop>
minestrikeLore.add(ChatColor.RESET + "or Purchase at: " + C.cYellow + "www.mineplex.com/shop");
}
List<String> lovechestLore = Lists.newArrayList();
lovechestLore.add(" ");
lovechestLore.add(F.value("Love Chests Owned", "" + loveCount));
lovechestLore.add(" ");
lovechestLore.addAll(UtilText.splitLines(new String[]{"Placeholder"}, LineFormat.LORE));
lovechestLore.add(" ");
if (loveCount > 0)
{
lovechestLore.add(C.cGreen + "Click to Open!");
}
else
{
if (!availableLove)
{
lovechestLore.add(C.cRed + "This item is no longer available");
}
else
{
lovechestLore.add(ChatColor.RESET + "Click to craft for " + C.cAqua + TreasureType.LOVE_CHEST.getPurchasePrice() + " Treasure Shards");
lovechestLore.add(" ");
lovechestLore.add(ChatColor.RESET + "or Purchase at: " + C.cYellow + "www.mineplex.com/shop");
}
}
ShopItem shards = new ShopItem(Material.PRISMARINE_SHARD, C.cAqua + C.Bold + treasureShards + " Treasure Shards", shardLore.toArray(new String[0]), 0, false);
// Normal chests
@ -395,6 +424,7 @@ public class TreasurePage extends ShopPageBase<TreasureManager, TreasureShop>
ItemStack trick = new ShopItem(Material.SKULL_ITEM, C.cGoldB + "Trick or Treat Treasure", trickLore.toArray(new String[0]), 0, false, false);
ItemStack thank = new ShopItem(Material.COOKED_CHICKEN, C.cGoldB + "Thankful Treasure", thankLore.toArray(new String[0]), 0, false, false);
ItemStack gingerbread = SkinData.GINGERBREAD.getSkull(C.cRedB + "Gingerbread" + C.cGreenB + " Treasure", gingerbreadLore);
ItemStack lovechest = SkinData.LOVESTRUCK.getSkull(C.cRedB + "Love Treasure", lovechestLore);
// Adds shard item
addItem(49, shards);
@ -416,6 +446,7 @@ public class TreasurePage extends ShopPageBase<TreasureManager, TreasureShop>
TreasurePageItem trickTreasureItem = new TreasurePageItem(trick, trickCount, TreasureType.TRICK_OR_TREAT);
TreasurePageItem thankTreasureItem = new TreasurePageItem(thank, thankCount, TreasureType.THANKFUL);
TreasurePageItem gingerbreadTreasureItem = new TreasurePageItem(gingerbread, gingerbreadCount, TreasureType.GINGERBREAD);
TreasurePageItem loveChestItem = new TreasurePageItem(lovechest, loveCount, TreasureType.LOVE_CHEST);
_normalTreasures.add(oldTreasureItem);
_normalTreasures.add(ancientTreasureItem);
@ -424,13 +455,42 @@ public class TreasurePage extends ShopPageBase<TreasureManager, TreasureShop>
_normalTreasures.add(omegaTreasureItem);
_normalTreasures.add(minestrikeTreasureItem);
_seasonalTreasures.add(winterTreasureItem);
_seasonalTreasures.add(freedomTreasureItem);
_seasonalTreasures.add(hauntedTreasureItem);
_seasonalTreasures.add(trickTreasureItem);
_seasonalTreasures.add(thankTreasureItem);
_specialTreasures.add(gingerbreadTreasureItem);
if (availableChristmas)
_specialTreasures.add(winterTreasureItem);
else
_seasonalTreasures.add(winterTreasureItem);
if (availableFreedom)
_specialTreasures.add(freedomTreasureItem);
else
_seasonalTreasures.add(freedomTreasureItem);
if (availableHaunted)
_specialTreasures.add(hauntedTreasureItem);
else
_seasonalTreasures.add(hauntedTreasureItem);
if (availableTrick)
_specialTreasures.add(trickTreasureItem);
else
_seasonalTreasures.add(trickTreasureItem);
if (availableThank)
_specialTreasures.add(thankTreasureItem);
else
_seasonalTreasures.add(thankTreasureItem);
if (availableGingerbread)
_specialTreasures.add(gingerbreadTreasureItem);
else
_seasonalTreasures.add(gingerbreadTreasureItem);
if (availableLove)
_specialTreasures.add(loveChestItem);
else
_seasonalTreasures.add(loveChestItem);
}
private void buildFirstPage()