From 369dabffaecd62a826bd27b3cb6a65b5f28ae74e Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Wed, 13 Jul 2016 15:07:24 -0500 Subject: [PATCH] Amplifier updates - move to boost shards only --- .../core/boosters/gui/BoosterPage.java | 2 +- .../hub/server/ui/ServerGameMenu.java | 2 +- .../arcade/booster/GameBoosterManager.java | 6 +- .../src/nautilus/game/arcade/game/Game.java | 41 -------------- .../game/arcade/managers/GameGemManager.java | 56 +++++++++---------- 5 files changed, 30 insertions(+), 77 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/boosters/gui/BoosterPage.java b/Plugins/Mineplex.Core/src/mineplex/core/boosters/gui/BoosterPage.java index e3a9da071..3a6315ec9 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/boosters/gui/BoosterPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/boosters/gui/BoosterPage.java @@ -81,7 +81,7 @@ public class BoosterPage extends ShopPageBase { lore.add(" "); lore.add(C.cGray + "Game Amplifiers allow you to"); - lore.add(C.cGray + "increase the gems and shards"); + lore.add(C.cGray + "increase the shards"); lore.add(C.cGray + "earned in that game for 1 hour."); lore.add(C.cGray + "You will also earn bonus rewards"); lore.add(C.cGray + "from players thanking you while"); diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java index 517720f53..2a9b3243a 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java @@ -220,7 +220,7 @@ public class ServerGameMenu extends ShopPageBase { // append to start of lore builder.getLore().add(0, C.cWhite + "Amplified by " + C.cGreen + booster.getPlayerName() + C.cWhite + " - " + C.cGreen + booster.getTimeRemainingString()); - builder.getLore().add(1, C.cWhite + "All players earn " + C.cGreen + "2x Gems" + C.cWhite + " and " + C.cAqua + "2x Shards"); + builder.getLore().add(1, C.cWhite + "All players earn "+ C.cAqua + "2x Shards"); builder.setGlow(true); } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/booster/GameBoosterManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/booster/GameBoosterManager.java index 5fe291f44..764fc09ef 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/booster/GameBoosterManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/booster/GameBoosterManager.java @@ -55,7 +55,7 @@ public class GameBoosterManager extends MiniPlugin if (active == null) { - UtilPlayer.message(player, F.main("Thanks", "There is no active booster to Thank!")); + UtilPlayer.message(player, F.main("Thanks", "There is no active amplifier to Thank!")); return; } @@ -81,10 +81,10 @@ public class GameBoosterManager extends MiniPlugin Booster booster = event.getBooster(); if (event.getBoosterGroup().equals(_boosterGroup)) { - Bukkit.broadcastMessage(F.main("Amplifier", F.name(booster.getPlayerName()) + " has activated an Amplifier for " + booster.getMultiplier() + "x Gems and Shards!")); + Bukkit.broadcastMessage(F.main("Amplifier", F.name(booster.getPlayerName()) + " has activated a Game Amplifier for " + booster.getMultiplier() + "x Shards!")); } else { - Bukkit.broadcastMessage(F.main("Amplifier", F.name(booster.getPlayerName()) + " has activated an Amplifier on " + F.elem(event.getBoosterGroup().replaceAll("_", " ")) + "!")); + Bukkit.broadcastMessage(F.main("Amplifier", F.name(booster.getPlayerName()) + " has activated a Game Amplifier on " + F.elem(event.getBoosterGroup().replaceAll("_", " ")) + "!")); } } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java index 9ef8aec56..e4f76a2f7 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java @@ -330,7 +330,6 @@ public abstract class Game implements Listener private NautHashMap _deadBodies = new NautHashMap(); private NautHashMap _deadBodiesExpire = new NautHashMap(); - public ArrayList GemBoosters = new ArrayList(); private final Set> _statTrackers = new HashSet<>(); private NautHashMap _teamReqs = new NautHashMap(); @@ -1468,46 +1467,6 @@ public abstract class Game implements Listener SetState(GameState.End); } - public void AddGemBooster(Player player) - { - if (!GemBoosterEnabled) - { - UtilPlayer.message(player, F.main("Game", "You cannot use " + F.elem("Gem Boosters")) + " for this game."); - return; - } - - if (GemBoosters.size() >= 4) - { - UtilPlayer.message(player, F.main("Game", "Games cannot have more than " + F.elem("4 Gem Boosters")) + "."); - return; - } - - if (GemBoosters.contains(player.getName())) - { - UtilPlayer.message(player, F.main("Game", "You can only use " + F.elem("1 Gem Booster")) + " per game."); - return; - } - - Announce(F.elem(player.getName()) + " used a " + F.elem(C.cGreen + "Gem Booster") + " for " - + F.elem("+" + (100 - (GemBoosters.size() * 25)) + "% Gems") + "!"); - - GemBoosters.add(player.getName()); - } - - public double GetGemBoostAmount() - { - if (GemBoosters.size() == 1) - return 1; - if (GemBoosters.size() == 2) - return 1.75; - if (GemBoosters.size() == 3) - return 2.25; - if (GemBoosters.size() == 4) - return 2.5; - - return 0; - } - public void AddStat(Player player, String stat, int amount, boolean limitTo1, boolean global) { if (!Manager.IsRewardStats()) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameGemManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameGemManager.java index 182fcb7ec..963edb84d 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameGemManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameGemManager.java @@ -179,15 +179,16 @@ public class GameGemManager implements Listener System.out.println("Gems for " + Manager.GetClients().Get(player).GetPlayerName()); } + final int baseShards = total; + int shards = baseShards; + //Gem Boooster Booster booster = Manager.getBoosterManager().getActiveBooster(); if (game.GemBoosterEnabled && booster != null) { - total *= booster.getMultiplier(); + shards += baseShards * booster.getMultiplier(); } - int shards = total; - //Gem Finder if (game.GemHunterEnabled) { @@ -221,13 +222,13 @@ public class GameGemManager implements Listener int accountId = Manager.GetClients().getAccountId(player); if (rank == rank.ULTRA) - shards *= 1.5; + shards += baseShards * 0.5; else if (rank == rank.HERO) - shards *= 2; + shards += baseShards * 1; else if (rank == rank.LEGEND) - shards *= 2.5; + shards += baseShards * 1.5; else if (rank.has(Rank.TITAN)) - shards *= 3; + shards += baseShards * 2; Manager.GetDonation().RewardGems(null, "Earned " + game.GetName(), player.getName(), player.getUniqueId(), total); if (accountId != -1) @@ -313,18 +314,6 @@ public class GameGemManager implements Listener int totalGems = earnedGems; - //Gem Booster - Booster booster = Manager.getBoosterManager().getActiveBooster(); - if (game.GemBoosterEnabled && booster != null) - { - int addedGems = (int) (earnedGems * booster.getMultiplier()) - earnedGems; - UtilPlayer.message(player, F.elem(C.cGreen + "+" + addedGems + " Gems") + " for " + F.elem(booster.getPlayerName() + "'s Game Amplifier" + C.cGreen + " +" + booster.getIncreasePercent() + "%")); - - totalGems *= booster.getMultiplier(); - } - - int shards = totalGems; - //Gem Finder if (game.GemHunterEnabled) { @@ -370,28 +359,33 @@ public class GameGemManager implements Listener totalGems += earnedGems; } - int earnedShards = shards; - double mult = 1; + final int baseShards = totalGems; + int shards = baseShards; + double extraMult = 0; Rank rank = Manager.GetClients().Get(player).GetRank(); if (rank == rank.ULTRA) - mult = 1.5; + extraMult = 0.5; else if (rank == rank.HERO) - mult = 2; + extraMult = 1; else if (rank == rank.LEGEND) - mult = 2.5; + extraMult = 1.5; else if (rank.has(Rank.TITAN)) - mult = 3; + extraMult = 2; - shards *= mult; - mult--; - - UtilPlayer.message(player, F.elem(C.cAqua + "+" + earnedShards + " Treasure Shards") + " for " + F.elem("Earning " + earnedShards + " Gems")); + UtilPlayer.message(player, F.elem(C.cAqua + "+" + baseShards + " Treasure Shards") + " for " + F.elem("Earning " + baseShards + " Gems")); if (rank.has(Rank.ULTRA)) { - UtilPlayer.message(player, F.elem(C.cAqua + "+" + (shards - earnedShards) + " Treasure Shards") + " for " + - F.elem(rank.getTag(true, true)) + F.elem(" Rank" + C.cAqua + " +" + Math.round((mult*100)) + "%")); + UtilPlayer.message(player, F.elem(C.cAqua + "+" + (baseShards * extraMult) + " Treasure Shards") + " for " + + F.elem(rank.getTag(true, true)) + F.elem(" Rank" + C.cAqua + " +" + Math.round((extraMult*100)) + "%")); + } + Booster booster = Manager.getBoosterManager().getActiveBooster(); + if (game.GemBoosterEnabled && booster != null) + { + double multiplier = booster.getMultiplier() - 1; + UtilPlayer.message(player, F.elem(C.cAqua + "+" + (baseShards * multiplier) + " Treasure Shards") + " for " + + F.name(booster.getPlayerName()) + "'s" + F.elem(" Game Amplifier" + C.cAqua + " +" + Math.round((multiplier*100)) + "%")); } //Inform