added flags to disable gem multipliers per-game. UHC was giving too much :O
This commit is contained in:
parent
a8d1cef933
commit
6e6e0e2ae0
@ -215,7 +215,10 @@ public abstract class Game implements Listener
|
||||
public boolean GiveClock = true;
|
||||
|
||||
public double GemMultiplier = 1;
|
||||
|
||||
public boolean GemHunterEnabled = true;
|
||||
public boolean GemBoosterEnabled = true;
|
||||
public boolean GemDoubleEnabled = true;
|
||||
|
||||
//Gameplay Data
|
||||
public HashMap<Location, Player> PrivateBlockMap = new HashMap<Location, Player>();
|
||||
public HashMap<String, Integer> PrivateBlockCount = new HashMap<String, Integer>();
|
||||
@ -1125,6 +1128,12 @@ public abstract class Game implements Listener
|
||||
|
||||
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")) + ".");
|
||||
|
@ -156,6 +156,10 @@ public class UHC extends TeamGame
|
||||
this.WorldBoundaryKill = false;
|
||||
|
||||
this.TickPerTeleport = 3;
|
||||
|
||||
this.GemBoosterEnabled = false;
|
||||
this.GemDoubleEnabled = false;
|
||||
this.GemHunterEnabled = false;
|
||||
|
||||
WorldTimeSet = -1;
|
||||
|
||||
|
@ -48,7 +48,7 @@ public class GameGemManager implements Listener
|
||||
|
||||
Game game = Manager.GetGame();
|
||||
if (game == null) return;
|
||||
|
||||
|
||||
if (!(event.GetEvent().getEntity() instanceof Player))
|
||||
return;
|
||||
|
||||
@ -162,16 +162,20 @@ public class GameGemManager implements Listener
|
||||
int total = earned;
|
||||
|
||||
//Gem Boooster
|
||||
total += (int)(earned * game.GetGemBoostAmount());
|
||||
if (game.GemBoosterEnabled)
|
||||
total += (int)(earned * game.GetGemBoostAmount());
|
||||
|
||||
//Gem Finder
|
||||
int gemFinder = Manager.GetAchievement().get(player.getName(), Achievement.GLOBAL_GEM_HUNTER).getLevel();
|
||||
if (gemFinder > 0)
|
||||
if (game.GemHunterEnabled)
|
||||
{
|
||||
total += (int)(earned * (gemFinder * 0.25));
|
||||
int gemFinder = Manager.GetAchievement().get(player.getName(), Achievement.GLOBAL_GEM_HUNTER).getLevel();
|
||||
if (gemFinder > 0)
|
||||
{
|
||||
total += (int)(earned * (gemFinder * 0.25));
|
||||
}
|
||||
}
|
||||
|
||||
if (DoubleGem)
|
||||
|
||||
if (DoubleGem && game.GemDoubleEnabled)
|
||||
total += earned;
|
||||
|
||||
Manager.GetDonation().RewardGems(null, "Earned " + game.GetName(), player.getName(), player.getUniqueId(), total);
|
||||
@ -220,7 +224,7 @@ public class GameGemManager implements Listener
|
||||
int totalGems = earnedGems;
|
||||
|
||||
//Gem Booster
|
||||
if (game.GetGemBoostAmount() > 0)
|
||||
if (game.GetGemBoostAmount() > 0 && game.GemBoosterEnabled)
|
||||
{
|
||||
UtilPlayer.message(player, F.elem(C.cGreen + "+" + (int)(earnedGems*game.GetGemBoostAmount()) + " Gems") + " for " +
|
||||
F.elem(game.GemBoosters.size() + " Gem Boosters " + C.cGreen + "+" + (int)(game.GetGemBoostAmount()*100) + "%"));
|
||||
@ -229,17 +233,20 @@ public class GameGemManager implements Listener
|
||||
}
|
||||
|
||||
//Gem Finder
|
||||
int gemFinder = Manager.GetAchievement().get(player.getName(), Achievement.GLOBAL_GEM_HUNTER).getLevel();
|
||||
if (gemFinder > 0)
|
||||
if (game.GemHunterEnabled)
|
||||
{
|
||||
UtilPlayer.message(player, F.elem(C.cGreen + "+" + ((int)(earnedGems*(gemFinder * 0.25)) + " Gems")) + " for " +
|
||||
F.elem("Gem Hunter " + gemFinder + C.cGreen + " +" + (gemFinder*25) + "%"));
|
||||
int gemFinder = Manager.GetAchievement().get(player.getName(), Achievement.GLOBAL_GEM_HUNTER).getLevel();
|
||||
if (gemFinder > 0)
|
||||
{
|
||||
UtilPlayer.message(player, F.elem(C.cGreen + "+" + ((int)(earnedGems*(gemFinder * 0.25)) + " Gems")) + " for " +
|
||||
F.elem("Gem Hunter " + gemFinder + C.cGreen + " +" + (gemFinder*25) + "%"));
|
||||
|
||||
totalGems += earnedGems * (gemFinder * 0.25);
|
||||
totalGems += earnedGems * (gemFinder * 0.25);
|
||||
}
|
||||
}
|
||||
|
||||
//Double Gem
|
||||
if (DoubleGem)
|
||||
if (DoubleGem && game.GemDoubleEnabled)
|
||||
{
|
||||
UtilPlayer.message(player, F.elem(C.cGreen + "+" + (earnedGems) + " Gems") + " for " + F.elem(C.cDGreen + "Double Gem Weekend"));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user