Merge branch 'master' of ssh://184.154.0.242:7999/min/Mineplex
This commit is contained in:
commit
1bbb42214d
@ -2,17 +2,27 @@ package mineplex.core.achievement;
|
||||
|
||||
public enum Achievement
|
||||
{
|
||||
GLOBAL_GEM_HUNTER("Gem Hunter", new String[] {"Global.GemsEarned"}, new int[] {10000, 15000, 20000, 25000, 30000, 35000, 40000, 45000, 50000, 55000, 60000, 65000}),
|
||||
GLOBAL_GEM_HUNTER("Gem Hunter",
|
||||
new String[] {"Global.GemsEarned"},
|
||||
new String[] {"+1 for every Gem earned in any game."},
|
||||
new int[] {10000, 15000, 20000, 25000, 30000, 35000, 40000, 45000, 50000, 55000, 60000, 65000});
|
||||
|
||||
GAME_SPLEEF_SMASHER("Spleef Smasher", new String[] {"Super Spleef.BlocksBroken"}, new int[] {100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200});
|
||||
/*
|
||||
GAME_SPLEEF_SMASHER("Spleef Smasher",
|
||||
new String[] {"Super Spleef.BlocksBroken"},
|
||||
new String[] {"+1 for every broken Block in Spleef."},
|
||||
new int[] {100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200});
|
||||
*/
|
||||
|
||||
private String _name;
|
||||
private String[] _desc;
|
||||
private String[] _stats;
|
||||
private int[] _levels;
|
||||
|
||||
Achievement(String name, String[] stats, int[] levels)
|
||||
Achievement(String name, String[] stats, String[] desc, int[] levels)
|
||||
{
|
||||
_name = name;
|
||||
_desc = desc;
|
||||
_stats = stats;
|
||||
_levels = levels;
|
||||
}
|
||||
@ -22,6 +32,11 @@ public enum Achievement
|
||||
return _name;
|
||||
}
|
||||
|
||||
public String[] getDesc()
|
||||
{
|
||||
return _desc;
|
||||
}
|
||||
|
||||
public String[] getStats()
|
||||
{
|
||||
return _stats;
|
||||
|
@ -50,9 +50,7 @@ public class StatsManager extends MiniClientPlugin<PlayerStats>
|
||||
|
||||
public void incrementStat(Player player, final String statName, int value)
|
||||
{
|
||||
int newValue = Get(player).addStat(statName, Get(player).getStat(statName) + value);
|
||||
|
||||
System.out.println(player.getName() + " - " + statName + " - " + value + " ? " + newValue);
|
||||
int newValue = Get(player).addStat(statName, value);
|
||||
|
||||
//Event
|
||||
UtilServer.getServer().getPluginManager().callEvent(new StatChangeEvent(player.getName(), statName, newValue - value, newValue));
|
||||
|
@ -42,7 +42,7 @@ public class GameAchievementManager implements Listener
|
||||
Manager.GetAchievement().clearLog(event.getPlayer());
|
||||
}
|
||||
|
||||
//@EventHandler(priority = EventPriority.MONITOR)
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void processAchievementLog(final GameStateChangeEvent event)
|
||||
{
|
||||
if (Manager.IsTournamentServer())
|
||||
@ -85,19 +85,29 @@ public class GameAchievementManager implements Listener
|
||||
|
||||
AchivementData data = Manager.GetAchievement().get(player, type);
|
||||
|
||||
String nameLevel = F.elem(C.cGold + C.Bold + type.getName() + " " + ChatColor.RESET + C.cYellow + data.getLevel() + C.cGold + "/" + C.cYellow + type.getMaxLevel());
|
||||
String progress = F.elem(C.cGreen + "+" + log.get(type).Amount);
|
||||
|
||||
if (log.get(type).LevelUp)
|
||||
{
|
||||
UtilPlayer.message(player, F.elem(type.getName() + " " + data.getLevel() + "/" + type.getMaxLevel()) +
|
||||
" " + F.elem(C.cGreen + "+" + log.get(type).Amount) +
|
||||
" " + F.elem(C.cAqua + "LEVELED UP!"));
|
||||
UtilPlayer.message(player, nameLevel + " " + progress +
|
||||
" " + F.elem(C.cAqua + C.Bold + "LEVEL UP!"));
|
||||
|
||||
player.playSound(player.getLocation(), Sound.LEVEL_UP, 1f, 1f);
|
||||
}
|
||||
else
|
||||
{
|
||||
UtilPlayer.message(player, F.elem(type.getName() + " " + data.getLevel() + "/" + type.getMaxLevel()) +
|
||||
" " + F.elem(C.cGreen + "+" + log.get(type).Amount) +
|
||||
UtilPlayer.message(player, nameLevel + " " + progress +
|
||||
" " + F.elem(ChatColor.YELLOW + "" + (data.getExpNextLevel() - data.getExpRemainder()) + " to Next Level"));
|
||||
}
|
||||
|
||||
for (String desc : type.getDesc())
|
||||
{
|
||||
UtilPlayer.message(player, desc);
|
||||
out++;
|
||||
}
|
||||
|
||||
|
||||
out++;
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,6 @@ public class GameGemManager implements Listener
|
||||
ArcadeManager Manager;
|
||||
|
||||
boolean DoubleGem = false;
|
||||
boolean GemFinder = false;
|
||||
|
||||
public GameGemManager(ArcadeManager manager)
|
||||
{
|
||||
@ -166,16 +165,12 @@ public class GameGemManager implements Listener
|
||||
total += (int)(earned * game.GetGemBoostAmount());
|
||||
|
||||
//Gem Finder
|
||||
if (GemFinder)
|
||||
int gemFinder = Manager.GetAchievement().get(player.getName(), Achievement.GLOBAL_GEM_HUNTER).getLevel();
|
||||
if (gemFinder > 0)
|
||||
{
|
||||
int gemFinder = Manager.GetAchievement().get(player.getName(), Achievement.GLOBAL_GEM_HUNTER).getLevel();
|
||||
if (gemFinder > 0)
|
||||
{
|
||||
total += (int)(earned * (gemFinder * 0.25));
|
||||
}
|
||||
total += (int)(earned * (gemFinder * 0.25));
|
||||
}
|
||||
|
||||
|
||||
if (DoubleGem)
|
||||
total += earned;
|
||||
|
||||
@ -233,18 +228,14 @@ public class GameGemManager implements Listener
|
||||
totalGems += earnedGems * game.GetGemBoostAmount();
|
||||
}
|
||||
|
||||
|
||||
//Gem Finder
|
||||
if (GemFinder)
|
||||
int gemFinder = Manager.GetAchievement().get(player.getName(), Achievement.GLOBAL_GEM_HUNTER).getLevel();
|
||||
if (gemFinder > 0)
|
||||
{
|
||||
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) + "%")));
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user