Implement easter egg baskets in games which can give fantastic rewards

This commit is contained in:
AlexTheCoder 2017-04-11 20:18:09 -04:00
parent 2d61dffaea
commit 9a58cd792e
5 changed files with 46 additions and 31 deletions

View File

@ -57,6 +57,13 @@ public enum Achievement
new int[]{200},
AchievementCategory.HOLIDAY),
GLOBAL_EGG_HUNTER_2017("2017 Egg Hunter", 4000,
new String[]{"Global.Easter Eggs 2017"},
new String[]{"Find 200 Easter Egg Baskets,",
"during Easter 2017"},
new int[]{200},
AchievementCategory.HOLIDAY),
//Bridges
BRIDGES_WINS("Bridge Champion", 600,
new String[]{"The Bridges.Wins"},

View File

@ -208,9 +208,6 @@ public class AchievementManager extends MiniPlugin
return level;
}
if (sender.getName().equalsIgnoreCase("B2_mp"))
return 101;
if (rank.has(Rank.MODERATOR))
level = Math.max(level, 5);
if (rank.has(Rank.SNR_MODERATOR))
@ -222,9 +219,6 @@ public class AchievementManager extends MiniPlugin
if (rank.has(Rank.OWNER))
level = Math.max(level, 50 + get(sender, Achievement.GLOBAL_GEM_HUNTER).getLevel());
if (sender.getName().equalsIgnoreCase("Phinary"))
level = 0;
return level;
}

View File

@ -50,7 +50,7 @@ public class GiveawayMessageHandler implements CommandCallback
String playerName = message.getPlayerName();
int count = message.getEternalCount();
String countString = count + UtilTime.getDayOfMonthSuffix(count);
String chatMessage = C.cPurple + playerName + C.cWhite + " found Eternal Rank in a " + C.cPurple + "Thanksgiving Chicken";
String chatMessage = C.cPurple + playerName + C.cWhite + " found Eternal Rank in an " + C.cPurple + "Easter Egg Basket";
UtilTextMiddle.display(C.cDPurple + C.Bold + "ETERNAL", chatMessage, 20, 80, 20, UtilServer.getPlayers());
World world = UtilServer.getPlayers().length > 0 ? UtilServer.getPlayers()[0].getWorld() : Bukkit.getWorlds().get(0);
LightFlicker lightFlicker = new LightFlicker(world);

View File

@ -353,7 +353,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
TitanGiveawayManager titanGiveaway = new TitanGiveawayManager(getPlugin(), clientManager, serverStatusManager);
EternalGiveawayManager eternalGiveawayManager = new EternalGiveawayManager(getPlugin(), clientManager, serverStatusManager);
IsHolidayEnabled = false;
IsHolidayEnabled = true;
if (IsHolidayEnabled)
new HolidayManager(this, titanGiveaway, eternalGiveawayManager);

View File

@ -97,8 +97,8 @@ public class HolidayManager implements Listener
}
}
private HolidayType _type = HolidayType.THANKSGIVING;
private String _statName = "Thanksgiving Chickens 2016";
private HolidayType _type = HolidayType.EASTER;
private String _statName = "Easter Eggs 2017";
private ArcadeManager _arcadeManager;
private TitanGiveawayManager _titanManager;
@ -109,7 +109,7 @@ public class HolidayManager implements Listener
private HashSet<Item> _items = new HashSet<>();
private HashSet<Item> _coins = new HashSet<>();
private HashSet<Item> _shards = new HashSet<>();
private HashSet<Item> _gems = new HashSet<>();
private static final double CHEST_CHANCE = 0.001;
@ -478,25 +478,25 @@ public class HolidayManager implements Listener
if (player != null && _arcadeManager.GetGame() != null)
{
_arcadeManager.GetGame().AddStat(player, _statName, 1, false, true);
System.out.println("Recording Pumpkin Break for " + player.getName());
System.out.println("Recording Holiday Block Break for " + player.getName());
}
//Coins
//Shards
for (int i = 0; i < 4 + Math.random() * 8; i++)
{
Item coin = block.getWorld().dropItem(block.getLocation().add(0.5, 1, 0.5),
ItemStackFactory.Instance.CreateStack(Material.PRISMARINE_SHARD, (byte) 0, 1, UtilMath.r(999999) + "Coin"));
Item shard = block.getWorld().dropItem(block.getLocation().add(0.5, 1, 0.5),
ItemStackFactory.Instance.CreateStack(Material.PRISMARINE_SHARD, (byte) 0, 1, UtilMath.r(999999) + "Shard"));
Vector vel = new Vector(
(Math.random() - 0.5) * 0.5,
0.1 + Math.random() * 0.3,
(Math.random() - 0.5) * 0.5);
coin.setVelocity(vel);
shard.setVelocity(vel);
coin.setPickupDelay(20);
shard.setPickupDelay(20);
_coins.add(coin);
_shards.add(shard);
}
//Gems
@ -531,6 +531,20 @@ public class HolidayManager implements Listener
});
}*/
// Eternal Giveaway
if (player != null)
{
_eternalGiveawayManager.openPumpkin(player, new Runnable()
{
@Override
public void run()
{
Location location = block.getLocation().add(0.5, 0.5, 0.5);
new EternalGiveawayAnimation(_eternalGiveawayManager, location, 3000L);
}
});
}
if (player != null)
{
InventoryManager manager = _arcadeManager.getInventoryManager();
@ -540,9 +554,9 @@ public class HolidayManager implements Listener
if (hasItemsToGivePlayer(TreasureType.HAUNTED.getRewardPool(), player))
{
FireworkEffect fireworkEffect = FireworkEffect.builder().with(FireworkEffect.Type.BALL_LARGE)
.withColor(Color.ORANGE).withColor(Color.BLACK).withFade(Color.ORANGE)
.withFade(Color.BLACK).flicker(true).build();
manager.addItemToInventory(player, "Haunted Chest", 1);
.withColor(Color.LIME).withColor(Color.WHITE).withFade(Color.YELLOW)
.withFade(Color.WHITE).flicker(true).build();
manager.addItemToInventory(player, "Spring Chest", 1);
HalloweenSmashedEffect halloweenSmashedEffect = new HalloweenSmashedEffect(block.getLocation()
.add(.5, .5, .5), fireworkEffect, _arcadeManager.getPlugin());
halloweenSmashedEffect.start();
@ -569,25 +583,25 @@ public class HolidayManager implements Listener
if (player != null && _arcadeManager.GetGame() != null)
{
_arcadeManager.GetGame().AddStat(player, _statName, 1, false, true);
System.out.println("Recording Entity Killong for " + player.getName());
System.out.println("Recording Entity Killing for " + player.getName());
}
//Coins
for (int i=0 ; i < 4 + Math.random()*8 ; i++)
{
Item coin = entity.getWorld().dropItem(entity.getLocation().add(0.5, 1, 0.5),
ItemStackFactory.Instance.CreateStack(Material.PRISMARINE_SHARD, (byte)0, 1, UtilMath.r(999999) + "Coin"));
Item shard = entity.getWorld().dropItem(entity.getLocation().add(0.5, 1, 0.5),
ItemStackFactory.Instance.CreateStack(Material.PRISMARINE_SHARD, (byte)0, 1, UtilMath.r(999999) + "Shard"));
Vector vel = new Vector(
(Math.random() - 0.5) * 0.5,
0.1 + Math.random() * 0.3,
(Math.random() - 0.5) * 0.5);
coin.setVelocity(vel);
shard.setVelocity(vel);
coin.setPickupDelay(20);
shard.setPickupDelay(20);
_coins.add(coin);
_shards.add(shard);
}
//Gems
@ -629,12 +643,12 @@ public class HolidayManager implements Listener
if (UtilPlayer.isSpectator(event.getPlayer()))
return;
if (_coins.contains(event.getItem()))
if (_shards.contains(event.getItem()))
{
event.setCancelled(true);
event.getItem().remove();
_arcadeManager.GetDonation().rewardCurrency(GlobalCurrency.TREASURE_SHARD, event.getPlayer(), _type + " Coins", 4 * event.getItem().getItemStack().getAmount());
_arcadeManager.GetDonation().rewardCurrency(GlobalCurrency.TREASURE_SHARD, event.getPlayer(), _type + " Shards", 4 * event.getItem().getItemStack().getAmount());
event.getPlayer().getWorld().playSound(event.getPlayer().getLocation(), Sound.ORB_PICKUP, 1f, 2f);
}
@ -660,7 +674,7 @@ public class HolidayManager implements Listener
if (event.getType() != UpdateType.FAST)
return;
Iterator<Item> coinIterator = _coins.iterator();
Iterator<Item> coinIterator = _shards.iterator();
while (coinIterator.hasNext())
{
@ -703,7 +717,7 @@ public class HolidayManager implements Listener
@EventHandler
public void spawnDebug(PlayerCommandPreprocessEvent event)
{
if (event.getPlayer().isOp() && event.getMessage().toLowerCase().startsWith("/pumpkin"))
if (event.getPlayer().isOp() && event.getMessage().toLowerCase().startsWith("/holidayblock"))
{
spawnSpecialBlock(event.getPlayer().getLocation().getBlock());
event.setCancelled(true);