More treasure rewards + tweaks

This commit is contained in:
Shaun Bennett 2014-09-12 14:24:30 -05:00
parent dea6c98fc9
commit 20680acea0
7 changed files with 22 additions and 21 deletions

View File

@ -18,13 +18,11 @@ public class ChestData
private Block _block; private Block _block;
private ITreasureReward _reward; private ITreasureReward _reward;
private boolean _opened; private boolean _opened;
private boolean _finishedOpen;
public ChestData(Block block, ITreasureReward reward) public ChestData(Block block, ITreasureReward reward)
{ {
_block = block; _block = block;
_opened = false; _opened = false;
_finishedOpen = false;
_reward = reward; _reward = reward;
} }
@ -33,21 +31,11 @@ public class ChestData
return _opened; return _opened;
} }
public boolean isFinishedOpen()
{
return _finishedOpen;
}
public void setOpened(boolean opened) public void setOpened(boolean opened)
{ {
_opened = opened; _opened = opened;
} }
public void setFinishedOpen(boolean finishedOpen)
{
_finishedOpen = finishedOpen;
}
public Block getBlock() public Block getBlock()
{ {
return _block; return _block;

View File

@ -298,7 +298,6 @@ public class Treasure
if (!chestData.isOpened()) if (!chestData.isOpened())
{ {
chestData.setOpened(true); chestData.setOpened(true);
chestData.setFinishedOpen(true);
chestData.getReward().giveReward(_player); chestData.getReward().giveReward(_player);
} }
} }

View File

@ -29,7 +29,6 @@ import mineplex.core.treasure.reward.ITreasureReward;
import mineplex.core.treasure.reward.RewardManager; import mineplex.core.treasure.reward.RewardManager;
import mineplex.core.treasure.reward.RewardRarity; import mineplex.core.treasure.reward.RewardRarity;
import mineplex.core.treasure.reward.rewards.CoinReward; import mineplex.core.treasure.reward.rewards.CoinReward;
import mineplex.core.treasure.reward.rewards.GemReward;
import mineplex.core.treasure.reward.rewards.InventoryReward; import mineplex.core.treasure.reward.rewards.InventoryReward;
import mineplex.core.treasure.reward.rewards.UnknownPackageReward; import mineplex.core.treasure.reward.rewards.UnknownPackageReward;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
@ -70,6 +69,8 @@ public class TreasureManager extends MiniPlugin
new ItemStack(Material.INK_SACK), RewardRarity.VERY_RARE, 300)); new ItemStack(Material.INK_SACK), RewardRarity.VERY_RARE, 300));
_rewardManager.addReward(new UnknownPackageReward(donationManager, "Notch Morph", "Notch", _rewardManager.addReward(new UnknownPackageReward(donationManager, "Notch Morph", "Notch",
new ItemStack(Material.INK_SACK), RewardRarity.VERY_RARE, 10)); new ItemStack(Material.INK_SACK), RewardRarity.VERY_RARE, 10));
_rewardManager.addReward(new InventoryReward(inventoryManager, "Gem Boosters", "Gem Booster", 50, 100,
new ItemStack(Material.EMERALD_BLOCK), RewardRarity.VERY_RARE, 500));
// Rare // Rare
_rewardManager.addReward(new CoinReward(donationManager, 500, 1000, 1000, RewardRarity.RARE)); _rewardManager.addReward(new CoinReward(donationManager, 500, 1000, 1000, RewardRarity.RARE));
@ -83,12 +84,24 @@ public class TreasureManager extends MiniPlugin
new ItemStack(Material.LEATHER), RewardRarity.RARE, 500)); new ItemStack(Material.LEATHER), RewardRarity.RARE, 500));
_rewardManager.addReward(new UnknownPackageReward(donationManager, "Enderman Morph", "Enderman Morph", _rewardManager.addReward(new UnknownPackageReward(donationManager, "Enderman Morph", "Enderman Morph",
new ItemStack(Material.ENDER_PEARL), RewardRarity.RARE, 200)); new ItemStack(Material.ENDER_PEARL), RewardRarity.RARE, 200));
_rewardManager.addReward(new InventoryReward(inventoryManager, "Gem Boosters", "Gem Booster", 10, 20,
new ItemStack(Material.EMERALD_BLOCK), RewardRarity.RARE, 500));
// Uncommon // Uncommon
_rewardManager.addReward(new CoinReward(donationManager, 100, 500, 1000, RewardRarity.UNCOMMON)); _rewardManager.addReward(new CoinReward(donationManager, 100, 500, 2000, RewardRarity.UNCOMMON));
_rewardManager.addReward(new InventoryReward(inventoryManager, "Ender Pearls", "Ethereal Pearl", 75, 150,
new ItemStack(Material.ENDER_PEARL), RewardRarity.UNCOMMON, 1000));
_rewardManager.addReward(new InventoryReward(inventoryManager, "Fireworks", "Fireworks", 75, 150,
new ItemStack(Material.FIREWORK), RewardRarity.UNCOMMON, 1000));
_rewardManager.addReward(new InventoryReward(inventoryManager, "TNT", "TNT", 30, 60,
new ItemStack(Material.TNT), RewardRarity.UNCOMMON, 1000));
_rewardManager.addReward(new InventoryReward(inventoryManager, "Melons", "Melon Launcher", 150, 300,
new ItemStack(Material.MELON_BLOCK), RewardRarity.UNCOMMON, 1000));
_rewardManager.addReward(new InventoryReward(inventoryManager, "Gem Boosters", "Gem Booster", 1, 10,
new ItemStack(Material.EMERALD_BLOCK), RewardRarity.UNCOMMON, 500));
// Common // Common
_rewardManager.addReward(new CoinReward(donationManager, 0, 100, 1000, RewardRarity.COMMON)); _rewardManager.addReward(new CoinReward(donationManager, 0, 100, 2000, RewardRarity.COMMON));
_rewardManager.addReward(new InventoryReward(inventoryManager, "Ender Pearls", "Ethereal Pearl", 25, 75, _rewardManager.addReward(new InventoryReward(inventoryManager, "Ender Pearls", "Ethereal Pearl", 25, 75,
new ItemStack(Material.ENDER_PEARL), RewardRarity.COMMON, 1000)); new ItemStack(Material.ENDER_PEARL), RewardRarity.COMMON, 1000));
_rewardManager.addReward(new InventoryReward(inventoryManager, "Fireworks", "Fireworks", 25, 75, _rewardManager.addReward(new InventoryReward(inventoryManager, "Fireworks", "Fireworks", 25, 75,

View File

@ -7,7 +7,6 @@ import org.bukkit.FireworkEffect;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Sound; import org.bukkit.Sound;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.craftbukkit.v1_7_R4.CraftWorld;
import mineplex.core.common.util.UtilFirework; import mineplex.core.common.util.UtilFirework;
import mineplex.core.treasure.Treasure; import mineplex.core.treasure.Treasure;
@ -17,6 +16,10 @@ import mineplex.core.treasure.Treasure;
*/ */
public class ChestExplodeAnimation extends Animation public class ChestExplodeAnimation extends Animation
{ {
/**
* Played when a "Very Rare" chest is opened
*/
private Random _random = new Random(); private Random _random = new Random();
private Block _chestBlock; private Block _chestBlock;

View File

@ -57,8 +57,6 @@ public class ChestOpenAnimation extends Animation
{ {
_hologram = new Hologram(_chestData.getBlock().getLocation().add(0.5, 1.1, 0.5), _text); _hologram = new Hologram(_chestData.getBlock().getLocation().add(0.5, 1.1, 0.5), _text);
_hologram.sendToPlayers(_chestData.getBlock().getLocation().getWorld().getPlayers().toArray(new Player[0])); _hologram.sendToPlayers(_chestData.getBlock().getLocation().getWorld().getPlayers().toArray(new Player[0]));
_chestData.setFinishedOpen(true);
} }
} }

View File

@ -16,7 +16,7 @@ import mineplex.core.treasure.Treasure;
public class CircleAnimation extends Animation public class CircleAnimation extends Animation
{ {
/** /**
* Uncommon Rarity * Played when a "Rare" chest is opened
*/ */
private Location _centerLocation; private Location _centerLocation;

View File

@ -25,7 +25,7 @@ import mineplex.core.treasure.Treasure;
public class FireworksAnimation extends Animation public class FireworksAnimation extends Animation
{ {
/** /**
* Rare Rarity * Played when an "Uncommon" chest is opened
*/ */
private Random _random = new Random(); private Random _random = new Random();