Amplifier updates - move to boost shards only

This commit is contained in:
Shaun Bennett 2016-07-13 15:07:24 -05:00
parent 9c3aee6373
commit 369dabffae
5 changed files with 30 additions and 77 deletions

View File

@ -81,7 +81,7 @@ public class BoosterPage extends ShopPageBase<BoosterManager, BoosterShop>
{ {
lore.add(" "); lore.add(" ");
lore.add(C.cGray + "Game Amplifiers allow you to"); 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 + "earned in that game for 1 hour.");
lore.add(C.cGray + "You will also earn bonus rewards"); lore.add(C.cGray + "You will also earn bonus rewards");
lore.add(C.cGray + "from players thanking you while"); lore.add(C.cGray + "from players thanking you while");

View File

@ -220,7 +220,7 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
{ {
// append to start of lore // 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(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); builder.setGlow(true);
} }
} }

View File

@ -55,7 +55,7 @@ public class GameBoosterManager extends MiniPlugin
if (active == null) 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; return;
} }
@ -81,10 +81,10 @@ public class GameBoosterManager extends MiniPlugin
Booster booster = event.getBooster(); Booster booster = event.getBooster();
if (event.getBoosterGroup().equals(_boosterGroup)) 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 } 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("_", " ")) + "!"));
} }
} }
} }

View File

@ -330,7 +330,6 @@ public abstract class Game implements Listener
private NautHashMap<String, Entity> _deadBodies = new NautHashMap<String, Entity>(); private NautHashMap<String, Entity> _deadBodies = new NautHashMap<String, Entity>();
private NautHashMap<String, Long> _deadBodiesExpire = new NautHashMap<String, Long>(); private NautHashMap<String, Long> _deadBodiesExpire = new NautHashMap<String, Long>();
public ArrayList<String> GemBoosters = new ArrayList<String>();
private final Set<StatTracker<? extends Game>> _statTrackers = new HashSet<>(); private final Set<StatTracker<? extends Game>> _statTrackers = new HashSet<>();
private NautHashMap<Player, Player> _teamReqs = new NautHashMap<Player, Player>(); private NautHashMap<Player, Player> _teamReqs = new NautHashMap<Player, Player>();
@ -1468,46 +1467,6 @@ public abstract class Game implements Listener
SetState(GameState.End); 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) public void AddStat(Player player, String stat, int amount, boolean limitTo1, boolean global)
{ {
if (!Manager.IsRewardStats()) if (!Manager.IsRewardStats())

View File

@ -179,15 +179,16 @@ public class GameGemManager implements Listener
System.out.println("Gems for " + Manager.GetClients().Get(player).GetPlayerName()); System.out.println("Gems for " + Manager.GetClients().Get(player).GetPlayerName());
} }
final int baseShards = total;
int shards = baseShards;
//Gem Boooster //Gem Boooster
Booster booster = Manager.getBoosterManager().getActiveBooster(); Booster booster = Manager.getBoosterManager().getActiveBooster();
if (game.GemBoosterEnabled && booster != null) if (game.GemBoosterEnabled && booster != null)
{ {
total *= booster.getMultiplier(); shards += baseShards * booster.getMultiplier();
} }
int shards = total;
//Gem Finder //Gem Finder
if (game.GemHunterEnabled) if (game.GemHunterEnabled)
{ {
@ -221,13 +222,13 @@ public class GameGemManager implements Listener
int accountId = Manager.GetClients().getAccountId(player); int accountId = Manager.GetClients().getAccountId(player);
if (rank == rank.ULTRA) if (rank == rank.ULTRA)
shards *= 1.5; shards += baseShards * 0.5;
else if (rank == rank.HERO) else if (rank == rank.HERO)
shards *= 2; shards += baseShards * 1;
else if (rank == rank.LEGEND) else if (rank == rank.LEGEND)
shards *= 2.5; shards += baseShards * 1.5;
else if (rank.has(Rank.TITAN)) else if (rank.has(Rank.TITAN))
shards *= 3; shards += baseShards * 2;
Manager.GetDonation().RewardGems(null, "Earned " + game.GetName(), player.getName(), player.getUniqueId(), total); Manager.GetDonation().RewardGems(null, "Earned " + game.GetName(), player.getName(), player.getUniqueId(), total);
if (accountId != -1) if (accountId != -1)
@ -313,18 +314,6 @@ public class GameGemManager implements Listener
int totalGems = earnedGems; 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 //Gem Finder
if (game.GemHunterEnabled) if (game.GemHunterEnabled)
{ {
@ -370,28 +359,33 @@ public class GameGemManager implements Listener
totalGems += earnedGems; totalGems += earnedGems;
} }
int earnedShards = shards; final int baseShards = totalGems;
double mult = 1; int shards = baseShards;
double extraMult = 0;
Rank rank = Manager.GetClients().Get(player).GetRank(); Rank rank = Manager.GetClients().Get(player).GetRank();
if (rank == rank.ULTRA) if (rank == rank.ULTRA)
mult = 1.5; extraMult = 0.5;
else if (rank == rank.HERO) else if (rank == rank.HERO)
mult = 2; extraMult = 1;
else if (rank == rank.LEGEND) else if (rank == rank.LEGEND)
mult = 2.5; extraMult = 1.5;
else if (rank.has(Rank.TITAN)) else if (rank.has(Rank.TITAN))
mult = 3; extraMult = 2;
shards *= mult; UtilPlayer.message(player, F.elem(C.cAqua + "+" + baseShards + " Treasure Shards") + " for " + F.elem("Earning " + baseShards + " Gems"));
mult--;
UtilPlayer.message(player, F.elem(C.cAqua + "+" + earnedShards + " Treasure Shards") + " for " + F.elem("Earning " + earnedShards + " Gems"));
if (rank.has(Rank.ULTRA)) if (rank.has(Rank.ULTRA))
{ {
UtilPlayer.message(player, F.elem(C.cAqua + "+" + (shards - earnedShards) + " Treasure Shards") + " for " + 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((mult*100)) + "%")); 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 //Inform